|
|
|
@ -312,6 +312,7 @@ |
|
|
|
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg', |
|
|
|
inventoryList: [], |
|
|
|
settingShow: false, |
|
|
|
isCancel:false, |
|
|
|
showFormula: false, |
|
|
|
chartData: {}, |
|
|
|
showDan:'', |
|
|
|
@ -480,8 +481,10 @@ |
|
|
|
res.result.saleDetailDTOList[i].returnPrice = res.result.saleDetailDTOList[i].discountAmount |
|
|
|
res.result.saleDetailDTOList[i].stockLogList = new Map() |
|
|
|
that.returnList.set(res.result.saleDetailDTOList[i].productId,res.result.saleDetailDTOList[i]) |
|
|
|
for(let m=0;m<res.result.saleDetailDTOList[i].stockLogList1.length;m++){ |
|
|
|
res.result.saleDetailDTOList[i].stockLogList1[m].productCount = 0-res.result.saleDetailDTOList[i].stockLogList1[m].productCount |
|
|
|
for(let m=0;m<res.result.saleDetailDTOList[i].stockLogList1.length;m++){ |
|
|
|
// res.result.saleDetailDTOList[i].stockLogList1[m].stockCount = res.result.saleDetailDTOList[i].stockLogList1[m].stockCount - res.result.saleDetailDTOList[i].stockLogList1[m].productCount |
|
|
|
res.result.saleDetailDTOList[i].stockLogList1[m].productCount = 0-res.result.saleDetailDTOList[i].stockLogList1[m].productCount |
|
|
|
|
|
|
|
that.returnList.get(res.result.saleDetailDTOList[i].productId).stockLogList.set(res.result.saleDetailDTOList[i].stockLogList1[m].attributeList,res.result.saleDetailDTOList[i].stockLogList1[m]) |
|
|
|
} |
|
|
|
|
|
|
|
@ -511,6 +514,7 @@ |
|
|
|
}, true, true).then((res1) => { |
|
|
|
if (res1.code == 200) { |
|
|
|
if (type == 'goPay') { |
|
|
|
this.isCancel = true |
|
|
|
this.goSaleGoods(item,'cancel') |
|
|
|
} else { |
|
|
|
this.getSaleInfo() |
|
|
|
@ -523,20 +527,20 @@ |
|
|
|
// 取消订单 |
|
|
|
getOrderInfoList(item,type) { |
|
|
|
let that = this; |
|
|
|
// if(item.status == 0 || item.status == 1){ |
|
|
|
// this.tui.request('/app/sale/status', "POST", { |
|
|
|
// status: 4, |
|
|
|
// orderId: item.id |
|
|
|
// }, true, true).then((res1) => { |
|
|
|
// if (res1.code == 200) { |
|
|
|
if(item.status == 0 || item.status == 1){ |
|
|
|
this.tui.request('/app/sale/status', "POST", { |
|
|
|
status: 4, |
|
|
|
orderId: item.id |
|
|
|
}, true, true).then((res1) => { |
|
|
|
if (res1.code == 200) { |
|
|
|
this.cancelSale(item,type) |
|
|
|
// } else { |
|
|
|
// this.tui.toast(res.message) |
|
|
|
// } |
|
|
|
// }).catch((res1) => {}) |
|
|
|
// }else{ |
|
|
|
// this.cancelSale(item,type) |
|
|
|
// } |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res1) => {}) |
|
|
|
}else{ |
|
|
|
this.cancelSale(item,type) |
|
|
|
} |
|
|
|
}, |
|
|
|
sliceMsg(val) { |
|
|
|
var name = '' |
|
|
|
@ -570,9 +574,16 @@ |
|
|
|
let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList) |
|
|
|
newSaleDetailDTOList[hasCount].productCount = Number(newSaleDetailDTOList[hasCount] |
|
|
|
.productCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount) |
|
|
|
if(this.isCancel == true){ |
|
|
|
newSaleDetailDTOList[hasCount].stockCount = newSaleDetailDTOList[hasCount].stockCount + newSaleDetailDTOList[hasCount].productCount |
|
|
|
} |
|
|
|
} else { |
|
|
|
item.saleDetailDTOList[i].stockLogList1[m].name = this.sliceMsg(item.saleDetailDTOList[i] |
|
|
|
.stockLogList1[m].attributeList) |
|
|
|
if(this.isCancel == true){ |
|
|
|
item.saleDetailDTOList[i].stockLogList1[m].stockCount = item.saleDetailDTOList[i].stockLogList1[m].stockCount + item.saleDetailDTOList[i].stockLogList1[m].productCount |
|
|
|
} |
|
|
|
|
|
|
|
newSaleDetailDTOList.push(item.saleDetailDTOList[i].stockLogList1[m]) |
|
|
|
attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList, num) |
|
|
|
num++ |
|
|
|
|