浏览代码

feat: 更新sxtList为动态获取,保持与detail.vue一致

xieyong 1 周之前
父节点
当前提交
50c947be6d
共有 1 个文件被更改,包括 14 次插入 和 18 次删除
  1. 14 18
      src/views/material/product/components/index-data.vue

+ 14 - 18
src/views/material/product/components/index-data.vue

@@ -811,24 +811,7 @@
             }
           }
         ],
-        sxtList: [
-          {
-            label: '自制件',
-            value: 1
-          },
-          {
-            label: '采购件',
-            value: 2
-          },
-          {
-            label: '外协件',
-            value: 3
-          },
-          {
-            label: '受托件',
-            value: 4
-          }
-        ],
+        sxtList: [],
 
         // newColumns: [],
         // 表格选中数据
@@ -857,6 +840,19 @@
         }
       });
 
+      // 属性类型字典(与 detail.vue 中 getLbjtListList 保持一致)
+      getByCode('categoryComponentAttribute').then((res) => {
+        if (res.code === '0') {
+          this.sxtList = (res.data || []).map((item) => {
+            const key = Object.keys(item)[0];
+            return {
+              value: Number(key),
+              label: item[key]
+            };
+          });
+        }
+      });
+
       this.getCategoryNeedApprove();
 
       // this.requestDict('生产类型');