Browse Source

发货任务校验物料发货数量必须一致才能提交

hella_online_20240823
lijuncheng 3 months ago
parent
commit
f8fe9753b7
  1. 6
      src/pages/deliver/coms/comDeliverDetailCard.vue
  2. 1
      src/pages/deliver/coms/comScanDeliverPack.vue
  3. 75
      src/pages/deliver/job/deliverDetail.vue

6
src/pages/deliver/coms/comDeliverDetailCard.vue

@ -22,10 +22,10 @@
:isShowLocation="false" :isShowPack="batch.packingNumber!=null && batch.packingNumber!=''"> :isShowLocation="false" :isShowPack="batch.packingNumber!=null && batch.packingNumber!=''">
</recommend-balance> </recommend-balance>
<view class="uni-flex uni-row" v-if='batch.Records.length>0'> <view class="uni-flex uni-row" v-if='batch.Records.length>0'>
<view class="center " style=" width: 20px; color: #0CC2B6; margin-left: 40px;"> <view class="center " style=" width: 20px;background-color: #0CC2B6; color: #fff; margin-left: 40px;padding: 0px 2px;">
实际 扫描
</view> </view>
<view class="uni-flex uni-column" style="width: 100%;"> <view class="uni-flex uni-column scan_view" style="width: 100%;">
<view v-for="(record,index) in batch.Records"> <view v-for="(record,index) in batch.Records">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)" <uni-swipe-action-item @click="swipeClick($event,batch,record,index)"

1
src/pages/deliver/coms/comScanDeliverPack.vue

@ -434,6 +434,7 @@
balance.packQty = packageInfo.packQty balance.packQty = packageInfo.packQty
balance.packUnit = packageInfo.packUnit balance.packUnit = packageInfo.packUnit
let record = { let record = {
scaned: true,
itemCode: label.itemCode, itemCode: label.itemCode,
packingNumber: label.packingNumber, packingNumber: label.packingNumber,
batch: label.batch, batch: label.batch,

75
src/pages/deliver/job/deliverDetail.vue

@ -27,7 +27,7 @@
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class=""> <scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource"> <view v-for="(toLocation, index) in detailSource">
<comDeliverDetailCard ref='comIssueDetailCard' <comDeliverDetailCard ref='comIssueDetailCard'
:dataContent="toLocation" :dataContent="toLocation"
@ -38,13 +38,17 @@
</scroll-view> </scroll-view>
</view> </view>
<div class="btn_bottom"> <view class="page-footer">
<view class="" style="display: flex;flex-direction: row;"> <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view> </view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view> </view>
</div> </view>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button> <win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<comScanDeliverPack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'> <comScanDeliverPack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanDeliverPack> </comScanDeliverPack>
@ -245,6 +249,58 @@
} }
}, },
checkCount(){
let str=""
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
var taskQty =0;
item.taskQty =calc.add(taskQty,item.qty)
var totalQty =0;
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)
}
})
})
})
item.totalQty =totalQty
})
})
this.detailSource.forEach(detail=>{
detail.Items.forEach(item=>{
if(item.taskQty!=item.totalQty){
str += `物料号【${item.itemCode}】提交数量【${item.totalQty}】与任务物料数量【${item.taskQty}】不一致\n`
}
})
})
if(str){
str = '任务明细未全部完成,请全部扫描后提交\n' + str
this.showErrorMessage(str)
}
return str?false:true
},
submitJob() { submitJob() {
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
@ -254,6 +310,12 @@
this.$refs.comMessage.showConfirmMessageModal('请扫描箱码') this.$refs.comMessage.showConfirmMessageModal('请扫描箱码')
return return
} }
if(!this.checkCount()){
uni.hideLoading()
return ;
}
deliverJobSubmit(params).then(res => { deliverJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
@ -417,9 +479,6 @@
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}, },
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
closeScanMessage() { closeScanMessage() {
this.scanPopupGetFocus(); this.scanPopupGetFocus();

Loading…
Cancel
Save