Просмотр исходного кода

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

yusheng 10 месяцев назад
Родитель
Сommit
39024e56a7
1 измененных файлов с 33 добавлено и 0 удалено
  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;
             }
           },
+          {
+            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',
             align: 'center',
@@ -628,6 +658,9 @@
         }
       });
       // this.requestDict('生产类型');
+      this.requestDict('物品机型');
+      this.requestDict('物品颜色');
+
       this.getFieldModel();
     },