Răsfoiți Sursa

表格配置

zhangqing 1 an în urmă
părinte
comite
16938b727c
2 a modificat fișierele cu 24 adăugiri și 10 ștergeri
  1. 12 7
      src/views/produceOrder/index.vue
  2. 12 3
      src/views/produceWord/index.vue

+ 12 - 7
src/views/produceOrder/index.vue

@@ -17,8 +17,8 @@
       </el-tabs>
       <!-- 数据表格 -->
       <ele-pro-table ref="table" :key="activeName" :initLoad="false" :columns="newColumns" :datasource="datasource"
-        row-key="code" :cache-key="`${activeName}produceOrderTable`" :selection.sync="selection"
-        @sort-change="onSortChange" autoAmendPage :parse-data="parseData">
+        row-key="code" :cache-key="cacheKeyUrl" :selection.sync="selection"
+        @sort-change="onSortChange" autoAmendPage :parse-data="parseData" @columns-change="handleColumnChange">
         <template v-slot:toolbar>
           <el-button type="success">新建</el-button>
           <el-button type="success">暂停</el-button>
@@ -139,9 +139,11 @@ import EquipmentDialog from './components/EquipmentDialog.vue'
 import detailsPop from './components/details/index.vue'
 
 import { debounce } from 'lodash';
+import tableColumnsMixin from '@/mixins/tableColumnsMixin';
 
 
 export default {
+  mixins: [tableColumnsMixin],
   components: {
     produceOrderSearch,
     pickingDialog,
@@ -182,7 +184,9 @@ export default {
         { label: '预制计划', value: '3' }
       ],
       selection: [],
-      newColumns: []
+      newColumns: [],
+      cacheKeyUrl:'7cc8e5d2-mes-produceOrder',
+      columnsVersion:0
     };
   },
   computed: {
@@ -297,8 +301,7 @@ export default {
     },
     columns() {
 
-
-
+      const num = this.columnsVersion
       const opt = {
         first: [
           // {
@@ -340,6 +343,7 @@ export default {
         // },
 
         {
+          prop: 'code',
           slot: 'code',
           label: '生产工单号',
           align: 'center',
@@ -353,6 +357,7 @@ export default {
         // },
 
         {
+          prop: 'QRcode',
           slot: 'QRcode',
           label: '二维码',
           align: 'center',
@@ -466,7 +471,6 @@ export default {
           showOverflowTooltip: true,
           minWidth: 110
         },
-
         ...opt[this.activeName],
         {
           prop: 'createTime',
@@ -476,6 +480,7 @@ export default {
           minWidth: 110
         },
         {
+          prop: 'status',
           slot: 'status',
           label: '状态',
           align: 'center',
@@ -658,7 +663,7 @@ export default {
         });
 
         this.newColumns = [...this.columns, ...newRes, ...privateColumn];
-
+        this.getTabColumns();
         this.$forceUpdate();
       });
     },

+ 12 - 3
src/views/produceWord/index.vue

@@ -8,9 +8,10 @@ r++<template>
         ref="table"
         :columns="newColumns"
         :datasource="datasource"
-        cache-key="workOrderTable"
+        :cache-key="cacheKeyUrl"
         height="calc(100vh - 365px)"
         @sort-change="onSortChange"
+        @columns-change="handleColumnChange"
       >
         <template v-slot:code="{ row }">
           <!-- <el-link type="primary" :underline="false" @click="goDetail(row)"> -->
@@ -88,7 +89,10 @@ r++<template>
 
   import OrderSearch from './components/order-search.vue';
   import { debounce } from 'lodash';
+  import tableColumnsMixin from '@/mixins/tableColumnsMixin';
+
   export default {
+    mixins: [tableColumnsMixin],
     components: {
       OrderSearch
     },
@@ -110,12 +114,15 @@ r++<template>
           { label: '已完成', value: 6 },
           { label: '已延期', value: 7 },
           { label: '待下达', value: 8 }
-        ]
+        ],
+        cacheKeyUrl: '0c2fb832-mes-produceWord',
+        columnsVersion:0
       };
     },
     computed: {
       // 表格列配置
       columns() {
+          const num = this.columnsVersion
         return [
           {
             columnKey: 'index',
@@ -135,6 +142,7 @@ r++<template>
           },
 
           {
+            prop: 'code',
             slot: 'code',
             label: '生产订单号',
             align: 'center',
@@ -224,6 +232,7 @@ r++<template>
             sortable: 'custom'
           },
           {
+            prop: 'status',
             slot: 'status',
             label: '状态',
             align: 'center',
@@ -313,7 +322,7 @@ r++<template>
           });
 
           this.newColumns = [...this.columns, ...newRes];
-
+          this.getTabColumns();
           this.$forceUpdate();
         });
       },