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

Loading…
Cancel
Save