Browse Source

完善回款返利分配

master
yunuo970428 8 months ago
parent
commit
fdac43695b
  1. 52
      anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/collectionrebateallotAdd.vue

52
anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/collectionrebateallotAdd.vue

@ -48,7 +48,7 @@
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item> <el-form-item>
<el-input v-model="formobj.shareProportion" clearable @keyup.native="UpNumber" placeholder="" class="addinputw"/> <el-input v-model="formobj.shareProportion" @input="shareProportionInput" @keyup.native="formobj.shareProportion = getNumber(formobj.shareProportion, 2)" clearable placeholder="" class="addinputw"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="3" class="tleftb"> <el-col :span="3" class="tleftb">
@ -56,7 +56,7 @@
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item> <el-form-item>
<span>{{ shareRebateTotalSummation() }}</span> <span>{{ formobj.shareRebateTotal }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="3" class="tleftb"> <el-col :span="3" class="tleftb">
@ -64,7 +64,7 @@
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item> <el-form-item>
<span>{{ thisRebateBalanceSummation() }}</span> <span>{{ formobj.thisRebateBalance }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -149,15 +149,23 @@ export default {
} }
}, },
methods: { methods: {
UpNumber(e) { getNumber(val, limit) {
e.target.value = e.target.value.replace(/[^\d.]/g, '') // ."-" val = val.replace(/[^0-9.]/g, '') //
e.target.value = e.target.value.replace(/^00/, '0.') // 0 val = val.replace(/^00/, '0.') // 0
e.target.value = e.target.value.replace(/\.{2,}/g, '.') // . val = val.replace(/^\./g, '0.') // 0.
e.target.value = e.target.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3') // val = val.replace(/\.{2,}/g, '.') //
if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') { val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); //
// 0102 /^0\d+/.test(val) ? val = val.slice(1) : '' // 0
e.target.value = parseFloat(e.target.value) 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
}, },
showEdit(val) { showEdit(val) {
this.$nextTick(() => { this.$nextTick(() => {
@ -175,24 +183,20 @@ export default {
this.formobj.withholdingApply = val.withholdingApply this.formobj.withholdingApply = val.withholdingApply
this.formobj.distributionState = '已分配' this.formobj.distributionState = '已分配'
this.formobj.scmCollectionRebateDistributionVehs = val.scmCollectionRebateDistributionVehs this.formobj.scmCollectionRebateDistributionVehs = val.scmCollectionRebateDistributionVehs
this.formobj.shareGinExaProportion = parseFloat(this.formobj.estimateRebate) / parseFloat(this.formobj.collectionMoney) // = /
this.formobj.shareGinExaProportion = Math.round((parseFloat(this.formobj.estimateRebate !== '' ? this.formobj.estimateRebate : 0) / parseFloat(this.formobj.collectionMoney !== '' ? this.formobj.collectionMoney : 0)) * 100) / 100
this.viewTitle = '回款返利分配' this.viewTitle = '回款返利分配'
}, },
shareRebateTotalSummation() { shareProportionInput() {
if (this.formobj.shareProportion !== '') { // = *
this.formobj.shareRebateTotal = parseFloat(this.formobj.collectionMoney) * parseFloat(this.formobj.shareProportion) this.formobj.shareRebateTotal = Math.round((parseFloat(this.formobj.collectionMoney !== '' ? this.formobj.collectionMoney : 0) * parseFloat(this.formobj.shareProportion !== '' ? this.formobj.shareProportion : 0)) * 100) / 100
return this.formobj.shareRebateTotal // = -
} this.formobj.thisRebateBalance = parseFloat(this.formobj.estimateRebate !== '' ? this.formobj.estimateRebate : 0) - parseFloat(this.formobj.shareRebateTotal !== '' ? this.formobj.shareRebateTotal : 0)
},
thisRebateBalanceSummation() {
if (this.formobj.shareRebateTotal !== '') {
this.formobj.thisRebateBalance = parseFloat(this.formobj.estimateRebate) - parseFloat(this.formobj.shareRebateTotal)
return this.formobj.thisRebateBalance
}
}, },
handleAllocation() { handleAllocation() {
for (var i = 0; i < this.formobj.scmCollectionRebateDistributionVehs.length; i++) { for (var i = 0; i < this.formobj.scmCollectionRebateDistributionVehs.length; i++) {
this.formobj.scmCollectionRebateDistributionVehs[i].distributionCollectionRebate = parseFloat(this.formobj.scmCollectionRebateDistributionVehs[i].costPrice) * parseFloat(this.formobj.shareProportion) // = *
this.formobj.scmCollectionRebateDistributionVehs[i].distributionCollectionRebate = Math.round((parseFloat(this.formobj.scmCollectionRebateDistributionVehs[i].costPrice !== '' ? this.formobj.scmCollectionRebateDistributionVehs[i].costPrice : 0) * (parseFloat(this.formobj.shareProportion !== '' ? this.formobj.shareProportion : 0) / 100)) * 100) / 100
} }
}, },
handleSave() { handleSave() {

Loading…
Cancel
Save