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

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

Loading…
Cancel
Save