Commit 49d28100 authored by 黄奎's avatar 黄奎

页面修改

parent 5cfb96c2
...@@ -354,57 +354,51 @@ ...@@ -354,57 +354,51 @@
testyunx(skuArr, i, list) testyunx(skuArr, i, list)
this.calcList(this.skuList, this.SpecificationList); this.calcList(this.skuList, this.SpecificationList);
}, },
calcList(list, calist) { calcList(tempSkuList, calist) {
let oldArr = JSON.parse(JSON.stringify(this.SpecificationPriceList)) let oldArr = JSON.parse(JSON.stringify(this.SpecificationPriceList))
this.SpecificationPriceList = []; this.SpecificationPriceList = [];
let arrList = []; var tempArray = [];
list.forEach(item => { tempSkuList.forEach(item => {
item.AttrList = []; var tempObj = {
item.SpecificationSort = ""; AttrList: [],
SpecificationSort: "",
GoodsNumbers: "",
GoodsWeight: 0,
InventoryNum: 0,
SellingPrice: 0,
CostMoney: 0,
Commission: 0,
isNoExite: true,
}
var specificationSortStr = ""
item.forEach((item2, index2) => { item.forEach((item2, index2) => {
let obj = { let obj = {
SName: item2.SName, SName: item2.SName,
SVName: item2.SVName, SVName: item2.SVName,
SVId: item2.SVId SVId: item2.SVId
}; };
let str = ":" + index2; if (index2 == 0) {
item.SpecificationSort = item2.SVId + str; specificationSortStr += item2.SVId
item.GoodsNumbers = ""; } else {
item.GoodsWeight = 0; specificationSortStr += ":" + item2.SVId
item.InventoryNum = 0; }
item.SellingPrice = 0; tempObj.AttrList.push(obj);
item.CostMoney = 0;
item.Commission = 0;
item.AttrList.push(obj);
}); });
tempObj.SpecificationSort = specificationSortStr;
tempArray.push(tempObj)
}); });
tempArray.forEach((item, i) => {
list.forEach((item, i) => {
let obj = {};
obj = {
isNoExite: true,
AttrList: item.AttrList,
SpecificationSort: item.SpecificationSort,
GoodsNumbers: item.GoodsNumbers,
GoodsWeight: item.GoodsWeight,
InventoryNum: item.InventoryNum,
SellingPrice: item.SellingPrice,
CostMoney: item.CostMoney,
Commission: item.Commission
};
var isExists = false;
var isExistsIndex = -1;
oldArr.forEach((val, index) => { oldArr.forEach((val, index) => {
if (val.SpecificationSort == item.SpecificationSort) { if (val.SpecificationSort == item.SpecificationSort) {
obj.GoodsNumbers = val.GoodsNumbers; item.GoodsNumbers = val.GoodsNumbers;
obj.GoodsWeight = val.GoodsWeight; item.GoodsWeight = val.GoodsWeight;
obj.InventoryNum = val.InventoryNum; item.InventoryNum = val.InventoryNum;
obj.SellingPrice = val.SellingPrice; item.SellingPrice = val.SellingPrice;
obj.CostMoney = val.CostMoney; item.CostMoney = val.CostMoney;
obj.Commission = val.Commission; item.Commission = val.Commission;
} }
}) })
this.SpecificationPriceList.push(obj); this.SpecificationPriceList.push(item);
}); });
this.$forceUpdate(); this.$forceUpdate();
}, },
...@@ -412,7 +406,9 @@ ...@@ -412,7 +406,9 @@
DeleteggModule(item, index) { DeleteggModule(item, index) {
let that = this; let that = this;
that.Confirm("是否确认删除?", function () { that.Confirm("是否确认删除?", function () {
that.getDeleteSpec(item.Id); if (item.Id > 0) {
that.getDeleteSpec(item.Id);
}
that.ComTreeList = []; that.ComTreeList = [];
that.memberList2 = []; that.memberList2 = [];
that.SpecificationList.splice(index, 1); that.SpecificationList.splice(index, 1);
...@@ -428,7 +424,9 @@ ...@@ -428,7 +424,9 @@
Deleteggz(item, index, index2) { Deleteggz(item, index, index2) {
let that = this; let that = this;
that.Confirm("是否确认删除?", function () { that.Confirm("是否确认删除?", function () {
that.getDeleteSpecValue(item.Id); if (item.Id > 0) {
that.getDeleteSpecValue(item.Id);
}
that.SpecificationList[index].SpecificationValueList.splice(index2, 1); that.SpecificationList[index].SpecificationValueList.splice(index2, 1);
that.$forceUpdate(); that.$forceUpdate();
if (that.SpecificationList[index].SpecificationValueList.length == 0) { if (that.SpecificationList[index].SpecificationValueList.length == 0) {
...@@ -613,29 +611,29 @@ ...@@ -613,29 +611,29 @@
}); });
}, },
//删除规格后调用 //删除规格后调用
getDeleteSpec(Id){ getDeleteSpec(Id) {
let msg={ let msg = {
Id:Id Id: Id
} }
this.apipost("/api/GroupBuy/DeleteSpec", msg, res => { this.apipost("/api/GroupBuy/DeleteSpec", msg, res => {
console.log(res,'删除了') console.log(res, '删除了')
if(res.data.resultCode==1){ if (res.data.resultCode == 1) {
}else{ } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
}) })
}, },
//删除规格值过后调用 //删除规格值过后调用
getDeleteSpecValue(Id){ getDeleteSpecValue(Id) {
let msg={ let msg = {
Id:Id Id: Id
} }
this.apipost("/api/GroupBuy/DeleteSpecValue", msg, res => { this.apipost("/api/GroupBuy/DeleteSpecValue", msg, res => {
console.log(res,'删除了') console.log(res, '删除了')
if(res.data.resultCode==1){ if (res.data.resultCode == 1) {
}else{ } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
}) })
......
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