Commit c13e31d2 authored by dcy's avatar dcy

佣金管理:价格默认为空,不要默认为1,必须让用户输入,并且金额要大于0

parent 0231012e
......@@ -7,7 +7,7 @@
<el-col :span="5">
<el-form-item label="客户名称" prop="customerId">
<div style="display: flex">
<el-input placeholder="请输入选择客户" v-model="customerName"></el-input>
<el-input readonly="readonly" placeholder="请输入选择客户" v-model="customerName"></el-input>
<img style="width: 40px;height: 40px;margin-left: 40px;" src="@/assets/images/phonebook.png" class="phonebook" @click="customerNameShow= true" />
</div>
<!-- <el-select-->
......@@ -284,7 +284,7 @@ export default {
//明佣
mingServantFrom: [
{
refund: 1,
refund: '',
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),
refundUnit:undefined,
}
......@@ -302,10 +302,10 @@ export default {
//暗佣+达标返佣
darkServantAndRebateForm: [
{
amount: 1,// 暗佣-满减金额
amount: '',// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountUnit:undefined,// 暗佣-满减金额对应单位,
refund: 1,//暗佣-满之后返还金额
refund: '',//暗佣-满之后返还金额
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundUnit:undefined,//暗佣-满之后返还金额的单位
}
......@@ -313,10 +313,10 @@ export default {
//暗佣+明金
mingServantAnddarkServant: [
{
refund: 1,// 暗佣+明佣 上调金额
refund: '',// 暗佣+明佣 上调金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣+明佣 上调对应的货币
refundUnit: undefined,//暗佣+明佣 上调对应的单位
darkAdjustCommission: 1,//暗佣+明佣 上调金额
darkAdjustCommission: '',//暗佣+明佣 上调金额
darkAdjustCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣+明佣 上调对应的货币
darkAdjustUnit:undefined,//暗佣+明佣 上调对应的单位
}
......@@ -357,32 +357,32 @@ export default {
if(r.code === 0){
this.weightList = r.data
this.$set(this.mingServantFrom,0, {
refund: 1,
refund: '',
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),
refundUnit: parseInt(this.weightList[0].id),})
this.$set(this.darkServantAndProductForm, 0,
{
productType: 0,//商品类型
productAttr: 0,//暗佣 产品属性
darkCommission: 1,//暗佣 佣金
darkCommission: '',//暗佣 佣金
darkCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣 货币
darkUnit: parseInt(this.weightList[0].id),// 暗佣 单位
})
this.$set(this.darkServantAndRebateForm, 0,
{
amount: 1,// 暗佣-满减金额
amount: '',// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountUnit:parseInt (this.weightList[0].id),// 暗佣-满减金额对应单位,
refund: 1,//暗佣-满之后返还金额
refund: '',//暗佣-满之后返还金额
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundUnit:parseInt(this.weightList[0].id),//暗佣-满之后返还金额的单位
})
this.$set(this.mingServantAnddarkServant, 0,
{
refund: 1,// 暗佣+明佣 上调金额
refund: '',// 暗佣+明佣 上调金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣+明佣 上调对应的货币
refundUnit: parseInt(this.weightList[0].id),//暗佣+明佣 上调对应的单位
darkAdjustCommission: 1,//暗佣+明佣 上调金额
darkAdjustCommission: '',//暗佣+明佣 上调金额
darkAdjustCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣+明佣 上调对应的货币
darkAdjustUnit:parseInt(this.weightList[0].id),//暗佣+明佣 上调对应的单位
})
......@@ -480,16 +480,16 @@ export default {
this.darkServantAndProductForm.push({
productType:0,//商品类型
productAttr:0,//暗佣 产品属性
darkCommission: 1,//暗佣 佣金
darkCommission: '',//暗佣 佣金
darkCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣 货币
darkUnit:this.darkServantAndProductForm[0].darkUnit,// 暗佣 单位
})
}else {
this.darkServantAndRebateForm.push( {
amount: 1,// 暗佣-满减金额
amount: '',// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountUnit: parseInt(this.weightList[0].id),// 暗佣-满减金额对应单位,
refund: 1,//暗佣-满之后返还金额
refund: '',//暗佣-满之后返还金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundUnit: this.darkServantAndRebateForm[0].refundUnit,//暗佣-满之后返还金额的单位
})
......@@ -508,11 +508,11 @@ export default {
if(this.darkServantAndProductForm.some(i => i.darkCommission <= 0 || isNaN(i.darkCommission))) return this.$message.warning('请输入大于0的金额')
this.form.customerCommissionInfoBaseVOList = this.darkServantAndProductForm
} else {
if(this.darkServantAndRebateForm.some(i => i.amount <= 0 || i.refund <=0)) return this.$message.warning('请输入大于0的金额')
if(this.darkServantAndRebateForm.some(i => i.amount <= 0 ||isNaN(Number(i.amount)) || i.refund <=0 ||isNaN(Number(i.refund)))) return this.$message.warning('请输入大于0的金额')
this.form.customerCommissionInfoBaseVOList = this.darkServantAndRebateForm
}
} else if (this.form.type == 3) {
if(this.mingServantAnddarkServant[0].darkAdjustCommission <= 0 || this.mingServantAnddarkServant[0].refund <= 0 ) return this.$message.warning('请输入大于0的金额')
if(this.mingServantAnddarkServant[0].darkAdjustCommission <= 0 || isNaN(Number(this.mingServantAnddarkServant[0].darkAdjustCommission)) || this.mingServantAnddarkServant[0].refund <= 0 || isNaN(Number(this.mingServantAnddarkServant[0].refund))) return this.$message.warning('请输入大于0的金额')
this.form.customerCommissionInfoBaseVOList = this.mingServantAnddarkServant
}
if(this.$route.params.dictId == 0){
......@@ -520,7 +520,7 @@ export default {
console.log('添加',r)
if(r.code == 0){
this.$message.success('添加成功!');
this.$router.go(-1)
this.$tab.closeOpenPage({path:'/customer/customerCommission'});
}
})
}else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment