Browse Source

采购收货多次收货

intex_online20241205
张立 4 months ago
parent
commit
c9f41e36b1
  1. 13
      src/api/request2.js
  2. 91
      src/pages/purchaseReceipt/job/receiptDetail.vue

13
src/api/request2.js

@ -866,7 +866,18 @@ export function getPurchaseReceiptJobDetail(id) {
data: {},
});
}
/**
* 采购收货 获取收货记录的列表
* @param {*} id 任务id
*
*/
export function getPurchaseReceiptJobDetailListByNmber(requestNumber) {
return request({
url: baseApi + "/wms/purchasereceipt-record-detail/listByNmber?requestNumber=" + requestNumber,
method: "get",
data: {},
});
}
/**
* 采购收货 任务提交
* @param {*} 任务id

91
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -89,7 +89,8 @@
getPurchaseReceiptJobDetail,
takePurchaseReceiptJob,
cancleTakePurchaseReceiptJob,
getPutawayJobList
getPutawayJobList,
getPurchaseReceiptJobDetailListByNmber
} from '@/api/request2.js';
import {
@ -287,6 +288,7 @@
} else {
that.toLocationCode = that.jobToLocationCode;
}
console.log(777,that.toLocationCode)
that.isAllReceived = false;
//
@ -300,6 +302,11 @@
this.managementType = this.managementList&& this.managementList[0]&& this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
}
})
// ,
getPurchaseReceiptJobDetailListByNmber(that.jobContent.requestNumber).then((res)=>{
console.log(res)
this.receiptRecordList = res.data
})
// if (uni.getStorageSync('purchaseReceiptDetailPointParams')) {
// const purchaseReceiptDetailPointParams = uni.getStorageSync(
// 'purchaseReceiptDetailPointParams')
@ -489,6 +496,11 @@
this.showMessage("批次【" + batch + "】不在列表中")
} else {
//
var isHavePackingNumber1 =this.receiptRecordList.find(r => r.packingNumber == packingNumber);
if(isHavePackingNumber1){
this.showMessage("箱码【" + packingNumber + "】已经生成任务");
return
}
var isHavePackingNumber =this.packingNumberList.find(r => r.packingNumber == packingNumber);
if(isHavePackingNumber){
this.showMessage("箱码【" + packingNumber + "】已经扫描");
@ -674,6 +686,7 @@
//
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
@ -693,6 +706,7 @@
//
let str = ''
let str1 = ''
let str2 = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur=>{
if(cur.scaned){
@ -702,6 +716,9 @@
if(parseFloat(cur.qty)<parseFloat(cur.handleQty)){
str1 += `物料号【${item.itemCode}】批次【${cur.batch}】扫描数量【${cur.handleQty}】大于任务推荐数量【${cur.qty}】,\n请修改后再提交`
}
if(parseFloat(cur.qty)!=parseFloat(cur.handleQty)){
str2 += `物料号【${item.itemCode}】批次【${cur.batch}】扫描数量【${cur.handleQty}】与任务推荐数量【${cur.qty}】不一致,\n`
}
}
})
})
@ -723,8 +740,19 @@
//
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
if(str2){
setTimeout(()=>{
this.$refs.comMessage.showQuestionMessage1(str2 + "是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
},100)
}else{
this.submitJob()
}
}
});
} else {
//
@ -772,7 +800,12 @@
mask: true
});
var params = this.setParams();
var params = '';
if(this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY'){
params = this.setParamsBatch()
}else{
params = this.setParams()
}
let that = this
console.log(877,params)
purchaseReceiptJobSubmit(params).then(res => {
@ -883,30 +916,68 @@
},
setParams() {
setParamsBatch() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
console.log(8787,this.detailSource)
this.detailSource.forEach(item => {
let obj = ''
item.subList.forEach(detail => {
// if (!detail.scaned) {
// detail.handleQty = 0
// }
if(detail.scaned){
detail.packList.forEach(pack => {
obj= {...item,...detail, ...pack}
obj.toLocationCode = detail.toLocationCode
if (!pack.scaned) {
pack.handleQty = 0
}
obj.toPackingNumber =pack.packingNumber
// obj.packingNumber = ''
delete obj.subList
delete obj.packList
subList.push(obj)
})
let obj = {...detail}
obj.packList = []
obj.toLocationCode = this.toLocationCode ? this.toLocationCode :this.jobToLocationCode
// // obj.packList = []
// obj.toLocationCode = this.toLocationCode ? this.toLocationCode :this.jobToLocationCode
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,detail.packingNumber, detail.batch);
obj.toPackingNumber = info.packingNumber;
obj.packingNumber = info.packingNumber;
obj.formPackingNumber = info.packingNumber;
// console.log(info)
// obj.toPackingNumber =info.packingNumber;
// obj.packingNumber = info.packingNumber;
// obj.formPackingNumber = info.packingNumber;
obj.toBatch = info.batch;
subList.push(obj)
}
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
},
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
// if (!detail.scaned) {
// detail.handleQty = 0
// }
detail.packList.forEach(pack => {
if (!pack.scaned) {
pack.handleQty = 0
}
})
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;
detail.toBatch = info.batch;
subList.push(detail)
})
})
this.jobContent.subList = subList

Loading…
Cancel
Save