瀏覽代碼

fix(purchaseOrder): 修复采购订单总价计算和添加折扣计算逻辑

liujt 5 天之前
父節點
當前提交
337609cd45
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/views/purchasingManage/purchaseOrder/components/addDialogNew.vue

+ 3 - 2
src/views/purchasingManage/purchaseOrder/components/addDialogNew.vue

@@ -1447,7 +1447,7 @@
       },
       //选择采购核价回调
       async changeInquiryList(data) {
-        console.log(data, '=======');
+        console.log(data, 'data=======');
         this.form.relationId = data.id;
         this.form.relationCode = data.inquiryCode;
         this.form.relationName = data.inquiryName;
@@ -1511,12 +1511,13 @@
       async putTableValue({ productList, rawDetailList, outputDetailList }) {
         let totalPrice = 0;
         productList.forEach((item) => {
-          totalPrice += item.totalPrice;
+          totalPrice += item.totalPrice ? (+item.totalPrice) : 0;
         });
         this.$store.commit('order/setAllcountAmount', totalPrice);
         this.$set(this.form, 'totalPrice', totalPrice);
         if (this.form.relationType == 3) {
           this.$set(this.form, 'payAmount', totalPrice);
+          this.discountInput();
         }
 
         this.$refs.inventoryTable &&