Browse Source

修改补料任务提交

hella_online_20240829
lijuncheng 5 months ago
parent
commit
bd869f9bd7
  1. 2
      src/mycomponents/balance/handleBalance.vue
  2. 105
      src/pages/repleinsh/coms/comScanReplishPack.vue

2
src/mycomponents/balance/handleBalance.vue

@ -2,7 +2,7 @@
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;"> <view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;">
<view class="space_between center"> <view class="space_between center">
<view style="word-break: break-all;width: 60%;"> <view style="word-break: break-all;width: 60%;">
<pack title='外包装' v-if="detail.parentPackingNumber!=undefined && detail.parentPackingNumber!=''" <pack title='外包装' v-if="detail.parentPackingNumber"
:packingCode="detail.parentPackingNumber"></pack> :packingCode="detail.parentPackingNumber"></pack>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>

105
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -113,7 +113,9 @@
import { import {
getBalanceByManagementPrecision getBalanceByManagementPrecision
} from '@/common/balance.js'; } from '@/common/balance.js';
import { getDirectoryItemArray } from '../../../common/directory.js'; import {
getDirectoryItemArray
} from '../../../common/directory.js';
export default { export default {
name: 'winScanPack', name: 'winScanPack',
@ -185,7 +187,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
let that = this; let that = this;
that.fromLocationList = []; that.fromLocationList = [];
if (that.dataContent != null) { if (that.dataContent != null) {
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();
@ -249,15 +251,16 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
mask: true mask: true
}) })
this.getBalance(result.label,packageInfo, balances => { this.getBalance(result.label, packageInfo, balances => {
// //
let s = ''; let s = '';
if (result.package.parentNumber == null || result.package.parentNumber == '') { if (!result.package.parentNumber) {
if (balances.list.length == 0) { if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else { } else {
let newBalances = balances.list.filter(b => b.locationCode ==that.fromLocationCode); let newBalances = balances.list.filter(b => b.locationCode == that
.fromLocationCode);
if (newBalances.length == 0) { if (newBalances.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else if (newBalances.length == 1) { } else if (newBalances.length == 1) {
@ -270,10 +273,52 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
} else { } else {
// //
if (balances.list.length == 0) { if (balances.list.length == 0) {
this.afterGetBalance(result.label, null, packageInfo); this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else { } else {
this.showErrorMessage('该包装在库位【' + balances.list[0].locationCode + //
'】已经有库存余额,请重新扫描') let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
.number)
//
let subParentPackitems = balances.list.filter(r => r.packingNumber ==
packageInfo
.parentNumber)
//
if (subPackitems.length == 0) {
//
if (subParentPackitems.length > 0) {
if(subParentPackitems.length==1){
let balance = subParentPackitems[0];
this.afterGetBalance(result.label, balance, packageInfo);
}else {
this.showBalanceSelect(subParentPackitems);
}
} else {
this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' +
packageInfo.number + '】都未查找到库存余额')
}
} else {
this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' + balances
.list[0].locationCode +
'】已经有库存余额,请重新扫描')
}
// //
// if (subitems.length == 0 && subParentPackitems.length > 0) {
// this.afterGetBalance(result.label, null, packageInfo);
// } else if (subitems.length > 0 && subParentPackitems.length == 0) {
// //
// this.showErrorMessage('' + balances.list[0].locationCode +
// ',')
// } else {
// }
} }
} }
uni.hideLoading(); uni.hideLoading();
@ -304,24 +349,24 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
} }
}, },
getBalance(label, packageInfo,callback) { getBalance(label, packageInfo, callback) {
var filters = [] var filters = []
if (packageInfo.parentNumber) { if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + packageInfo.packingNumber; var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({ filters.push({
column: "packingNumber", column: "packingNumber",
action: "in", action: "in",
value: packingNumber value: packingNumber
}) })
} else { } else {
filters.push({ filters.push({
column: "packingNumber", column: "packingNumber",
action: "==", action: "==",
value: packageInfo.packingNumber value: label.packingNumber
}) })
} }
filters.push({ filters.push({
column: "itemCode", column: "itemCode",
action: "==", action: "==",
@ -484,8 +529,9 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
let record = { let record = {
scaned: true, scaned: true,
itemCode: balance.itemCode, itemCode: balance.itemCode,
packingNumber: balance.packingNumber, packingNumber: packageInfo.number,
batch: balance.batch, parentPackingNumber: packageInfo.parentNumber,
batch: packageInfo.batch,
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),
uom: balance.uom, uom: balance.uom,
@ -579,10 +625,11 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode); let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode);
if (item != undefined) { if (item != undefined) {
item.Locations.forEach(l => { item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber ||
b
.packingNumber == null || b.packingNumber == '') && b.batch == .packingNumber == null || b.packingNumber == '') && b.batch ==
record.batch); record.batch);
let rIndex = batch.Records.findIndex(r => r.packingNumber == record let rIndex = batch.Records.findIndex(r => r.packingNumber == record
.packingNumber && r .packingNumber && r
.batch == record.batch); .batch == record.batch);

Loading…
Cancel
Save