Commit cc3cbf87 authored by dcy's avatar dcy

客户佣金重量单位,修改为api拿

parent acc1b99e
......@@ -67,7 +67,7 @@
<el-col :span="24">
<el-form-item label="佣金类型(明佣、暗佣)">
<el-radio-group v-model="form.type">
<el-radio v-for="(item,index) in getDictDatas(DICT_TYPE.COMMISSION_TYPE)" :label="parseInt(item.value)"
<el-radio v-for="(item,index) in getDictDatas(DICT_TYPE.COMMISSION_TYPE)" v-show="item.value != 0" :label="parseInt(item.value)"
:key="index">{{ item.label }}
</el-radio>
</el-radio-group>
......@@ -98,8 +98,8 @@
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div>
<custom-selectors-dictionary v-model="mingServantFrom[0].refundUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
<custom-selectors-dictionary v-model="mingServantFrom[0].refundUnit" label-key="titleZh" value-key="id"
:options="weightList"></custom-selectors-dictionary>
</div>
</div>
</div>
......@@ -131,8 +131,8 @@
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="custom">
<custom-selectors-dictionary v-model="item.darkUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
<custom-selectors-dictionary v-model="item.darkUnit" label-key="titleZh" value-key="id"
:options="weightList"></custom-selectors-dictionary>
</div>
</div>
<div>
......@@ -157,7 +157,7 @@
</div>
<div class="item">
<custom-selectors-dictionary v-model="item.amountUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
label-key="titleZh" value-key="id" :options="weightList"></custom-selectors-dictionary>
</div>
</div>
<div class="content">
......@@ -171,7 +171,7 @@
</div>
<div class="item">
<custom-selectors-dictionary v-model="item.refundUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
label-key="titleZh" value-key="id" :options="weightList"></custom-selectors-dictionary>
</div>
</div>
<el-button type="primary" @click="addToFn(2)" v-show="darkServantAndRebateForm.length -1 === index">添加</el-button>
......@@ -189,8 +189,8 @@
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="item">
<custom-selectors-dictionary v-model="mingServantAnddarkServant[0].refundUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
<custom-selectors-dictionary label-key="titleZh" value-key="id" v-model="mingServantAnddarkServant[0].refundUnit"
:options="weightList"></custom-selectors-dictionary>
</div>
</div>
</div>
......@@ -208,8 +208,8 @@
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="item">
<custom-selectors-dictionary v-model="mingServantAnddarkServant[0].darkAdjustUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
<custom-selectors-dictionary v-model="mingServantAnddarkServant[0].darkAdjustUnit" label-key="titleZh" value-key="id"
:options="weightList"></custom-selectors-dictionary>
</div>
</div>
</div>
......@@ -240,6 +240,7 @@ import customSelectorsDictionary from "./customSelectorsDictionary"
import {getTradeCityList} from "@/api/ecw/region";
import RoutersSelector from "@/components/RoutersSelector"
import CustomersSelector from "@/components/CustomersSelector";
import {getUnitList} from "@/api/ecw/unit";
export default {
name: "CustomerCommissionInfo",
......@@ -273,7 +274,7 @@ export default {
{
refund: 0,
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),
refundUnit: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value),
refundUnit:undefined,
}
],
//暗佣金+产品
......@@ -283,7 +284,7 @@ export default {
productAttr: undefined,//暗佣 产品属性
darkCommission: 0,//暗佣 佣金
darkCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣 货币
darkUnit:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value),// 暗佣 单位
darkUnit:undefined,// 暗佣 单位
}
],
//暗佣+达标返佣
......@@ -291,10 +292,10 @@ export default {
{
amount: 0,// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountUnit:parseInt (this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value),// 暗佣-满减金额对应单位,
amountUnit:undefined,// 暗佣-满减金额对应单位,
refund: 0,//暗佣-满之后返还金额
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundUnit:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value),//暗佣-满之后返还金额的单位
refundUnit:undefined,//暗佣-满之后返还金额的单位
}
],
//暗佣+明金
......@@ -302,10 +303,10 @@ export default {
{
refund: 0,// 暗佣+明佣 上调金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣+明佣 上调对应的货币
refundUnit: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value),//暗佣+明佣 上调对应的单位
refundUnit: undefined,//暗佣+明佣 上调对应的单位
darkAdjustCommission: 0,//暗佣+明佣 上调金额
darkAdjustCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣+明佣 上调对应的货币
darkAdjustUnit:parseInt( this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value),//暗佣+明佣 上调对应的单位
darkAdjustUnit:undefined,//暗佣+明佣 上调对应的单位
}
],
customerForm: {
......@@ -327,6 +328,8 @@ export default {
},
customerShow: true,
id:undefined,//佣金id
weightList:[]
};
},
computed:{
......@@ -338,6 +341,43 @@ export default {
},
},
created() {
//重量单位
getUnitList().then(r =>{
if(r.code === 0){
this.weightList = r.data
this.$set(this.mingServantFrom,0, {
refund: 0,
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),
refundUnit: parseInt(this.weightList[0].id),})
this.$set(this.darkServantAndProductForm, 0,
{
productType: undefined,//商品类型
productAttr: undefined,//暗佣 产品属性
darkCommission: 0,//暗佣 佣金
darkCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣 货币
darkUnit: parseInt(this.weightList[0].id),// 暗佣 单位
})
this.$set(this.darkServantAndRebateForm, 0,
{
amount: 0,// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountUnit:parseInt (this.weightList[0].id),// 暗佣-满减金额对应单位,
refund: 0,//暗佣-满之后返还金额
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundUnit:parseInt(this.weightList[0].id),//暗佣-满之后返还金额的单位
})
this.$set(this.mingServantAnddarkServant, 0,
{
refund: 0,// 暗佣+明佣 上调金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣+明佣 上调对应的货币
refundUnit: parseInt(this.weightList[0].id),//暗佣+明佣 上调对应的单位
darkAdjustCommission: 0,//暗佣+明佣 上调金额
darkAdjustCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣+明佣 上调对应的货币
darkAdjustUnit:parseInt(this.weightList[0].id),//暗佣+明佣 上调对应的单位
})
}
})
this.getCustomeList();
if(this.$route.params.dictId != 0){
commissionGetByCustomerId(this.$route.params.dictId).then(r => {
......@@ -437,9 +477,9 @@ export default {
this.darkServantAndRebateForm.push( {
amount: 0,// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountUnit: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value),// 暗佣-满减金额对应单位,
amountUnit: parseInt(this.weightList[0].id),// 暗佣-满减金额对应单位,
refund: 0,//暗佣-满之后返还金额
refundCurrency: parseInt (this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundUnit: this.darkServantAndRebateForm[0].refundUnit,//暗佣-满之后返还金额的单位
})
}
......@@ -516,36 +556,36 @@ export default {
deep:true,
},
'form.transportId':function (val){
if(!this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)) return
if(!this.weightList) return
if((val == 1 || val == 2)){
let index = this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT).findIndex(item => item.label == '立方米');
let index = this.weightList.findIndex(item => item.id == 7);
this.mingServantFrom.forEach(item =>{
item.refundUnit = parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[index].value);
item.refundUnit = parseInt(this.weightList[index].id);
})
this.mingServantAnddarkServant.forEach(item =>{
item.refundUnit =parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[index].value);
item.darkAdjustUnit =parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[index].value);
item.refundUnit =parseInt(this.weightList[index].id);
item.darkAdjustUnit =parseInt(this.weightList[index].id);
})
this.darkServantAndRebateForm.forEach(item =>{
item.refundUnit = parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[index].value);
item.refundUnit = parseInt(this.weightList[index].id);
})
this.darkServantAndProductForm.forEach(item =>{
item.darkUnit = parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[index].value);
item.darkUnit = parseInt(this.weightList[index].id);
})
}else {
let index = this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT).findIndex(item => item.label == '千克');
let index = this.weightList.findIndex(item => item.id == 6);
this.mingServantFrom.forEach(item =>{
item.refundUnit =parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[index].value);
item.refundUnit =parseInt(this.weightList[index].id);
})
this.mingServantAnddarkServant.forEach(item =>{
item.refundUnit = parseInt( this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[index].value);
item.darkAdjustUnit =parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[index].value);
item.refundUnit = parseInt( this.weightList[index].id);
item.darkAdjustUnit =parseInt(this.weightList[index].id);
})
this.darkServantAndRebateForm.forEach(item =>{
item.refundUnit =parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[index].value);
item.refundUnit =parseInt(this.weightList[index].id);
})
this.darkServantAndProductForm.forEach(item =>{
item.darkUnit = parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[index].value);
item.darkUnit = parseInt(this.weightList[index].id);
})
}
......
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