Răsfoiți Sursa

禅道bug 修复:工单表格列配置逻辑重构及缓存键优化,拆分条件空格格式化

yusheng 9 luni în urmă
părinte
comite
7f08f92e11
1 a modificat fișierele cu 19 adăugiri și 19 ștergeri
  1. 19 19
      src/views/workOrder/index.vue

+ 19 - 19
src/views/workOrder/index.vue

@@ -24,7 +24,7 @@
       <ele-pro-table
         ref="table"
         :cache-key="cacheKeyUrl"
-        :columns="newColumns"
+        :columns="columns"
         :datasource="datasource"
         :parse-data="parseData"
         autoAmendPage
@@ -118,7 +118,7 @@
             派单
           </el-link>
           <el-link
-            v-if="unpackShow(row)&&row.splitResidue!==0"
+            v-if="unpackShow(row) && row.splitResidue !== 0"
             :underline="false"
             type="primary"
             @click="toUnpack(row)"
@@ -229,12 +229,12 @@
           { label: '生产中', value: 5 },
           { label: '待下达', value: 8 }
         ],
-        newColumns: [],
+        columns: [],
         stationList: [],
         teamsList: [],
         crewList: [],
         current: null,
-        cacheKeyUrl: '3cbbdff9-aps-workOrder',
+        cacheKeyUrl: '3cbbdff9-aps-workOrder-index',
         columnsVersion: 1,
         dispatchRow: {},
         dispatchVisible: false,
@@ -283,10 +283,20 @@
       clientEnvironmentId() {
         return this.$store.state.user.info.clientEnvironmentId;
       },
-      // 表格列配置
-      columns() {
-        // const num = this.columnsVersion;
-        return [
+
+      checkRowData() {
+        return (row) => {
+          return row.checkedata ? true : false;
+        };
+      }
+    },
+    created() {
+      this.setColumns()
+      this.getFieldModel();
+    },
+    methods: {
+      setColumns() {
+        this.columns = [
           {
             width: 45,
             type: 'selection',
@@ -553,16 +563,6 @@
           }
         ];
       },
-      checkRowData() {
-        return (row) => {
-          return row.checkedata ? true : false;
-        };
-      }
-    },
-    created() {
-      this.getFieldModel();
-    },
-    methods: {
       // 进入详情
       openDetails(row) {
         let dispatchRow = { ...row };
@@ -728,7 +728,7 @@
             };
           });
 
-          this.newColumns = [...this.columns, ...newRes, ...privateColumn];
+          this.columns = [...this.columns, ...newRes, ...privateColumn];
 
           this.$forceUpdate();
         });