Browse Source

修改发料、补料任务,扫父子包装限制与直接相同

hella_online_20240819
lijuncheng 3 months ago
parent
commit
c43c338668
  1. 207
      src/pages/issue/coms/comScanIssuePack.vue
  2. 3
      src/pages/repleinsh/coms/comRepleishDetailCard.vue
  3. 55
      src/pages/repleinsh/coms/comScanReplishPack.vue
  4. 27
      src/pages/repleinsh/job/repleinshDetail.vue

207
src/pages/issue/coms/comScanIssuePack.vue

@ -501,7 +501,16 @@
let item = that.toLocation.Items.find(r => r.itemCode == itemCode); let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode; that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
if (fromLocation &&!fromLocation.isNewAdd) { //
if (fromLocation){
//
// if(fromLocation.isNewAdd){
// }else {
// //
// }
let batch = fromLocation.Batchs.find(r => r.batch == lot); let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) { if (batch != undefined) {
if (batch.Records == undefined) { if (batch.Records == undefined) {
@ -562,8 +571,9 @@
}); });
} }
} }
} else {
}else {
//
if (this.jobContent.allowModifyLocation == "TRUE") { if (this.jobContent.allowModifyLocation == "TRUE") {
this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,是否要继续发料?", res => { "】与推荐的库位不一致,是否要继续发料?", res => {
@ -580,6 +590,149 @@
"】与推荐的库位不一致,不允许继续发料?") "】与推荐的库位不一致,不允许继续发料?")
} }
} }
// if (fromLocation && !fromLocation.isNewAdd) {
// let batch = fromLocation.Batchs.find(r => r.batch == lot);
// if (batch != undefined) {
// if (batch.Records == undefined) {
// batch.Records = [];
// }
// let record = batch.Records.find(r => r.packingNumber == packingCode);
// if (record == undefined) {
// //
// if (batch.Recommends != undefined && batch.Recommends.length > 0) {
// let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
// if (recommend != undefined) {
// that.addRecord(batch, label, balance, packageInfo)
// } else {
// //
// if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
// that.addRecord(batch, label, balance, packageInfo);
// } else {
// that.showErrorMessage('' + packingCode + '',
// res => {
// that.getfocus();
// return;
// }
// )
// }
// }
// } else {
// that.addRecord(batch, label, balance, packageInfo)
// }
// } else {
// that.showErrorMessage('' + packingCode + ',',
// res => {
// that.getfocus();
// }
// )
// }
// } else {
// if (this.jobContent.allowModifyBatch == "TRUE") {
// this.showQuestionMessage('' + that.fromLocationCode + ',' + lot +
// ',?', res => {
// if (res) {
// let batch = that.createBatchInfo(label, balance, packageInfo);
// //details
// if (fromLocation.Batchs.length > 0) {
// batch.detail = fromLocation.Batchs[0].detail;
// }
// fromLocation.Batchs.unshift(batch);
// this.getfocus();
// that.$emit("afterScan");
// }
// })
// } else {
// that.showErrorMessage('' + lot + '',
// res => {
// that.getfocus();
// });
// }
// }
// } else {
// if (fromLocation&&fromLocation.isNewAdd) {
// let batch = fromLocation.Batchs.find(r => r.batch == lot);
// if (batch != undefined) {
// if (batch.Records == undefined) {
// batch.Records = [];
// }
// let record = batch.Records.find(r => r.packingNumber == packingCode);
// if (record == undefined) {
// //
// if (batch.Recommends != undefined && batch.Recommends.length > 0) {
// let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
// if (recommend != undefined) {
// that.addRecord(batch, label, balance, packageInfo)
// } else {
// //
// if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
// that.addRecord(batch, label, balance, packageInfo);
// } else {
// that.showErrorMessage('' + packingCode + '',
// res => {
// that.getfocus();
// return;
// }
// )
// }
// }
// } else {
// that.addRecord(batch, label, balance, packageInfo)
// }
// } else {
// that.showErrorMessage('' + packingCode + ',',
// res => {
// that.getfocus();
// }
// )
// }
// } else {
// if (this.jobContent.allowModifyBatch == "TRUE") {
// this.showQuestionMessage('' + that.fromLocationCode + ',' + lot +
// ',?', res => {
// if (res) {
// let batch = that.createBatchInfo(label, balance, packageInfo);
// //details
// if (fromLocation.Batchs.length > 0) {
// batch.detail = fromLocation.Batchs[0].detail;
// }
// fromLocation.Batchs.unshift(batch);
// this.getfocus();
// that.$emit("afterScan");
// }
// })
// } else {
// that.showErrorMessage('' + lot + '',
// res => {
// that.getfocus();
// });
// }
// }
// } else {
// if (this.jobContent.allowModifyLocation == "TRUE") {
// this.showQuestionMessage("[" + itemCode + "]" + that.fromLocationCode +
// ",?", res => {
// if (res) {
// let locaion = that.createLocationInfo(label, balance, packageInfo);
// item.Locations.push(locaion);
// this.getfocus();
// that.$emit("afterScan");
// }
// })
// } else {
// this.showErrorMessage("[" + itemCode + "]" + that.fromLocationCode +
// ",?")
// }
// }
// }
} catch (e) { } catch (e) {
that.showErrorMessage(e.stack, that.showErrorMessage(e.stack,
res => { res => {
@ -596,7 +749,7 @@
qty: balance.qty, qty: balance.qty,
uom: balance.uom, uom: balance.uom,
handleQty: 0, handleQty: 0,
isNewAdd:true, isNewAdd: true,
Batchs: [] Batchs: []
} }
let batch = this.createBatchInfo(label, balance, packageInfo); let batch = this.createBatchInfo(label, balance, packageInfo);
@ -656,12 +809,60 @@
}, },
addRecord(batch, label, balance, packageInfo) { addRecord(batch, label, balance, packageInfo) {
if (packageInfo.parentNumber) {
var checkData = batch.Records.find(r => {
if (r.packingNumber == packageInfo.parentNumber &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.showErrorMessage("箱码[" + packageInfo.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
} else {
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
this.$emit("afterScan");
}
} else {
//
var checkData = batch.Records.find(r => {
if (r.parentPackingNumber == packageInfo.number &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentPackingNumber + "]" + "批次[" +
balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
batch.Records = [];
let record = this.creatRecord(label, balance, packageInfo); let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);
this.getfocus(); this.getfocus();
this.$emit("afterScan"); this.$emit("afterScan");
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
this.$emit("afterScan");
}
}
}, },
getfocus() { getfocus() {

3
src/pages/repleinsh/coms/comRepleishDetailCard.vue

@ -35,7 +35,8 @@
<text class="card_content ">{{record.parentPackingNumber}}</text> <text class="card_content ">{{record.parentPackingNumber}}</text>
</view> --> </view> -->
<handle-balance :detail="record" :isShowLocation="false" <handle-balance :detail="record" :isShowLocation="false"
:isShowStatus='true'> :isShowStatus='true'
:isShowBatch="batch.packingNumber!=null">
<!-- :isShowBatch="batch.packingNumber!=null" --> <!-- :isShowBatch="batch.packingNumber!=null" -->
</handle-balance> </handle-balance>
</uni-swipe-action-item> </uni-swipe-action-item>

55
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -433,7 +433,7 @@
that.fromLocationCode = balance.locationCode; that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
// //
if (fromLocation && !fromLocation.isNewAdd) { if (fromLocation ) {
let batch = fromLocation.Batchs.find(r => r.batch == lot); let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) { if (batch != undefined) {
if (batch.Records == undefined) { if (batch.Records == undefined) {
@ -479,6 +479,7 @@
batch.detail = fromLocation.Batchs[0].detail; batch.detail = fromLocation.Batchs[0].detail;
} }
fromLocation.Batchs.unshift(batch); fromLocation.Batchs.unshift(batch);
this.getfocus();
} }
}) })
} else { } else {
@ -539,6 +540,7 @@
batch: label.batch, batch: label.batch,
qty: 0, qty: 0,
uom: label.uom, uom: label.uom,
handleQty: Number(balance.qty),
Records: [] Records: []
} }
let record = {} let record = {}
@ -624,10 +626,61 @@
} else { } else {
record = this.creatRecordByBalance(balance, packageInfo); record = this.creatRecordByBalance(balance, packageInfo);
} }
if (packageInfo.parentNumber) {
var checkData = batch.Records.find(r => {
if (r.packingNumber == packageInfo.parentNumber &&
r.batch == packageInfo.batch) {
return r;
}
})
if (checkData) {
//
this.showErrorMessage("箱码[" + packageInfo.number + "]批次[" + packageInfo.batch +
"]的父包装已经扫描")
} else {
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
}
} else {
//
var checkData = batch.Records.find(r => {
if (r.parentPackingNumber == packageInfo.number &&
r.batch == packageInfo.batch) {
return r;
}
})
if (checkData) {
//
this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentPackingNumber + "]" + "批次[" +
packageInfo
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
batch.Records=[]
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);
this.getfocus(); this.getfocus();
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
}
}
}, },
getfocus() { getfocus() {

27
src/pages/repleinsh/job/repleinshDetail.vue

@ -189,6 +189,11 @@
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.subList[0].itemCode ="255.707-01"
that.subList[0].fromLocationCode ="S12-01-1"
that.subList[0].batch ="20240728"
that.jobContent.allowModifyLocation="TRUE"
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.detailSource = getDataSource(that.detailSource, that.subList) that.detailSource = getDataSource(that.detailSource, that.subList)
if (that.scanMessage) { if (that.scanMessage) {
@ -335,17 +340,17 @@
return return
} }
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
repleinshJobSubmit(params).then(res => { // repleinshJobSubmit(params).then(res => {
uni.hideLoading() // uni.hideLoading()
if (res.data) { // if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成补料记录\n" + res.data) // this.showCommitSuccessMessage("\n\n" + res.data)
} else { // } else {
this.showErrorMessage("提交失败[" + res.msg + "]") // this.showErrorMessage("[" + res.msg + "]")
} // }
}).catch(error => { // }).catch(error => {
uni.hideLoading() // uni.hideLoading()
this.showErrorMessage(error) // this.showErrorMessage(error)
}) // })
}, },
setParams() { setParams() {

Loading…
Cancel
Save