Browse Source

修改合包校验

hella_online_20241205
lijuncheng 2 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"> <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
@ -100,7 +99,8 @@
toPackingNumber: "", toPackingNumber: "",
toBatch: "", toBatch: "",
currentItemCode: "", currentItemCode: "",
dataContent: {} dataContent: {},
toLocationCode: ""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -325,6 +325,7 @@
this.fromLocationCode = ''; this.fromLocationCode = '';
this.toPackingNumber = "" this.toPackingNumber = ""
this.toBatch = "" this.toBatch = ""
this.toLocationCode = ""
this.currentItemCode = "" this.currentItemCode = ""
this.dataContent = {} this.dataContent = {}
@ -343,11 +344,61 @@
"]一致,请扫描不同箱码") "]一致,请扫描不同箱码")
return; return;
} else { } else {
this.toPackingNumber = result.label.packingNumber; this.getBalance(result.label.packingNumber);
this.toBatch =result.label.batch }
},
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() 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