소스 검색

fix(库存管理): 统一

yusheng 5 달 전
부모
커밋
db94c8979a
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      src/BIZComponents/setProduct.js

+ 6 - 6
src/BIZComponents/setProduct.js

@@ -63,8 +63,8 @@ export function changeCount(row, countObj, noDiscountSingle, weightType) {
 function setWeight(row, countObj) {
   if (row.weightUnit == row.measuringUnit) {
     row['totalWeight'] = row.totalCount;
-  } else if (row[countObj.countKey] && row.singleWeight) {
-    row['totalWeight'] = (row[countObj.countKey] * row.singleWeight).toFixed(2);
+  } else if (row.totalCount&& row.singleWeight) {
+    row['totalWeight'] = (row.totalCount * row.singleWeight).toFixed(2);
   } else {
     row['totalWeight'] = 0;
   }
@@ -75,9 +75,9 @@ function setWeight(row, countObj) {
   // } else {
   //   row['totalWeight'] = 0;
   // }
-  if (row.weightUnit == row.measuringUnit) {
-    row['totalCount'] = row.totalWeight;
-  }
+  // if (row.weightUnit == row.measuringUnit) {
+  //   row['totalCount'] = row.totalWeight;
+  // }
   console.log(row['totalCount'], 'dsds');
 }
 // 计算单重
@@ -100,7 +100,7 @@ function setSingleWeight(row, countObj, endIndex) {
     }
     // console.log(totalWeight, 'totalWeight');
     row['singleWeight'] = Number(totalWeight/row[countObj.countKey]).toFixed(2);
-  } else if (row.totalWeight && row[countObj.countKey]) {
+  } else if (row.totalWeight && row.totalCount) {
     row['singleWeight'] = (row.totalWeight / row.totalCount).toFixed(2);
   } else {
     row['singleWeight'] = 0;