Browse Source

YT-420预生产直接上架直接操作报库位有库存余额,此库位库存满了,应推荐下一个库存

intex_online20241111
zhang_li 1 month ago
parent
commit
8a3538087a
  1. 3
      src/mycomponents/scan/winComScanBalance.vue
  2. 97
      src/pages/productPutaway/record/productPutawayRecord.vue

3
src/mycomponents/scan/winComScanBalance.vue

@ -131,7 +131,8 @@
} }
this.getItemCodeType(result.package.itemCode, callBack => { this.getItemCodeType(result.package.itemCode, callBack => {
if(this.isCheckLocationBalance){ if(this.isCheckLocationBalance){
this.getToLocationBalance(this.resultData) // this.getToLocationBalance(this.resultData)
this.queryBalance(this.resultData);
}else { }else {
this.queryBalance(this.resultData) this.queryBalance(this.resultData)
} }

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

@ -50,7 +50,8 @@
import { import {
productPutawayRecordSubmit, productPutawayRecordSubmit,
getrecommendLocationExpectin, getrecommendLocationExpectin,
recommendLocationRemoveExpectin recommendLocationRemoveExpectin,
getBalanceByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
@ -58,7 +59,8 @@
deepCopyData deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getPrecisionStrategyList getPrecisionStrategyList,
getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
@ -72,6 +74,10 @@
createDetailInfo, createDetailInfo,
calcHandleQty calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
@ -152,7 +158,7 @@
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;
@ -179,12 +185,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
this.getRecommendLocation(balance) await this.getRecommendLocation(balance,result)
this.scanPopupGetFocus() await 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.fromLocationCode == balance.locationCode && r.fromLocationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) { r.inventoryStatus == balance.inventoryStatus) {
return r; return r;
@ -265,14 +270,15 @@
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);
}, },
getRecommendLocation(balance) { async getRecommendLocation(balance,result) {
uni.showLoading({ uni.showLoading({
title: '扫描中...', title: '扫描中...',
mask: true mask: true
@ -285,22 +291,88 @@
batch: balance.batch batch: balance.batch
}; };
console.log(JSON.stringify(param)) console.log(JSON.stringify(param))
getrecommendLocationExpectin(param).then(result => { await getrecommendLocationExpectin(param).then(async result1 => {
uni.hideLoading(); uni.hideLoading();
let item = this.detailSource.find(res => { let item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
return res return res
} }
}) })
item.toLocationCode = result.data.code; item.toLocationCode = result1.data.code;
item.expectinNumber = result.data.expectinNumber; item.expectinNumber = result1.data.expectinNumber;
await this.getToLocationBalance(item.toLocationCode,result)
this.$forceUpdate(); this.$forceUpdate();
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error); this.showErrorMessage(error);
}) })
}, },
//
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);
})
}
}
})
},
// //
removeRecommendLocation(lst) { removeRecommendLocation(lst) {
let param = { let param = {
@ -348,6 +420,7 @@
openScanPopup() { openScanPopup() {
if (this.businessType) { if (this.businessType) {
this.toLocationAreaTypeList = getDirectoryItemArray(this.businessType.inAreaTypes)
this.$refs.scanPopup.openScanPopup(this.businessType); this.$refs.scanPopup.openScanPopup(this.businessType);
} else { } else {
this.getBusinessType() this.getBusinessType()

Loading…
Cancel
Save