Browse Source

修改发料任务的扫描

lijuncheng0816
niexiting 1 month ago
parent
commit
4c656ca31a
  1. 8
      .env.development
  2. 145
      src/pages/issue/coms/comScanIssuePack.vue

8
.env.development

@ -1,11 +1,11 @@
VITE_BASE_URL=http://172.21.32.13:81/api/admin-api VITE_BASE_URL=http://172.21.32.14:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api
# 租户配置 # 租户配置
VITE_TENANT='[{"text":"长春1379","value":1}]' VITE_TENANT='[{"text":"长春1379","value":1}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=true
# 积木报表请求路径 # 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.13:90' VITE_JMREPORT_BASE_URL='http://172.21.32.14:90'

145
src/pages/issue/coms/comScanIssuePack.vue

@ -35,7 +35,7 @@
</view> --> </view> -->
<!-- <u-line class='line_color'></u-line> --> <!-- <u-line class='line_color'></u-line> -->
<view class="uni-flex uni-row" style="align-items: center; <!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff; background-color: #fff;
margin-left: 20rpx; margin-left: 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
@ -49,7 +49,7 @@
placeholder="请选择库位" @confirm="fromLocationUpdate" placeholder="请选择库位" @confirm="fromLocationUpdate"
:inputStyle="inputStyleObject"></uni-combox> :inputStyle="inputStyleObject"></uni-combox>
</view> </view>
</view> </view> -->
<view class=""> <view class="">
<view class=""> <view class="">
@ -231,7 +231,7 @@
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0]; that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode; that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList(); // that.fromLocationList = that.getFromLocationList();
} }
}, },
@ -239,23 +239,23 @@
this.$refs.balanceSelect.openPopup(items); this.$refs.balanceSelect.openPopup(items);
}, },
getFromLocationList() { // getFromLocationList() {
let list = []; // let list = [];
this.dataContent.forEach(location => { // this.dataContent.forEach(location => {
location.Items.forEach(item => { // location.Items.forEach(item => {
item.Locations.forEach(f => { // item.Locations.forEach(f => {
let item = list.find(l => l == f.fromLocationCode); // let item = list.find(l => l == f.fromLocationCode);
if (item == undefined) { // if (item == undefined) {
list.push(f.fromLocationCode) // list.push(f.fromLocationCode)
} // }
}) // })
}) // })
}); // });
// // //
list = uniqueArray(list); // list = uniqueArray(list);
this.fromLocationCode = list[0]; // this.fromLocationCode = list[0];
return list; // return list;
}, // },
fromLocationUpdate(fromlocation) { fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation) let location = this.fromLocationList.find(r => r == fromlocation)
@ -268,12 +268,12 @@
onScanResult(result) { onScanResult(result) {
try { try {
let that = this; let that = this;
if (that.fromLocationCode == '') { // if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => { // that.showErrorMessage('', res => {
that.$refs.toLocationCombox.onFocus(); // that.$refs.toLocationCombox.onFocus();
}); // });
return; // return;
} // }
let packageInfo = result.package; let packageInfo = result.package;
let itemCode = result.label.itemCode; let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber; let packingCode = result.label.packingNumber;
@ -287,7 +287,7 @@
) )
return; return;
} else { } else {
var params = { var params = {
itemCode: result.package.itemCode, itemCode: result.package.itemCode,
batch: result.label.batch, batch: result.label.batch,
@ -318,9 +318,7 @@
if (result.label.packingNumber != result.balance.packingNumber) { if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.handleQty = Number(result.label.qty) result.balance.handleQty = Number(result.label.qty)
} } else {
else
{
result.balance.handleQty = Number(result.balance.qty) result.balance.handleQty = Number(result.balance.qty)
} }
this.afterGetBalance(result.label, result.balance, result.package); this.afterGetBalance(result.label, result.balance, result.package);
@ -502,62 +500,7 @@
} }
} }
}, },
onScanResult1(result) {
try {
let that = this;
if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus();
});
return;
}
that.label = result.label;
that.packageInfo = result.package;
// let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
let lot = result.label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
that.showErrorMessage('未查找到物料【' + itemCode + '】的发料明细',
res => {
that.getfocus();
}
)
return;
} else {
//
uni.showLoading({
title: '加载中',
mask: true
})
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
balanceRes => {
if (balanceRes.success) {
if (balanceRes.data.list.length == 0) {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录',
res => {
this.packGetFocus();
})
} else if (balanceRes.data.list.length == 1) {
let balance = balanceRes.data.list[0];
this.afterGetBalance(result.label, balance, that.packageInfo);
} else {
this.showBalanceSelect(balanceRes.data.list);
}
} else {
this.showErrorMessage(balanceRes.message.message);
}
uni.hideLoading();
});
}
} catch (e) {
this.showErrorMessage(e.stack)
uni.hideLoading();
}
},
selectBalanceItem(balance) { selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo); this.afterGetBalance(this.label, balance, this.packageInfo);
}, },
@ -569,6 +512,7 @@
let packingCode = label.packingNumber; let packingCode = label.packingNumber;
let lot = label.batch; let lot = label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode); let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
if (fromLocation != undefined) { if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot); let batch = fromLocation.Batchs.find(r => r.batch == lot);
@ -580,7 +524,7 @@
let record = batch.Records.find(r => r.packingNumber == packingCode); let record = batch.Records.find(r => r.packingNumber == packingCode);
if (record == undefined) { if (record == undefined) {
// //
if ( batch.Recommends !=undefined && batch.Recommends.length > 0) { if (batch.Recommends != undefined && batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) { if (recommend != undefined) {
that.addRecord(batch, label, balance, packageInfo) that.addRecord(batch, label, balance, packageInfo)
@ -631,11 +575,8 @@
} }
} }
} else { } else {
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发料明细', let locaion = that.createLocationInfo(label, balance, packageInfo);
res => { item.Locations.push(locaion);
that.getfocus();
}
)
} }
} catch (e) { } catch (e) {
that.showErrorMessage(e.stack, that.showErrorMessage(e.stack,
@ -646,6 +587,22 @@
} }
}, },
//
createLocationInfo(label, balance, packageInfo) {
let location = {
fromLocationCode: balance.locationCode,
qty: balance.qty,
uom: balance.uom,
handleQty: 0,
Batchs: []
}
let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance;
location.Batchs.push(batch);
return location;
},
createBatchInfo(data, balance, packageInfo) { createBatchInfo(data, balance, packageInfo) {
let batch = { let batch = {
batch: data.batch, batch: data.batch,
@ -672,7 +629,7 @@
// qty: Number(balance.qty), // qty: Number(balance.qty),
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty), // qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
qty: balance.handleQty, qty: balance.handleQty,
handleQty:balance.handleQty, handleQty: balance.handleQty,
uom: balance.uom, uom: balance.uom,
inventoryStatus: balance.inventoryStatus, inventoryStatus: balance.inventoryStatus,
balance: balance, balance: balance,
@ -681,7 +638,7 @@
packUnit: packageInfo.packUnit, packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty packQty: packageInfo.packQty
} }
return record; return record;
}, },

Loading…
Cancel
Save