|
|
|
@ -149,47 +149,42 @@ export default { |
|
|
|
|
if (salePrice && floorPrice && preQuantity && preAmount) { |
|
|
|
|
let strategyArr = [ |
|
|
|
|
// 原策略 |
|
|
|
|
{ salePrice, floorPrice, preQuantity, preAmount, preCostAmount: +floorPrice * +preQuantity }, |
|
|
|
|
() => { |
|
|
|
|
return { salePrice, floorPrice, preQuantity, preAmount, preCostAmount: floorPrice * preQuantity } |
|
|
|
|
}, |
|
|
|
|
// 以提货量为准 |
|
|
|
|
{ |
|
|
|
|
salePrice: this.newSalePrice, |
|
|
|
|
floorPrice: this.newCostPrice, |
|
|
|
|
() => { |
|
|
|
|
let _salePrice = this.newSalePrice |
|
|
|
|
let _floorPrice = this.newCostPrice |
|
|
|
|
return { |
|
|
|
|
salePrice: _salePrice, |
|
|
|
|
floorPrice: _floorPrice, |
|
|
|
|
preQuantity, |
|
|
|
|
preAmount: +this.newSalePrice * +preQuantity, |
|
|
|
|
preCostAmount: +this.newCostPrice * +preQuantity |
|
|
|
|
preAmount: _salePrice * preQuantity, |
|
|
|
|
preCostAmount: _floorPrice * preQuantity |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 以订单金额为准 |
|
|
|
|
{ |
|
|
|
|
salePrice: this.newSalePrice, |
|
|
|
|
floorPrice: this.newCostPrice, |
|
|
|
|
preQuantity: +preAmount / +this.newSalePrice, |
|
|
|
|
() => { |
|
|
|
|
let _salePrice = this.newSalePrice |
|
|
|
|
let _floorPrice = this.newCostPrice |
|
|
|
|
return { |
|
|
|
|
salePrice: _salePrice, |
|
|
|
|
floorPrice: _floorPrice, |
|
|
|
|
preQuantity: preAmount / _salePrice, |
|
|
|
|
preAmount, |
|
|
|
|
preCostAmount: +this.newCostPrice * (+preAmount / +this.newSalePrice) |
|
|
|
|
preCostAmount: _floorPrice * (preAmount / _salePrice) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
strategyArr.forEach((item, index) => { |
|
|
|
|
for (let key in item) { |
|
|
|
|
item[key] = this.fixedHandle(item[key]) |
|
|
|
|
let data = item() |
|
|
|
|
for (let key in data) { |
|
|
|
|
data[key] = this.fixedHandle(data[key]) |
|
|
|
|
} |
|
|
|
|
Object.assign(this.tableData[index], item) |
|
|
|
|
Object.assign(this.tableData[index], data) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// // 原策略 |
|
|
|
|
// Object.assign(this.tableData[0], { salePrice: salePrice, floorPrice: floorPrice, preQuantity: preQuantity, preAmount: preAmount }) |
|
|
|
|
// // 以提货量为准 |
|
|
|
|
// Object.assign(this.tableData[1], { |
|
|
|
|
// salePrice: this.newSalePrice, |
|
|
|
|
// floorPrice: this.newCostPrice, |
|
|
|
|
// preQuantity: preQuantity, |
|
|
|
|
// preAmount: +this.newSalePrice * +preQuantity |
|
|
|
|
// }) |
|
|
|
|
// // 以订单金额为准 |
|
|
|
|
// Object.assign(this.tableData[2], { |
|
|
|
|
// salePrice: this.newSalePrice, |
|
|
|
|
// floorPrice: this.newCostPrice, |
|
|
|
|
// preQuantity: +preAmount / +this.newSalePrice, |
|
|
|
|
// preAmount: preAmount |
|
|
|
|
// }) |
|
|
|
|
this.undergoChanges = true |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|