|
|
@ -49,9 +49,13 @@ |
|
|
|
transferIssueRecordSubmit, |
|
|
|
transferReceiptRecordSubmit |
|
|
|
} from '@/api/request2.js'; |
|
|
|
import { |
|
|
|
getPrecisionStrategyList |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
goHome, |
|
|
|
getPackingNumberAndBatchByList |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -116,12 +120,15 @@ |
|
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
|
businessType: {}, |
|
|
|
managementList:[], |
|
|
|
dataContent: {} |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted(option) { |
|
|
|
var typeCode ="" |
|
|
|
if(this.transferType=="TransferDeliver"){ |
|
|
|
typeCode = "TransferDeliver" |
|
|
|
if(this.transferType=="Transfer"){ |
|
|
|
typeCode = "Transfer" |
|
|
|
}else if(this.transferType=="TransferReceipt"){ |
|
|
|
typeCode = "TransferReceipt" |
|
|
|
} |
|
|
@ -251,57 +258,119 @@ |
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
return; |
|
|
|
} |
|
|
|
//允许部分提交 |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
if(this.detailSource.length > 0 && this.detailSource[0].subList.length > 0){ |
|
|
|
//查询管理模式 |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
this.managementList = []; |
|
|
|
var precisionStrategParams = this.setPrecisionStrategParams() |
|
|
|
|
|
|
|
getPrecisionStrategyList(precisionStrategParams, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
if(this.transferType=="Transfer"){ |
|
|
|
transferIssueRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成调拨出库记录<br>" + res.data) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
}else if(this.transferType=="TransferReceipt"){ |
|
|
|
// transferReceiptRecordSubmit(params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成调拨入库记录<br>" + res.data) |
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
} |
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
if(this.transferType=="transferIssue"){ |
|
|
|
// transferIssueRecordSubmit(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) |
|
|
|
// }) |
|
|
|
|
|
|
|
}else if(this.transferType=="transferReceipt"){ |
|
|
|
// transferReceiptRecordSubmit(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) |
|
|
|
// }) |
|
|
|
}) |
|
|
|
|
|
|
|
}else { |
|
|
|
this.showErrorMessage("没有要提交的数据,请先扫描") |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setPrecisionStrategParams(){ |
|
|
|
var itemList = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
var filterResult = itemList.filter(res => { |
|
|
|
if (res.itemCode == item.itemCode |
|
|
|
&&res.locationCode == detail.locationCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
//去掉重复元素 |
|
|
|
if(filterResult.length==0){ |
|
|
|
var result = { |
|
|
|
itemCode: item.itemCode, |
|
|
|
locationCode: detail.locationCode |
|
|
|
} |
|
|
|
itemList.push(result) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
return itemList; |
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
|
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
|
// detail.packingNumber, detail.batch); |
|
|
|
// detail.toPackingNumber =info.packingNumber; |
|
|
|
// detail.toBatch =info.batch; |
|
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
|
detail.packingNumber, detail.locationCode, detail.batch); |
|
|
|
|
|
|
|
detail.itemCode = detail.itemCode; |
|
|
|
detail.inventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
detail.fromPackingNumber = info.packingNumber; |
|
|
|
detail.toPackingNumber = info.packingNumber; |
|
|
|
|
|
|
|
detail.fromContainerNumber = detail.containerNumber; |
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
|
|
|
|
detail.fromBatch =info.batch; |
|
|
|
detail.toBatch = info.batch; |
|
|
|
|
|
|
|
detail.fromLocationCode = detail.locationCode; |
|
|
|
detail.toLocationCode = detail.locationCode; |
|
|
|
|
|
|
|
|
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
return subList; |
|
|
|
this.dataContent.subList =subList; |
|
|
|
this.dataContent.creator =creator; |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -338,14 +407,13 @@ |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
getToLocationCode(location, code) { |
|
|
|
if (this.fromLocationCode == code) { |
|
|
|
uni.showToast({ |
|
|
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.ToLocationCodeInfo = location; |
|
|
|
// if (this.fromLocationCode == code) { |
|
|
|
// uni.showToast({ |
|
|
|
// title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
|
// duration: 2000 |
|
|
|
// }) |
|
|
|
// return |
|
|
|
// } |
|
|
|
this.toLocationCode = code; |
|
|
|
}, |
|
|
|
|
|
|
|