فهرست منبع

fix(saleOrder): 修复不定项总价计算精度问题

liujt 3 ماه پیش
والد
کامیت
5da819da55
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      src/views/saleManage/saleOrder/components/typeList.vue

+ 2 - 0
src/views/saleManage/saleOrder/components/typeList.vue

@@ -276,6 +276,7 @@
 
           this.allPrice += item.totalPrice;
         });
+        this.allPrice = Number(this.allPrice.toFixed(2));
         this.$emit('setCountAmount', this.allPrice);
         this.$emit('setTotalPlanNum', totalCount);
       },
@@ -284,6 +285,7 @@
       async putTableValue(productList) {
         if (productList) {
           this.form.datasource = productList;
+          this.allPrice = productList?.reduce((acc, item) => acc + item.totalPrice, 0).toFixed(2) || 0;
           this.$refs.table.reload();
         }
       },