From 8e451b57702434dcf0ec9deb2e7398d235970260 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期二, 26 八月 2025 16:50:31 +0800
Subject: [PATCH] 报工查询页面、产线选择下拉框调整

---
 src/views/mes/MesMaterialLoadingListView.vue |  151 +++++++++++++++++++++++++++-----------------------
 1 files changed, 82 insertions(+), 69 deletions(-)

diff --git a/src/views/mes/MesMaterialLoadingListView.vue b/src/views/mes/MesMaterialLoadingListView.vue
index 8bedb56..ed3a0c2 100644
--- a/src/views/mes/MesMaterialLoadingListView.vue
+++ b/src/views/mes/MesMaterialLoadingListView.vue
@@ -1,9 +1,16 @@
 <template>
-  <a-card :bordered="false" title="涓婁笅鏂欐煡璇�">
+  <a-card :bordered="false">
     <!-- 鏌ヨ鍖哄煙 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="浜х嚎">
+              <j-search-select-tag placeholder="璇烽�夋嫨" v-model="queryParam.factoryId"
+                                   dict="base_factory,factory_name,id,del_flag=0 and factory_category = '3'"
+              ></j-search-select-tag>
+            </a-form-item>
+          </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="宸ュ崟鍙�">
               <j-search-select-tag placeholder="璇疯緭鍏ュ伐宸ュ崟鍙�" v-model="queryParam.workOrderId"
@@ -11,31 +18,38 @@
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="璁惧ID">
-              <j-input placeholder="璇疯緭鍏ヨ澶嘔D" v-model="queryParam.equipmentId"></j-input>
+            <a-form-item label="璁惧">
+              <j-search-select-tag placeholder="璇烽�夋嫨璁惧" v-model="queryParam.equipmentId"
+                                   dict="eam_equipment,equipment_name,id,del_flag=0"></j-search-select-tag>
             </a-form-item>
           </a-col>
+          <template v-if="toggleSearchStatus">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="鐗╂枡缂栫爜">
-              <j-input dictCode="work_order_status" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�"
-                       v-model="queryParam.materialNumber"></j-input>
+              <a-input dictCode="work_order_status" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�"
+                       v-model="queryParam.materialNumber"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="鐗╂枡鍚嶇О">
-              <j-input dictCode="work_order_status" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
-                       v-model="queryParam.materialName"></j-input>
+              <a-input dictCode="work_order_status" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
+                       v-model="queryParam.materialName"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="鎵规鍙�">
-              <j-input placeholder="璇疯緭鍏ユ壒娆″彿" v-model="queryParam.batchNumber"></j-input>
+              <a-input placeholder="璇疯緭鍏ユ壒娆″彿" v-model="queryParam.batchNumber"></a-input>
             </a-form-item>
           </a-col>
+          </template>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
+              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
             </span>
           </a-col>
         </a-row>
@@ -57,6 +71,7 @@
           :pagination="ipagination"
           :loading="loading"
           :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: 'radio'}"
+          :customRow="clickSelect"
           class="j-table-force-nowrap"
           @change="handleTableChange">
 
@@ -103,19 +118,16 @@
       </div>
       <a-tabs v-model="activeKey" @change="handleChangeTabs">
         <a-tab-pane tab="涓嬫枡" :key="refKeys[0]" :forceRender="true">
-          <div style="display: flex; align-items: center; margin-bottom: 10px;">
-          </div>
-          <j-vxe-table
-            keep-source
+          <a-table
             :ref="refKeys[0]"
             :loading="mesMaterialUnloading.loading"
             :columns="mesMaterialUnloading.columns"
             :dataSource="mesMaterialUnloading.dataSource"
-            :maxHeight="300"
-            :rowNumber="true"
-            :rowSelection="true"
-            :toolbar="false"
-          />
+            :pagination="false"
+            :scroll="{ y: 300 }"
+            size="middle"
+            bordered>
+          </a-table>
         </a-tab-pane>
       </a-tabs>
     </a-spin>
@@ -160,12 +172,12 @@
         {
           title: '宸ュ崟鍙�',
           align: 'center',
-          dataIndex: 'workOrderId_dictText'
+          dataIndex: 'workOrderCode'
         },
         {
-          title: '璁惧ID',
+          title: '璁惧',
           align: 'center',
-          dataIndex: 'equipmentId'
+          dataIndex: 'equipmentName'
         },
         {
           title: '宸ュ簭缂栫爜',
@@ -202,58 +214,48 @@
           align: 'center',
           dataIndex: 'remainingQuantity'
         },
