Selaa lähdekoodia

feat(产品列表): 添加产品详情展示字段并优化字典获取

liujt 6 kuukautta sitten
vanhempi
commit
3d032da3cb

+ 72 - 1
src/BIZComponents/product-list.vue

@@ -196,9 +196,10 @@
   import { lbjtList } from '@/enum/dict.js';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { levelList } from '@/enum/dict.js';
+  import dictMixins from '@/mixins/dictMixins';
 
   export default {
-    mixins: [tabMixins],
+    mixins: [tabMixins, dictMixins],
 
     components: {
       productTree,
@@ -380,6 +381,69 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            prop: 'modelKey',
+            label: '机型',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'voltage',
+            label: '电压',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.extField?.voltage || '';
+            }
+          },
+          {
+            prop: 'layBy',
+            label: '贮藏',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.extField?.layBy ? this.getDictValue(
+                '贮藏',
+                row.extField?.layBy
+              ) : '';
+            }
+          },
+          {
+            prop: 'warrantyPeriod',
+            label: '保质期',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              let unit = ''
+              if(row.warrantyPeriodUnit) {
+                unit = this.getDictValue(
+                  '保质期单位',
+                  row.warrantyPeriodUnit
+                );
+              }
+              console.log(row.warrantyPeriodUnit, unit)
+              return row.warrantyPeriod ? row.warrantyPeriod + unit : '';
+            }
+          },
+          {
+            prop: 'purchaseOrigins',
+            label: '产地',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.purchaseOrigins && row.purchaseOrigins.length
+                ? row.purchaseOrigins
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
+          },
           {
             prop: 'measuringUnit',
             label: '计量单位',
@@ -438,6 +502,12 @@
         ];
       }
     },
+    created() {
+      this.requestDict('保质期单位');
+      this.requestDict('贮藏');
+      this.requestDict('产地');
+      this.requestDict('贮藏');
+    },
     methods: {
       getDictV(code, val) {
         if (!this.dictList[code]) return '';
@@ -452,6 +522,7 @@
             label: item[values[0]]
           };
         });
+        console.log('code', this.dictList[code]);
       },
       open(item, currentIndex, value) {
         this.dataSources = value || '1';

+ 2 - 1
src/enum/dict.js

@@ -71,7 +71,8 @@ export default {
   冲差方式: 'adjust_method',
   冲差原因: 'adjust_reason',
   冲差范围: 'adjust_range',
-  调整类型: 'adjust_price_type'
+  调整类型: 'adjust_price_type',
+  贮藏: 'layBy',
 };
 
 export const numberList = [

+ 6 - 0
src/views/contractManage/contractBook/components/addDialog.vue

@@ -1545,6 +1545,7 @@
                 );
               }
               if (source == 'quotation') {
+                
                 //报价单是否生成过合同
                 let res = await BJisHasGeneratedContractAPI(
                   row.contractVO.sourceId
@@ -1637,6 +1638,11 @@
             Tel,
             firstLink.mobilePhone || this.linkNameOptions[0]?.mobilePhone
           );
+          this.$set(
+            this.form,
+            'businessUserId',
+            contractVO.businessUserId || this.form.businessUserId || ''
+          );
           this.changePersonel();
           if (contractVO.type == 1) {
             this.changeParent({ id: contractVO.partaId });