Sfoglia il codice sorgente

采购订单组件优化:添加表格缓存key,调整表单赋值时机,完善发票列表显示列及库存表格条件渲染

yusheng 9 mesi fa
parent
commit
1d8f2366b5

+ 4 - 1
src/views/purchasingManage/purchaseOrder/components/addDialog.vue

@@ -335,6 +335,7 @@
             :pricingWay="form.pricingWay"
             :supplierMark="form.supplierMark"
             :is-show-supplier-mark="true"
+            cacheKeyUrl="eos-purchasingManage-purchaseOrder-inventoryTable1"
             :isContractId="
               !!form.contractId && !OutValidate.includes(form.sourceType)
             "
@@ -350,6 +351,7 @@
             :detailType="2"
             :pricingWay="form.pricingWay"
             :supplierMark="form.supplierMark"
+            cacheKeyUrl="eos-purchasingManage-purchaseOrder-inventoryTable2"
             :is-show-supplier-mark="true"
             :isContractId="
               !!form.contractId && !OutValidate.includes(form.sourceType)
@@ -1144,9 +1146,10 @@
         this.loading = true;
         const data = await getpurchaseorderDetail(id);
         this.loading = false;
+            this.form = data;
+
         if (data) {
           this.$nextTick(() => {
-            this.form = data;
             this.$store.commit('order/setAllcountAmount', data.totalAmount);
             this.$refs.inventoryTable &&
               this.$refs.inventoryTable.putTableValue(data.productList);

+ 2 - 0
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -1066,6 +1066,8 @@
     methods: {
       async open(row) {
         this.activeName = '1';
+        this.activeComp = 'order';
+
         this.form = row;
         this.visible = true;
         await this.getDetailData(row.id);

+ 73 - 54
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -614,7 +614,8 @@
       },
       detailType: {
         default: 0
-      }
+      },
+      cacheKeyUrl:'eos-purchasingManage-purchaseOrder-inventoryTable'
     },
     components: {
       taskinstanceDialog,
@@ -645,7 +646,6 @@
       };
       return {
         levelList,
-        cacheKeyUrl: 'eos-purchasingManage-purchaseOrder-inventoryTable',
         pricingWayList,
         discountTotalPrice: 0.0,
         allPrice: 0.0,
@@ -793,31 +793,40 @@
             slot: 'goodsPriceType',
             align: 'center'
           },
-          {
-            width: 160,
-            prop: 'singlePrice',
-            label: '单价(含税)',
-            slot: 'singlePrice',
-            headerSlot: 'headerSinglePrice',
-            align: 'center',
-            show: !this.detailType
-          },
-          {
-            width: 180,
-            prop: 'notaxSinglePrice',
-            label: '不含税单价',
-            slot: 'notaxSinglePrice',
-            align: 'center',
-            show: !this.detailType
-          },
-          {
-            width: 150,
-            prop: 'taxRate',
-            label: '税率',
-            slot: 'taxRate',
-            align: 'center',
-            show: !this.detailType
-          },
+          !this.detailType
+            ? {
+                width: 160,
+                prop: 'singlePrice',
+                label: '单价(含税)',
+                slot: 'singlePrice',
+                headerSlot: 'headerSinglePrice',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
+          !this.detailType
+            ? {
+                width: 180,
+                prop: 'notaxSinglePrice',
+                label: '不含税单价',
+                slot: 'notaxSinglePrice',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
+          !this.detailType
+            ? {
+                width: 150,
+                prop: 'taxRate',
+                label: '税率',
+                slot: 'taxRate',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
           {
             width: 120,
             prop: 'supplierMark',
@@ -909,31 +918,40 @@
             align: 'center'
           },
 
-          {
-            width: 160,
-            prop: 'discountSinglePrice',
-            label: '折后单价(含税)',
-            slot: 'discountSinglePrice',
-            align: 'center',
-            show: !this.detailType
-          },
+          !this.detailType
+            ? {
+                width: 160,
+                prop: 'discountSinglePrice',
+                label: '折后单价(含税)',
+                slot: 'discountSinglePrice',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
 
-          {
-            width: 120,
-            prop: 'totalPrice',
-            label: '合计(含税)',
-            slot: 'totalPrice',
-            align: 'center',
-            show: !this.detailType
-          },
-          {
-            width: 120,
-            prop: 'discountTotalPrice',
-            label: '折后合计(含税)',
-            slot: 'discountTotalPrice',
-            align: 'center',
-            show: !this.detailType
-          },
+          !this.detailType
+            ? {
+                width: 120,
+                prop: 'totalPrice',
+                label: '合计(含税)',
+                slot: 'totalPrice',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
+          !this.detailType
+            ? {
+                width: 120,
+                prop: 'discountTotalPrice',
+                label: '折后合计(含税)',
+                slot: 'discountTotalPrice',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
           {
             width: 110,
             prop: 'batchNo',
@@ -1084,9 +1102,9 @@
 
       //改变数量
       changeCount(row, index) {
-        if (this.detailType) {
-          return;
-        }
+        // if (this.detailType) {
+        //   return;
+        // }
         let countObj = {
           countKey: 'purchaseCount',
           unitKey: 'purchaseUnit',
@@ -1423,6 +1441,7 @@
           this.$set(parasm, 'pricingWay', item.pricingWay || 1);
           this.$set(parasm, 'goodsLevel', item.level);
           this.$set(parasm, 'taxRate', 13);
+          this.$set(parasm, 'totalCount', 0);
           if (item.modelKey) {
             this.$set(parasm, 'modelKey', item.modelKey.split(','));
           }

+ 28 - 8
src/views/purchasingManage/purchaseOrder/orderAssociation/invoiceList.vue

@@ -71,14 +71,34 @@
             showOverflowTooltip: true,
             minWidth: 200
           },
-          // {
-          //   prop: 'orderNo',
-          //   label: '采购订单编码',
-          //   align: 'center',
-          //   slot: 'orderNo',
-          //   showOverflowTooltip: true,
-          //   minWidth: 200
-          // },
+           {
+            prop: 'productNames',
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'productCodes',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'batchNos',
+            label: '批次号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'productCount',
+            label: '数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
           {
             prop: 'supplierName',
             label: '供应商名称',