Bladeren bron

禅道bug 修复:销售订单表格缓存键属性名修正及列配置逻辑优化

yusheng 9 maanden geleden
bovenliggende
commit
6d046e8b44
1 gewijzigde bestanden met toevoegingen van 15 en 6 verwijderingen
  1. 15 6
      src/views/saleOrder/index.vue

+ 15 - 6
src/views/saleOrder/index.vue

@@ -29,7 +29,7 @@
         row-key="id"
         @sort-change="onSortChange"
         @columns-change="handleColumnChange"
-        :cacheKeyUrl="cacheKeyUrl"
+        :cacheKey="cacheKeyUrl"
       >
         <!--   :cache-key="cacheKeyUrl" -->
         <template v-slot:code="{ row }">
@@ -152,8 +152,8 @@
         activeName: 'first',
         selection: [],
 
-        newColumns: [],
-        cacheKeyUrl: 'c32a9c7d-aps-saleOrder',
+        _newColumns: [],
+        cacheKeyUrl: 'aps-saleOrder-index',
         columnsVersion: 1,
         // 订单类型
         orderTypeList: [
@@ -184,6 +184,9 @@
       },
       columns() {
         const version = this.columnsVersion;
+        if (!this._newColumns) {
+          this._newColumns = [];
+        }
         return [
           {
             width: 45,
@@ -240,7 +243,13 @@
             showOverflowTooltip: true,
             formatter: (row) => {
               if (row.bomType) {
-                return row.bomType == 1 ? 'PBOM' : row.bomType == 2 ? 'MBOM' :  row.bomType == 3 ? 'ABOM' : 'EBOM';
+                return row.bomType == 1
+                  ? 'PBOM'
+                  : row.bomType == 2
+                  ? 'MBOM'
+                  : row.bomType == 3
+                  ? 'ABOM'
+                  : 'EBOM';
               }
               return '';
             }
@@ -486,7 +495,7 @@
             label: '主机描述',
             showOverflowTooltip: true
           },
-          ...this.newColumns
+          ...this._newColumns
         ];
       }
     },
@@ -609,7 +618,7 @@
             };
           });
 
-          this.newColumns = [...newRes, ...privateColumn];
+          this._newColumns = [...newRes, ...privateColumn];
           // console.log(this.newColumns, 'productCode')
           // this.getTabColumns();
           this.$forceUpdate();