|
|
@ -17,7 +17,7 @@ |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<requiredLocation title="目标库位" :locationCode="toLocationCode" :isShowEdit="true" |
|
|
|
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" :isShowEdit="true" |
|
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
|
<u-line></u-line> |
|
|
|
|
|
|
@ -48,7 +48,9 @@ |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
goHome |
|
|
|
goHome, |
|
|
|
updateTitle, |
|
|
|
getPackingNumberAndBatch |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -61,6 +63,9 @@ |
|
|
|
createDetailInfo, |
|
|
|
calcHandleQty |
|
|
|
} from '@/common/record.js'; |
|
|
|
import { |
|
|
|
getManagementPrecisions |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
|
@ -99,6 +104,17 @@ |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
fromType: { |
|
|
|
handler(newName, oldName) { |
|
|
|
this.updateTitle() |
|
|
|
}, |
|
|
|
immediate: true, |
|
|
|
deep: true |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
data() { |
|
|
|
return { |
|
|
|
id: '', |
|
|
@ -113,6 +129,7 @@ |
|
|
|
toLocationCode: '', |
|
|
|
tolocationTypeList: [], |
|
|
|
businessType: {}, |
|
|
|
showToLoaction:false |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
@ -135,7 +152,10 @@ |
|
|
|
this.$refs.comMessage.showBreakMessage(res.message); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//返回首页 |
|
|
|
onNavigationBarButtonTap(e) { |
|
|
|
if (e.index === 0) { |
|
|
@ -150,6 +170,25 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
updateTitle(){ |
|
|
|
if(this.businessTypeCode=='returnToStore'){ |
|
|
|
if(this.fromType == 'requestType'){ |
|
|
|
updateTitle("合格退料申请") |
|
|
|
this.showToLoaction=false |
|
|
|
}else { |
|
|
|
updateTitle("合格退料记录") |
|
|
|
this.showToLoaction=true |
|
|
|
} |
|
|
|
}else if(this.businessTypeCode=='returnToHold'){ |
|
|
|
if(this.fromType == 'requestType'){ |
|
|
|
updateTitle("隔离退料申请") |
|
|
|
this.showToLoaction=false |
|
|
|
}else { |
|
|
|
updateTitle("隔离退料记录") |
|
|
|
this.showToLoaction=true |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
showFromLocationPopup() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.scanFromLocationCode.openScanPopup(); |
|
|
@ -208,7 +247,6 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
removePack() { |
|
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
|
var item = this.detailSource[i]; |
|
|
@ -236,103 +274,97 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
if (this.toLocationCode == "") { |
|
|
|
if (this.showToLoaction &&this.toLocationCode == "") { |
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
return; |
|
|
|
} |
|
|
|
//允许部分提交 |
|
|
|
if (this.jobContent.allowPartialComplete == "TRUE") { |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
if(this.fromType=="requestType"){ |
|
|
|
var params = this.setParams(false) |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
// (this.id, params).then(res => { |
|
|
|
// productionReturnRequestSubmit(params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// var hint = res.data.Number; |
|
|
|
// this.showCommitSuccessMessage("提交成功" + hint, ) |
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
}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.setParams(true) |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
|
|
|
|
// productionReturnRecordSubmit(params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败") |
|
|
|
// this.showErrorMessage("提交失败"+res.msg) |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
} else { |
|
|
|
this.calcScanCount(); |
|
|
|
if (this.scanCount < this.subList.length) { |
|
|
|
this.showMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount + "]总共[" + this.subList.length + |
|
|
|
"]"); |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
var params = { |
|
|
|
requestNumber: this.jobContent.requestNumber, |
|
|
|
jobNumber: "", |
|
|
|
asnNumber: this.jobContent.asnNumber, |
|
|
|
ppNumber: this.jobContent.ppNumber, |
|
|
|
supplierCode: this.jobContent.supplierCode, |
|
|
|
ReceiptDock: this.jobContent.ReceiptDock, |
|
|
|
carrierCode: this.jobContent.carrierCode, |
|
|
|
transferMode: this.jobContent.transferMode, |
|
|
|
vehiclePlateNumber: this.jobContent.vehiclePlateNumber, |
|
|
|
fromWarehouseCode: this.toLocationInfo.WarehouseCode, |
|
|
|
toWarehouseCode: this.toLocationInfo.WarehouseCode, |
|
|
|
OutTransaction: this.businessType.OutTransactionType, //出库事务类型 |
|
|
|
InTransaction: this.businessType.InTransactionType, //入库事务类型 |
|
|
|
executeTime: "2023-08-4 16:30:11", //执行时间 |
|
|
|
activeDate: "2023-08-4 16:30:11", //生效时间 |
|
|
|
available: "1", //是否可用 0不可用,1可用 |
|
|
|
requestTime: this.jobContent.requestTime, |
|
|
|
dueTime: "2023-08-4 16:30:11", //截止时间 |
|
|
|
departmentCode: this.jobContent.departmentCode, |
|
|
|
UserPositionCode: "", //岗位 |
|
|
|
interfaceType: "jklxPURCHASE_RECEIPT", //接口类型 |
|
|
|
Number: this.jobContent.Number, |
|
|
|
businessType: this.jobContent.businessType, |
|
|
|
remark: this.jobContent.remark, |
|
|
|
creationTime: this.jobContent.creationTime, |
|
|
|
Creatorld: this.jobContent.Creatorld, |
|
|
|
creatorName: this.jobContent.creatorName, |
|
|
|
extraProperties: this.jobContent.extraProperties, |
|
|
|
Siteld: this.jobContent.Siteld, |
|
|
|
Code: "", |
|
|
|
subList: [ |
|
|
|
|
|
|
|
], |
|
|
|
setParams(queryModel) { |
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
// var subItem = {}; |
|
|
|
// Object.assign(subItem, detail) |
|
|
|
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.toContainerNumber = detail.containerNumber |
|
|
|
detail.toBatch = detail.toBatch; |
|
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
detail.toLocationCode = "" |
|
|
|
} |
|
|
|
|
|
|
|
this.detailSource.forEach(res => { |
|
|
|
res.subList.forEach(res1 => { |
|
|
|
if (res1.scaned) { |
|
|
|
res1.record.FromLocationGroupCode = ""; |
|
|
|
res1.record.FromAreaCode = ""; |
|
|
|
res1.record.ToLocationGroupCode = this.toLocationInfo.LocationGroupCode; |
|
|
|
res1.record.ToAreaCode = this.toLocationInfo.AreaCode; |
|
|
|
res1.record.VisualInspectResult = ""; //目检结果 |
|
|
|
res1.record.VisualInspectPhotos = ""; //目检照片 |
|
|
|
res1.record.FailedReason = ""; //不合格原因 |
|
|
|
res1.record.MassDefect = ""; //质量缺陷 |
|
|
|
res1.record.SinglePrice = ""; //单价 |
|
|
|
res1.record.Amount = ""; //金额 |
|
|
|
res1.record.Code = ""; |
|
|
|
res1.record.JobDetailID = res1.record.id; |
|
|
|
res1.record.interfaceType = "jklxPURCHASE_RECEIPT"; |
|
|
|
params.subList.push(res1.record) |
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
return params; |
|
|
|
this.jobContent.subList = subList |
|
|
|
this.jobContent.creator = creator; |
|
|
|
return this.jobContent; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
|
this.scanPopupLoseFocus(); |
|
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
|