Browse Source

采购收货多次收货

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

13
src/api/request2.js

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

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

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

Loading…
Cancel
Save