|
@@ -3,6 +3,7 @@ import Vue from 'vue';
|
|
|
//改变数量
|
|
//改变数量
|
|
|
export function changeCount(row, countObj, noDiscountSingle, weightType) {
|
|
export function changeCount(row, countObj, noDiscountSingle, weightType) {
|
|
|
console.log('changeCount~~', row, countObj, noDiscountSingle)
|
|
console.log('changeCount~~', row, countObj, noDiscountSingle)
|
|
|
|
|
+ const type = countObj.type || 'sale';
|
|
|
let total = row[countObj.countKey] || 0;
|
|
let total = row[countObj.countKey] || 0;
|
|
|
let data = row;
|
|
let data = row;
|
|
|
if (row.packageDispositionList) {
|
|
if (row.packageDispositionList) {
|
|
@@ -27,7 +28,7 @@ export function changeCount(row, countObj, noDiscountSingle, weightType) {
|
|
|
setSingleWeight(data);
|
|
setSingleWeight(data);
|
|
|
} else {
|
|
} else {
|
|
|
console.log('weightType~~', 2)
|
|
console.log('weightType~~', 2)
|
|
|
- setWeight(data);
|
|
|
|
|
|
|
+ setWeight(data, type);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
data['totalPrice'] = 0;
|
|
data['totalPrice'] = 0;
|
|
@@ -49,8 +50,8 @@ export function changeCount(row, countObj, noDiscountSingle, weightType) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 计算总重
|
|
// 计算总重
|
|
|
-function setWeight(row) {
|
|
|
|
|
- if (row.weightUnit == row.measuringUnit && row.pricingWay == 1) {
|
|
|
|
|
|
|
+function setWeight(row, type) {
|
|
|
|
|
+ if (row.weightUnit == row.measuringUnit && row.pricingWay == 1 && type != 'purchase') {
|
|
|
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).toFixed(2);
|
|
row['totalWeight'] = (row.totalCount * row.singleWeight).toFixed(2);
|