Browse Source

YT-420发料补料 pda直接操作报库位有库存余额,此库位库存满了,应推荐下一个库存

intex_online20241111
zhang_li 1 month ago
parent
commit
dffa89a729
  1. 5
      src/pages/issue/record/directIssue.vue
  2. 89
      src/pages/repleinsh/record/directRepleinshRecord.vue

5
src/pages/issue/record/directIssue.vue

@ -81,7 +81,7 @@
getPrecisionStrategyList, getPrecisionStrategyList,
getPrecisionStrategyParams getPrecisionStrategyParams
} from '@/common/balance.js'; } from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
@ -187,7 +187,7 @@
getScanResult(result) { getScanResult(result) {
this.setData(result); this.setData(result);
}, },
setData(result) { async setData(result) {
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
@ -224,6 +224,7 @@
this.detailSource.push(itemp) this.detailSource.push(itemp)
this.itemCode = balance.itemCode; this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode this.fromLocationCode = balance.locationCode
await this.getToLocationBalance(this.fromLocationCode,result)
this.scanPopupGetFocus() this.scanPopupGetFocus()
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {

89
src/pages/repleinsh/record/directRepleinshRecord.vue

@ -17,10 +17,8 @@
<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" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)" :isShowFromLocation="false" @removeItem="removeItem(index,item)" :isShowToLocation="false"
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData" @removePack="removePack">
:isShowParentToLocation="false"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
</view> </view>
@ -28,8 +26,7 @@
</view> </view>
<view class="page-footer"> <view class="page-footer">
<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="">
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" <requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :locationAreaTypeList="toLocationAreaTypeList"> @getLocation='getToLocationCode' :locationAreaTypeList="toLocationAreaTypeList">
@ -81,6 +78,7 @@
calcHandleQty calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';
import { import {
getManagementPrecisions, getManagementPrecisions,
getPrecisionStrategyList, getPrecisionStrategyList,
@ -218,14 +216,14 @@
this.setData(result); this.setData(result);
}, },
setData(result) { async setData(result) {
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) { if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this this.showErrorMessage("批次[" + balance.batch + "]在库位[" + this
.fromLocationCode + "]没有库存余额") .fromLocationCode + "]没有库存余额")
return; return;
} }
@ -256,11 +254,11 @@
this.detailSource.push(itemp) this.detailSource.push(itemp)
this.itemCode = balance.itemCode; this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode this.fromLocationCode = balance.locationCode
await this.getToLocationBalance(this.toLocationCode,result)
this.scanPopupGetFocus() this.scanPopupGetFocus()
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == pack.number && if (r.batch == balance.batch &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode && r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) { r.inventoryStatus == balance.inventoryStatus) {
return r; return r;
@ -303,7 +301,7 @@
}) })
if (checkData) { if (checkData) {
// //
this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentNumber+"]" + "批次[" + balance this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentNumber + "]" + "批次[" + balance
.batch + "]是父包装,是否移除子包装", res => { .batch + "]是父包装,是否移除子包装", res => {
if (res) { if (res) {
item.subList = []; item.subList = [];
@ -334,14 +332,81 @@
this.scanPopupGetFocus() this.scanPopupGetFocus()
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {
this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") detail.handleQty = calc.add(detail.handleQty, result.label.qty)
// this.showErrorMessage("[" + detail.packingNumber + "[" + balance.batch + "]")
} }
} }
} }
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
}, },
//
async getToLocationBalance(toLocationCode, result) {
uni.showLoading({
title: '查询中',
mask: true
})
var filters = []
if (result.package.parentNumber) {
var packingNumber = result.package.parentNumber + "," + result.package.number;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: result.package.number
})
}
filters.push({
column: "itemCode",
action: "==",
value: result.package.itemCode
})
filters.push({
column: "batch",
action: "==",
value: result.package.batch
})
filters.push({
column: "areaType",
action: "in",
value: this.toLocationAreaTypeList.join(',')
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
await getManagementPrecisions([result.package.itemCode], toLocationCode, async res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision == 'BY_BATCH') ?
'BY_BATCH' : ''
if (this.managementType == 'BY_BATCH') {
uni.hideLoading()
} else {
await getBalanceByFilter(params).then(res => {
uni.hideLoading()
if (res.data.list.length > 0) {
this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额");
}
// callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
}
}
})
},
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {

Loading…
Cancel
Save