Jelajahi Sumber

库存表格优化:移除isQueryEE参数,完善价格计算逻辑

yusheng 9 bulan lalu
induk
melakukan
49a40a2fd6
2 mengubah file dengan 4 tambahan dan 2 penghapusan
  1. 0 1
      src/BIZComponents/inventoryTable.vue
  2. 4 1
      src/BIZComponents/setProduct.js

+ 0 - 1
src/BIZComponents/inventoryTable.vue

@@ -1497,7 +1497,6 @@
           if (categoryIds.length > 0) {
             return await contactQueryByCategoryIdsAPI({
               categoryIds,
-              isQueryEE: 1
             });
           } else {
             return Promise.resolve({});

+ 4 - 1
src/BIZComponents/setProduct.js

@@ -27,6 +27,9 @@ export function changeCount(row, countObj, noDiscountSingle) {
     data['discountTotalPrice'] = !noDiscountSingle
       ? data.totalPrice
       : data.discountTotalPrice;
+  } else {
+    data['totalPrice'] = 0;
+    data['discountTotalPrice'] = 0;
   }
   // getNotaxSinglePrice(data);
   return data;
@@ -51,7 +54,7 @@ export function getAllPrice(arr) {
       sum += Number(item.totalPrice);
     }
   });
-  return sum;
+  return isNaN(sum) ? 0 : sum.toFixed(2);
 }
 // //计算不含税单价
 // function getNotaxSinglePrice(row) {