Commit 8fd15647 authored by 黄奎's avatar 黄奎

页面修改

parent 9809a98a
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<i @click="Deleteggz(item, index, index2)" class="el-icon-error close"></i> <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 v-if="index == 0 && item.EnabledImage == 1" flex="cross:center main:center" class="img-box">
<div class="attr-jt"></div> <div class="attr-jt"></div>
<div v-if="item2.Image == ''" @click=" openggImg(item, index, item2, index2) " <div v-if="item2.Image == ''" @click="openggImg(item, index, item2, index2)"
class="app-attachment"> class="app-attachment">
<div style="line-height: normal; display: inline-block;"> <div style="line-height: normal; display: inline-block;">
<span>+添加图片</span> <span>+添加图片</span>
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<div v-if="item2.Image != ''" class="el-image" style="height: 88px; width: 88px;"> <div v-if="item2.Image != ''" class="el-image" style="height: 88px; width: 88px;">
<img :src="item2.Image" style="width:100%;height:100%" /> <img :src="item2.Image" style="width:100%;height:100%" />
</div> </div>
<span v-if="item2.Image != ''" @click=" DeleteImageUrl(item, index, item2, index2) " <span v-if="item2.Image != ''" @click="DeleteImageUrl(item, index, item2, index2)"
class="el-icon-error close"></span> class="el-icon-error close"></span>
<div v-if="item2.Image != ''" style="position: absolute;"> <div v-if="item2.Image != ''" style="position: absolute;">
<div class="app-attachment"> <div class="app-attachment">
...@@ -145,14 +145,14 @@ ...@@ -145,14 +145,14 @@
</div> </div>
</div> </div>
<div> <div>
<span @click="addGgz(item, index)" class="blue f12">添加规格值</span> <span @click="AddSpecValue(item, index)" class="blue f12">添加规格值</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div v-if="SpecificationList.length < 6" flex="dir:left cross:center" class="bg"> <div v-if="SpecificationList.length < 6" flex="dir:left cross:center" class="bg">
<el-button @click="addggModeule" size="small">添加规格模板</el-button> <el-button @click="chooseSpec" size="small">选择规格模板</el-button>
<el-button @click="addggxm" size="small">添加规格项目</el-button> <el-button @click="addSpec" size="small">添加规格项目</el-button>
<span style="padding-left: 14px;color: rgb(201, 201, 201)">注:规格名最多添加5个</span> <span style="padding-left: 14px;color: rgb(201, 201, 201)">注:规格名最多添加5个</span>
</div> </div>
</div> </div>
...@@ -160,7 +160,6 @@ ...@@ -160,7 +160,6 @@
<div v-show="SpecificationPriceList.length > 0" style="width: 130%; margin-top: 24px;"> <div v-show="SpecificationPriceList.length > 0" style="width: 130%; margin-top: 24px;">
<div class="app-attr"> <div class="app-attr">
<div class="box"> <div class="box">
<!-- <el-checkbox v-model="val2">全选</el-checkbox> -->
<el-form-item label-width="90px" style="display:inline-block" label="批量设置"> <el-form-item label-width="90px" style="display:inline-block" label="批量设置">
<el-input style="width:100%" size="small" v-model="valpl" placeholder="请输入内容" class="input-with-select"> <el-input style="width:100%" size="small" v-model="valpl" placeholder="请输入内容" class="input-with-select">
<el-select style="width:120px" v-model="ggpl" slot="prepend" placeholder="请选择"> <el-select style="width:120px" v-model="ggpl" slot="prepend" placeholder="请选择">
...@@ -253,7 +252,6 @@ ...@@ -253,7 +252,6 @@
<el-dialog title="选择文件" :visible.sync="changeState" width="1240px"> <el-dialog title="选择文件" :visible.sync="changeState" width="1240px">
<ChooseImg @SelectId="SelectId" :IsMultiple="true"></ChooseImg> <ChooseImg @SelectId="SelectId" :IsMultiple="true"></ChooseImg>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -316,7 +314,7 @@ ...@@ -316,7 +314,7 @@
}, },
methods: { methods: {
// 添加规格模板 // 添加规格模板
addggxm() { addSpec() {
let that = this; let that = this;
let obj = { let obj = {
Name: "", Name: "",
...@@ -330,10 +328,9 @@ ...@@ -330,10 +328,9 @@
// 修改规格值 // 修改规格值
ggzChange() { ggzChange() {
this.$forceUpdate(); this.$forceUpdate();
this.ComTreeList = [];
this.memberList2 = []; this.skuList = [];
this.skuList = []; this.getSkuData([], 0, this.SpecificationList);
this.getSkuData([], 0, this.SpecificationList);
}, },
getSkuData(skuArr = [], i, list) { getSkuData(skuArr = [], i, list) {
const testyunx = (skuArr = [], i, list) => { const testyunx = (skuArr = [], i, list) => {
...@@ -355,6 +352,7 @@ ...@@ -355,6 +352,7 @@
} }
} }
testyunx(skuArr, i, list) testyunx(skuArr, i, list)
console.log("this.skuList",this.skuList);
this.calcList(this.skuList, this.SpecificationList); this.calcList(this.skuList, this.SpecificationList);
}, },
calcList(list, calist) { calcList(list, calist) {
...@@ -421,82 +419,8 @@ ...@@ -421,82 +419,8 @@
}; };
arrList.push(obj1); arrList.push(obj1);
}); });
this.calcdis(JSON.parse(JSON.stringify(arrList)));
},
calcdis(dislist) {
let memberListarray = JSON.parse(JSON.stringify(dislist));
let ComTreeList = JSON.parse(JSON.stringify(this.ComTreeList));
for (let i = 0; i < dislist.length; i++) {
if (this.SeparateDistributionType == 2 && this.ComTreeList.length >
0) {
if (i < ComTreeList.length) {
ComTreeList.forEach((val, z) => {
if (val.SpecificationSort == dislist[i].SpecificationSort) {
dislist[i].GradeCommissionList = [];
dislist[i].GradeCommissionList = val.GradeCommissionList;
}
})
} else {
for (let j = 0; j < this.DropdownList.length; j++) {
let obj = {
SpecificationSort: dislist[i].SpecificationSort,
DistributorGrade: this.DropdownList[j].Id,
OneCommission: 0,
TwoCommission: 0,
ThreeCommission: 0,
Name: dislist[i].Name
};
dislist[i].GradeCommissionList.push(obj);
}
}
} else {
for (let j = 0; j < this.DropdownList.length; j++) {
let obj = {
SpecificationSort: dislist[i].SpecificationSort,
DistributorGrade: this.DropdownList[j].Id,
OneCommission: 0,
TwoCommission: 0,
ThreeCommission: 0,
Name: dislist[i].Name
};
dislist[i].GradeCommissionList.push(obj);
}
}
}
for (let i = 0; i < memberListarray.length; i++) {
memberListarray[i].GradePriceList = [];
if (this.EnjoyMember == 1 && this.memberList2.length > 0) {
if (i < this.memberList2.length) {
this.memberList2.forEach(val => {
if (val.SpecificationSort == memberListarray[i].SpecificationSort) {
memberListarray[i].GradePriceList = [];
memberListarray[i].GradePriceList = val.GradePriceList;
}
})
} else {
for (let j = 0; j < this.huiyList.length; j++) {
let obj = {
MemberGrade: this.huiyList[j].Grade,
MemberPrice: 0
};
memberListarray[i].GradePriceList.push(obj);
}
}
} else {
for (let j = 0; j < this.huiyList.length; j++) {
let obj = {
MemberGrade: this.huiyList[j].Grade,
MemberPrice: 0
};
memberListarray[i].GradePriceList.push(obj);
}
}
}
this.disList2 = JSON.parse(JSON.stringify(dislist));
this.memberList2 = JSON.parse(JSON.stringify(memberListarray));
}, },
// 删除规格模板 //删除规格模板
DeleteggModule(item, index) { DeleteggModule(item, index) {
this.ComTreeList = []; this.ComTreeList = [];
this.memberList2 = []; this.memberList2 = [];
...@@ -508,7 +432,7 @@ ...@@ -508,7 +432,7 @@
this.skuList = []; this.skuList = [];
this.getSkuData([], 0, this.SpecificationList); this.getSkuData([], 0, this.SpecificationList);
}, },
// 删除规格值 //删除规格值
Deleteggz(item, index, index2) { Deleteggz(item, index, index2) {
this.SpecificationList[index].SpecificationValueList.splice(index2, 1); this.SpecificationList[index].SpecificationValueList.splice(index2, 1);
this.$forceUpdate(); this.$forceUpdate();
...@@ -528,7 +452,7 @@ ...@@ -528,7 +452,7 @@
this.SpecificationList[index].SpecificationValueList[index2].Image = ""; this.SpecificationList[index].SpecificationValueList[index2].Image = "";
}, },
// 添加规格值 // 添加规格值
addGgz(item, index) { AddSpecValue(item, index) {
let obj = { let obj = {
Id: 0, Id: 0,
Image: "", Image: "",
...@@ -537,7 +461,8 @@ ...@@ -537,7 +461,8 @@
}; };
this.SpecificationList[index].SpecificationValueList.push(obj); this.SpecificationList[index].SpecificationValueList.push(obj);
}, },
addggModeule() { //添加规格
chooseSpec() {
this.speciDig = true; this.speciDig = true;
this.speciList.forEach(item => { this.speciList.forEach(item => {
item.NewSpecList = []; item.NewSpecList = [];
...@@ -561,9 +486,11 @@ ...@@ -561,9 +486,11 @@
} }
this.$forceUpdate(); this.$forceUpdate();
}, },
//规格值切换选择
changeSpeciList(val, index) { changeSpeciList(val, index) {
this.$forceUpdate(); this.$forceUpdate();
}, },
//选择规格
chooseSpecificationValueList() { chooseSpecificationValueList() {
if (!this.SpecificationList) { if (!this.SpecificationList) {
this.SpecificationList = []; this.SpecificationList = [];
......
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