|
|
@ -1249,6 +1249,10 @@ export default { |
|
|
|
this.$post(this.api.ship,row).then(res => {}); |
|
|
|
this.$post(this.api.ship,row).then(res => {}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 如果非数字,则返回0 |
|
|
|
|
|
|
|
handleNaN(val) { |
|
|
|
|
|
|
|
return isNaN(val) ? 0 : val |
|
|
|
|
|
|
|
}, |
|
|
|
// 计算折扣率 |
|
|
|
// 计算折扣率 |
|
|
|
calculateDiscount(val, row) { |
|
|
|
calculateDiscount(val, row) { |
|
|
|
if (row.finalPrice) |
|
|
|
if (row.finalPrice) |
|
|
@ -1258,7 +1262,7 @@ export default { |
|
|
|
userAmount(val, row) { |
|
|
|
userAmount(val, row) { |
|
|
|
if (val && row.totalAmount) { |
|
|
|
if (val && row.totalAmount) { |
|
|
|
// row.accountNum = Math.floor(row.totalAmount / val); |
|
|
|
// row.accountNum = Math.floor(row.totalAmount / val); |
|
|
|
row.accountNum = Math.round(row.totalAmount / val); |
|
|
|
row.accountNum = this.handleNaN(Math.round(row.totalAmount / val)) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 合同起止日期选择 |
|
|
|
// 合同起止日期选择 |
|
|
@ -1289,25 +1293,25 @@ export default { |
|
|
|
if (row.totalAmount) { |
|
|
|
if (row.totalAmount) { |
|
|
|
let all = row.totalAmount; |
|
|
|
let all = row.totalAmount; |
|
|
|
if (row.accountNum) {// 若有账号 |
|
|
|
if (row.accountNum) {// 若有账号 |
|
|
|
row.finalPrice = Math.round(all / row.accountNum).toFixed(2); |
|
|
|
row.finalPrice = this.handleNaN(Math.round(all / row.accountNum).toFixed(2)) |
|
|
|
} |
|
|
|
} |
|
|
|
if (row.finalPrice) {// 若有市场价 |
|
|
|
if (row.finalPrice) {// 若有市场价 |
|
|
|
// row.accountNum = Math.floor(all / row.finalPrice); |
|
|
|
// row.accountNum = Math.floor(all / row.finalPrice); |
|
|
|
row.accountNum = Math.round(all / row.finalPrice); |
|
|
|
row.accountNum = this.handleNaN(Math.round(all / row.finalPrice)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 计算成交总额 |
|
|
|
// 计算成交总额 |
|
|
|
dealComputers(e, row) { |
|
|
|
dealComputers(e, row) { |
|
|
|
if (row.finalPrice && row.accountNum) { |
|
|
|
if (row.finalPrice && row.accountNum) { |
|
|
|
row.totalAmount = Math.round((row.finalPrice) * (row.accountNum)).toFixed(2); |
|
|
|
row.totalAmount = this.handleNaN(Math.round((row.finalPrice) * (row.accountNum)).toFixed(2)) |
|
|
|
} |
|
|
|
} |
|
|
|
this.allAmount(); |
|
|
|
this.allAmount(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 计算成交价 |
|
|
|
// 计算成交价 |
|
|
|
dealBargain(e, row) { |
|
|
|
dealBargain(e, row) { |
|
|
|
if (row.accountNum && row.totalAmount) { |
|
|
|
if (row.accountNum && row.totalAmount) { |
|
|
|
row.finalPrice = Math.round(row.totalAmount / row.accountNum).toFixed(2); |
|
|
|
row.finalPrice = this.handleNaN(Math.round(row.totalAmount / row.accountNum).toFixed(2)) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|