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="space_between center">
<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>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>

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

@ -113,7 +113,9 @@
import {
getBalanceByManagementPrecision
} from '@/common/balance.js';
import { getDirectoryItemArray } from '../../../common/directory.js';
import {
getDirectoryItemArray
} from '../../../common/directory.js';
export default {
name: 'winScanPack',
@ -185,7 +187,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
let that = this;
that.fromLocationList = [];
if (that.dataContent != null) {
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList();
@ -249,15 +251,16 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
mask: true
})
this.getBalance(result.label,packageInfo, balances => {
this.getBalance(result.label, packageInfo, balances => {
//
let s = '';
if (result.package.parentNumber == null || result.package.parentNumber == '') {
if (!result.package.parentNumber) {
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} 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) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else if (newBalances.length == 1) {
@ -270,10 +273,52 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
} else {
//
if (balances.list.length == 0) {
this.afterGetBalance(result.label, null, packageInfo);
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} 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();
@ -304,24 +349,24 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
}
},
getBalance(label, packageInfo,callback) {
getBalance(label, packageInfo, callback) {
var filters = []
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + packageInfo.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: packageInfo.packingNumber
})
}
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
@ -484,8 +529,9 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
let record = {
scaned: true,
itemCode: balance.itemCode,
packingNumber: balance.packingNumber,
batch: balance.batch,
packingNumber: packageInfo.number,
parentPackingNumber: packageInfo.parentNumber,
batch: packageInfo.batch,
qty: Number(balance.qty),
// qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty),
uom: balance.uom,
@ -579,10 +625,11 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode);
if (item != undefined) {
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 ==
record.batch);
let rIndex = batch.Records.findIndex(r => r.packingNumber == record
.packingNumber && r
.batch == record.batch);

Loading…
Cancel
Save