Browse Source

包装定位

Lexie 1 year ago
parent
commit
bdc894bea0

+ 15 - 0
src/api/jixiaoguanli/jitairibaobiao.js

@@ -83,6 +83,21 @@ export const getproductionaddList = (params) => {
   })
 }
 
+export const locate = (params) => {
+  return service({
+    url:'/mes_server/packaging_process_output/locate',
+    method: 'get',
+    params
+  })
+}
+
+export const getInfo = (params) => {
+  return service({
+    url:'/mes_server/packaging_process_output/getInfo',
+    method: 'get',
+    params
+  })
+}
 
 
 

+ 113 - 40
src/view/performance/Packagingoutput.vue

@@ -20,7 +20,7 @@
               </el-row>
               <el-button type="primary" :icon="Search" @click="onSearch">搜索</el-button>
               <el-button type="primary" :icon="Refresh">重置</el-button>
-			  <el-button type="primary" :icon="Search">定位</el-button>
+			  <el-button type="primary" :icon="Search" @click="positioningVisible">定位</el-button>
 			  <el-button type="primary" :icon="Search">查改</el-button>
               <div style="margin-left: auto;">
                 <el-button type="primary" :icon="Download" @click="exportExcel">导出到Excel</el-button>
@@ -28,9 +28,9 @@
             </div>
             <!-- 数据展示 -->
             <el-table ref="multipleTable" style="width: 100%" tooltip-effect="dark" :data="tableData" row-key="ID"
-              highlight-current-row="true" border @selection-change="handleSelectionChange" :show-overflow-tooltip="true" @row-dblclick="doubleClick">
+              highlight-current-row="true"  :cell-style="cellStyle" border @selection-change="handleSelectionChange" :show-overflow-tooltip="true" @row-dblclick="doubleClick">
               <el-table-column type="selection" width="55" />
-			  <el-table-column align="left" label="创建用户" prop="sys_id" width="120"/>
+			  <el-table-column align="left" label="创建用户" prop="sys_id" width="120" />
               <el-table-column align="left" label="日期" prop="sczl_rq" width="120"/>
               <el-table-column align="left" label="包装产量" prop="sczl_cl" width="120"/>
               <el-table-column align="left" label="包装数量" prop="sczl_PgCl" width="120"/>
@@ -49,7 +49,7 @@
           <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type === 'create' ? '添加' : '修改'"
             destroy-on-close width="1200px">
             <!-- <el-scrollbar height="500px"> -->
-            <el-form :model="formData" label-position="left" ref="elFormRef" :rules="rule">
+            <el-form :model="gdbhformData" label-position="left" ref="elFormRef" :rules="rule">
 
               <el-row :gutter="20">
 
@@ -95,7 +95,7 @@
                                 <el-input v-model="formData.image" :clearable="true" placeholder="ZI00401" />
                               </el-col>
                               <el-col :span="3">
-                                <el-input v-model="formData.image" :clearable="true" placeholder="瞿春生" />
+                                <el-input v-model="formData.image" :clearable="true" placeholder="瞿春生" data-="" />
                               </el-col>
                               <el-col :span="3">
                                 <el-input v-model="formData.image" :clearable="true" placeholder="11.0" />
@@ -249,6 +249,22 @@
             </template>
           </el-dialog>
 
+
+
+          <el-dialog v-model="positioningVisibleshow" :before-close="closepositioningVisible" :title="type==='create'?'添加':'修改'" destroy-on-close>
+            <el-card>
+				<el-form-item label="工单编号" prop="name">
+				  <el-row :gutter="20">
+				    <el-col :span="12">
+				      <el-input v-model="positionvalue" :clearable="true" placeholder="ZT01733" />
+				    </el-col>                      
+				  </el-row>
+				</el-form-item>
+			</el-card>
+			<el-button type="primary" @click="enterpositioning">确 定</el-button>
+          </el-dialog>
+
+
         </el-main>
       </el-container>
     </el-container>
@@ -259,7 +275,9 @@
 <script setup>
 import {
   getList,
-  getTab
+  getTab,
+  locate,
+  getInfo
 } from '@/api/jixiaoguanli/jitairibaobiao'
 
 // 全量引入格式化工具 请按需保留
@@ -448,7 +466,7 @@ const detailData = reactive([
     dedh: '030002002',
   },
 ])
