Browse Source

修改发料补料提交校验

ljc_0803
lijuncheng 3 months ago
parent
commit
eb63ed4f5e
  1. 2
      src/pages/issue/coms/comScanIssuePack.vue
  2. 21
      src/pages/repleinsh/coms/comScanReplishPack.vue
  3. 59
      src/pages/repleinsh/job/repleinshDetail.vue

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

@ -564,7 +564,7 @@
} }
} else { } else {
if (this.jobContent.allowModifyLocation == "FALSE") { if (this.jobContent.allowModifyLocation == "TRUE") {
this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,是否要继续发料?", res => { "】与推荐的库位不一致,是否要继续发料?", res => {
if (res) { if (res) {

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

@ -417,7 +417,9 @@
}, },
selectBalanceItem(balance) { selectBalanceItem(balance) {
if(balance){
this.afterGetBalance(this.label, balance, this.packageInfo); this.afterGetBalance(this.label, balance, this.packageInfo);
}
}, },
afterGetBalance(label, balance, packageInfo) { afterGetBalance(label, balance, packageInfo) {
@ -431,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 != undefined) { if (fromLocation && !fromLocation.isNewAdd) {
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) {
@ -487,8 +489,24 @@
} }
} }
} else { } else {
if (this.jobContent.allowModifyLocation == "TRUE") {
this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,是否要继续发料?", res => {
if (res) {
let locaion = that.createLocationInfo(label, balance, packageInfo); let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion); item.Locations.push(locaion);
this.getfocus();
that.$emit("afterScan");
}
})
} else {
this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,不允许继续发料?")
}
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.stack, this.showErrorMessage(e.stack,
@ -506,6 +524,7 @@
qty: balance.qty, qty: balance.qty,
uom: balance.uom, uom: balance.uom,
handleQty: 0, handleQty: 0,
isNewAdd: true,
Batchs: [] Batchs: []
} }
let batch = this.createBatchInfo(label, balance, packageInfo); let batch = this.createBatchInfo(label, balance, packageInfo);

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

@ -30,7 +30,7 @@
:locationAreaTypeList="toLocationAreaTypeList"></requiredLocation> :locationAreaTypeList="toLocationAreaTypeList"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="clickSubmit">提交</button>
</view> </view>
</view> </view>
</view> </view>
@ -225,6 +225,58 @@
}); });
}, },
clickSubmit(){
let str=""
var totalQty =0;
var taskQty =0;
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
taskQty =calc.add(taskQty,item.qty)
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if (batch.qty != record.qty) {
var tempHandleQty = 0
if (record.qty) {
tempHandleQty = record.qty
} else {
tempHandleQty = 0
}
if (batch.qty != 0) {
str +=
`包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n`
}
}
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
})
})
})
if(str){
str = '任务明细未全部完成,是否提交?\n' + str
}
if(totalQty!=taskQty){
str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交"
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
//
this.$throttle(this.submitJob, 2000, this)()
} else {
this.scanPopupGetFocus()
}
});
}else {
//
this.$throttle(this.submitJob, 2000, this)()
}
},
submit() { submit() {
var scanCount = this.getScanCount(this.subList); var scanCount = this.getScanCount(this.subList);
@ -277,6 +329,11 @@
mask: true mask: true
}); });
var params = this.setParams() var params = this.setParams()
if (!params.subList || params.subList.length == 0) {
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的补料任务")
return
}
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
repleinshJobSubmit(params).then(res => { repleinshJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()

Loading…
Cancel
Save