Ver código fonte

feat: 优化表格列配置,添加型号和规格字段,自动推导新方案展示属性(润天)

xieyong 1 semana atrás
pai
commit
91d361a47a
1 arquivos alterados com 21 adições e 17 exclusões
  1. 21 17
      src/views/material/BOMmanage/components/detailedList.vue

+ 21 - 17
src/views/material/BOMmanage/components/detailedList.vue

@@ -503,10 +503,24 @@
           },
           {
             prop: 'imgCode',
-            label: '零部件图号(规格型号)',
+            label: '零部件图号',
             showOverflowTooltip: true,
             width: 150
           },
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 260
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 260
+          },
           {
             prop: 'versions',
             slot: 'versions',
@@ -787,23 +801,13 @@
           width: 120
         };
       },
-      // 新方案默认展示的 prop 集合(与 newColumnsConfig 保持一致)
+      // 新方案默认展示的 prop 集合(自动从 newColumnsConfig 推导,避免漏配导致老列覆盖新列)
       newPropSet() {
-        return new Set([
-          'level',
-          'categoryCode',
-          'imgCode',
-          'versions',
-          'updateTime',
-          'name',
-          'dosage',
-          'measuringUnit',
-          'brandNum',
-          'netWeight',
-          'totalWeight',
-          'createName',
-          'createTime'
-        ]);
+        const set = new Set();
+        this.newColumnsConfig.forEach((c) => {
+          if (c.prop) set.add(c.prop);
+        });
+        return set;
       },
       // 表格列:按 useNewColumns 决定输出老方案还是新方案
       columns() {