From 475455f8f4b8cd407d0f3cc7c821aa35ddda29e6 Mon Sep 17 00:00:00 2001
From: zhuo <2089219845@qq.com>
Date: 星期四, 06 三月 2025 11:09:00 +0800
Subject: [PATCH] 清除低代码

---
 src/views/business/materialOrder/index.vue |  237 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 189 insertions(+), 48 deletions(-)

diff --git a/src/views/business/materialOrder/index.vue b/src/views/business/materialOrder/index.vue
index 45c4936..d5e4a46 100644
--- a/src/views/business/materialOrder/index.vue
+++ b/src/views/business/materialOrder/index.vue
@@ -2,19 +2,23 @@
   <div class="app-container">
     <div>
       <div class="search">
-        <el-form :model="entity" ref="entity" size="small" :inline="true"><el-form-item label="鎵瑰彿" prop="updateBatchNo">
+        <el-form :model="entity" ref="entity" size="small" :inline="true">
+          <el-form-item label="鎵瑰彿" prop="updateBatchNo">
             <el-input v-model="entity.updateBatchNo" clearable placeholder="璇疯緭鍏�" size="small"
               @keyup.enter.native="refreshTable">
             </el-input>
-          </el-form-item><el-form-item label="濮旀墭缂栧彿" prop="entrustCode">
+          </el-form-item>
+          <el-form-item label="濮旀墭缂栧彿" prop="entrustCode">
             <el-input v-model="entity.entrustCode" clearable placeholder="璇疯緭鍏�" size="small"
               @keyup.enter.native="refreshTable">
             </el-input>
-          </el-form-item><el-form-item label="闆朵欢鍙�" prop="partNo">
+          </el-form-item>
+          <el-form-item label="闆朵欢鍙�" prop="partNo">
             <el-input v-model="entity.partNo" clearable placeholder="璇疯緭鍏�" size="small"
               @keyup.enter.native="refreshTable">
             </el-input>
-          </el-form-item><el-form-item label="闆朵欢鎻忚堪" prop="partDesc">
+          </el-form-item>
+          <el-form-item label="闆朵欢鎻忚堪" prop="partDesc">
             <el-input v-model="entity.partDesc" clearable placeholder="璇疯緭鍏�" size="small"
               @keyup.enter.native="refreshTable">
             </el-input>
@@ -55,7 +59,8 @@
         <div class="table-tab">
           <div>
             <ul class="tab">
-              <li v-for="(m, i) in tabList" :key="m.value" :class="{ active: m.value === tabIndex }" @click="handleTab(m)">
+              <li v-for="(m, i) in tabList" :key="m.value" :class="{ active: m.value === tabIndex }"
+                @click="handleTab(m)">
                 {{ m.label }}</li>
             </ul>
           </div>
@@ -69,31 +74,32 @@
         <!--寰呬笅鍗�-->
         <div class="table">
           <lims-table :tableData="tableData" :column="column" v-if="tabIndex === 0" @pagination="pagination"
-            :height="'calc(100vh - 290px)'" key="tableData" :page="page" :tableLoading="tableLoading"></lims-table>
+            :rowClassName="changeRowClass" :height="'calc(100vh - 290px)'" key="tableData" :page="page"
+            :tableLoading="tableLoading"></lims-table>
         </div>
         <!--妫�楠屼腑-->
         <div class="table">
           <lims-table :tableData="tableData1" :column="column1" v-if="tabIndex === 1" :isSelection="true"
-            :handleSelectionChange="selectMethod" @pagination="pagination1" :height="'calc(100vh - 290px)'"
-            key="tableData1" :page="page1" :tableLoading="tableLoading1"></lims-table>
+            :rowClassName="changeRowClass" :handleSelectionChange="selectMethod" @pagination="pagination1"
+            :height="'calc(100vh - 290px)'" key="tableData1" :page="page1" :tableLoading="tableLoading1"></lims-table>
         </div>
         <!--宸叉楠�-->
         <div class="table">
           <lims-table :tableData="tableData2" :column="column2" v-if="tabIndex === 2" :isSelection="true"
