Commit 3b95b398 authored by 黄奎's avatar 黄奎

页面修改

parent b9f8539d
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
<div v-for="(item, index) in SpecificationList" :key="index+'3'" style="margin-bottom:16px;"> <div v-for="(item, index) in 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" 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;">
</el-input> </el-input>
<el-checkbox v-show="index == 0" v-model="item.EnabledImage" :true-label="1" :false-label="2">规格图片 <el-checkbox v-show="index == 0" v-model="item.EnabledImage" :true-label="1" :false-label="2">规格图片
</el-checkbox> </el-checkbox>
...@@ -121,12 +121,11 @@ ...@@ -121,12 +121,11 @@
<div class="box-grow-0">规格值:</div> <div class="box-grow-0">规格值:</div>
<div flex="dir:left" style="flex-wrap: wrap;"> <div flex="dir:left" style="flex-wrap: wrap;">
<div v-for="(item2,index2) in item.SpecificationValueList" :key="index2+'4'" class="attr-list"> <div v-for="(item2,index2) in item.SpecificationValueList" :key="index2+'4'" class="attr-list">
<el-input @input="ggzChange" size="mini" v-model="item2.Name" width="152px"></el-input> <el-input @input="ggzChange(true)" size="mini" v-model="item2.Name" width="152px"></el-input>
<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>
</div> </div>
...@@ -326,11 +325,12 @@ ...@@ -326,11 +325,12 @@
this.SpecificationList.push(obj); this.SpecificationList.push(obj);
}, },
// 修改规格值 // 修改规格值
ggzChange() { ggzChange(isReload) {
this.$forceUpdate(); this.$forceUpdate();
if (isReload) {
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) => {
...@@ -352,10 +352,10 @@ ...@@ -352,10 +352,10 @@
} }
} }
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) {
console.log("skuList", list)
let oldArr = JSON.parse(JSON.stringify(this.SpecificationPriceList)) let oldArr = JSON.parse(JSON.stringify(this.SpecificationPriceList))
this.SpecificationPriceList = []; this.SpecificationPriceList = [];
let arrList = []; let arrList = [];
...@@ -368,11 +368,8 @@ ...@@ -368,11 +368,8 @@
SVName: item2.SVName, SVName: item2.SVName,
SVId: item2.SVId SVId: item2.SVId
}; };
let str = ":"; let str = ":" + index2;
if (index2 == item.length - 1) { item.SpecificationSort = item2.SVId + str;
str = "";
}
item.SpecificationSort += item2.SVId + str;
item.GoodsNumbers = ""; item.GoodsNumbers = "";
item.GoodsWeight = 0; item.GoodsWeight = 0;
item.InventoryNum = 0; item.InventoryNum = 0;
...@@ -382,6 +379,7 @@ ...@@ -382,6 +379,7 @@
item.AttrList.push(obj); item.AttrList.push(obj);
}); });
}); });
list.forEach((item, i) => { list.forEach((item, i) => {
let obj = {}; let obj = {};
obj = { obj = {
...@@ -395,30 +393,21 @@ ...@@ -395,30 +393,21 @@
CostMoney: item.CostMoney, CostMoney: item.CostMoney,
Commission: item.Commission Commission: item.Commission
}; };
oldArr.forEach(val => { var isExists = false;
var isExistsIndex = -1;
oldArr.forEach((val, index) => {
if (val.SpecificationSort == item.SpecificationSort) { if (val.SpecificationSort == item.SpecificationSort) {
obj = { obj.GoodsNumbers = val.GoodsNumbers;
isNoExite: false, obj.GoodsWeight = val.GoodsWeight;
AttrList: item.AttrList, obj.InventoryNum = val.InventoryNum;
SpecificationSort: val.SpecificationSort, obj.SellingPrice = val.SellingPrice;
GoodsNumbers: val.GoodsNumbers, obj.CostMoney = val.CostMoney;
GoodsWeight: val.GoodsWeight, obj.Commission = val.Commission;
InventoryNum: val.InventoryNum,
SellingPrice: val.SellingPrice,
CostMoney: val.CostMoney,
Commission: val.Commission
};
} }
}) })
this.SpecificationPriceList.push(obj); this.SpecificationPriceList.push(obj);
let obj1 = {
Id: i,
AttrList: item.AttrList,
SpecificationSort: item.SpecificationSort,
GradeCommissionList: []
};
arrList.push(obj1);
}); });
this.$forceUpdate();
}, },
//删除规格模板 //删除规格模板
DeleteggModule(item, index) { DeleteggModule(item, index) {
......
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