Jelajahi Sumber

产品列表页新增机型和颜色字段显示,并加载对应字典

yusheng 10 bulan lalu
induk
melakukan
39024e56a7
1 mengubah file dengan 33 tambahan dan 0 penghapusan
  1. 33 0
      src/views/material/product/components/index-data.vue

+ 33 - 0
src/views/material/product/components/index-data.vue

@@ -570,6 +570,36 @@
               )?.label;
               )?.label;
             }
             }
           },
           },
+          {
+            prop: 'modelKey',
+            label: '机型',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.modelKey
+                ? row.modelKey
+                    .split(',')
+                    ?.map((item) => this.getDictValue('物品机型', item))
+                    .toString()
+                : '';
+            }
+          },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.colorKey
+                ? row.colorKey
+                    .split(',')
+                    ?.map((item) => this.getDictValue('物品颜色', item))
+                    .toString()
+                : '';
+            }
+          },
           {
           {
             prop: 'isEnabled',
             prop: 'isEnabled',
             align: 'center',
             align: 'center',
@@ -628,6 +658,9 @@
         }
         }
       });
       });
       // this.requestDict('生产类型');
       // this.requestDict('生产类型');
+      this.requestDict('物品机型');
+      this.requestDict('物品颜色');
+
       this.getFieldModel();
       this.getFieldModel();
     },
     },