Commit 33a8acdb authored by 黄奎's avatar 黄奎

页面修改

parent 87c39158
......@@ -12,8 +12,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-item label="分销名称" prop="Name">
<el-input v-model="addMsg.Name" size="small"></el-input>
......@@ -21,30 +21,22 @@
<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>
......@@ -129,14 +121,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>
......@@ -156,15 +150,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: [{
......@@ -172,23 +166,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() {
......@@ -197,51 +195,51 @@
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;
}
......@@ -260,7 +258,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;
}
......@@ -276,38 +274,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) => {
......@@ -338,15 +333,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() {
......@@ -361,8 +355,6 @@
this.GradeId = this.$route.query.UserId;
this.getData()
}
})
},
getData() {
......@@ -372,33 +364,28 @@
}, 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;
}
......@@ -435,6 +422,7 @@
overflow: scroll;
height: 400px;
}
.usersListEdit .tip {
margin-left: 10px;
display: inline-block;
......
......@@ -132,7 +132,7 @@
</el-input>
</el-form-item>
</template>
<template v-if="!rubData.data.list[rubik]">
<template v-if="rubData.data.list&&!rubData.data.list[rubik]">
<el-form-item label="图片上传">
<span>请先在左边选择图片位置</span>
</el-form-item>
......@@ -141,7 +141,7 @@
<el-card shadow="never">
<el-form-item label="图片上传">
<el-button size="mini" @click="choicImg=true">选择图片</el-button>
<div flex style="flex-wrap: wrap;" v-if="rubData.data.list[rubik].pic_url">
<div flex style="flex-wrap: wrap;" v-if="rubData.data.list&&rubData.data.list[rubik].pic_url">
<div flex="main:center cross:center" class="app-gallery-item"
style="height: 100px; width: 100px;">
<img :src="getIconLink(rubData.data.list[rubik].pic_url)" style="width:100%;height:100%;">
......@@ -149,7 +149,7 @@
</div>
</el-form-item>
<el-form-item label="选择链接">
<el-input size="small" v-model="rubData.data.list[rubik].link[0].PageName" :disabled="true">
<el-input size="small" v-model="rubData.data.list&&rubData.data.list[rubik].link[0].PageName" :disabled="true">
<template slot="append">
<el-button @click="isShowLink=true">选择链接</el-button>
</template>
......
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