Эх сурвалжийг харах

fix: 临时生产计划新增时保存列设置与更新各组件的缓存键以避免冲突

xieyong 1 өдөр өмнө
parent
commit
f136ed189a

+ 1 - 1
src/views/productionPlan/components/auxiliaryMaterial.vue

@@ -76,7 +76,7 @@
                 :init-load="false"
                 :datasource="datasourceList"
                 row-key="code"
-                :cache-key="`ProductionPlanTable`"
+                :cache-key="`aps-productionPlan-auxiliaryMaterial`"
                 border
                 height="40vh"
                 key="id"

+ 9 - 1
src/views/productionPlan/components/factoryAdd/index.vue

@@ -192,11 +192,12 @@
             ref="tableRef"
             :columns="columns"
             row-key="code"
-            :cache-key="`ProductionPlanTable`"
+            :cache-key="cacheKeyUrl"
             :datasource="form.productInfoList"
             border
             height="40vh"
             key="id"
+            @columns-change="handleColumnChange"
           >
             <template v-slot:modelKey="{ row, $index }">
               <el-select
@@ -525,6 +526,7 @@
   import { planIsReview } from '@/api/productionPlan/index';
   import contactDialog from '@/components/contactDialog/openContactDialog.vue';
   import { deepClone } from '@/utils';
+  import tableColumnsMixin from '@/mixins/tableColumnsMixin';
 
   export default {
     components: {
@@ -533,6 +535,7 @@
       ProcessRoute,
       contactDialog
     },
+    mixins: [tableColumnsMixin],
     props: {
       factoryType: {
         type: Number,
@@ -606,6 +609,8 @@
       //   return this.$store.state.user.info.clientEnvironmentId;
       // },
       columns() {
+        // 依赖 columnsVersion,列配置从服务端同步回来后能重新计算并生效
+        const num = this.columnsVersion;
         return [
           {
             columnKey: 'index',
@@ -810,6 +815,9 @@
         visible: false,
         factoriesId: '',
         clientEnvironmentId: '',
+        // 产品信息表格的列配置缓存标识(localStorage 与服务端配置共用),不可与其他表格重复
+        cacheKeyUrl: 'aps-productionPlan-factoryAdd-productInfo',
+        columnsVersion: 1,
         title: '新增临时生产计划',
         type: 3,
         weightList: [

+ 1 - 1
src/views/productionPlan/components/homogeneityInspectDialog.vue

@@ -154,7 +154,7 @@
                 :init-load="false"
                 :datasource="datasourceList"
                 row-key="code"
-                :cache-key="`ProductionPlanTable`"
+                :cache-key="`aps-productionPlan-homogeneityInspectDialog`"
                 border
                 height="40vh"
                 key="id"

+ 1 - 1
src/views/productionPlan/components/kittingComplete.vue

@@ -155,7 +155,7 @@
                 :init-load="false"
                 :datasource="datasourceList"
                 row-key="code"
-                :cache-key="`ProductionPlanTable`"
+                :cache-key="`aps-productionPlan-kittingComplete`"
                 border
                 height="40vh"
                 key="id"

+ 1 - 1
src/views/productionPlan/components/routeResourceData.vue

@@ -19,7 +19,7 @@
             :columns="columns"
             :datasource="datasourceList"
             row-key="code"
-            :cache-key="`ProductionPlanTable`"
+            :cache-key="`aps-productionPlan-routeResourceData`"
             border
             height="40vh"
             key="id"