-        {
-          title: '鎿嶄綔',
-          dataIndex: 'action',
-          align: 'center',
-          fixed: 'right',
-          width: 147,
-          scopedSlots: { customRender: 'action' }
-        }
+        // {
+        //   title: '鎿嶄綔',
+        //   dataIndex: 'action',
+        //   align: 'center',
+        //   fixed: 'right',
+        //   width: 147,
+        //   scopedSlots: { customRender: 'action' }
+        // }
       ],
       mesMaterialUnloading: {
         loading: false,
         dataSource: [],
         columns: [
-          // {
-          //   title: '涓婃枡',
-          //   key: 'loadingId',
-          //   type: JVXETypes.input,
-          //   width: '200px',
-          //   placeholder: '璇疯緭鍏�${title}',
-          //   defaultValue: ''
-          // },
+          {
+            title: '#',
+            dataIndex: '',
+            key: 'rowIndex',
+            width: 60,
+            align: 'center',
+            customRender: function(t, r, index) {
+              return parseInt(index) + 1
+            }
+          },
           {
             title: '鐗╂枡缂栫爜',
-            key: 'materialNumber',
-            type: JVXETypes.input,
-            width: '200px',
-            placeholder: '璇疯緭鍏�${title}',
-            defaultValue: ''
+            align: 'center',
+            dataIndex: 'materialNumber'
           },
           {
             title: '鐗╂枡鍚嶇О',
-            key: 'materialName',
-            type: JVXETypes.input,
-            width: '200px',
-            placeholder: '璇疯緭鍏�${title}',
-            defaultValue: ''
+            align: 'center',
+            dataIndex: 'materialName'
           },
           {
             title: '鎵规鍙�',
-            key: 'batchNumber',
-            type: JVXETypes.input,
-            width: '200px',
-            placeholder: '璇疯緭鍏�${title}',
-            defaultValue: ''
+            align: 'center',
+            dataIndex: 'batchNumber'
           },
           {
             title: '鏁伴噺',
-            key: 'quantity',
-            type: JVXETypes.input,
-            width: '200px',
-            placeholder: '璇疯緭鍏�${title}',
-            defaultValue: ''
+            align: 'center',
+            dataIndex: 'quantity'
           }
         ]
       },
@@ -280,20 +282,31 @@
   methods: {
     initDictConfig() {
     },
-    async onSelectChange(selectedRowKeys) {
-      this.mesMaterialUnloading.loading = true
-      // 鍗曢�夋ā寮忎笅锛宻electedRowKeys 鏄暟缁勶紝浣嗛暱搴︽渶澶氫负1
-      console.log('鐐瑰嚮浜�---->',selectedRowKeys[0])
-      this.selectedRowKeys = selectedRowKeys
-      this.mesMaterialUnloading.dataSource=[]
-      // 鑾峰彇閫変腑琛岀殑瀹屾暣鏁版嵁
-      if (selectedRowKeys.length > 0) {
-        const selectedId = selectedRowKeys[0] // 閫変腑琛岀殑id
-        const mesMaterialUnloading = await getAction(this.url.queryUnloadingByLoadingId, { 'loadingId': selectedId })
-        this.mesMaterialUnloading.dataSource = mesMaterialUnloading.result
-        this.mesMaterialUnloading.loading = false
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys;
+      this.selectionRows = selectionRows;
+      this.selectTabData(selectedRowKeys[0])
+    },
+    clickSelect(record) {
+      return {
+        on: {
+          click: () => {
+            this.selectedRowKeys = [record.id]
+            this.selectTabData(record.id)
+          }
+        }
       }
     },
+    selectTabData(id) {
+      this.mesMaterialUnloading.loading = true
+      getAction(this.url.queryUnloadingByLoadingId, { 'loadingId': id }).then(res => {
+        if (res.success) {
+          this.mesMaterialUnloading.dataSource = res.result
+        }
+      }).finally(() => {
+        this.mesMaterialUnloading.loading = false
+      })
+    },
     getSuperFieldList() {
       let fieldList = []
       fieldList.push({ type: 'int', value: 'delFlag', text: '鍒犻櫎鏍囪', dictCode: '' })

--
Gitblit v1.9.3