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

页面修改

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