Commit 5742b429 authored by zhengke's avatar zhengke

修改

parent 830cf40e
......@@ -37,7 +37,7 @@
:key="index+'12'">
</el-option>
</el-select>
<el-input type="text" size="small" v-model="item.number" style="width:150px;margin-top:5px;">
<el-input type="text" size="small" v-model="item.Number" style="width:150px;margin-top:5px;">
<el-button slot="append">
<span v-if="addMsg.SeparateDistributionMoneyType == 2"></span>
<span v-if="addMsg.SeparateDistributionMoneyType == 1">%</span>
......@@ -46,7 +46,7 @@
<el-button size="small" type="primary" @click="setInfo(item,index)">设置</el-button>
</div>
<el-table :ref="'multipleTable'+index" :data="item.DistributioncommissionList" tooltip-effect="dark"
style="width: 100%;border:1px solid #E8EAEE" @selection-change="handleSelectionChange">
style="width: 100%;border:1px solid #E8EAEE" @selection-change="(selections)=>{handleSelectionChange(selections,index,item)}">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column width="100" label="等级名称">
......@@ -63,21 +63,21 @@
<el-input v-model="scope.row.OneCommission"
@keyup.native="checkPrice(scope.row,'OneCommission')" v-if="index == 0" size="small">
<el-button slot="append">
<span v-if="addMsg.SeparateDistributionMoneyType == 2"></span>
<span v-if="addMsg.SeparateDistributionMoneyType == 2">1</span>
<span v-if="addMsg.SeparateDistributionMoneyType == 1">%</span>
</el-button>
</el-input>
<el-input v-model="scope.row.TwoCommission"
@keyup.native="checkPrice(scope.row,'TwoCommission')" v-if="index == 1" size="small">
<el-button slot="append">
<span v-if="addMsg.SeparateDistributionMoneyType == 2"></span>
<span v-if="addMsg.SeparateDistributionMoneyType == 2">2</span>
<span v-if="addMsg.SeparateDistributionMoneyType == 1">%</span>
</el-button>
</el-input>
<el-input v-model="scope.row.ThreeCommission"
@keyup.native="checkPrice(scope.row,'ThreeCommission')" v-if="index==2" size="small">
<el-button slot="append">
<span v-if="addMsg.SeparateDistributionMoneyType == 2"></span>
<span v-if="addMsg.SeparateDistributionMoneyType == 2">3</span>
<span v-if="addMsg.SeparateDistributionMoneyType == 1">%</span>
</el-button>
</el-input>
......@@ -101,21 +101,21 @@
<el-tag type="danger">{{rootItem.People_Num}}人团</el-tag>
</div>
<label style="margin-bottom:0;padding:18px 10px;">批量设置</label>
<el-select placeholder="请选择层级" v-model="fxVal" style="width:130px;" size="small">
<el-select placeholder="请选择层级" v-model="rootItem.Leavel" style="width:130px;" size="small">
<el-option v-for="(item, index) in butorTier" :label="`${index + 1}级分销`" :value="index + 1"
:key="index+'12'">
</el-option>
</el-select>
<el-input type="text" size="small" style="width:150px;margin-top:5px;">
<el-input type="text" size="small" v-model="rootItem.Number" style="width:150px;margin-top:5px;">
<el-button slot="append">
<span v-if="addMsg.SeparateDistributionMoneyType == 2"></span>
<span v-if="addMsg.SeparateDistributionMoneyType == 1">%</span>
</el-button>
</el-input>
<el-button size="small" type="primary">设置</el-button>
<el-button size="small" type="primary" @click="setInfo(rootItem,rootIndex)">设置</el-button>
</div>
<el-table ref="multipleTable" :data="rootItem.DistributioncommissionList" tooltip-effect="dark"
style="width: 100%;border:1px solid #E8EAEE">
style="width: 100%;border:1px solid #E8EAEE" @selection-change="(selections)=>{handleSelectionChange(selections,rootIndex,rootItem)}">
<el-table-column type="selection" width="55">
</el-table-column>
<template v-for="(specItem, specIndex) in SpecList">
......@@ -189,6 +189,7 @@
//多选数组
selectList: [],
CommonIndex:-1, //选中index
};
},
watch: {
......@@ -206,7 +207,8 @@
People_Num: item.People_Num,
DistributioncommissionList: item.DistributioncommissionList,
Leavel: '', //层级
Number: '' //设置->金额/百分比
Number: 0, //设置->金额/百分比
selectList:[], //选中数组
};
this.DistributioncommissionList.push(obj);
})
......@@ -218,7 +220,8 @@
People_Num: item.People_Num,
DistributioncommissionList: item.DistributionCommissionTreeList,
Leavel: '', //层级
Number: '' //设置->金额/百分比
Number: 0, //设置->金额/百分比
selectList:[], //选中数组
};
this.DistributioncommissionList.push(obj);
console.log(this.DistributioncommissionList, 'this.DistributioncommissionList');
......@@ -263,6 +266,9 @@
var obj = {
People_Num: item.People_Num,
DistributioncommissionList: [],
Leavel: '', //层级
Number: 0, //设置->金额/百分比
selectList:[], //选中数组
}
item.StepPriceList.forEach(subItem => {
var tempObj = JSON.parse(JSON.stringify(subItem));
......@@ -288,8 +294,12 @@
})
}
},
handleSelectionChange(val) {
handleSelectionChange(val,index,item) {
console.log(val,'val');
console.log(index,'index');
console.log(item,'item');
this.selectList = val;
item.selectList=val;
},
//获取分销层级
getDistributor() {
......@@ -338,54 +348,62 @@
});
},
//普通设置=>批量设置
// setInfo(item) {
// //普通
// if (this.addMsg.SeparateDistributionType == 1) {
// if (!this.selectList || this.selectList.length === 0) {
// this.Error('请勾选分销商等级');
// return;
// }
// if (this.selectData === '') {
// this.Error('请选择分销层级');
// return;
// }
// this.ruleForm.shareLevelList.forEach((item, index) => {
// let sign = false;
// this.selectList.map((item1) => {
// if (JSON.stringify(item1) === JSON.stringify(item)) {
// sign = true;
// }
// });
// if (sign) {
// item[this.selectData] = this.batchShareLevel
// }
// })
// } else {
// if (!this.selectList || this.selectList.length === 0) {
// this.$message.warning('请勾选商品规格');
// return;
// }
// if (this.selectLevel === '') {
// this.$message.warning('请选择分销商等级');
// return;
// }
// if (this.selectData === '') {
// this.$message.warning('请选择分销层级');
// return;
// }
// this.ruleForm.attr.forEach((item, index) => {
// let sign = false;
// this.selectList.map((item1) => {
// if (JSON.stringify(item1.attr_list) === JSON.stringify(item.attr_list)) {
// sign = true;
// }
// });
// if (sign) {
// item.shareLevelList[this.selectLevel][this.selectData] = this.batchShareLevel
// }
// })
// }
// }
setInfo(item) {
//普通
if (this.addMsg.SeparateDistributionType == 1) {
if (!item.selectList || item.selectList.length === 0) {
this.Error('请勾选分销商等级');
return;
}
if (item.Leavel === '') {
this.Error('请选择分销层级');
return;
}
item.DistributioncommissionList.forEach(x=>{
item.selectList.forEach(y=>{
if(x.DistributorGrade==y.DistributorGrade){
if(item.Leavel==1){
x.OneCommission=item.Number
}
if(item.Leavel==2){
x.TwoCommission=item.Number
}
if(item.Leavel==3){
x.ThreeCommission=item.Number
}
}
})
})
} else {
if (!item.selectList || item.selectList.length === 0) {
this.Error('请勾选商品规格');
return;
}
if (item.Leavel === '') {
this.Error('请选择分销商等级');
return;
}
item.DistributioncommissionList.forEach(x => {
x.GradeCommissionList.forEach((y, index) => {
item.selectList.forEach(z => {
if (x.Id == z.Id) {
if (index == item.Leavel) {
if (item.Leavel == 1) {
y.OneCommission = item.Number;
}
if (item.Leavel == 2) {
y.TwoCommission = item.Number;
}
if (item.Leavel == 3) {
y.ThreeCommission = item.Number;
}
}
}
});
});
});
}
}
},
mounted() {
this.getDistributor();
......
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