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 => {
if(this.isCheckLocationBalance){
this.getToLocationBalance(this.resultData)
// this.getToLocationBalance(this.resultData)
this.queryBalance(this.resultData);
}else {
this.queryBalance(this.resultData)
}

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

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

Loading…
Cancel
Save