Browse Source

发料任务自动提交

hella_online_20240829
niexiting 4 months ago
parent
commit
bd2e8b49fa
  1. 10
      src/mycomponents/scan/winComScan.vue
  2. 27
      src/pages/issue/coms/comScanIssuePack.vue
  3. 53
      src/pages/issue/job/issueDetail.vue
  4. 21
      src/pages/repleinsh/job/repleinshDetail.vue

10
src/mycomponents/scan/winComScan.vue

@ -101,14 +101,14 @@
}, },
mounted() { mounted() {
this.boxfocus =true; this.boxfocus =true;
uni.hideKeyboard(); // uni.hideKeyboard();
// #ifdef H5 // #ifdef H5
if (document.querySelector('textarea') != null) { // if (document.querySelector('textarea') != null) {
document.querySelector('textarea').setAttribute('inputmode', 'none') // document.querySelector('textarea').setAttribute('inputmode', 'none')
} // }
// #endif // #endif
this.hide() // this.hide()
// #ifdef APP-PLUS // #ifdef APP-PLUS
// //
// this.hide() // this.hide()

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

@ -122,6 +122,7 @@
export default { export default {
name: 'winScanPack', name: 'winScanPack',
emits: ["afterScan"],
components: { components: {
winComScan, winComScan,
balance, balance,
@ -231,20 +232,12 @@
if (this.toLocation && result.package.packUnit) { if (this.toLocation && result.package.packUnit) {
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode); let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (result.package.packUnit !== item.packUnit) { if (result.package.packUnit !== item.packUnit) {
this.$refs.comMessage.showModal({ this.$refs.comMessage.showQuestionMessage(
iconType:'警告', '扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?', res => {
content:`扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, if (res) {
showConfirmButton:true,
showCancelButton:true,
confirmText:'是',
cancelText:'否',
success:({confirm})=>{
if(confirm){
this.onScanResult(result) this.onScanResult(result)
} }
}
}); });
return
} else { } else {
this.onScanResult(result) this.onScanResult(result)
} }
@ -340,6 +333,7 @@
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => { res => {
that.getfocus(); that.getfocus();
return;
} }
) )
} }
@ -347,6 +341,7 @@
} else { } else {
that.addRecord(batch, label, balance, packageInfo) that.addRecord(batch, label, balance, packageInfo)
} }
that.$emit("afterScan");
} else { } else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
res => { res => {
@ -354,6 +349,7 @@
} }
) )
} }
} else { } else {
if (this.jobContent.allowModifyBatch == "TRUE") { if (this.jobContent.allowModifyBatch == "TRUE") {
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot +
@ -436,9 +432,6 @@
addRecord(batch, label, balance, packageInfo) { addRecord(batch, label, balance, packageInfo) {
let record = this.creatRecord(label, balance, packageInfo); let record = this.creatRecord(label, balance, packageInfo);
if(!batch.packingNumber){//bug-wyf
batch.packingNumber = label.packingNumber
}
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);
@ -494,10 +487,12 @@
if (item != undefined) { if (item != undefined) {
item.Locations.forEach(l => { item.Locations.forEach(l => {
let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b.batch == record.batch); let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b
.batch == record.batch);
if (batch && batch.Records && batch.Records.length > 0) { if (batch && batch.Records && batch.Records.length > 0) {
let rIndex = batch.Records.findIndex(r => r.packingNumber == record.packingNumber && r.batch == record.batch); let rIndex = batch.Records.findIndex(r => r.packingNumber == record
.packingNumber && r.batch == record.batch);
batch.Records.splice(rIndex, 1); batch.Records.splice(rIndex, 1);
} }

53
src/pages/issue/job/issueDetail.vue

@ -34,7 +34,8 @@
</view> </view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button> <win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'> <com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'
@afterScan='afterScan'>
</com-scan-issue-pack> </com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -243,7 +244,6 @@
// }, // },
submit() { submit() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -335,16 +335,15 @@
record.singlePrice = single_price; record.singlePrice = single_price;
record.amount = single_price * r.qty; record.amount = single_price * r.qty;
// //使 //使
// if (this.jobContent if (this.jobContent
// .useOnTheWayLocation == .useOnTheWayLocation == 'TRUE') {
// 'TRUE') { record.toPackingNumber = r
// record.toPackingNumber = r .packingNumber;
// .packingNumber; record.toBatch = r.batch;
// record.toBatch = r.batch; } else {
// } else { var info =
debugger getPackingNumberAndBatch(
var info = getPackingNumberAndBatch(
this.managementList, r this.managementList, r
.itemCode, .itemCode,
r.packingNumber, r r.packingNumber, r
@ -352,7 +351,7 @@
record.toPackingNumber = info record.toPackingNumber = info
.packingNumber; .packingNumber;
record.toBatch = info.batch; record.toBatch = info.batch;
// } }
subItem.recordList.push(record); subItem.recordList.push(record);
}) })
subList.push(subItem); subList.push(subItem);
@ -409,7 +408,8 @@
if (item != undefined) { if (item != undefined) {
item.Locations.forEach(l => { item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b.packingNumber == null || b.packingNumber == '') && b.batch == record.batch); let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == null || b.packingNumber == '') && b.batch == record.batch);
let handleQty = 0; let handleQty = 0;
if (batch != undefined) { if (batch != undefined) {
@ -425,6 +425,31 @@
item.handleQty = itemHandleQty; item.handleQty = itemHandleQty;
}, },
afterScan() {
this.detailSource.forEach(detail => {
let s = '';
detail.Items.forEach(item => {
let totalHandleQty = 0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
totalHandleQty = calc.add(totalHandleQty, batch.handleQty)
})
})
if (item.qty == totalHandleQty) {
this.submit();
} else {
this.$refs.comMessage.showQuestionMessage('实际扫描数量【' + totalHandleQty +
'】与物料需求数量【' + item.qty +
'】不一致,是否继续提交', res => {
if (res) {
this.submit();
}
});
}
})
})
},
scanPopupGetFocus() { scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.getfocus();

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

@ -184,7 +184,10 @@
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
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)
setTimeout(r => {
that.resizeCollapse(); that.resizeCollapse();
}, 100)
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
} }
@ -268,6 +271,7 @@
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
return;
repleinshJobSubmit(params).then(res => { repleinshJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
@ -312,17 +316,20 @@
.toLocationCode; .toLocationCode;
record.supplierCode = r.supplierCode; record.supplierCode = r.supplierCode;
if(r.parentPackingNumber!=''&&r.parentPackingNumber!=null) if (r.parentPackingNumber != '' && r
{ .parentPackingNumber != null) {
record.fromPackingNumber = r.parentPackingNumber; record.fromPackingNumber = r
.parentPackingNumber;
record.toPackingNumber = r record.toPackingNumber = r
.packingNumber; .packingNumber;
} // record.fromPackUnit = r.packUnit;
else record.toPackUnit = r.packUnit;
{ } else {
record.fromPackingNumber = r.packingNumber; record.fromPackingNumber = r
.packingNumber;
record.toPackingNumber = r record.toPackingNumber = r
.packingNumber; .packingNumber;
record.toPackUnit = r.packUnit;
} }
record.toBatch = r.batch; record.toBatch = r.batch;

Loading…
Cancel
Save