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

页面修改

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