Browse Source

修改合包校验

hella_online_20241205
李俊城 6 months ago
parent
commit
08dda93578
  1. 71
      src/pages/package/record/mergePackageRecord.vue

71
src/pages/package/record/mergePackageRecord.vue

@ -9,10 +9,8 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index"
:isShowToLocation="false"
:isShowParentToLocation="false"
:allowModifyQty="true"
<record-com-detail-card :dataContent="item" :index="index" :isShowToLocation="false"
:isShowParentToLocation="false" :allowModifyQty="true"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
@ -25,8 +23,8 @@
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<packageTarget ref="toPackingRef" title="目标箱码" :isShowEdit="true" :packingNumber="toPackingNumber"
@getScanResult='getToPackingNumber'></packageTarget>
<packageTarget ref="toPackingRef" title="目标箱码" :isShowEdit="true"
:packingNumber="toPackingNumber" @getScanResult='getToPackingNumber'></packageTarget>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -46,7 +44,8 @@
<script>
import {
mergePackageRecordSubmit
mergePackageRecordSubmit,
getBalanceByFilter
} from '@/api/request2.js';
import {
goHome
@ -100,7 +99,8 @@
toPackingNumber: "",
toBatch: "",
currentItemCode: "",
dataContent: {}
dataContent: {},
toLocationCode: ""
};
},
onLoad(option) {
@ -325,6 +325,7 @@
this.fromLocationCode = '';
this.toPackingNumber = ""
this.toBatch = ""
this.toLocationCode = ""
this.currentItemCode = ""
this.dataContent = {}
@ -343,11 +344,61 @@
"]一致,请扫描不同箱码")
return;
} else {
this.toPackingNumber = result.label.packingNumber;
this.toBatch =result.label.batch
this.getBalance(result.label.packingNumber);
}
},
getBalance(packingNumber) {
uni.showLoading({
title: "查询中",
mask: true
})
var filters = []
filters.push({
column: "packingNumber",
action: "==",
value: packingNumber
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) {
var toLocationCode = res.data.list[0].locationCode
if (!this.checkLocation(this.fromLocationCode, toLocationCode)) {
this.showErrorMessage("目标箱码[" + packingNumber + "]的来源库位[" + toLocationCode +
"]与合包的来源库位[" + this.fromLocationCode + "]不一致")
return;
}
this.toPackingNumber = res.data.list[0].packingNumber;
this.toBatch = res.data.list[0].batch
this.toLocationCode = res.data.list[0].locationCode
this.$refs.toPackingRef.closePack()
} else {
this.showErrorMessage(res.msg)
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
checkLocation(fromLocationCode, toLocationCode) {
var isPassed = true
if (fromLocationCode != toLocationCode) {
isPassed = false
}
return isPassed
},
}
}
</script>

Loading…
Cancel
Save