浏览代码

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();
         }
       },