Browse Source

修改预生产上架扫描

lijuncheng0816
lijuncheng 3 months ago
parent
commit
a3c4e52f0d
  1. 38
      src/pages/productPutaway/record/productPutawayRecord.vue

38
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>
@ -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 => {
itemp.toLocationCode = res.code;
itemp.expectinNumber = res.expectinNumber;
this.detailSource.push(itemp) this.detailSource.push(itemp)
this.$forceUpdate(); this.calcHandleQty();
}) this.getRecommendLocation(balance)
} 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);
@ -461,8 +470,7 @@
} }
}, },
cancel() cancel() {
{
this.clearData(); this.clearData();
this.openScanPopup(); this.openScanPopup();
} }

Loading…
Cancel
Save