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