Commit f24a462a authored by 黄奎's avatar 黄奎

页面修改

parent 84f8d798
......@@ -55,8 +55,7 @@
<div flex="dir:left">
<div v-for="(item,index) in addMsg.CarouselImageList" :key="index"
style="margin-right: 20px; position: relative; ">
<div class="colapp-image"
:style="{backgroundImage:'url('+ item.Path + ')'}"></div>
<div class="colapp-image" :style="{backgroundImage:'url('+ item.Path + ')'}"></div>
<el-button @click="ClearCarouse(index)" class="delBtn" type="danger" icon="el-icon-close"
circle></el-button>
</div>
......@@ -96,8 +95,7 @@
<el-button @click="clearCustom" style="position: absolute;right: 6px;top: -10px;"
v-if="addMsg.CustomShareImage && addMsg.CustomShareImage!=''" size="mini" type="danger"
icon="el-icon-close" circle></el-button>
<img style="width:80px;height:80px" :src="addMsg.CustomShareImage"
alt="">
<img style="width:80px;height:80px" :src="addMsg.CustomShareImage" alt="">
</div>
<p style="margin-top:-15px" class="blue f12">
<span class="point" @click="imgDig=true">查看图例</span>
......@@ -147,11 +145,12 @@
</el-input>
</el-form-item>
<el-form-item label="成本价">
<el-input @change="getSuggestPrice" v-model="addMsg.CostPrice" type="number" min="1" size="small" placeholder="请输入内容"
class="input-with-select">
<el-input @change="getSuggestPrice" v-model="addMsg.CostPrice" type="number" min="1" size="small"
placeholder="请输入内容" class="input-with-select">
<el-button slot="append"></el-button>
</el-input>
<span v-if="SuggestPriceInfo.Status && SuggestPriceInfo.Status==1" class="cred" style="position: absolute;width: 400px;margin-left: 15px;">
<span v-if="SuggestPriceInfo.Status && SuggestPriceInfo.Status==1" class="cred"
style="position: absolute;width: 400px;margin-left: 15px;">
建议零售价:¥{{SuggestPriceInfo.MPrice}}
</span>
</el-form-item>
......@@ -205,13 +204,15 @@
<div flex="dir:left" style="padding: 0px 10px;margin-top: 16px;">
<div class="box-grow-0">规格值:</div>
<div flex="dir:left" style="flex-wrap: wrap;">
<div v-for="(item2,index2) in item.SpecificationValueList" :key="index2" class="attr-list">
<div v-for="(item2,index2) in item.SpecificationValueList" :key="index2"
class="attr-list">
<el-input @input="ggzChange" size="mini" v-model="item2.Name" width="152px"></el-input>
<i @click="Deleteggz(item,index,index2)" class="el-icon-error close"></i>
<div v-if="index==0 && item.EnabledImage==1" flex="cross:center main:center"
class="img-box">
<div class="attr-jt"></div>
<div v-if="item2.Image==''" @click="openggImg(item,index,item2,index2)" class="app-attachment">
<div v-if="item2.Image==''" @click="openggImg(item,index,item2,index2)"
class="app-attachment">
<div style="line-height: normal; display: inline-block;">
<span>+添加图片</span>
</div>
......@@ -219,10 +220,12 @@
<div v-if="item2.Image!=''" class="el-image" style="height: 88px; width: 88px;">
<img :src="item2.Image" style="width:100%;height:100%">
</div>
<span v-if="item2.Image!=''" @click="DeleteImageUrl(item,index,item2,index2)" class="el-icon-error close"></span>
<span v-if="item2.Image!=''" @click="DeleteImageUrl(item,index,item2,index2)"
class="el-icon-error close"></span>
<div v-if="item2.Image!=''" style="position: absolute;">
<div class="app-attachment">
<el-button @click="openggImg(item,index,item2,index2)" type="primary" size="small">替换</el-button>
<el-button @click="openggImg(item,index,item2,index2)" type="primary"
size="small">替换</el-button>
</div>
</div>
</div>
......@@ -270,7 +273,6 @@
</template>
</el-table-column>
</template>
<el-table-column :render-header="renderHeader" label="价格">
<template slot-scope="scope">
<el-input v-model="scope.row.SellingPrice" size="small"></el-input>
......@@ -407,8 +409,6 @@
</div>
</div>
</el-form-item>
</el-col>
</el-row>
</el-card>
......@@ -538,7 +538,6 @@
</el-button>
</el-input>
</span>
</template>
</el-table-column>
</template>
......@@ -569,7 +568,6 @@
</div>
<el-table ref="table" :data="disList2" border style="width: 100%"
@selection-change="TbaleSelectionChange3">
<template v-for="(item,index) in SpecificationList">
<el-table-column :key="index" :label="item.Name" width="100">
<template slot-scope="scope">
......@@ -603,12 +601,10 @@
</template>
<el-table-column type="selection" :fixed="true" width="55">
</el-table-column>
</el-table>
</div>
</el-form-item>
</template>
</el-tab-pane>
<el-tab-pane label="会员价设置" name="third">
<el-form-item label="是否享受会员功能">
......@@ -625,7 +621,8 @@
</el-form-item>
<el-form-item v-if="addMsg.SeparateSetMember==1 && SpecificationPriceList.length==0" label="默认规格会员价设置">
<div v-for="(item,index) in memberList1[0].GradePriceList" :key="index">
<el-input style="width:700px" placeholder="请输入内容" v-model="item.MemberPrice" size="small" class="input-with-select">
<el-input style="width:700px" placeholder="请输入内容" v-model="item.MemberPrice" size="small"
class="input-with-select">
<el-button slot="prepend">{{item.Name}}</el-button>
<el-button slot="append"></el-button>
</el-input>
......@@ -639,8 +636,8 @@
<el-input style="width:500px;position:relative;top:5px" size="small" v-model="memberinput"
placeholder="请输入内容">
<el-select slot="prepend" style="width:130px" v-model="memberVal" size="small">
<el-option v-for="(item,index) in huiyList" :label="item.Name" :value="item.Grade"
:key="index"></el-option>
<el-option v-for="(item,index) in huiyList" :label="item.Name" :value="item.Grade" :key="index">
</el-option>
</el-select>
<el-button @click="HySet" slot="append">确定</el-button>
</el-input>
......@@ -669,7 +666,6 @@
</el-table>
</div>
</el-form-item>
</el-tab-pane>
</el-tabs>
</el-form>
......@@ -711,7 +707,6 @@
</div>
</div>
</el-checkbox-group>
</div>
</el-col>
<el-col v-show="childList3.length>0" :span="8" style="padding:0 10px;box-sizing:border-box">
......@@ -728,7 +723,6 @@
</div>
</div>
</el-checkbox-group>
</div>
</el-col>
</el-row>
......@@ -793,7 +787,6 @@
<el-radio-group v-model="val1">
<el-radio @change="YfSelect1" style="padding-bottom:10px" class="yfradio" :label="{Name:'默认运费',Id:0}">默认表单
</el-radio>
<!-- <el-radio @change="YfSelect" style="padding-bottom:10px" class="yfradio" v-for="(item,index) in ruleList" :key="index" :label="item">{{item.RulesName}}</el-radio> -->
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
......@@ -816,7 +809,6 @@
<div class="tpl-scrollbar el-scrollbar">
<el-checkbox @change="speciDigActive=index,changeCheckAll(item,index)" v-for="(item,index) in speciList"
v-model="item.checkAll" :key="index">{{item.Name}}</el-checkbox>
</div>
</div>
<div class="tpl-box" style="margin-left:10px">
......@@ -860,7 +852,6 @@
SpecificationValueList: [],
speciDig: false,
speciList: [],
val2: '',
defaultMsg: '',
config: {
......@@ -923,9 +914,8 @@
EnjoyMember: 1,
SeparateSetMember: 2,
IsQuickBuy: 1,
FullNumPinkage:0,
FullMoneyPinkage:0,
FullNumPinkage: 0,
FullMoneyPinkage: 0,
},
fenleiData: [],
checkList: [],
......@@ -969,7 +959,6 @@
checkService: [],
keepServiceList: [],
keepFreightId: -1,
ruleList: [],
val: {},
val1: {},
......@@ -998,27 +987,21 @@
gradeVal: '',
xxVal: '',
xxList: [],
huiyList:[],
memberList1:[
{
Id:0,
SpecificationSort:'',
GradePriceList:[],
}
],
memberList2:[],
memberinput:'',
memberVal:'',
memberCheck:[],
imgListIndex1:0,
imgListIndex2:0,
NewCategoryList:[],
hpState:0,
SuggestPriceInfo:{},
huiyList: [],
memberList1: [{
Id: 0,
SpecificationSort: '',
GradePriceList: [],
}],
memberList2: [],
memberinput: '',
memberVal: '',
memberCheck: [],
imgListIndex1: 0,
imgListIndex2: 0,
NewCategoryList: [],
hpState: 0,
SuggestPriceInfo: {},
};
},
created() {
......@@ -1038,49 +1021,47 @@
this.getSpeciList();
this.getDistributor();
this.gethuiyList();
},
methods: {
//
HySet(){
this.memberList2.forEach(item=>{
this.memberCheck.forEach(check=>{
if(item.Id==check.Id){
item.GradePriceList.forEach(list1=>{
if(list1.MemberGrade==this.memberVal){
list1.MemberPrice=this.memberinput;
HySet() {
this.memberList2.forEach(item => {
this.memberCheck.forEach(check => {
if (item.Id == check.Id) {
item.GradePriceList.forEach(list1 => {
if (list1.MemberGrade == this.memberVal) {
list1.MemberPrice = this.memberinput;
}
})
}
})
})
},
TbaleSelectionChange4(val){
this.memberCheck=val;
TbaleSelectionChange4(val) {
this.memberCheck = val;
},
gethuiyList(){
let msg={
pageIndex:1,
pageSize:999,
Grade:0,
Name:'',
Enabled:1,
gethuiyList() {
let msg = {
pageIndex: 1,
pageSize: 999,
Grade: 0,
Name: '',
Enabled: 1,
};
this.apipost("/api/user/GetMemberGradePageList",msg, res => {
this.loading=false;
if(res.data.resultCode==1){
let pageData=res.data.data.pageData;
this.huiyList=pageData;
this.huiyList.forEach(item=>{
let obj={
Name:item.Name,
MemberGrade:item.Grade,
MemberPrice:0,
this.apipost("/api/user/GetMemberGradePageList", msg, res => {
this.loading = false;
if (res.data.resultCode == 1) {
let pageData = res.data.data.pageData;
this.huiyList = pageData;
this.huiyList.forEach(item => {
let obj = {
Name: item.Name,
MemberGrade: item.Grade,
MemberPrice: 0,
}
this.memberList1[0].GradePriceList.push(obj);
})
}
})
},
TbaleSelectionChange3(val) {
......@@ -1095,27 +1076,25 @@
this.Error("请选择层级!");
return;
}
this.disList2.forEach(item=>{
item.GradeCommissionList.forEach(grade=>{
this.xxList.forEach(list=>{
if(item.Id==list.Id){
this.disList2.forEach(item => {
item.GradeCommissionList.forEach(grade => {
this.xxList.forEach(list => {
if (item.Id == list.Id) {
if(grade.DistributorGrade==this.gradeVal){
if(this.fxVal==1){
grade.OneCommission=this.xxVal;
if (grade.DistributorGrade == this.gradeVal) {
if (this.fxVal == 1) {
grade.OneCommission = this.xxVal;
}
if(this.fxVal==2){
grade.TwoCommission=this.xxVal;
if (this.fxVal == 2) {
grade.TwoCommission = this.xxVal;
}
if(this.fxVal==3){
grade.ThreeCommission=this.xxVal;
if (this.fxVal == 3) {
grade.ThreeCommission = this.xxVal;
}
}
}
})
})
})
},
PuSet() {
......@@ -1161,7 +1140,6 @@
}
})
})
},
TbaleSelectionChange(val) {
this.ggplList = val;
......@@ -1181,21 +1159,17 @@
);
},
CheckBox(val) {
},
butionType(val) {
// this.skuList = [];
// this.getSkuData([], 0, this.SpecificationList);
},
// 删除规格模板
DeleteggModule(item, index) {
this.SpecificationList.splice(index, 1);
if(this.SpecificationList.length==0){
this.addMsg.SeparateDistributionType=1;
if (this.SpecificationList.length == 0) {
this.addMsg.SeparateDistributionType = 1;
}
this.$forceUpdate();
this.skuList = [];
this.getSkuData([], 0, this.SpecificationList);
},
// 删除规格值
......@@ -1205,7 +1179,6 @@
if (this.SpecificationList[index].SpecificationValueList.length == 0) {
this.SpecificationList.splice(index, 1)
}
this.skuList = [];
this.getSkuData([], 0, this.SpecificationList);
},
......@@ -1230,7 +1203,6 @@
Sort: that.SpecificationList.length
}
this.SpecificationList.push(obj);
},
// 添加规格值
addGgz(item, index) {
......@@ -1272,7 +1244,7 @@
this.speciDig = false;
},
getSkuData(skuArr = [], i, list) {
if(list[i]){
if (list[i]) {
for (let j = 0; j < list[i].SpecificationValueList.length; j++) {
skuArr[i] = {};
if (i < list.length - 1) {
......@@ -1289,7 +1261,6 @@
}
}
this.calcList(this.skuList, this.SpecificationList);
},
calcList(list, calist) {
this.SpecificationPriceList = [];
......@@ -1332,15 +1303,13 @@
};
this.SpecificationPriceList.push(obj)
arrList.push(obj1)
})
this.calcdis(JSON.parse(JSON.stringify(arrList)));
},
calcdis(dislist) {
let memberList2=JSON.parse(JSON.stringify(dislist))
let memberList2 = JSON.parse(JSON.stringify(dislist))
dislist.forEach(item => {
item.GradeCommissionList=[];
item.GradeCommissionList = [];
for (let i = 0; i < this.DropdownList.length; i++) {
let obj = {
DistributorGrade: this.DropdownList[i].Id,
......@@ -1353,11 +1322,11 @@
}
})
memberList2.forEach(item => {
item.GradePriceList=[];
item.GradePriceList = [];
for (let i = 0; i < this.huiyList.length; i++) {
let obj = {
MemberGrade: this.huiyList[i].Grade,
MemberPrice:'',
MemberPrice: '',
}
item.GradePriceList.push(obj);
}
......@@ -1393,11 +1362,11 @@
} else {
this.addMsg.DistributionCommissionList = this.disList2;
}
if(this.addMsg.SeparateSetMember==1 && this.SpecificationList.length==0){
this.addMsg.MemberPriceList=this.memberList1;
if (this.addMsg.SeparateSetMember == 1 && this.SpecificationList.length == 0) {
this.addMsg.MemberPriceList = this.memberList1;
}
if(this.addMsg.SeparateSetMember==1 && this.SpecificationList.length>0){
this.addMsg.MemberPriceList=this.memberList2;
if (this.addMsg.SeparateSetMember == 1 && this.SpecificationList.length > 0) {
this.addMsg.MemberPriceList = this.memberList2;
}
this.addMsg.SpecificationPriceList = this.SpecificationPriceList;
this.addMsg.SpecificationList = this.SpecificationList;
......@@ -1408,7 +1377,6 @@
} else {
this.Error(res.data.message)
}
})
} else {
return false;
......@@ -1476,7 +1444,6 @@
YfSelect(val) {
this.addMsg.FreightId = val.ID;
this.addMsg.FreightName = val.RulesName;
},
ServiceCheck(item, index) {
this.addMsg.ServiceList.forEach((list, k) => {
......@@ -1496,16 +1463,14 @@
ClearCarouse(index) {
this.addMsg.CarouselImageList.splice(index, 1);
},
DeleteImageUrl(item,index,item2,index2){
this.SpecificationList[index].SpecificationValueList[index2].Image='';
DeleteImageUrl(item, index, item2, index2) {
this.SpecificationList[index].SpecificationValueList[index2].Image = '';
},
openggImg(item,index,item2,index2){
openggImg(item, index, item2, index2) {
this.changeState = true;
this.imgType = 3;
this.imgListIndex1=index;
this.imgListIndex2=index2;
this.imgListIndex1 = index;
this.imgListIndex2 = index2;
},
openChangeDig(val) {
this.changeState = true;
......@@ -1515,20 +1480,18 @@
if (this.imgType == 1) {
let obj = {
Id: msg.selectId,
Path: this.domainManager().ImageUrl+msg.url,
Path: this.domainManager().ImageUrl + msg.url,
}
this.addMsg.CarouselImageList.push(obj);
}
if (this.imgType == 2) {
// this.addMsg.CustomShareImage = msg.selectId;
this.addMsg.CustomShareImage = this.domainManager().ImageUrl+msg.url;
// this.addMsg.CustomShareImagePath = this.domainManager().ImageUrl+msg.url;
this.addMsg.CustomShareImage = this.domainManager().ImageUrl + msg.url;
}
if (this.imgType == 3) {
let imgListIndex1=this.imgListIndex1;
let imgListIndex2=this.imgListIndex2;
this.SpecificationList[imgListIndex1].SpecificationValueList[imgListIndex2].Image=this.domainManager().ImageUrl+msg.url;
let imgListIndex1 = this.imgListIndex1;
let imgListIndex2 = this.imgListIndex2;
this.SpecificationList[imgListIndex1].SpecificationValueList[imgListIndex2].Image = this.domainManager()
.ImageUrl + msg.url;
}
this.changeState = false;
},
......@@ -1539,38 +1502,35 @@
getChild2(ChildList) {
this.childList2 = ChildList;
},
ExitCateList(){
this.NewCategoryList=[];
this.addMsg.CategoryList.forEach(item=>{
item.Name=item.CategoryName;
ExitCateList() {
this.NewCategoryList = [];
this.addMsg.CategoryList.forEach(item => {
item.Name = item.CategoryName;
this.NewCategoryList.push(item.CategoryId)
})
},
handleCheckChange() {
this.addMsg.CategoryList=[];
this.NewCategoryList.forEach(list=>{
this.addMsg.CategoryList = [];
this.NewCategoryList.forEach(list => {
this.fenleiData.forEach(item => {
if(list==item.Id){
item.CategoryId=item.Id;
if (list == item.Id) {
item.CategoryId = item.Id;
this.addMsg.CategoryList.push(item)
}
item.ChildList.forEach(item2=>{
if(list==item2.Id){
item2.CategoryId=item2.Id;
item.ChildList.forEach(item2 => {
if (list == item2.Id) {
item2.CategoryId = item2.Id;
this.addMsg.CategoryList.push(item2)
}
item2.ChildList.forEach(item3=>{
if(list==item3.Id){
item3.CategoryId=item3.Id;
item2.ChildList.forEach(item3 => {
if (list == item3.Id) {
item3.CategoryId = item3.Id;
this.addMsg.CategoryList.push(item3)
}
})
})
})
})
console.log("this.addMsg.CategoryList",this.addMsg.CategoryList)
},
exitCheck(item, index) {
this.addMsg.CategoryList.forEach((list, k) => {
......@@ -1596,15 +1556,14 @@
this.fenleiData = pageData;
this.fenleiData.forEach(item => {
item.CategoryName = item.Name;
item.ChildList.forEach(item2=>{
item.ChildList.forEach(item2 => {
item2.CategoryName = item2.Name;
item2.ChildList.forEach(item3=>{
item2.ChildList.forEach(item3 => {
item3.CategoryName = item3.Name;
})
})
})
}
})
},
getData() {
......@@ -1612,12 +1571,11 @@
GoodsId: this.GoodsId
}, res => {
this.addMsg = res.data.data;
console.log("this.addMsg",this.addMsg)
this.SpecificationPriceList = this.addMsg.SpecificationPriceList;
this.SpecificationList = this.addMsg.SpecificationList;
if (this.addMsg.SeparateDistributionType == 1) {
this.disList1 = this.addMsg.DistributionCommissionTreeList;
if(this.addMsg.DistributionCommissionTreeList.length>0){
if (this.addMsg.DistributionCommissionTreeList.length > 0) {
this.GradeCommissionList = this.addMsg.DistributionCommissionTreeList[0].GradeCommissionList
}
}
......@@ -1630,38 +1588,35 @@
GradeCommissionList: this.GradeCommissionList
};
this.disList1.push(objNew);
if(this.addMsg.GoodsDetails && this.addMsg.GoodsDetails!=''){
if (this.addMsg.GoodsDetails && this.addMsg.GoodsDetails != '') {
this.$refs.ue.SetVal(this.addMsg.GoodsDetails);
}
this.NewCategoryList=[];
this.addMsg.CategoryList.forEach(item=>{
item.Name=item.CategoryName;
this.NewCategoryList = [];
this.addMsg.CategoryList.forEach(item => {
item.Name = item.CategoryName;
this.NewCategoryList.push(item.CategoryId)
})
this.getSuggestPrice()
})
},
getSuggestPrice(){
if(this.hpState==1 && Number(this.addMsg.CostPrice)>0){
let arr=[];
this.addMsg.CategoryList.forEach(item=>{
item.Name=item.CategoryName;
getSuggestPrice() {
if (this.hpState == 1 && Number(this.addMsg.CostPrice) > 0) {
let arr = [];
this.addMsg.CategoryList.forEach(item => {
item.Name = item.CategoryName;
arr.push(item.CategoryId)
})
let CategoryIds=arr.join(',');
let msg={
CategoryIds:CategoryIds,
CostPrice:this.addMsg.CostPrice
let CategoryIds = arr.join(',');
let msg = {
CategoryIds: CategoryIds,
CostPrice: this.addMsg.CostPrice
}
this.apipost("/api/user/GetHpGoodsSuggestPrice", msg, res => {
if (res.data.resultCode == 1) {
this.SuggestPriceInfo = res.data.data;
console.log("this.SuggestPriceInfo",this.SuggestPriceInfo)
}
})
}
},
getRule() {
let msg1 = {
......@@ -1674,7 +1629,6 @@
let pageData = res.data.data.pageData;
this.ruleList = pageData;
}
})
},
getService() {
......@@ -1690,7 +1644,6 @@
let pageData = res.data.data.pageData;
this.serviceList = pageData;
}
})
},
getDistributor() {
......@@ -1708,7 +1661,6 @@
}
this.GetDropdownList();
}
})
},
GetDropdownList() {
......@@ -1728,7 +1680,6 @@
Id: 0
}
this.DropdownList.unshift(msg)
this.disList1.GradeCommissionList = [];
this.disList1.SpecificationSort = "";
this.DropdownList.forEach(item => {
......@@ -1745,7 +1696,7 @@
}
})
this.DropdownList = JSON.parse(JSON.stringify(this.DropdownList));
if (!this.$route.query.GoodsId || this.addMsg.DistributionCommissionTreeList.length==0) {
if (!this.$route.query.GoodsId || this.addMsg.DistributionCommissionTreeList.length == 0) {
this.GradeCommissionList = [];
this.DropdownList.forEach(item => {
let obj2 = {
......@@ -1769,7 +1720,6 @@
},
},
};
</script>
<style>
.app-attr-group .close {
......@@ -1779,11 +1729,13 @@
font-size: 16px;
cursor: pointer;
}
.goodsListEdit .el-image {
position: relative;
display: inline-block;
overflow: hidden;
}
.goodsListEdit .pendSelect {
width: 100px;
}
......@@ -1906,7 +1858,7 @@
position: absolute;
right: -8px;
top: -8px;
padding: 4px 4px!important;
padding: 4px 4px !important;
}
.goodsListEdit .add-image-btn {
......
......@@ -695,17 +695,6 @@
this.Info(res.data.message);
}
})
},
//修改版权
TestMall() {
this.apipost("/api/Mall/GetHome",{MiniAppId:"wxacd9f8cc3480d29e"}, res => {
console.log("res",res);
if (res.data.resultCode == 1) {
} else {
this.Info(res.data.message);
}
})
},
//跳转至首页
goHomePage(){
......@@ -718,7 +707,6 @@
}
},
mounted() {
this.TestMall();
this.init();
this.getMiniPrograme();
this.getRemoveMiniPrograme();
......
......@@ -5,7 +5,6 @@
</div>
<div class="content">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px" style="width:60%">
<el-form-item label="分销名称" prop="Name">
<el-input v-model="addMsg.Name" size="small"></el-input>
</el-form-item>
......@@ -19,30 +18,22 @@
</el-form-item>
<el-form-item label="等级">
<el-button @click="gradeDig=true" size="small" type="primary" style="margin-bottom:10px">选择等级</el-button>
<el-table
:data="addMsg.RatioList"
border
style="width: 100%">
<el-table-column
prop="GradeName"
label="名称">
<el-table :data="addMsg.RatioList" border style="width: 100%">
<el-table-column prop="GradeName" label="名称">
</el-table-column>
<el-table-column
prop="address"
label="比例">
<el-table-column prop="address" label="比例">
<template slot-scope="scope">
<el-input @input="inputVal(scope.row)" type="number" min="1" v-model="scope.row.CommissionRatio" size="small" placeholder="请输入">
<el-input @input="inputVal(scope.row)" type="number" min="1" v-model="scope.row.CommissionRatio"
size="small" placeholder="请输入">
<el-button slot="append">%</el-button>
</el-input>
</template>
</el-table-column>
<el-table-column
width="80px"
prop="address"
label="操作">
<el-table-column width="80px" prop="address" label="操作">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<img @click="Delete(scope.row,scope.$index)" style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/del.png" alt="">
<img @click="Delete(scope.row,scope.$index)" style="width:32px;height:32px;margin:0 10px"
src="../../assets/img/userman/del.png" alt="">
</el-tooltip>
</template>
</el-table-column>
......@@ -55,8 +46,8 @@
{{item.CategoryName}}
</el-tag>
</template>
<el-button type="primary" @click="flDig=true,keepCategoryList=addMsg.CategoryList"
style="margin:0 10px;" size="small">选择分类</el-button>
<el-button type="primary" @click="flDig=true,keepCategoryList=addMsg.CategoryList" style="margin:0 10px;"
size="small">选择分类</el-button>
</el-form-item>
</el-form>
</div>
......@@ -96,7 +87,6 @@
</div>
</div>
</el-checkbox-group>
</div>
</el-col>
<el-col v-show="childList3.length>0" :span="8" style="padding:0 10px;box-sizing:border-box">
......@@ -113,7 +103,6 @@
</div>
</div>
</el-checkbox-group>
</div>
</el-col>
</el-row>
......@@ -128,14 +117,16 @@
</el-dialog>
<!-- 选择等级 -->
<el-dialog title="选择等级" :visible.sync="gradeDig" width="510px">
<div style="box-sizing: border-box;background-color: #F3F5F6;width: 100%;padding-left: 20px;height: 50px;line-height: 50px;">
<div
style="box-sizing: border-box;background-color: #F3F5F6;width: 100%;padding-left: 20px;height: 50px;line-height: 50px;">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
</el-checkbox>
</div>
<div style="margin: 15px 0;"></div>
<div style="padding: 10px 25px 20px;">
<el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
<el-checkbox style="margin-bottom:10px;width:110px" v-for="city in cities" :label="city.Id" :key="city.GradeName">
<el-checkbox style="margin-bottom:10px;width:110px" v-for="city in cities" :label="city.Id"
:key="city.GradeName">
{{city.GradeName}}</el-checkbox>
</el-checkbox-group>
</div>
......@@ -155,15 +146,15 @@
cities: [],
cityOptions: [],
isIndeterminate: true,
gradeDig:false,
flDig:false,
gradeDig: false,
flDig: false,
addMsg: {
Id: 0,
DecimalType: 2,
Name: '',
Enabled:2,
RatioList:[],
CategoryList:[],
Enabled: 2,
RatioList: [],
CategoryList: [],
},
rules: {
Name: [{
......@@ -171,23 +162,27 @@
message: '请输入分销名称',
trigger: 'blur'
}],
DecimalType: [
{ required: true, message: '请选择类型', trigger: 'change' }
],
Enabled: [
{ required: true, message: '请选择是否启用', trigger: 'change' }
],
DecimalType: [{
required: true,
message: '请选择类型',
trigger: 'change'
}],
Enabled: [{
required: true,
message: '请选择是否启用',
trigger: 'change'
}],
},
GradeId: '',
loading: false,
gradeList: [],
fenleiData:[],
fenleiData: [],
checkList: [],
childList2: [],
childList3: [],
keepCategoryList: [],
HpGradeList:[],
NewCategoryList:[],
HpGradeList: [],
NewCategoryList: [],
};
},
created() {
......@@ -196,51 +191,50 @@
this.getHpDistributorGrade();
},
methods: {
inputVal(row){
if(Number(row.CommissionRatio)<0){
row.CommissionRatio=1;
inputVal(row) {
if (Number(row.CommissionRatio) < 0) {
row.CommissionRatio = 1;
}
if(Number(row.CommissionRatio)>100){
row.CommissionRatio=100;
if (Number(row.CommissionRatio) > 100) {
row.CommissionRatio = 100;
}
},
Delete(item,index){
Delete(item, index) {
this.addMsg.RatioList.splice(index, 1);
this.checkedCities.forEach((list,k)=>{
if(list==item.GradeId){
this.checkedCities.forEach((list, k) => {
if (list == item.GradeId) {
this.checkedCities.splice(k, 1);
}
})
},
chooseGrade(){
let arr=[];
this.addMsg.RatioList=[];
this.cities.forEach(item=>{
this.checkedCities.forEach(list=>{
if(item.Id==list){
let Obj={
Grade:item.Grade,
GradeId:item.Id,
CommissionRatio:'',
GradeName:item.GradeName,
chooseGrade() {
let arr = [];
this.addMsg.RatioList = [];
this.cities.forEach(item => {
this.checkedCities.forEach(list => {
if (item.Id == list) {
let Obj = {
Grade: item.Grade,
GradeId: item.Id,
CommissionRatio: '',
GradeName: item.GradeName,
}
arr.push(Obj);
}
})
})
let list=arr.sort(this.compareGrade("Grade",true));
this.addMsg.RatioList=list;
this.gradeDig=false;
let list = arr.sort(this.compareGrade("Grade", true));
this.addMsg.RatioList = list;
this.gradeDig = false;
},
compareGrade(property,desc) {
compareGrade(property, desc) {
return function (a, b) {
var value1 = a[property];
var value2 = b[property];
if(desc==true){
if (desc == true) {
// 升序排列
return value1 - value2;
}else{
} else {
// 降序排列
return value2 - value1;
}
......@@ -259,7 +253,7 @@
Save(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.addMsg.RatioList.length==0){
if (this.addMsg.RatioList.length == 0) {
this.Error("请选择返佣等级!");
return;
}
......@@ -275,38 +269,35 @@
}
});
},
ExitCateList(){
this.NewCategoryList=[];
this.addMsg.CategoryList.forEach(item=>{
item.Name=item.CategoryName;
ExitCateList() {
this.NewCategoryList = [];
this.addMsg.CategoryList.forEach(item => {
item.Name = item.CategoryName;
this.NewCategoryList.push(item.CategoryId)
})
},
handleCheckChange() {
this.addMsg.CategoryList=[];
this.NewCategoryList.forEach(list=>{
this.addMsg.CategoryList = [];
this.NewCategoryList.forEach(list => {
this.fenleiData.forEach(item => {
if(list==item.Id){
item.CategoryId=item.Id;
if (list == item.Id) {
item.CategoryId = item.Id;
this.addMsg.CategoryList.push(item)
}
item.ChildList.forEach(item2=>{
if(list==item2.Id){
item2.CategoryId=item2.Id;
item.ChildList.forEach(item2 => {
if (list == item2.Id) {
item2.CategoryId = item2.Id;
this.addMsg.CategoryList.push(item2)
}
item2.ChildList.forEach(item3=>{
if(list==item3.Id){
item3.CategoryId=item3.Id;
item2.ChildList.forEach(item3 => {
if (list == item3.Id) {
item3.CategoryId = item3.Id;
this.addMsg.CategoryList.push(item3)
}
})
})
})
})
console.log("this.addMsg.CategoryList",this.addMsg.CategoryList)
},
exitCheck(item, index) {
this.addMsg.CategoryList.forEach((list, k) => {
......@@ -337,15 +328,14 @@
this.fenleiData = pageData;
this.fenleiData.forEach(item => {
item.CategoryName = item.Name;
item.ChildList.forEach(item2=>{
item.ChildList.forEach(item2 => {
item2.CategoryName = item2.Name;
item2.ChildList.forEach(item3=>{
item2.ChildList.forEach(item3 => {
item3.CategoryName = item3.Name;
})
})
})
}
})
},
getHpDistributorGrade() {
......@@ -360,8 +350,6 @@
this.GradeId = this.$route.query.UserId;
this.getData()
}
})
},
getData() {
......@@ -371,33 +359,29 @@
}, res => {
this.loading = false;
this.addMsg = res.data.data;
this.NewCategoryList=[];
this.addMsg.CategoryList.forEach(item=>{
item.Name=item.CategoryName;
this.NewCategoryList = [];
this.addMsg.CategoryList.forEach(item => {
item.Name = item.CategoryName;
this.NewCategoryList.push(item.CategoryId)
})
this.checkedCities=[];
this.addMsg.RatioList.forEach(item=>{
this.cities.forEach(list=>{
if(item.GradeId==list.Id){
this.checkedCities = [];
this.addMsg.RatioList.forEach(item => {
this.cities.forEach(list => {
if (item.GradeId == list.Id) {
this.checkedCities.push(list.Id);
}
})
})
//
})
},
},
mounted() {
}
};
</script>
<style>
.app-add-cat .el-checkbox-group {
.app-add-cat .el-checkbox-group {
font-size: 14px !important;
}
......@@ -434,6 +418,7 @@
overflow: scroll;
height: 400px;
}
.usersListEdit .tip {
margin-left: 10px;
display: inline-block;
......
......@@ -1237,7 +1237,6 @@
//点击保存
SaveData() {
this.addMsg.ComponentDataList = this.dataList;
console.log("this.addMsg",this.addMsg);
this.apipost("/api/Template/SetMiniTemplate", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.addMsg.Id = res.data.data;
......
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