From 39a9419d3eb4e74bb19d8175da62f21eb6f94650 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Mon, 12 Aug 2024 09:12:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=85=A5=E5=BA=93=E7=94=B3?= =?UTF-8?q?=E8=AF=B7--=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2=E4=B8=AD?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=96=B9=E6=B3=95=E4=BB=A5=E5=8F=8A=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E5=B0=8F=E6=95=B0=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruzhang/ruzhangguanli/ruzhangAdd.vue | 358 ++++++------------ 1 file changed, 125 insertions(+), 233 deletions(-) diff --git a/anrui-scm/anrui-scm-ui/src/views/ruzhang/ruzhangguanli/ruzhangAdd.vue b/anrui-scm/anrui-scm-ui/src/views/ruzhang/ruzhangguanli/ruzhangAdd.vue index 7a8003cee1..089ff3825b 100644 --- a/anrui-scm/anrui-scm-ui/src/views/ruzhang/ruzhangguanli/ruzhangAdd.vue +++ b/anrui-scm/anrui-scm-ui/src/views/ruzhang/ruzhangguanli/ruzhangAdd.vue @@ -73,11 +73,11 @@
厂家合同价
- +
其中上装价格
- +
上装价格计算依据
@@ -90,11 +90,11 @@
一次运费
- +
二次运费
- +
@@ -108,7 +108,7 @@
可享受金额
- +
@@ -126,7 +126,7 @@
可享受金额
- +
@@ -145,7 +145,7 @@
可享受比例(%)
- +
对应金额
@@ -159,7 +159,7 @@
可享受比例(%)
- +
对应金额
@@ -169,7 +169,7 @@
金额合计
- +
政策备注
@@ -331,24 +331,8 @@ export default { } }) }, - // 输入数字正则 - oninput(val, limit = 0) { - val = val.replace(/[^\d]/g, '') // 保留数字 - val = val.replace(/^00/, '0'); // 开头不能有两个0 - /^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0 - const str = '^(\\d+)\\.(\\d{' + limit + '}).*$' - const reg = new RegExp(str) - if (limit === 0) { - // 不需要小数点 - val = val.replace(reg, '$1') - } else { - // 通过正则保留小数点后指定的位数 - val = val.replace(reg, '$1.$2') - } - return val - }, - UpNumberRatio(val, limit = 2) { - val = val.replace(/[^\d.]/g, '') // 保留数字 + getNumber(val, limit) { + val = val.replace(/[^0-9.]/g, '') // 保留数字 val = val.replace(/^00/, '0.') // 开头不能有两个0 val = val.replace(/^\./g, '0.') // 开头为小数点转换为0. val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个 @@ -422,211 +406,125 @@ export default { this.inputEligibleProportionThree() } }, - // 计算政策3 + // 计算政策3的对应金额 inputEligibleProportionTwo() { - if (this.formobj.eligibleProportionTwo !== '') { - if (this.policyOneChecked && this.policyOneTwoChecked) { // 计算政策3时:勾选扣减政策1、扣减政策2 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } - } else { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) + if (this.formobj.eligibleProportionTwo !== '') { // 政策3的可享受比例不为空 + if (this.policyOneChecked && this.policyOneTwoChecked) { // 同时勾选扣减政策1、扣减政策2 + if (this.freightChecked) { // 勾选扣减运费 + // 政策3的对应金额 = (厂家合同价 - 一次运费 - 二次运费 - 政策1的可享受金额 - 政策2的可享受金额) * 政策3的可享受比例 + this.formobj.corrMoneyTwo = Math.round((((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0')) * (parseFloat(this.formobj.eligibleProportionTwo !== '' ? this.formobj.eligibleProportionTwo : '0') / 100))) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策3的对应金额 = (厂家合同价 - 政策1的可享受金额 - 政策2的可享受金额) * 政策3的可享受比例 + this.formobj.corrMoneyTwo = Math.round((((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0')) * (parseFloat(this.formobj.eligibleProportionTwo !== '' ? this.formobj.eligibleProportionTwo : '0') / 100))) * 100) / 100 } - } else if (this.policyOneChecked && !this.policyOneTwoChecked) { // 计算政策3时:勾选扣减政策1 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } - } else { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) + } else if (this.policyOneChecked && !this.policyOneTwoChecked) { // 计算政策3时:勾选扣减政策1、未勾选扣减政策2 + if (this.freightChecked) { // 勾选扣减运费 + // 政策3的对应金额 = (厂家合同价 - 一次运费 - 二次运费 - 政策1的可享受金额) * 政策3的可享受比例 + this.formobj.corrMoneyTwo = Math.round((((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0')) * (parseFloat(this.formobj.eligibleProportionTwo !== '' ? this.formobj.eligibleProportionTwo : '0') / 100))) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策3的对应金额 = (厂家合同价 - 政策1的可享受金额) * 政策3的可享受比例 + this.formobj.corrMoneyTwo = Math.round((((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0')) * (parseFloat(this.formobj.eligibleProportionTwo !== '' ? this.formobj.eligibleProportionTwo : '0') / 100))) * 100) / 100 } - } else if (!this.policyOneChecked && this.policyOneTwoChecked) { // 计算政策3时:勾选扣减政策2 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } - } else { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) + } else if (!this.policyOneChecked && this.policyOneTwoChecked) { // 计算政策3时:未勾选扣减政策1、勾选扣减政策2 + if (this.freightChecked) { // 勾选扣减运费 + // 政策3的对应金额 = (厂家合同价 - 一次运费 - 二次运费 - 政策2的可享受金额) * 政策3的可享受比例 + this.formobj.corrMoneyTwo = Math.round((((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0')) * (parseFloat(this.formobj.eligibleProportionTwo !== '' ? this.formobj.eligibleProportionTwo : '0') / 100))) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策3的对应金额 = (厂家合同价 - 政策2的可享受金额) * 政策3的可享受比例 + this.formobj.corrMoneyTwo = Math.round((((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0')) * (parseFloat(this.formobj.eligibleProportionTwo !== '' ? this.formobj.eligibleProportionTwo : '0') / 100))) * 100) / 100 } - } else { // 计算政策3时:未勾选任何扣减政策 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight)), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } else { - this.formobj.corrMoneyTwo = this.multiplication(parseFloat(this.formobj.contractPrice), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) - } - } else { - this.formobj.corrMoneyTwo = this.multiplication(parseFloat(this.formobj.contractPrice), (parseFloat(this.formobj.eligibleProportionTwo) / 100)) + } else { // 计算政策3时:同时未勾选扣减政策1、扣减政策2 + if (this.freightChecked) { // 扣减运费 + // 政策3的对应金额 = (厂家合同价 - 一次运费 - 二次运费) * 政策3的可享受比例 + this.formobj.corrMoneyTwo = Math.round((((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0')) * (parseFloat(this.formobj.eligibleProportionTwo !== '' ? this.formobj.eligibleProportionTwo : '0') / 100))) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策3的对应金额 = (厂家合同价) * 政策3的可享受比例 + this.formobj.corrMoneyTwo = Math.round((((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0')) * (parseFloat(this.formobj.eligibleProportionTwo !== '' ? this.formobj.eligibleProportionTwo : '0') / 100))) * 100) / 100 } } - } else { + } else { // 政策3的可享受比例为空,政策3的对应金额为0 this.formobj.corrMoneyTwo = 0 } - if (this.formobj.eligibleAmountOne === '' && this.formobj.eligibleAmountTwo === '') { - this.formobj.moneyCount = parseFloat(0) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree) - } else if (this.formobj.eligibleAmountOne !== '' && this.formobj.eligibleAmountTwo === '') { - this.formobj.moneyCount = parseFloat(this.formobj.eligibleAmountOne) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree) - } else if (this.formobj.eligibleAmountOne === '' && this.formobj.eligibleAmountTwo !== '') { - this.formobj.moneyCount = parseFloat(this.formobj.eligibleAmountTwo) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree) - } else { - this.formobj.moneyCount = parseFloat(this.formobj.eligibleAmountOne) + parseFloat(this.formobj.eligibleAmountTwo) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree) - } + // 计算金额合计 = 政策1的可享受金额 + 政策2的可享受金额 + 政策3的对应金额 + 政策4的对应金额 + this.formobj.moneyCount = Math.round((parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0') + parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0') + parseFloat(this.formobj.corrMoneyTwo !== '' ? this.formobj.corrMoneyTwo : '') + parseFloat(this.formobj.corrMoneyThree !== '' ? this.formobj.corrMoneyThree : '')) * 100) / 100 if (this.formobj.eligibleProportionThree !== '') { this.inputEligibleProportionThree() } return this.formobj.corrMoneyTwo }, - // 计算政策4 + // 计算政策4的对应金额 inputEligibleProportionThree() { - if (this.formobj.eligibleProportionThree !== '') { - if (this.policyTwoChecked && this.policyThreeChecked && this.policyThreeByThreeChecked) { // 计算政策4时:勾选扣减政策1、扣减政策2、扣减政策3 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) + if (this.formobj.eligibleProportionThree !== '') { // 政策4的可享受比例 + if (this.policyTwoChecked && this.policyThreeChecked && this.policyThreeByThreeChecked) { // 计算政策4时:同时勾选扣减政策1、扣减政策2、扣减政策3 + if (this.freightChecked) { // 勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 一次运费 - 二次运费 - 政策1的可享受金额 - 政策2的可享受金额 - 政策3的对应金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0') - parseFloat(this.formobj.corrMoneyTwo !== '' ? this.formobj.corrMoneyTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 政策1的可享受金额 - 政策2的可享受金额 - 政策3的对应金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0') - parseFloat(this.formobj.corrMoneyTwo !== '' ? this.formobj.corrMoneyTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 } - } else if (this.policyTwoChecked && !this.policyThreeChecked && this.policyThreeByThreeChecked) { // 计算政策4时:勾选扣减政策1、扣减政策3 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) + } else if (this.policyTwoChecked && !this.policyThreeChecked && this.policyThreeByThreeChecked) { // 计算政策4时:勾选扣减政策1、扣减政策3、未勾选扣减政策2 + if (this.freightChecked) { // 勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 一次运费 - 二次运费 - 政策1的可享受金额 - 政策3的对应金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0') - parseFloat(this.formobj.corrMoneyTwo !== '' ? this.formobj.corrMoneyTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 政策1的可享受金额 - 政策3的对应金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0') - parseFloat(this.formobj.corrMoneyTwo !== '' ? this.formobj.corrMoneyTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 } - } else if (!this.policyTwoChecked && this.policyThreeChecked && this.policyThreeByThreeChecked) { // 计算政策4时:勾选扣减政策2、扣减政策3 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.corrMoneyTwo) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.corrMoneyTwo) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.corrMoneyTwo) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.corrMoneyTwo) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.corrMoneyTwo) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) + } else if (!this.policyTwoChecked && this.policyThreeChecked && this.policyThreeByThreeChecked) { // 计算政策4时:未勾选扣减政策1、勾选扣减政策2、扣减政策3 + if (this.freightChecked) { // 勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 一次运费 - 二次运费 - 政策2的可享受金额 - 政策3的对应金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0') - parseFloat(this.formobj.corrMoneyTwo !== '' ? this.formobj.corrMoneyTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 政策2的可享受金额 - 政策3的对应金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0') - parseFloat(this.formobj.corrMoneyTwo !== '' ? this.formobj.corrMoneyTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 } - } else if (this.policyTwoChecked && this.policyThreeChecked && !this.policyThreeByThreeChecked) { // 计算政策4时:勾选扣减政策1、扣减政策2 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) + } else if (this.policyTwoChecked && this.policyThreeChecked && !this.policyThreeByThreeChecked) { // 计算政策4时:勾选扣减政策1、扣减政策2、未勾选扣减政策3 + if (this.freightChecked) { // 勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 一次运费 - 二次运费 - 政策1的可享受金额 - 政策2的可享受金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 政策1的可享受金额 - 政策2的可享受金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 } } else if (!this.policyTwoChecked && !this.policyThreeChecked && this.policyThreeByThreeChecked) { // 计算政策4时:勾选扣减政策3 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } - } else if (this.policyTwoChecked && !this.policyThreeChecked && !this.policyThreeByThreeChecked) { // 计算政策4时:勾选扣减政策1 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) + if (this.freightChecked) { // 勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 一次运费 - 二次运费 - 政策3的对应金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0') - parseFloat(this.formobj.corrMoneyTwo !== '' ? this.formobj.corrMoneyTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 政策3的对应金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.corrMoneyTwo !== '' ? this.formobj.corrMoneyTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 } } else if (!this.policyTwoChecked && this.policyThreeChecked && !this.policyThreeByThreeChecked) { // 计算政策4时:勾选扣减政策2 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) + if (this.freightChecked) { // 勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 一次运费 - 二次运费 - 政策2的可享受金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 政策2的可享受金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 + } + } else if (this.policyTwoChecked && !this.policyThreeChecked && !this.policyThreeByThreeChecked) { // 计算政策4时:勾选扣减政策1 + if (this.freightChecked) { // 勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 一次运费 - 二次运费 - 政策1的可享受金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 政策1的可享受金额) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 } } else { // 计算政策4时:未勾选任何一个扣减政策 - if (this.freightChecked) { - if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) - } - } else { - this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice)), (parseFloat(this.formobj.eligibleProportionThree) / 100)) + if (this.freightChecked) { // 勾选扣减运费 + // 政策4的对应金额 = (厂家合同价 - 一次运费 - 二次运费) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0') - parseFloat(this.formobj.onceFreight !== '' ? this.formobj.onceFreight : '0') - parseFloat(this.formobj.secondaryFreight !== '' ? this.formobj.secondaryFreight : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 + } else { // 未勾选扣减运费 + // 政策4的对应金额 = (厂家合同价) * 政策4的可享受比例 + this.formobj.corrMoneyThree = Math.round(((parseFloat(this.formobj.contractPrice !== '' ? this.formobj.contractPrice : '0')) * (parseFloat(this.formobj.eligibleProportionThree !== '' ? this.formobj.eligibleProportionThree : '0') / 100)) * 100) / 100 } } - } else { + } else { // 政策4的可享受比例为0时 this.formobj.corrMoneyThree = 0 } - if (this.formobj.eligibleAmountOne === '' && this.formobj.eligibleAmountTwo === '') { - this.formobj.moneyCount = parseFloat(0) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree) - } else if (this.formobj.eligibleAmountOne !== '' && this.formobj.eligibleAmountTwo === '') { - this.formobj.moneyCount = parseFloat(this.formobj.eligibleAmountOne) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree) - } else if (this.formobj.eligibleAmountOne === '' && this.formobj.eligibleAmountTwo !== '') { - this.formobj.moneyCount = parseFloat(this.formobj.eligibleAmountTwo) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree) - } else { - this.formobj.moneyCount = parseFloat(this.formobj.eligibleAmountOne) + parseFloat(this.formobj.eligibleAmountTwo) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree) - } + // 计算金额合计 = 政策1的可享受金额 + 政策2的可享受金额 + 政策3的对应金额 + 政策4的对应金额 + this.formobj.moneyCount = Math.round((parseFloat(this.formobj.eligibleAmountOne !== '' ? this.formobj.eligibleAmountOne : '0') + parseFloat(this.formobj.eligibleAmountTwo !== '' ? this.formobj.eligibleAmountTwo : '0') + parseFloat(this.formobj.corrMoneyTwo !== '' ? this.formobj.corrMoneyTwo : '') + parseFloat(this.formobj.corrMoneyThree !== '' ? this.formobj.corrMoneyThree : '')) * 100) / 100 return this.formobj.corrMoneyThree }, inputMoneyCount() { @@ -638,22 +536,6 @@ export default { } return this.formobj.costPrice }, - multiplication(arg1, arg2) { - var m = 0 - var s1 = arg1.toString() - var s2 = arg2.toString() - try { - m += s1.split('.')[1].length - } catch (e) { - console.log(e) - } - try { - m += s2.split('.')[1].length - } catch (e) { - console.log(e) - } - return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m) - }, showEdit(sid, row) { this.$nextTick(() => { this.$refs['form_obj'].clearValidate() @@ -875,8 +757,8 @@ export default { // 判断车辆列表中是否有未填写的车架号记录,如果有则进行分批入库的功能 var hint = 0 if (this.formobj.vehicleList.length > 0) { - for (var i = 0; i < this.formobj.vehicleList.length; i++) { - if (this.formobj.vehicleList[i].vinNo === '') { + for (var j = 0; j < this.formobj.vehicleList.length; j++) { + if (this.formobj.vehicleList[j].vinNo === '') { hint = 1 break } @@ -891,19 +773,24 @@ export default { }).then(() => { this.$refs['form_obj'].validate(valid => { if (valid) { + const loading = this.$loading({ + lock: true, + text: '数据正在保存中,请勿关闭页面', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) this.submitdisabled = true req.confirmRZ(this.formobj).then((res) => { if (res.success) { - this.$message({ - showClose: true, - type: 'success', - message: '提交成功' - }) + loading.close() + this.$message({ showClose: true, type: 'success', message: '提交成功' }) this.handleReturn('true') } else { + loading.close() this.submitdisabled = false } }).catch(() => { + loading.close() this.submitdisabled = false }) } @@ -922,18 +809,23 @@ export default { this.$refs['form_obj'].validate(valid => { if (valid) { this.submitdisabled = true + const loading = this.$loading({ + lock: true, + text: '数据正在保存中,请勿关闭页面', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) req.confirmRZ(this.formobj).then((res) => { if (res.success) { - this.$message({ - showClose: true, - type: 'success', - message: '提交成功' - }) + loading.close() + this.$message({ showClose: true, type: 'success', message: '提交成功' }) this.handleReturn('true') } else { + loading.close() this.submitdisabled = false } }).catch(() => { + loading.close() this.submitdisabled = false }) }