pull/17/head^2
xiaozhiyong 2 years ago
parent f4f44eb502
commit 2e3065b5ff
  1. 59
      src/views/order/components/confirmSubmit.vue

@ -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
} }
}, },

Loading…
Cancel
Save