|
|
@ -73,11 +73,11 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty spanOneWidth"><span>厂家合同价</span></div> |
|
|
|
<el-form-item><el-input @input="inputContractPrice" v-model="formobj.contractPrice" placeholder="" clearable @keyup.native="formobj.contractPrice = oninput(formobj.contractPrice,2)" class="addinputw addinputwOne"/></el-form-item> |
|
|
|
<el-form-item><el-input @input="inputContractPrice" v-model="formobj.contractPrice" placeholder="" clearable @keyup.native="formobj.contractPrice = getNumber(formobj.contractPrice,2)" class="addinputw addinputwOne"/></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty spanOneWidth"><span>其中上装价格</span></div> |
|
|
|
<el-form-item><el-input v-model="formobj.amongSzPrice" @keyup.native="formobj.amongSzPrice = oninput(formobj.amongSzPrice,2)" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
<el-form-item><el-input v-model="formobj.amongSzPrice" @keyup.native="formobj.amongSzPrice = getNumber(formobj.amongSzPrice,2)" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty spanOneWidth"><span>上装价格计算依据</span></div> |
|
|
@ -90,11 +90,11 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty spanOneWidth">一次运费</div> |
|
|
|
<el-form-item><el-input @input="inputOnceFreight" v-model="formobj.onceFreight" placeholder="" clearable @keyup.native="formobj.onceFreight = oninput(formobj.onceFreight,2)" class="addinputw addinputwOne"/></el-form-item> |
|
|
|
<el-form-item><el-input @input="inputOnceFreight" v-model="formobj.onceFreight" placeholder="" clearable @keyup.native="formobj.onceFreight = getNumber(formobj.onceFreight,2)" class="addinputw addinputwOne"/></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty spanOneWidth">二次运费</div> |
|
|
|
<el-form-item><el-input @input="inputSecondaryFreight" v-model="formobj.secondaryFreight" placeholder="" clearable @keyup.native="formobj.secondaryFreight = oninput(formobj.secondaryFreight,2)" class="addinputw addinputwOne"/></el-form-item> |
|
|
|
<el-form-item><el-input @input="inputSecondaryFreight" v-model="formobj.secondaryFreight" placeholder="" clearable @keyup.native="formobj.secondaryFreight = getNumber(formobj.secondaryFreight,2)" class="addinputw addinputwOne"/></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<div class="title"> |
|
|
@ -108,7 +108,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty spanOneWidth"><span>可享受金额</span></div> |
|
|
|
<el-form-item><el-input @input="inputEligibleAmountOne" @keyup.native="formobj.eligibleAmountOne = oninput(formobj.eligibleAmountOne,2)" v-model="formobj.eligibleAmountOne" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
<el-form-item><el-input @input="inputEligibleAmountOne" @keyup.native="formobj.eligibleAmountOne = getNumber(formobj.eligibleAmountOne,2)" v-model="formobj.eligibleAmountOne" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" style="border-bottom: 0px !important;"> |
|
|
|
<div class="spanThreeWidth"> |
|
|
@ -126,7 +126,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty spanOneWidth"><span>可享受金额</span></div> |
|
|
|
<el-form-item><el-input @input="inputEligibleAmountTwo" @keyup.native="formobj.eligibleAmountTwo = oninput(formobj.eligibleAmountTwo,2)" v-model="formobj.eligibleAmountTwo" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
<el-form-item><el-input @input="inputEligibleAmountTwo" @keyup.native="formobj.eligibleAmountTwo = getNumber(formobj.eligibleAmountTwo,2)" v-model="formobj.eligibleAmountTwo" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<div class="spanThreeWidth"> |
|
|
@ -145,7 +145,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty spanOneWidth"><span>可享受比例(%)</span></div> |
|
|
|
<el-form-item><el-input @input="inputEligibleProportionTwo" v-model="formobj.eligibleProportionTwo" @keyup.native="formobj.eligibleProportionTwo = UpNumberRatio(formobj.eligibleProportionTwo,2)" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
<el-form-item><el-input @input="inputEligibleProportionTwo" v-model="formobj.eligibleProportionTwo" @keyup.native="formobj.eligibleProportionTwo = getNumber(formobj.eligibleProportionTwo,2)" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<div class="span-sty spanOneWidth"><span>对应金额</span></div> |
|
|
@ -159,7 +159,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty spanOneWidth"><span>可享受比例(%)</span></div> |
|
|
|
<el-form-item><el-input @input="inputEligibleProportionThree" v-model="formobj.eligibleProportionThree" @keyup.native="formobj.eligibleProportionThree = UpNumberRatio(formobj.eligibleProportionThree,2)" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
<el-form-item><el-input @input="inputEligibleProportionThree" v-model="formobj.eligibleProportionThree" @keyup.native="formobj.eligibleProportionThree = getNumber(formobj.eligibleProportionThree,2)" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<div class="span-sty spanOneWidth"><span>对应金额</span></div> |
|
|
@ -169,7 +169,7 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty spanOneWidth"><span>金额合计</span></div> |
|
|
|
<el-form-item><el-input v-model="formobj.moneyCount" @keyup.native="formobj.moneyCount = UpNumberRatio(formobj.moneyCount,2)" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
<el-form-item><el-input v-model="formobj.moneyCount" @keyup.native="formobj.moneyCount = getNumber(formobj.moneyCount,2)" placeholder="" clearable class="addinputw addinputwOne"/></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="18"> |
|
|
|
<div class="span-sty spanOneWidth"><span>政策备注</span></div> |
|
|
@ -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 |
|
|
|
}) |
|
|
|
} |
|
|
|