فهرست منبع

fix(inventoryTable): 优化单重计算逻辑,统一使用handleCountChange方法,调整有效期截止日期显示条件

yusheng 7 ماه پیش
والد
کامیت
23a0a0b680
2فایلهای تغییر یافته به همراه25 افزوده شده و 9 حذف شده
  1. 19 5
      src/BIZComponents/inventoryTable.vue
  2. 6 4
      src/BIZComponents/inventoryTableDetails.vue

+ 19 - 5
src/BIZComponents/inventoryTable.vue

@@ -460,7 +460,7 @@
         <el-form-item :prop="'datasource.' + scope.$index + '.singleWeight'">
           <el-input
             v-model="scope.row.singleWeight"
-            @input="changeCount(scope.row, scope.$index)"
+            @input="handleCountChange(scope.row, scope.$index)"
             placeholder="请输入"
           >
             <template slot="append">
@@ -1222,8 +1222,7 @@
             label: '单重',
             slot: 'singleWeight',
             headerSlot: 'headerSingleWeight',
-            align: 'center',
-            isNone: this.quoteType === 2
+            align: 'center'
           },
           {
             minWidth: 120,
@@ -1483,7 +1482,7 @@
             prop: 'guaranteePeriodDeadline',
             label: '有效期截止日期',
             slot: 'guaranteePeriodDeadline',
-            isNone: !this.isGuaranteePeriod,
+            isNone: !this.isGuaranteePeriod || this.quoteType === 2,
             align: 'center'
           },
           {
@@ -1776,7 +1775,6 @@
 
       // 计算含税小计(原含税单价逻辑)
       calculateIncludingTaxPrice(row, index) {
-        console.log('row', row);
         if (!row) return;
 
         // 计算未税小记
@@ -1805,6 +1803,22 @@
           const quantity = Number(row[this.countObj.countKey]) || 1;
           const totalPrice = quotationSubtotalTax * quantity;
           this.$set(row, 'totalPrice', totalPrice.toFixed(2));
+          if (row[this.countObj.unitKey] == row.weightUnit) {
+            this.$set(
+              row,
+              'totalWeight',
+              quantity
+            );
+          } else {
+            if (quantity && row.singleWeight) {
+              this.$set(
+                row,
+                'totalWeight',
+                (quantity *row.singleWeight).toFixed(2)
+              );
+            }
+          }
+
           this.changeAll();
         });
       },

+ 6 - 4
src/BIZComponents/inventoryTableDetails.vue

@@ -142,7 +142,10 @@
         default: false,
         type: Boolean
       },
-
+      isGuaranteePeriod: {
+        default: true,
+        type: Boolean
+      },
       isDiscount: {
         //折让
         type: Boolean,
@@ -321,7 +324,7 @@
                   label: '平方数',
                   formatter: (row, column) => {
                     if (row.squareNumber) {
-                      return row.squareNumber + ' cm²';
+                      return row.squareNumber + 'm²';
                     }
                   },
                   align: 'center'
@@ -517,7 +520,6 @@
             prop: 'singleWeight',
             label: '单重',
             slot: 'singleWeight',
-            isNone: this.quoteType === 2,
             headerSlot: 'headerSingleWeight',
             formatter: (row, column) => {
               if (row.singleWeight) {
@@ -756,7 +758,7 @@
             width: 200,
             prop: 'guaranteePeriodDeadline',
             label: '有效期截止日期',
-            isNone: this.quoteType === 2,
+           isNone: !this.isGuaranteePeriod || this.quoteType === 2,
             slot: 'guaranteePeriodDeadline',
             align: 'center'
           },