|
|
@ -356,18 +356,28 @@ export default { |
|
|
|
// 计算附加项目 -- 外出费 -- 利润额 = 不开票金额 - 成本 |
|
|
|
outPrintInput() { |
|
|
|
this.formobj.outPrint = Math.round((parseFloat(this.formobj.outAmount !== '' ? this.formobj.outAmount : 0) - parseFloat(this.formobj.outCost !== '' ? this.formobj.outCost : 0)) * 100) / 100 |
|
|
|
this.costAmountAndPrint() |
|
|
|
}, |
|
|
|
// 计算附加项目 -- 厂家补助 -- 利润额 = 不开票金额 - 成本 |
|
|
|
subsidyPrintInput() { |
|
|
|
this.formobj.subsidyPrint = Math.round((parseFloat(this.formobj.subsidyAmount !== '' ? this.formobj.subsidyAmount : 0) - parseFloat(this.formobj.subsidyCost !== '' ? this.formobj.subsidyCost : 0)) * 100) / 100 |
|
|
|
this.costAmountAndPrint() |
|
|
|
}, |
|
|
|
// 计算附加项目 -- 施救费 -- 利润额 = 不开票金额 - 成本 |
|
|
|
rescuePrintInput() { |
|
|
|
this.formobj.rescuePrint = Math.round((parseFloat(this.formobj.rescueAmount !== '' ? this.formobj.rescueAmount : 0) - parseFloat(this.formobj.rescueCost !== '' ? this.formobj.rescueCost : 0)) * 100) / 100 |
|
|
|
this.costAmountAndPrint() |
|
|
|
}, |
|
|
|
handleOpen(value) { |
|
|
|
window.open(value, '_blank') |
|
|
|
}, |
|
|
|
// 计算单据信息模块 -- 成本合计、利润额 |
|
|
|
costAmountAndPrint() { |
|
|
|
// 成本合计 = 原成本合计 + 其他附加项目成本之和 |
|
|
|
this.formobj.costAmount = Math.round((parseFloat(this.formobj.costAmount !== '' ? this.formobj.costAmount : 0) + parseFloat(this.formobj.outCost !== '' ? this.formobj.outCost : 0) + parseFloat(this.formobj.subsidyCost !== '' ? this.formobj.subsidyCost : 0) + parseFloat(this.formobj.rescueCost !== '' ? this.formobj.rescueCost : 0)) * 100) / 100 |
|
|
|
// 利润额 = 原利润额 + 其他附加项目利润额之和 |
|
|
|
this.formobj.profit = Math.round((parseFloat(this.formobj.profit !== '' ? this.formobj.profit : 0) + parseFloat(this.formobj.outPrint !== '' ? this.formobj.outPrint : 0) + parseFloat(this.formobj.subsidyPrint !== '' ? this.formobj.subsidyPrint : 0) + parseFloat(this.formobj.rescuePrint !== '' ? this.formobj.rescuePrint : 0)) * 100) / 100 |
|
|
|
}, |
|
|
|
submit() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|