-            :handleSelectionChange="selectMethod" @pagination="pagination2" :height="'calc(100vh - 290px)'"
-            key="tableData2" :page="page2" :tableLoading="tableLoading2"></lims-table>
+            :rowClassName="changeRowClass" :handleSelectionChange="selectMethod" @pagination="pagination2"
+            :height="'calc(100vh - 290px)'" key="tableData2" :page="page2" :tableLoading="tableLoading2"></lims-table>
         </div>
         <!--鍏ㄩ儴-->
         <div class="table">
           <lims-table :tableData="tableData3" :column="column3" v-if="tabIndex === 3" :isSelection="true"
-            :handleSelectionChange="selectMethod" @pagination="pagination3" :height="'calc(100vh - 290px)'"
-            key="tableData3" :page="page3" :tableLoading="tableLoading3"></lims-table>
+            :rowClassName="changeRowClass" :handleSelectionChange="selectMethod" @pagination="pagination3"
+            :height="'calc(100vh - 290px)'" key="tableData3" :page="page3" :tableLoading="tableLoading3"></lims-table>
         </div>
         <!--瀛e害妫�楠�-->
         <div class="table">
           <lims-table :tableData="tableData4" :column="column4" v-if="tabIndex === 4" :isSelection="true"
-            :handleSelectionChange="selectMethod" @pagination="pagination4" :height="'calc(100vh - 290px)'"
-            key="tableData4" :page="page4" :tableLoading="tableLoading4"></lims-table>
+            :rowClassName="changeRowClass" :handleSelectionChange="selectMethod" @pagination="pagination4"
+            :height="'calc(100vh - 290px)'" key="tableData4" :page="page4" :tableLoading="tableLoading4"></lims-table>
         </div>
       </div>
     </div>
@@ -113,8 +119,8 @@
     </el-dialog>
     <!-- 鎾ら攢鎶ユ -->
     <el-dialog :visible.sync="declareDialogVisible" title="鎶ユ鎾ら攢" width="30%">
-      <p style="font-size:16px;color:#333333">鎵瑰彿<span
-          style="color:#34BD66">{{ this.insOrderRow.updateBatchNo }}</span>鐨勪俊鎭槸鍚�<span style="color: #FF4902">鎾ら攢鎶ユ</span>
+      <p style="font-size:16px;color:#333333">鎵瑰彿<span style="color:#34BD66">{{ this.insOrderRow.updateBatchNo
+          }}</span>鐨勪俊鎭槸鍚�<span style="color: #FF4902">鎾ら攢鎶ユ</span>
       </p>
       <span slot="footer" class="dialog-footer">
         <el-row>
