Browse Source

修改直接补料

hella_online_20240829
lijuncheng 5 months ago
parent
commit
a144a2485a
  1. 78
      src/common/balance.js
  2. 1
      src/mycomponents/balance/balance.vue
  3. 8
      src/mycomponents/scan/winScanPackAndLocation.vue
  4. 26
      src/pages/repleinsh/coms/comScanReplishPack.vue
  5. 58
      src/pages/repleinsh/job/repleinshDetail.vue
  6. 7
      src/pages/repleinsh/record/directRepleinshRecord.vue

78
src/common/balance.js

@ -131,8 +131,58 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) {
callback(result);
})
}
//通过父包装查询
export function getBalanceByManagementPrecisionByPacking(label, packageInfo,locationCode, fromInventoryStatuses, callback) {
let result = {
list: [],
success: true,
message: ''
};
let params = {
itemCodes: [label.itemCode],
locationCode: locationCode
};
// let jsonParem = JSON.stringify(param)
getManagementPrecision(params).then(res => {
let managementPrecision = res.data[0].ManagementPrecision;
switch (managementPrecision) {
case 'BY_PACKAGING':
byPacking(label, packageInfo,locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
case 'BY_BATCH':
byBatch(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
case 'BY_QUANTITY':
byQuantity(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
case 'BY_UNIQUEID':
byUniqueId(label, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
}
}).catch(error => {
let result = {
success: false,
message: error
};
callback(result);
})
}
export function getBalanceByManagementPrecision(label, locationCode, fromInventoryStatuses, callback) {
export function getBalanceByManagementPrecision(label,locationCode, fromInventoryStatuses, callback) {
let result = {
list: [],
success: true,
@ -147,7 +197,7 @@ export function getBalanceByManagementPrecision(label, locationCode, fromInvento
let managementPrecision = res.data[0].ManagementPrecision;
switch (managementPrecision) {
case 'BY_PACKAGING':
byPacking(label, locationCode, fromInventoryStatuses, res => {
byPacking(label, "",locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
@ -184,18 +234,30 @@ export function getBalanceByManagementPrecision(label, locationCode, fromInvento
* @param {Object} locationCode
* @param {Object} callback
*/
export function byPacking(label, locationCode, fromInventoryStatuses, callback) {
export function byPacking(label, packageInfo,locationCode, fromInventoryStatuses, callback) {
let result = {
success: true,
message: '',
data: {}
};
var filters = []
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
if (packageInfo&&packageInfo.parentNumber) {
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: "==",

1
src/mycomponents/balance/balance.vue

@ -2,6 +2,7 @@
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff;margin-bottom: 1px; ">
<view class="uni-flex uni-row space-between" style="align-items: center">
<view>
<pack v-if="dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack>
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location>

8
src/mycomponents/scan/winScanPackAndLocation.vue

@ -58,7 +58,7 @@
import winComScan from '@/mycomponents/scan/winComScan.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import {
getBalanceByManagementPrecision,
getBalanceByManagementPrecisionByPacking,
} from '@/common/balance.js';
import {
@ -245,7 +245,6 @@
mask: true
});
getBasicLocationByCode(this.fromLocationCode).then(res => {
uni.hideLoading();
if (res.data.total > 0) {
let result = res.data.list[0];
var type = result.areaType;
@ -256,11 +255,13 @@
// this.packGetFocus();
this.checkPackage(scanResult);
} else {
uni.hideLoading();
var hint = getListLocationAreaTypeDesc(this.fromLocationAreaTypeList);
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]是[" +
getLocationAreaTypeName(result.areaType) + "],需要的库区是[" + hint + "]")
}
} else {
uni.hideLoading();
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => {
this.locationGetFocus();
})
@ -303,7 +304,7 @@
// mask: true
// })
// -- fromInventoryStatuses
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this
getBalanceByManagementPrecisionByPacking(result.label,result.package, this.fromLocationCode, this
.balanceFromInventoryStatuses ? this.fromInventoryStatuses : undefined,
res => {
uni.hideLoading();
@ -318,6 +319,7 @@
// uni.hideLoading();
});
} else {
uni.hideLoading();
this.packCallBack(null);
}
}

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

@ -249,7 +249,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
mask: true
})
this.getBalance(result.label, balances => {
this.getBalance(result.label,packageInfo, balances => {
//
let s = '';
if (result.package.parentNumber == null || result.package.parentNumber == '') {
@ -303,13 +304,24 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
}
},
getBalance(label, callback) {
getBalance(label, packageInfo,callback) {
var filters = []
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
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
})
}
filters.push({
column: "itemCode",
action: "==",

58
src/pages/repleinsh/job/repleinshDetail.vue

@ -56,6 +56,7 @@
getCurrDateTime,
getDirectoryItemArray,
getPackingNumberAndBatch,
deepCopyData
} from '@/common/basic.js';
import {
@ -238,13 +239,6 @@
setSubmitParamsAndSubmit() {
//
var itemCodes = []
let locationCode = this.toLocationCode
this.detailSource.forEach(toLocation => {
toLocation.Items.forEach(item => {
itemCodes.push(item.itemCode)
})
})
this.submitJob();
//使
// if (this.jobContent.useOnTheWayLocation == 'TRUE') {
@ -305,34 +299,45 @@
// .packingNumber;
record.fromBatch = r.batch;
record.fromContainerNumber = r
.ContainerNumber;
.containerNumber;
record.toContainerNumber = r
.ContainerNumber;
.containerNumber;
record.toInventoryStatus = r
.inventoryStatus;
record.toLocationCode = this
.toLocationCode;
record.supplierCode = r.supplierCode;
if (r.parentPackingNumber != '' && r
.parentPackingNumber != null) {
record.fromPackingNumber = r
.parentPackingNumber;
record.toPackingNumber = r
.packingNumber;
// record.fromPackUnit = r.packUnit;
record.toPackUnit = r.packUnit;
} else {
record.fromPackingNumber = r
.packingNumber;
record.toPackingNumber = r
.packingNumber;
record.toPackUnit = r.packUnit;
}
record.fromParentPackingNumber = r
.parentPackingNumber;
record.fromPackingNumber = r
.packingNumber;
record.toPackingNumber = r
.packingNumber;
record.toPackUnit = r.packUnit;
record.toBatch = r.batch;
// if (r.parentPackingNumber != '' && r
// .parentPackingNumber != null) {
// record.fromPackingNumber = r
// .parentPackingNumber;
// record.toPackingNumber = r
// .packingNumber;
// // record.fromPackUnit = r.packUnit;
// record.toPackUnit = r.packUnit;
// } else {
// record.fromPackingNumber = r
// .packingNumber;
// record.toPackingNumber = r
// .packingNumber;
// record.toPackUnit = r.packUnit;
// }
// record.toBatch = r.batch;
// //使
// if (this.jobContent
// .useOnTheWayLocation ==
@ -353,7 +358,7 @@
// }
subItem.recordList.push(record);
})
commitSubList.push(subItem);
commitSubList.push(deepCopyData(subItem));
}
}
})
@ -464,9 +469,6 @@
this.scanPopupGetFocus();
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
closeScanMessage() {
this.scanPopupGetFocus();

7
src/pages/repleinsh/record/directRepleinshRecord.vue

@ -166,6 +166,8 @@
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.parentNumber =pack.parentNumber;
newDetail.packingNumber =pack.number
newDetail.packUnit =packUnit;
newDetail.packQty=packQty;
itemp.subList.push(newDetail);
@ -183,6 +185,8 @@
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber =pack.parentNumber;
newDetail.packingNumber =pack.number
newDetail.packUnit =packUnit;
newDetail.packQty=packQty;
item.subList.push(newDetail);
@ -334,8 +338,11 @@
{
toInventoryStatus:detail.inventoryStatus,
fromPackingNumber:info.packingNumber,
fromParentPackingNumber: detail.parentNumber,
fromBatch:info.batch,
toPackingNumber:info.packingNumber,
toBatch:info.batch,
fromLocationCode:detail.locationCode,
toLocationCode:detail.toLocationCode,

Loading…
Cancel
Save