This commit is contained in:
xiaozhiyong
2023-05-30 15:41:23 +08:00
parent f4f44eb502
commit 2e3065b5ff

View File

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