|
|
@ -223,6 +223,7 @@ |
|
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
|
|
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
//直接创建申请 |
|
|
|
if (this.fromType == "requestType") { |
|
|
|
var params = this.setRequestParams(); |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
@ -239,34 +240,25 @@ |
|
|
|
}) |
|
|
|
} else { |
|
|
|
|
|
|
|
var itemCodes = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
}) |
|
|
|
//直接创建记录 |
|
|
|
|
|
|
|
//采购退货不用查询管理模式 |
|
|
|
//获取管理模式,封装参数 |
|
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
|
|
|
|
var params = this.setRecordParams(true) |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
|
|
|
|
// purchaseReturnRecordSubmit(params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购退货记录" + res.data ) |
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败"+res.msg) |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
purchaseReturnRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成采购退货记录" + res.data) |
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
this.showErrorMessage("提交失败" + res.msg) |
|
|
|
} |
|
|
|
}); |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -279,31 +271,32 @@ |
|
|
|
setRecordParams(queryModel) { |
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.dataContent.creator = creator; |
|
|
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
if (queryModel) { |
|
|
|
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
|
detail.packingNumber, detail.batch); |
|
|
|
detail.toPackingNumber = info.packingNumber;; |
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
detail.toBatch = info.batch; |
|
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
detail.toLocationCode = this.toLocationCode |
|
|
|
} else { |
|
|
|
detail.toPackingNumber = detail.packingNumber; |
|
|
|
detail.itemCode = detail.itemCode; |
|
|
|
detail.inventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
detail.fromPackingNumber = detail.packingNumber; |
|
|
|
detail.toPackingNumber = detail.packingNumber;; |
|
|
|
|
|
|
|
detail.fromContainerNumber = detail.containerNumber; |
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
detail.toBatch = detail.toBatch; |
|
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
detail.toLocationCode = "" |
|
|
|
} |
|
|
|
|
|
|
|
detail.fromBatch = detail.batch; |
|
|
|
detail.toBatch = detail.batch; |
|
|
|
|
|
|
|
detail.fromLocationCode = this.fromLocationCode; |
|
|
|
detail.toLocationCode = ''; //采购退货直接出库,目标库位为空 |
|
|
|
|
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.dataContent.subList = subList |
|
|
|
this.dataContent.creator = creator; |
|
|
|
// this.dataContent.jobNumber = ''; |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
|
|
|
|