@@ -273,10 +279,22 @@
       tableLoading1: false,
       column1: [
         { label: '鎵瑰彿', prop: 'updateBatchNo' },
-        { label: '濮旀墭缂栧彿', prop: 'entrustCode' },
+        {
+          label: '濮旀墭缂栧彿',
+          prop: 'entrustCode',
+          width: "160px",
+          dataType: "link",
+          linkMethod: "changeEntrustCode",
+        },
         { label: '闆朵欢鍙�', prop: 'partNo' },
         { label: '闆朵欢鎻忚堪', prop: 'partDesc' },
-        { label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
+        {
+          label: '鏍峰搧鍚嶇О',
+          prop: 'sampleName',
+          width: "160px",
+          dataType: "link",
+          linkMethod: "selectAllByOne",
+        },
         { label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' },
         { label: '妫�楠屼汉', prop: 'userName' },
         { label: '涓嬪彂鏃堕棿', prop: 'sendTime' },
@@ -341,8 +359,48 @@
       tableData2: [],
       tableLoading2: false,
       column2: [
-        { label: '濮旀墭缂栧彿', prop: 'entrustCode' },
-        { label: '妫�楠岀姸鎬�', prop: 'inspectStatus' },
+        {
+          label: '濮旀墭缂栧彿',
+          prop: 'entrustCode',
+          width: "160px",
+          dataType: "link",
+          linkMethod: "changeEntrustCode",
+        },
+        {
+          dataType: 'tag',
+          label: '妫�楠岀姸鎬�',
+          prop: 'inspectStatus',
+          formatData: (params) => {
+            if (params == 0) {
+              return '妫�楠屼腑'
+            } else if (params == 1) {
+              return '鍚堟牸'
+            } else if (params == 2) {
+              return '涓嶅悎鏍�'
+            } else if (params == 3) {
+              return '鏈笅鍗�'
+            } else if (params == 4) {
+              return '璁╂鏀捐'
+            } else {
+              return null
+            }
+          },
+          formatType: (params) => {
+            if (params == 0) {
+              return 'warning'
+            } else if (params == 1) {
+              return 'success'
+            } else if (params == 2) {
+              return 'danger'
+            } else if (params == 3) {
+              return 'info'
+            } else if (params == 4) {
+              return ''
+            } else {
+              return null
+            }
+          }
+        },
         { label: '璁㈠崟鍙�', prop: 'orderNo' },
         { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived' },
         { label: '涓嬪彂鏃堕棿', prop: 'sendTime' },
@@ -352,7 +410,13 @@
         { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName' },
         { label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' },
         { label: '鍏嶆', prop: 'isExemption' },
-        { label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
+        {
+          label: '鏍峰搧鍚嶇О',
+          prop: 'sampleName',
+          width: "160px",
+          dataType: "link",
+          linkMethod: "selectAllByOne",
+        },
         { label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' },
         { label: '妫�楠屼汉', prop: 'userName' },
         {
@@ -454,8 +518,42 @@
       tableData3: [],
       tableLoading3: false,
       column3: [
-        { label: '濮旀墭缂栧彿', prop: 'entrustCode' },
-        { label: '妫�楠岀姸鎬�', prop: 'inspectStatus' },
+        { label: '濮旀墭缂栧彿', prop: 'entrustCode',width: "160px", },
+        {
+          dataType: 'tag',
+          label: '妫�楠岀姸鎬�',
+          prop: 'inspectStatus',
+          formatData: (params) => {
+            if (params == 0) {
+              return '妫�楠屼腑'
+            } else if (params == 1) {
+              return '鍚堟牸'
+            } else if (params == 2) {
+              return '涓嶅悎鏍�'
+            } else if (params == 3) {
+              return '鏈笅鍗�'
+            } else if (params == 4) {
+              return '璁╂鏀捐'
+            } else {
+              return null
+            }
+          },
+          formatType: (params) => {
+            if (params == 0) {
+              return 'warning'
+            } else if (params == 1) {
+              return 'success'
+            } else if (params == 2) {
+              return 'danger'
+            } else if (params == 3) {
+              return 'info'
+            } else if (params == 4) {
+              return ''
+            } else {
+              return null
+            }
+          }
+        },
         { label: '璁㈠崟鍙�', prop: 'orderNo' },
         { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived' },
         { label: '涓嬪彂鏃堕棿', prop: 'sendTime' },
@@ -465,7 +563,13 @@
         { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName' },
         { label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' },
         { label: '鍏嶆', prop: 'isExemption' },
-        { label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
+        {
+          label: '鏍峰搧鍚嶇О',
+          prop: 'sampleName',
+          width: "160px",
+          dataType: "link",
+          linkMethod: "selectAllByOne",
+        },
         { label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' },
         { label: '妫�楠屼汉', prop: 'userName' },
         {
@@ -520,8 +624,42 @@
       tableData4: [],
       tableLoading4: false,
       column4: [
-        { label: '濮旀墭缂栧彿', prop: 'entrustCode' },
-        { label: '妫�楠岀姸鎬�', prop: 'inspectStatus' },
+        { label: '濮旀墭缂栧彿', prop: 'entrustCode',width: "160px", },
+        {
+          dataType: 'tag',
+          label: '妫�楠岀姸鎬�',
+          prop: 'inspectStatus',
+          formatData: (params) => {
+            if (params == 0) {
+              return '妫�楠屼腑'
+            } else if (params == 1) {
+              return '鍚堟牸'
+            } else if (params == 2) {
+              return '涓嶅悎鏍�'
+            } else if (params == 3) {
+              return '鏈笅鍗�'
+            } else if (params == 4) {
+              return '璁╂鏀捐'
+            } else {
+              return null
+            }
+          },
+          formatType: (params) => {
+            if (params == 0) {
+              return 'warning'
+            } else if (params == 1) {
+              return 'success'
+            } else if (params == 2) {
+              return 'danger'
+            } else if (params == 3) {
+              return 'info'
+            } else if (params == 4) {
+              return ''
+            } else {
+              return null
+            }
+          }
+        },
         { label: '璁㈠崟鍙�', prop: 'orderNo' },
         { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived' },
         { label: '涓嬪彂鏃堕棿', prop: 'sendTime' },
@@ -531,7 +669,13 @@
         { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName' },
         { label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' },
         { label: '鍏嶆', prop: 'isExemption' },
-        { label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
+        {
+          label: '鏍峰搧鍚嶇О',
+          prop: 'sampleName',
+          width: "160px",
+          dataType: "link",
+          linkMethod: "selectAllByOne",
+        },
         { label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' },
         { label: '妫�楠屼汉', prop: 'userName' },
         {
@@ -898,10 +1042,16 @@
     },
     // 瀛e害妫�楠屼笅鍗�
     playOrderSec(row) {
-      if (typeof row !== "object") {
-        this.$router.push({ path: "/materialOrder/customsInspection", query: { active: row } });
+      this.$router.push({ path: "/materialOrder/customsInspection", query: { orderType: 1, customsInspection: row, active: 1 } });
+    },
+    // 鐐瑰嚮鏍峰搧鍚嶇О鏌ョ湅璇︽儏
+    selectAllByOne(row) {
+      if (row.isCopper == 1) {
+        this.currentId = row.enterOrderId
+        this.$router.push({ path: "/materialOrder/copperOrder", query: { customsInspection: row, active: 2, currentId: this.currentId } });
       } else {
-        this.$router.push({ path: "/materialOrder/customsInspection", query: { orderType: 1, customsInspection: row, active: 1 } });
+        this.currentId = row.insOrderId
+        this.$router.push({ path: "/materialOrder/customsInspection", query: { customsInspection: row, active: 2, currentId: this.currentId } });
       }
     },
     // 鎵撳紑鍏嶆寮规
@@ -1007,15 +1157,6 @@
         }).catch(() => { })
       }
     },
-    // 鐐瑰嚮鏍峰搧鍚嶇О鏌ョ湅璇︽儏
-    selectAllByOne(row) {
-      this.currentId = row.insOrderId
-      if (row.isCopper == 1) {
-        this.currentId = row.enterOrderId
-      }
-      this.customsInspection = row
-      this.active = 2;
-    },
     // 鏁版嵁鏌ョ湅
     handleDataLook(row) {
       this.dataLookInfo = row
@@ -1060,17 +1201,10 @@
       let entity = this.tabIndex === 3 ? { ...this.entity, isInspect: 2 } : { ...this.entity, state: 2, orderState: 4, }
       delete entity.orderBy
       this.outLoading = true
-      rawAllExport({
-        entity: entity
-      }, { responseType: "blob" }).then(res => {
+      rawAllExport({ entity: entity }).then(res => {
         this.outLoading = false
-        this.$message.success('瀵煎嚭鎴愬姛')
         const blob = new Blob([res], { type: 'application/octet-stream' });
-        const url = URL.createObjectURL(blob);
-        const link = document.createElement('a');
-        link.href = url;
-        link.download = '鍘熸潗鏂欐娴嬩俊鎭鍑�.xlsx';
-        link.click();
+        this.$download.saveAs(blob, '鍘熸潗鏂欐娴嬩俊鎭鍑�.xlsx');
       })
     },
     // 鎻愪氦淇敼濮旀墭缂栧彿淇℃伅
@@ -1085,6 +1219,7 @@
             this.entrustCodeVisible = false
             this.$message.success('淇敼鎴愬姛')
           }
+          this.refreshTable()
           this.submitCodeLoading = false
         })
       } catch (e) {
@@ -1100,6 +1235,12 @@
     selectMethod(val) {
       this.multipleSelection = val
     },
+    changeRowClass({ row, rowIndex }) {
+      if (row.isFirst == 1) {
+        return 'highlight-danger-row-border'
+      }
+      return ''
+    },
   },
 }
 </script>

--
Gitblit v1.9.3