Browse Source

修改合包校验

hella_online_20241205
lijuncheng 2 months ago
parent
commit
08dda93578
  1. 101
      src/pages/package/record/mergePackageRecord.vue

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

@ -9,10 +9,8 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" <record-com-detail-card :dataContent="item" :index="index" :isShowToLocation="false"
:isShowToLocation="false" :isShowParentToLocation="false" :allowModifyQty="true"
:isShowParentToLocation="false"
:allowModifyQty="true"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack"> @removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
@ -25,8 +23,8 @@
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<packageTarget ref="toPackingRef" title="目标箱码" :isShowEdit="true" :packingNumber="toPackingNumber" <packageTarget ref="toPackingRef" title="目标箱码" :isShowEdit="true"
@getScanResult='getToPackingNumber'></packageTarget> :packingNumber="toPackingNumber" @getScanResult='getToPackingNumber'></packageTarget>
</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="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -46,7 +44,8 @@
<script> <script>
import { import {
mergePackageRecordSubmit mergePackageRecordSubmit,
getBalanceByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome goHome
@ -98,15 +97,16 @@
outInventoryStatus: "", // outInventoryStatus: "", //
businessType: {}, businessType: {},
toPackingNumber: "", toPackingNumber: "",
toBatch:"", toBatch: "",
currentItemCode: "", currentItemCode: "",
dataContent: {} dataContent: {},
toLocationCode: ""
}; };
}, },
onLoad(option) { onLoad(option) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.title title: option.title
}) })
var typeCode = "MergePackage" var typeCode = "MergePackage"
getBusinessType(typeCode, res => { getBusinessType(typeCode, res => {
@ -153,7 +153,7 @@
return; return;
} }
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
itemp.containerNumber="" itemp.containerNumber = ""
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
@ -323,31 +323,82 @@
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.detailSource = [] this.detailSource = []
this.fromLocationCode = ''; this.fromLocationCode = '';
this.toPackingNumber ="" this.toPackingNumber = ""
this.toBatch ="" this.toBatch = ""
this.currentItemCode ="" this.toLocationCode = ""
this.dataContent ={} this.currentItemCode = ""
this.dataContent = {}
}) })
}, },
getToPackingNumber(result) { getToPackingNumber(result) {
if(this.currentItemCode!=result.label.itemCode){ if (this.currentItemCode != result.label.itemCode) {
this.showErrorMessage("当前物料号[" + this.currentItemCode + "与目标物料号[" + result.label.itemCode + this.showErrorMessage("当前物料号[" + this.currentItemCode + "与目标物料号[" + result.label.itemCode +
"]不一致,请扫描相同物料号") "]不一致,请扫描相同物料号")
return; return;
} }
var item =this.detailSource[0].subList.find(r=>r.packingNumber==result.label.packingNumber) var item = this.detailSource[0].subList.find(r => r.packingNumber == result.label.packingNumber)
if(item){ if (item) {
this.showErrorMessage("目标箱码[" + result.label.packingNumber + "与来源箱码[" + item.packingNumber + this.showErrorMessage("目标箱码[" + result.label.packingNumber + "与来源箱码[" + item.packingNumber +
"]一致,请扫描不同箱码") "]一致,请扫描不同箱码")
return; return;
}else { } else {
this.toPackingNumber = result.label.packingNumber; this.getBalance(result.label.packingNumber);
this.toBatch =result.label.batch
this.$refs.toPackingRef.closePack()
} }
} },
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> </script>

Loading…
Cancel
Save