-const total = ref(0)
+const total=ref(0)
 const page = ref(1)
 const limit = ref(10)
 const searchInfo = ref('')
@@ -456,9 +474,16 @@ const params = {
   date: '',
   sys_id: '',
   page: page.value.toString(),
-  limit: limit.value.toString(),
+  limit: limit.value.toString(),  
 }
-
+const locatevalue={
+	gdbh:'',
+	cpmc:'',
+	page:page.value.toString(),
+	limit:limit.value.toString(),  
+}
+let table=ref(5);
+let positionvalue=ref()
 // 分页设置
 const handleSizeChange = (val) => {
   limit.value = val;
@@ -475,8 +500,7 @@ const handleCurrentChange = (val) => {
 
 // 查询
 const getTableData = async () => {
-	
-	
+		
   const response = await getList(params);
   console.log(response)
   if (response.code === 0) {
@@ -493,6 +517,30 @@ const handleNodeClick = (node, check) => {
     getTableData();
   }
 }
+const Getlocate = async () => {
+  
+  const response = await locate(locatevalue);
+  console.log(response)
+  if (response.code === 0) {
+    tableData.splice(0, tableData.length, ...response.data.rows);
+  }
+}
+
+const enterpositioning = async () => {
+ locatevalue.gdbh=positionvalue;
+
+ console.log(locatevalue)
+ Getlocate()
+ closepositioningVisible()
+}
+
+
+
+const getpickInfo = async (value) => {
+  
+  const response = await getInfo({UniqId:value});
+  console.log(response) 
+}
 
 // 搜索
 function onSearch() {
@@ -545,6 +593,9 @@ const onDelete = async () => {
   }
 }
 
+// 弹窗控制标记
+const dialogFormVisible = ref(false)
+
 // 行为控制标记(弹窗内部需要增还是改)
 const type = ref('')
 
@@ -559,7 +610,24 @@ const updateCompanyFunc = async (row) => {
 }
 
 // 弹窗控制标记
-const dialogFormVisible = ref(false)
+const positioningVisibleshow = ref(false)
+
+const positioningVisible = () => {
+    type.value = 'create'
+    positioningVisibleshow.value = true
+}
+
+
+const closepositioningVisible = () => {
+  positioningVisibleshow.value = false
+  formData.value = {
+    address: '',
+    image: '',
+    name: '',
+  }
+}
+
+
 
 // 打开弹窗
 const openDialog = () => {
@@ -578,37 +646,42 @@ const closeDialog = () => {
 }
 // 弹窗确定
 const enterDialog = async () => {
-  elFormRef.value?.validate(async (valid) => {
-    if (!valid) return
-    let res
-    switch (type.value) {
-      case 'create':
-        res = await createCompany(formData.value)
-        break
-      case 'update':
-        res = await updateCompany(formData.value)
-        break
-      default:
-        res = await createCompany(formData.value)
-        break
-    }
-    if (res.code === 0) {
-      ElMessage({
-        type: 'success',
-        message: '创建/更改成功'
-      })
-      closeDialog()
-      getTableData()
-    }
-  })
+  elFormRef.value?.validate( async (valid) => {
+          if (!valid) return
+           let res
+           switch (type.value) {
+             case 'create':
+               res = await createCompany(formData.value)
+               break
+             case 'update':
+               res = await updateCompany(formData.value)
+               break
+             default:
+               res = await createCompany(formData.value)
+               break
+           }
+           if (res.code === 0) {
+             ElMessage({
+               type: 'success',
+               message: '创建/更改成功'
+             })
+             closeDialog()
+             getTableData()
+           }
+   })
 }
 
 // 双击表格操作
-function doubleClick(row, column, event) {
-  console.log(row, column, event);
-  // updateCompanyFunc(row);
-  type.value = 'update';
-  dialogFormVisible.value = true
+function doubleClick(row, column, event,rowIndex,columnIndex) {
+  
+     console.log(row, column, event);
+       // updateCompanyFunc(row);
+       type.value = 'update';
+       dialogFormVisible.value = true
+ console.log(row[column.property])
+ table.value=row[column.property]
+ console.log(table.value)
+       getpickInfo(table.value)
 }
 
 // 导出excel

+ 651 - 0
src/view/performance/yuangongrigongzi.vue

@@ -0,0 +1,651 @@
+<template>
+  <div>
+    <!-- 左侧树形结构 -->
+    <el-container>
+      <el-aside width="250px">
+        <div class="JKWTree-tree">
+          <h3>包装工序产量维护</h3>
+          <el-tree :data="treeData" :props="defaultProps" highlight-current="true"
+            @node-click="handleNodeClick"></el-tree>
+        </div>
+      </el-aside>
+
+      <el-container>
+        <el-main>
+          <!-- 按钮区域 -->
+          <div class="gva-table-box">
+            <div class="gva-btn-list">
+              <el-row :span="6">
+                <el-input v-model="searchInfo" placeholder="输入工单编号或产品名称" />
+              </el-row>
+              <el-button type="primary" :icon="Search" @click="onSearch">搜索</el-button>
+              <el-button type="primary" :icon="Refresh">重置</el-button>
+			  <el-button type="primary" :icon="Search">定位</el-button>
+			  <el-button type="primary" :icon="Search">查改</el-button>
+              <div style="margin-left: auto;">
+                <el-button type="primary" :icon="Download" @click="exportExcel">导出到Excel</el-button>
+              </div>
+            </div>
+            <!-- 数据展示 -->
+            <el-table ref="multipleTable" style="width: 100%" tooltip-effect="dark" :data="tableData" row-key="ID"
+              highlight-current-row="true" border @selection-change="handleSelectionChange" :show-overflow-tooltip="true" @row-dblclick="doubleClick">
+              <el-table-column type="selection" width="55" />
+			  <el-table-column align="left" label="创建用户" prop="sys_id" width="120"/>
+              <el-table-column align="left" label="日期" prop="sczl_rq" width="120"/>
+              <el-table-column align="left" label="包装产量" prop="sczl_cl" width="120"/>
+              <el-table-column align="left" label="包装数量" prop="sczl_PgCl" width="120"/>
+              <el-table-column align="left" label="创建时间" prop="sys_rq" width="160"/>
+              <el-table-column align="left" label="修改时间" prop="mod_rq" width="160"/>
+              <el-table-column align="left" label="UNIQID" prop="UniqId" width="120"/>
+            </el-table>
+            <!-- 分页 -->
+            <div class="gva-pagination">
+              <el-pagination layout="total, sizes, prev, pager, next, jumper" :current-page="page" :page-size="limit"
+                :page-sizes="[10, 30, 50, 100]" :total="total" @current-change="handleCurrentChange"
+                @size-change="handleSizeChange" />
+            </div>
+          </div>
+          <!-- 弹出框 -->
+          <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type === 'create' ? '添加' : '修改'"
+            destroy-on-close width="1200px">
+            <!-- <el-scrollbar height="500px"> -->
+            <el-form :model="formData" label-position="left" ref="elFormRef" :rules="rule">
+
+              <el-row :gutter="20">
+
+                <el-col :span="6">
+                  <el-form-item label="日期" prop="name">
+                    <el-row :gutter="20">
+                      <el-col :span="12">
+                        <el-input v-model="formData.code" :clearable="true" placeholder="ZT01733" />
+                      </el-col>
+                    </el-row>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+
+                            <!-- 标题栏 -->
+                            <el-row :gutter="10">
+                              <el-col :span="3">
+                                <span>工单编号</span>
+                              </el-col>
+                              <el-col :span="3">
+                                <span>印件工序</span>
+                              </el-col>
+                              <el-col :span="3">
+                                <span>工序名称</span>
+                              </el-col>
+                              <el-col :span="9">
+                                <span>印件名称</span>
+                              </el-col>
+                              <el-col :span="2">
+                                <span>包装产量</span>
+                              </el-col>
+							  <el-col :span="2">
+							    <span>每箱数量</span>
+							  </el-col>
+							  <el-col :span="2">
+							    <span>零头</span>
+							  </el-col>
+                            </el-row>
+              
+                            <!-- 员工1 -->
+                            <el-row :gutter="5" style="margin-top: 10px;">
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="ZI00401" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="瞿春生" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="11.0" />
+                              </el-col>
+                              <el-col :span="9">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="打包废纸" />
+                              </el-col>
+                              <el-col :span="2">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+                              </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+                            </el-row>
+              
+                            <!-- 员工2 -->
+                            <el-row :gutter="5" style="margin-top: 10px;">
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="ZI00401" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="瞿春生" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="11.0" />
+                              </el-col>
+                              <el-col :span="9">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="打包废纸" />
+                              </el-col>
+                              <el-col :span="2">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+                              </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+                            </el-row>
+              
+                            <!-- 员工3 -->
+                            <el-row :gutter="5" style="margin-top: 10px;">
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="ZI00401" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="瞿春生" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="11.0" />
+                              </el-col>
+                              <el-col :span="9">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="打包废纸" />
+                              </el-col>
+                              <el-col :span="2">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+                              </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+                            </el-row>
+              
+                            <!-- 员工4 -->
+                            <el-row :gutter="5" style="margin-top: 10px;">
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="ZI00401" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="瞿春生" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="11.0" />
+                              </el-col>
+                              <el-col :span="9">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="打包废纸" />
+                              </el-col>
+                              <el-col :span="2">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+                              </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+                            </el-row>
+              
+                            <!-- 员工5 -->
+                            <el-row :gutter="5" style="margin-top: 10px;">
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="ZI00401" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="瞿春生" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="11.0" />
+                              </el-col>
+                              <el-col :span="9">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="打包废纸" />
+                              </el-col>
+                              <el-col :span="2">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+                              </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+                            </el-row>
+              
+                            <!-- 员工6 -->
+                            <el-row :gutter="5" style="margin-top: 10px;">
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="ZI00401" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="瞿春生" />
+                              </el-col>
+                              <el-col :span="3">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="11.0" />
+                              </el-col>
+                              <el-col :span="9">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="打包废纸" />
+                              </el-col>
+                              <el-col :span="2">
+                                <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+                              </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+							  <el-col :span="2">
+							    <el-input v-model="formData.image" :clearable="true" placeholder="是" />
+							  </el-col>
+                            </el-row>
+			  
+            </el-form>
+            <!-- </el-scrollbar> -->
+            <template #footer>
+              <div class="dialog-footer">
+                <el-button @click="closeDialog">取 消</el-button>
+                <el-button type="primary" @click="enterDialog">确 定</el-button>
+              </div>
+            </template>
+          </el-dialog>
+
+        </el-main>
+      </el-container>
+    </el-container>
+
+  </div>
+</template>
+
+<script setup>
+import {
+  getList,
+  getTab
+} from '@/api/jixiaoguanli/jitairibaobiao'
+
+// 全量引入格式化工具 请按需保留
+import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { Search, Refresh, Download } from '@element-plus/icons-vue'
+import { ref, reactive, onMounted, onBeforeMount } from 'vue'
+import { getPackingSideTable, getPackingTable } from '@/api/mes_api_gty/myapi'
+
+defineOptions({
+  name: '06-packingDocuments'
+})
+
+// 侧边栏数据请求
+const treeData = reactive([]);
+
+const getTabdata = async () => {
+    //接口调用函数
+    const response  = await getTab();
+	console.log(response)
+	
+	
+	const transformedData = response.data.map(item => ({
+	      label: `${item.date.replace(/-/g, '.')}【单据数: ${item.counts}张】`,
+	      children: item.sys.map(sysItem => ({
+	        label: `${sysItem.sys_id} 【记录数: ${sysItem.count}张】`,
+	        params: {
+	          date: item.date.replace(/\./g, '-'),
+	          sys_id: sysItem.sys_id,
+	          total: sysItem.count,
+	        },
+	      })),
+	    }));
+	    treeData.splice(0, treeData.length, ...transformedData);
+
+	
+	}
+	
+
+getTabdata();
+
+// 自动化生成的字典(可能为空)以及字段
+const formData = ref({
+  id: '',
+  name: '',
+  date: '',
+  group: '',
+  packingOutput: '',
+  reworkOutput: '',
+  pieceOutput: '',
+  order: '',
+  user: '',
+  createTime: '',
+  updateTime: '',
+  uniqid: '',
+})
+
+// 验证规则
+const rule = reactive({
+})
+
+const elFormRef = ref()
+const elSearchFormRef = ref()
+
+// =========== 表格控制部分 ===========
+const tableData = reactive([])
+const detailData = reactive([
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+])
+const total = ref(0)
+const page = ref(1)
+const limit = ref(10)
+const searchInfo = ref('')
+const params = {
+  date: '',
+  sys_id: '',
+  page: page.value.toString(),
+  limit: limit.value.toString(),
+}
+
+// 分页设置
+const handleSizeChange = (val) => {
+  limit.value = val;
+  params.limit = val.toString();
+  getTableData();
+}
+
+// 页面跳转
+const handleCurrentChange = (val) => {
+  page.value = val
+  params.page = val.toString();
+  getTableData()
+}
+
+// 查询
+const getTableData = async () => {
+	
+	
+  const response = await getList(params);
+  console.log(response)
+  if (response.code === 0) {
+    tableData.splice(0, tableData.length, ...response.data.rows);
+  }
+}
+
+const handleNodeClick = (node, check) => {
+  //存放当前节点的nodeId
+  if (node.params) {
+    params.date = node.params.date;
+    params.sys_id = node.params.sys_id;
+    total.value = node.params.total;
+    getTableData();
+  }
+}
+
+// 搜索
+function onSearch() {
+
+}
+// ============== 表格控制部分结束 ===============
+
+// 获取需要的字典 可能为空 按需保留
+const setOptions = async () => {
+}
+
+// 获取需要的字典 可能为空 按需保留
+setOptions()
+
+// 多选数据
+const multipleSelection = ref([])
+// 多选
+const handleSelectionChange = (val) => {
+  multipleSelection.value = val
+}
+
+// 批量删除控制标记
+const deleteVisible = ref(false)
+
+// 多选删除
+const onDelete = async () => {
+  const ids = []
+  if (multipleSelection.value.length === 0) {
+    ElMessage({
+      type: 'warning',
+      message: '请选择要删除的数据'
+    })
+    return
+  }
+  multipleSelection.value &&
+    multipleSelection.value.map(item => {
+      ids.push(item.ID)
+    })
+  const res = await deleteCompanyByIds({ ids })
+  if (res.code === 0) {
+    ElMessage({
+      type: 'success',
+      message: '删除成功'
+    })
+    if (tableData.value.length === ids.length && page.value > 1) {
+      page.value--
+    }
+    deleteVisible.value = false
+    getTableData()
+  }
+}
+
+// 行为控制标记(弹窗内部需要增还是改)
+const type = ref('')
+
+// 更新行
+const updateCompanyFunc = async (row) => {
+  const res = await findCompany({ ID: row.ID })
+  type.value = 'update'
+  if (res.code === 0) {
+    formData.value = res.data.recompany
+    dialogFormVisible.value = true
+  }
+}
+
+// 弹窗控制标记
+const dialogFormVisible = ref(false)
+
+// 打开弹窗
+const openDialog = () => {
+  type.value = 'create'
+  dialogFormVisible.value = true
+}
+
+// 关闭弹窗
+const closeDialog = () => {
+  dialogFormVisible.value = false
+  formData.value = {
+    address: '',
+    image: '',
+    name: '',
+  }
+}
+// 弹窗确定
+const enterDialog = async () => {
+  elFormRef.value?.validate(async (valid) => {
+    if (!valid) return
+    let res
+    switch (type.value) {
+      case 'create':
+        res = await createCompany(formData.value)
+        break
+      case 'update':
+        res = await updateCompany(formData.value)
+        break
+      default:
+        res = await createCompany(formData.value)
+        break
+    }
+    if (res.code === 0) {
+      ElMessage({
+        type: 'success',
+        message: '创建/更改成功'
+      })
+      closeDialog()
+      getTableData()
+    }
+  })
+}
+
+// 双击表格操作
+function doubleClick(row, column, event) {
+  console.log(row, column, event);
+  // updateCompanyFunc(row);
+  type.value = 'update';
+  dialogFormVisible.value = true
+}
+
+// 导出excel
+function exportExcel() {
+  console.log('导出到excel');
+}
+
+// 生命周期钩子
+onMounted(async () => {
+});
+</script>
+
+<style>
+.JKWTree-container {
+  display: flex;
+}
+
+.JKWTree-tree {
+  width: 300px;
+  background-color: #fff;
+  padding: 10px;
+  margin-right: 20px;
+}
+
+.JKWTree-tree h3 {
+  font-size: 15px;
+  font-weight: 700;
+  margin: 10px 0;
+}
+
+.JKWTree-content {
+  flex: 1;
+}
+
+/* 选中某行时的背景色*/
+.el-table__body tr.current-row>td {
+  background: #ff80ff !important;
+  /* 背景颜色 */
+}
+</style>

File diff suppressed because it is too large
+ 477 - 454
src/view/yunyin/shengchanguanli/chengpinrucang.vue


Some files were not shown because too many files changed in this diff