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">
<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
@ -98,15 +97,16 @@
outInventoryStatus: "", //
businessType: {},
toPackingNumber: "",
toBatch:"",
toBatch: "",
currentItemCode: "",
dataContent: {}
dataContent: {},
toLocationCode: ""
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title
title: option.title
})
var typeCode = "MergePackage"
getBusinessType(typeCode, res => {
@ -153,7 +153,7 @@
return;
}
var itemp = createItemInfo(balance, pack);
itemp.containerNumber=""
itemp.containerNumber = ""
let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail);
@ -323,31 +323,82 @@
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.detailSource = []
this.fromLocationCode = '';
this.toPackingNumber =""
this.toBatch =""
this.currentItemCode =""
this.dataContent ={}
this.toPackingNumber = ""
this.toBatch = ""
this.toLocationCode = ""
this.currentItemCode = ""
this.dataContent = {}
})
},
getToPackingNumber(result) {
if(this.currentItemCode!=result.label.itemCode){
if (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)
if(item){
var item = this.detailSource[0].subList.find(r => r.packingNumber == result.label.packingNumber)
if (item) {
this.showErrorMessage("目标箱码[" + result.label.packingNumber + "与来源箱码[" + item.packingNumber +
"]一致,请扫描不同箱码")
return;
}else {
this.toPackingNumber = result.label.packingNumber;
this.toBatch =result.label.batch
this.$refs.toPackingRef.closePack()
return;
} else {
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