|
@@ -1,7 +1,9 @@
|
|
|
import Vue from 'vue';
|
|
import Vue from 'vue';
|
|
|
|
|
+import _ from 'lodash';
|
|
|
|
|
|
|
|
//改变数量
|
|
//改变数量
|
|
|
export function changeCount(row, countObj, noDiscountSingle) {
|
|
export function changeCount(row, countObj, noDiscountSingle) {
|
|
|
|
|
+ console.log('改变数量~~~~', row, countObj, noDiscountSingle);
|
|
|
let total = row[countObj.countKey] || 0;
|
|
let total = row[countObj.countKey] || 0;
|
|
|
let data = row;
|
|
let data = row;
|
|
|
if (row.packageDispositionList) {
|
|
if (row.packageDispositionList) {
|
|
@@ -42,7 +44,8 @@ function setWeight(row) {
|
|
|
if (row.weightUnit == row.measuringUnit) {
|
|
if (row.weightUnit == row.measuringUnit) {
|
|
|
row['totalWeight'] = row.totalCount;
|
|
row['totalWeight'] = row.totalCount;
|
|
|
} else if (row.totalCount && row.singleWeight) {
|
|
} else if (row.totalCount && row.singleWeight) {
|
|
|
- row['totalWeight'] = row.totalCount * row.singleWeight;
|
|
|
|
|
|
|
+ // 使用lodash的round函数保留4位小数并向上舍入
|
|
|
|
|
+ row['totalWeight'] = _.round(row.totalCount * row.singleWeight, 4, Math.ceil);
|
|
|
} else {
|
|
} else {
|
|
|
row['totalWeight'] = 0;
|
|
row['totalWeight'] = 0;
|
|
|
}
|
|
}
|