Browse Source

修改预生产上架扫描

lijuncheng0816
lijuncheng 1 month ago
parent
commit
a3c4e52f0d
  1. 48
      src/pages/productPutaway/record/productPutawayRecord.vue

48
src/pages/productPutaway/record/productPutawayRecord.vue

@ -1,10 +1,10 @@
<template> <template>
<view class=""> <view class="page-wraper">
<view class=""> <view class="">
<com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<view class="uni-flex uni-column" v-if="detailSource.length>0" style="height: calc(100vh - 44px);"> <view class="page-wraper" v-if="detailSource.length>0" style="height: calc(100vh - 44px);">
<view class="" style="flex: 1;"> <view class="page-main">
<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="">
@ -30,9 +30,11 @@
</view> </view>
</view> </view>
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-button v-if="detailSource.length>0" @goScan='openScanPopup'></win-scan-button>
<win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package> <win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode' <win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location> :locationAreaTypeList="toLocationAreaTypeList"></win-scan-location>
@ -142,7 +144,7 @@
}, },
methods: { methods: {
getScanResult(result) { getScanResult(result) {
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
result.balance.forEach( result.balance.forEach(
@ -155,17 +157,14 @@
}) })
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
itemp.containerNumber = balance.parentPackingNumber
// //
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
newDetail.fromInventoryStatus = balance.inventoryStatus; newDetail.fromInventoryStatus = balance.inventoryStatus;
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.getRecommendLocation(balance, res => { this.detailSource.push(itemp)
itemp.toLocationCode = res.code; this.calcHandleQty();
itemp.expectinNumber = res.expectinNumber; this.getRecommendLocation(balance)
this.detailSource.push(itemp)
this.$forceUpdate();
})
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber && if (r.packingNumber == balance.packingNumber &&
@ -191,7 +190,7 @@
) )
}, },
getRecommendLocation(balance, callback) { getRecommendLocation(balance) {
uni.showLoading({ uni.showLoading({
title: '扫描中...', title: '扫描中...',
mask: true mask: true
@ -201,11 +200,21 @@
expectinNumber: balance.packingNumber + "-" + Date.now(), expectinNumber: balance.packingNumber + "-" + Date.now(),
itemCode: balance.itemCode, itemCode: balance.itemCode,
inventoryStatus: balance.inventoryStatus, inventoryStatus: balance.inventoryStatus,
batch: balance.batch
}; };
console.log(JSON.stringify(param)) console.log(JSON.stringify(param))
getrecommendLocationExpectin(param).then(res => { getrecommendLocationExpectin(param).then(result => {
callback(res.data);
uni.hideLoading(); uni.hideLoading();
let item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode && res.containerNumber == balance
.parentPackingNumber) {
return res
}
})
item.toLocationCode = result.data.code;
item.expectinNumber = result.data.expectinNumber;
this.$forceUpdate();
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error); this.showErrorMessage(error);
@ -277,7 +286,7 @@
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.getfocus();
} }
}, },
scanPopupLoseFocus() { scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus(); this.$refs.scanPopup.losefocus();
@ -460,9 +469,8 @@
} }
} }
}, },
cancel() cancel() {
{
this.clearData(); this.clearData();
this.openScanPopup(); this.openScanPopup();
} }

Loading…
Cancel
Save