Commit 830cf40e authored by 黄奎's avatar 黄奎

页面修改

parent 89981de2
...@@ -150,8 +150,8 @@ ...@@ -150,8 +150,8 @@
<i class="elzk el-tooltip el-icon-info"></i> <i class="elzk el-tooltip el-icon-info"></i>
</el-tooltip> </el-tooltip>
</template> </template>
<goodsSpe v-show="IsShowSpec" @getSpecList="getSpecList" @getSpecPriceList="getSpecPriceList" <goodsSpe v-show="IsShowSpec" v-if="addMsg.SpecificationList&&addMsg.SpecificationList.length>0"
:SpecList="TempSpecList" :SpecPriceList="TempSpecPriceList"></goodsSpe> :addMsg="addMsg"></goodsSpe>
</el-form-item> </el-form-item>
<el-form-item label="商品货号"> <el-form-item label="商品货号">
<el-input v-model="addMsg.Goods_no" size="small" :disabled="true" placeholder="请输入商品货号" <el-input v-model="addMsg.Goods_no" size="small" :disabled="true" placeholder="请输入商品货号"
...@@ -392,7 +392,7 @@ ...@@ -392,7 +392,7 @@
</el-card> </el-card>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="阶梯团设置"> <el-tab-pane label="阶梯团设置">
<groupStep v-if="TempSpecList&&TempSpecList.length>0" :SpecList="TempSpecList" <groupStep v-if="TempSpecList&&TempSpecList.length>0" :addMsg="addMsg" :SpecList="TempSpecList"
:SpecPriceList="TempSpecPriceList" :GroupPriceList="TempGroupPriceList" @setNewVal="setNewVal"> :SpecPriceList="TempSpecPriceList" :GroupPriceList="TempGroupPriceList" @setNewVal="setNewVal">
</groupStep> </groupStep>
</el-tab-pane> </el-tab-pane>
...@@ -629,7 +629,7 @@ ...@@ -629,7 +629,7 @@
if (Mydata.SpecificationList && Mydata.SpecificationList.length > 0) { if (Mydata.SpecificationList && Mydata.SpecificationList.length > 0) {
this.addMsg.SpecificationList = Mydata.SpecificationList; //规格赋值 this.addMsg.SpecificationList = Mydata.SpecificationList; //规格赋值
this.TempSpecList = Mydata.SpecificationList; //this.TempSpecList = Mydata.SpecificationList;
} }
if (Mydata.SpecificationPriceList && Mydata.SpecificationPriceList.length > 0) { if (Mydata.SpecificationPriceList && Mydata.SpecificationPriceList.length > 0) {
this.addMsg.SpecificationPriceList = Mydata.SpecificationPriceList; //规格列表赋值 this.addMsg.SpecificationPriceList = Mydata.SpecificationPriceList; //规格列表赋值
...@@ -717,14 +717,16 @@ ...@@ -717,14 +717,16 @@
} }
}) })
} }
this.TempSpecList = JSON.parse(JSON.stringify(tempSpecArray)); this.addMsg.SpecificationList = JSON.parse(JSON.stringify(tempSpecArray));
var tempPriceArray = chooseGoods[0].SpecificationPriceList; var tempPriceArray = chooseGoods[0].SpecificationPriceList;
if (tempPriceArray && tempPriceArray.length > 0) { if (tempPriceArray && tempPriceArray.length > 0) {
tempPriceArray.forEach(item => { tempPriceArray.forEach(item => {
item.Id = 0; item.Id = 0;
}); });
} }
this.TempSpecPriceList = JSON.parse(JSON.stringify(tempPriceArray)); this.addMsg.SpecificationPriceList = tempPriceArray
this.IsShowSpec = true; this.IsShowSpec = true;
} }
this.$refs.choiceGood.toggleSelection(); this.$refs.choiceGood.toggleSelection();
...@@ -799,14 +801,6 @@ ...@@ -799,14 +801,6 @@
this.TempGroupPriceList = tempObj; this.TempGroupPriceList = tempObj;
this.addMsg.GroupList = tempObj; this.addMsg.GroupList = tempObj;
}, },
//获取子组件规格
getSpecList(val) {
this.addMsg.SpecificationList = val;
},
//获取子组件规格价格列表
getSpecPriceList(val) {
this.addMsg.SpecificationPriceList = val;
},
//获取分销金额 //获取分销金额
getDisCommission(disCommissionArray) { getDisCommission(disCommissionArray) {
if (this.addMsg.GroupList && this.addMsg.GroupList.length > 0) { if (this.addMsg.GroupList && this.addMsg.GroupList.length > 0) {
...@@ -829,7 +823,7 @@ ...@@ -829,7 +823,7 @@
}, },
//获取会员价列表 //获取会员价列表
getMemberList(memberList) { getMemberList(memberList) {
console.log("memberList",memberList); console.log("memberList", memberList);
if (this.addMsg.GroupList && this.addMsg.GroupList.length > 0) { if (this.addMsg.GroupList && this.addMsg.GroupList.length > 0) {
this.addMsg.GroupList.forEach(item => { this.addMsg.GroupList.forEach(item => {
if (memberList && memberList.length > 0) { if (memberList && memberList.length > 0) {
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<div> <div>
<div style="width:130%" class="goodsSpecifica"> <div style="width:130%" class="goodsSpecifica">
<div class="app-attr-group"> <div class="app-attr-group">
<div v-for="(item, index) in SpecificationList" :key="index+'3'" style="margin-bottom:16px;"> <div v-for="(item, index) in addMsg.SpecificationList" :key="index+'3'" style="margin-bottom:16px;">
<div flex="dir:left cross:center" class="bg"> <div flex="dir:left cross:center" class="bg">
<span>规格名:</span> <span>规格名:</span>
<el-input @input="ggzChange(false)" v-model="item.Name" size="mini" style="width: 94px;margin: 0px 16px;"> <el-input @input="ggzChange(false)" v-model="item.Name" size="mini" style="width: 94px;margin: 0px 16px;">
...@@ -149,14 +149,16 @@ ...@@ -149,14 +149,16 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="SpecificationList.length < 6" flex="dir:left cross:center" class="bg"> <div v-if="!addMsg.SpecificationList||(addMsg.SpecificationList&&addMsg.SpecificationList.length < 6)"
flex="dir:left cross:center" class="bg">
<el-button @click="chooseSpec" size="small">选择规格模板</el-button> <el-button @click="chooseSpec" size="small">选择规格模板</el-button>
<el-button @click="addSpec" 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>
</div> </div>
<div v-show="SpecificationPriceList.length > 0" style="width: 130%; margin-top: 24px;"> <div v-show="addMsg.SpecificationPriceList&&addMsg.SpecificationPriceList.length > 0"
style="width: 130%; margin-top: 24px;">
<div class="app-attr"> <div class="app-attr">
<div class="box"> <div class="box">
<el-form-item label-width="90px" style="display:inline-block" label="批量设置"> <el-form-item label-width="90px" style="display:inline-block" label="批量设置">
...@@ -173,11 +175,11 @@ ...@@ -173,11 +175,11 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<el-table ref="table" :data="SpecificationPriceList" border style="width: 100%" <el-table ref="table" :data="addMsg.SpecificationPriceList" border style="width: 100%"
@selection-change="TbaleSelectionChange"> @selection-change="TbaleSelectionChange">
<el-table-column type="selection" width="55"> <el-table-column type="selection" width="55">
</el-table-column> </el-table-column>
<template v-for="(item, index) in SpecificationList"> <template v-for="(item, index) in addMsg.SpecificationList">
<el-table-column :key="index+'5'" :label="item.Name"> <el-table-column :key="index+'5'" :label="item.Name">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="index == index2" v-for="(item2, index2) in scope.row.AttrList" :key="index2+'6'"> <span v-if="index == index2" v-for="(item2, index2) in scope.row.AttrList" :key="index2+'6'">
...@@ -252,19 +254,16 @@ ...@@ -252,19 +254,16 @@
<ChooseImg @SelectId="SelectId" :IsMultiple="true"></ChooseImg> <ChooseImg @SelectId="SelectId" :IsMultiple="true"></ChooseImg>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import ChooseImg from "@/components/global/ChooseImg.vue"; import ChooseImg from "@/components/global/ChooseImg.vue";
export default { export default {
props: ['SpecList', "SpecPriceList"], props: ["addMsg"],
components: { components: {
ChooseImg ChooseImg
}, },
data() { data() {
return { return {
SpecificationList: [], //规格数组
SpecificationPriceList: [], //规格+值 价格列表
ComTreeList: [], ComTreeList: [],
memberList2: [], memberList2: [],
skuList: [], skuList: [],
...@@ -285,31 +284,6 @@ ...@@ -285,31 +284,6 @@
SeparateDistributionType: 1, //待传递给父组件 SeparateDistributionType: 1, //待传递给父组件
EnjoyMember: 1, //待传父组件 EnjoyMember: 1, //待传父组件
}; };
},
watch: {
'SpecList': {
handler: function (val, oldval) {
this.SpecificationList = JSON.parse(JSON.stringify(val));
},
},
'SpecPriceList': {
handler: function (val, oldval) {
this.SpecificationPriceList = JSON.parse(JSON.stringify(val));
},
},
'SpecificationList': {
handler: function (val, oldval) {
this.$emit('getSpecList', this.SpecificationList);
},
},
'SpecificationPriceList': {
handler: function (val, oldval) {
this.$emit('getSpecPriceList', this.SpecificationPriceList);
},
}
},
created() {
}, },
methods: { methods: {
// 添加规格模板 // 添加规格模板
...@@ -318,18 +292,19 @@ ...@@ -318,18 +292,19 @@
let obj = { let obj = {
Name: "", Name: "",
SpecificationValueList: [], SpecificationValueList: [],
Sort: that.SpecificationList.length + 1, Sort: that.addMsg.SpecificationList.length + 1,
Id: 0, Id: 0,
EnabledImage: 2 EnabledImage: 2
}; };
this.SpecificationList.push(obj); this.addMsg.SpecificationList.push(obj);
this.ggzChange(true);
}, },
// 修改规格值 // 修改规格值
ggzChange(isReload) { ggzChange(isReload) {
this.$forceUpdate(); this.$forceUpdate();
if (isReload) { if (isReload) {
this.skuList = []; this.skuList = [];
this.getSkuData([], 0, this.SpecificationList); this.getSkuData([], 0, this.addMsg.SpecificationList);
} }
}, },
getSkuData(skuArr = [], i, list) { getSkuData(skuArr = [], i, list) {
...@@ -352,11 +327,11 @@ ...@@ -352,11 +327,11 @@
} }
} }
testyunx(skuArr, i, list) testyunx(skuArr, i, list)
this.calcList(this.skuList, this.SpecificationList); this.calcList(this.skuList, this.addMsg.SpecificationList);
}, },
calcList(tempSkuList, calist) { calcList(tempSkuList, calist) {
let oldArr = JSON.parse(JSON.stringify(this.SpecificationPriceList)) let oldArr = JSON.parse(JSON.stringify(this.addMsg.SpecificationPriceList))
this.SpecificationPriceList = []; this.addMsg.SpecificationPriceList = [];
var tempArray = []; var tempArray = [];
tempSkuList.forEach(item => { tempSkuList.forEach(item => {
var tempObj = { var tempObj = {
...@@ -398,7 +373,7 @@ ...@@ -398,7 +373,7 @@
item.Commission = val.Commission; item.Commission = val.Commission;
} }
}) })
this.SpecificationPriceList.push(item); this.addMsg.SpecificationPriceList.push(item);
}); });
this.$forceUpdate(); this.$forceUpdate();
}, },
...@@ -411,13 +386,13 @@ ...@@ -411,13 +386,13 @@
} }
that.ComTreeList = []; that.ComTreeList = [];
that.memberList2 = []; that.memberList2 = [];
that.SpecificationList.splice(index, 1); that.addMsg.SpecificationList.splice(index, 1);
if (that.SpecificationList.length == 0) { if (that.addMsg.SpecificationList.length == 0) {
that.SeparateDistributionType = 1; that.SeparateDistributionType = 1;
} }
that.$forceUpdate(); that.$forceUpdate();
that.skuList = []; that.skuList = [];
that.getSkuData([], 0, that.SpecificationList); that.getSkuData([], 0, that.addMsg.SpecificationList);
}); });
}, },
//删除规格值 //删除规格值
...@@ -427,13 +402,13 @@ ...@@ -427,13 +402,13 @@
if (item.Id > 0) { if (item.Id > 0) {
that.getDeleteSpecValue(item.Id); that.getDeleteSpecValue(item.Id);
} }
that.SpecificationList[index].SpecificationValueList.splice(index2, 1); that.addMsg.SpecificationList[index].SpecificationValueList.splice(index2, 1);
that.$forceUpdate(); that.$forceUpdate();
if (that.SpecificationList[index].SpecificationValueList.length == 0) { if (that.addMsg.SpecificationList[index].SpecificationValueList.length == 0) {
that.SpecificationList.splice(index, 1); that.addMsg.SpecificationList.splice(index, 1);
} }
that.skuList = []; that.skuList = [];
that.getSkuData([], 0, that.SpecificationList); that.getSkuData([], 0, that.addMsg.SpecificationList);
}); });
}, },
openggImg(item, index, item2, index2) { openggImg(item, index, item2, index2) {
...@@ -443,7 +418,7 @@ ...@@ -443,7 +418,7 @@
this.imgListIndex2 = index2; this.imgListIndex2 = index2;
}, },
DeleteImageUrl(item, index, item2, index2) { DeleteImageUrl(item, index, item2, index2) {
this.SpecificationList[index].SpecificationValueList[index2].Image = ""; this.addMsg.SpecificationList[index].SpecificationValueList[index2].Image = "";
}, },
// 添加规格值 // 添加规格值
AddSpecValue(item, index) { AddSpecValue(item, index) {
...@@ -453,7 +428,8 @@ ...@@ -453,7 +428,8 @@
Name: "", Name: "",
Sort: item.SpecificationValueList.length + 1 Sort: item.SpecificationValueList.length + 1
}; };
this.SpecificationList[index].SpecificationValueList.push(obj); this.addMsg.SpecificationList[index].SpecificationValueList.push(obj);
this.ggzChange(true);
}, },
//添加规格 //添加规格
chooseSpec() { chooseSpec() {
...@@ -486,8 +462,8 @@ ...@@ -486,8 +462,8 @@
}, },
//选择规格 //选择规格
chooseSpecificationValueList() { chooseSpecificationValueList() {
if (!this.SpecificationList) { if (!this.addMsg.SpecificationList) {
this.SpecificationList = []; this.addMsg.SpecificationList = [];
} }
let arr = []; let arr = [];
this.speciList.forEach(item => { this.speciList.forEach(item => {
...@@ -495,10 +471,10 @@ ...@@ -495,10 +471,10 @@
arr.push(item); arr.push(item);
} }
}); });
this.SpecificationList = JSON.parse( this.addMsg.SpecificationList = JSON.parse(
JSON.stringify(this.SpecificationList.concat(arr)) JSON.stringify(this.addMsg.SpecificationList.concat(arr))
); );
this.SpecificationList.forEach((item, index) => { this.addMsg.SpecificationList.forEach((item, index) => {
item.EnabledImage = 2; item.EnabledImage = 2;
item.Sort = index; item.Sort = index;
item.SpecificationValueList.forEach((list, index2) => { item.SpecificationValueList.forEach((list, index2) => {
...@@ -509,7 +485,7 @@ ...@@ -509,7 +485,7 @@
this.ComTreeList = []; this.ComTreeList = [];
this.memberList2 = [] this.memberList2 = []
this.skuList = []; this.skuList = [];
this.getSkuData([], 0, this.SpecificationList); this.getSkuData([], 0, this.addMsg.SpecificationList);
this.speciDig = false; this.speciDig = false;
}, },
ggPlSet() { ggPlSet() {
...@@ -517,7 +493,7 @@ ...@@ -517,7 +493,7 @@
this.Error("至少选择一项!"); this.Error("至少选择一项!");
return; return;
} }
this.SpecificationPriceList.forEach(item => { this.addMsg.SpecificationPriceList.forEach(item => {
this.ggplList.forEach(list => { this.ggplList.forEach(list => {
if (item.Id == list.Id) { if (item.Id == list.Id) {
if (this.ggpl == 1) { if (this.ggpl == 1) {
...@@ -561,7 +537,7 @@ ...@@ -561,7 +537,7 @@
if (this.imgType == 3) { if (this.imgType == 3) {
let imgListIndex1 = this.imgListIndex1; let imgListIndex1 = this.imgListIndex1;
let imgListIndex2 = this.imgListIndex2; let imgListIndex2 = this.imgListIndex2;
this.SpecificationList[imgListIndex1].SpecificationValueList[ this.addMsg.SpecificationList[imgListIndex1].SpecificationValueList[
imgListIndex2 imgListIndex2
].Image = that.getIconLink(msg[0].url); ].Image = that.getIconLink(msg[0].url);
} }
......
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