|
|
|
@ -264,6 +264,7 @@ |
|
|
|
pecsList: [], |
|
|
|
dataObj: new Map(), |
|
|
|
allChangeNum:0, |
|
|
|
isPlusAndMinus:false, |
|
|
|
shopName:'' |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -504,16 +505,25 @@ |
|
|
|
// } |
|
|
|
// if (this.temporaryList.length == 0) { |
|
|
|
if (jishuqi == this.goodsList.length) { |
|
|
|
console.log(jishuqi) |
|
|
|
console.log('value',value) |
|
|
|
console.log('temporaryList',this.temporaryList) |
|
|
|
for (var i = 0; i < value.length; i++) { |
|
|
|
this.attributeList = { |
|
|
|
attributeList: value[i], |
|
|
|
productCount: this.temporaryNum, |
|
|
|
productNum: this.productNum, |
|
|
|
name: evalue[i], |
|
|
|
price: this.purchasePrice |
|
|
|
let isTrue = false |
|
|
|
for (var m = 0; m < this.temporaryList.length; m++) { |
|
|
|
if(this.temporaryList[m].attributeList == value[i]){ |
|
|
|
isTrue = true |
|
|
|
} |
|
|
|
} |
|
|
|
if(isTrue == false){ |
|
|
|
this.attributeList = { |
|
|
|
attributeList: value[i], |
|
|
|
productCount: this.temporaryNum, |
|
|
|
productNum: this.productNum, |
|
|
|
name: evalue[i], |
|
|
|
price: this.purchasePrice |
|
|
|
} |
|
|
|
this.temporaryList.push(this.attributeList); |
|
|
|
} |
|
|
|
this.temporaryList.push(this.attributeList); |
|
|
|
} |
|
|
|
} |
|
|
|
this.$forceUpdate() |
|
|
|
@ -738,24 +748,37 @@ |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
sliceMsg(val) { |
|
|
|
var name = '' |
|
|
|
if (typeof(val) == 'string') { |
|
|
|
let newObj = JSON.parse(val) |
|
|
|
for (let as in newObj) { |
|
|
|
name += newObj[as] + '/' |
|
|
|
} |
|
|
|
} |
|
|
|
return name; |
|
|
|
}, |
|
|
|
//带参数跳转到开单页 |
|
|
|
goSaleGoods(item) { |
|
|
|
let dataList = [] |
|
|
|
console.log('11',item); |
|
|
|
if(item.saleDetailDTOList){ |
|
|
|
for (let i = 0; i < item.saleDetailDTOList.length; i++) { |
|
|
|
|
|
|
|
let obj = {} |
|
|
|
let attrMap = new Map() |
|
|
|
let newSaleDetailDTOList = [] |
|
|
|
let num = 0 |
|
|
|
for(let m = 0; m < item.saleDetailDTOList[i].stockLogList1.length; m++){ |
|
|
|
|
|
|
|
if(attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true){ |
|
|
|
let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList) |
|
|
|
let trueCount = hasCount.split('-')[0] |
|
|
|
let lastConut = Number(trueCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount) |
|
|
|
newSaleDetailDTOList[hasCount.split('-')[1]].productCount = lastConut |
|
|
|
newSaleDetailDTOList[hasCount].productCount = Number(newSaleDetailDTOList[hasCount].productCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount) |
|
|
|
}else{ |
|
|
|
item.saleDetailDTOList[i].stockLogList1[m].name = this.sliceMsg(item.saleDetailDTOList[i].stockLogList1[m].attributeList) |
|
|
|
newSaleDetailDTOList.push(item.saleDetailDTOList[i].stockLogList1[m]) |
|
|
|
attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList,item.saleDetailDTOList[i].stockLogList1[m].productCount+'-'+m) |
|
|
|
attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList,num) |
|
|
|
num++ |
|
|
|
} |
|
|
|
} |
|
|
|
obj.saleDetailQueryDTO = newSaleDetailDTOList |
|
|
|
@ -843,6 +866,7 @@ |
|
|
|
}, |
|
|
|
//通过商品id查询商品详细信息 |
|
|
|
getById(id) { |
|
|
|
this.temporaryList = [] |
|
|
|
this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if(res.result.delFlag ==0 || res.result.purchasePrice==null || res.result.inStorageStatus == 0){ |
|
|
|
|