Browse Source

修改调拨入库和直接上架

wms3.0_pda
niexiting 11 months ago
parent
commit
3ebfe853f0
  1. 16
      api/request2.js
  2. 41
      common/balance.js
  3. 1
      common/record.js
  4. 1
      common/style/pdabasic.css
  5. 124
      pages/putaway/record/putawayRecord.vue
  6. 70
      pages/transfer/job/receiptDetail.vue

16
api/request2.js

@ -304,6 +304,22 @@ export function getBasicLocationByCode(code) {
}); });
} }
/**
* 校验库位零件关系
* @param {*}
*
*/
export function validateItemAndLocation(parmas) {
return request({
url: baseApi + "/wms/location/validate",
method: "post",
data: parmas,
});
}
/** /**
* 查询物品信息接口 * 查询物品信息接口
* @param {*} code 物品代码 * @param {*} code 物品代码

41
common/balance.js

@ -4,6 +4,47 @@ import {
getBalanceByFilter getBalanceByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
/**
*
获取管理精度查询策略参数
* @param {*}
*
*/
export function getPrecisionStrategyParams(dataSource) {
}
/**
*
获取管理精度查询策略参数
* @param {*}
*
*/
export function getPrecisionStrategyParamsByLocation(detailSource,toLocationCode) {
var itemList = []
detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
res.locationCode == detail.toLocationCode) {
return res
}
})
//去掉重复元素
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
}
/** /**
* "itemCode": [], * "itemCode": [],

1
common/record.js

@ -19,6 +19,7 @@ export function createItemInfo(balance, pack) {
} }
return item; return item;
} }
export function createDetailInfo(data, pack) { export function createDetailInfo(data, pack) {
data.scaned = true; data.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus; // data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;

1
common/style/pdabasic.css

@ -725,6 +725,7 @@ page {
.page-header .header_item { .page-header .header_item {
/* padding-left: 10rpx; */ /* padding-left: 10rpx; */
padding: 5rpx 10rpx; padding: 5rpx 10rpx;
font-size:15px ;
} }
.page-header .header_job_top { .page-header .header_job_top {

124
pages/putaway/record/putawayRecord.vue

@ -41,7 +41,8 @@
<script> <script>
import { import {
putawayRequestSubmit, putawayRequestSubmit,
putawayRecordSubmit putawayRecordSubmit,
validateItemAndLocation
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -63,7 +64,9 @@
} from '@/common/record.js'; } from '@/common/record.js';
import { import {
getManagementPrecisions getManagementPrecisions,
getPrecisionStrategyList,
getPrecisionStrategyParamsByLocation
} from '@/common/balance.js'; } from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -89,22 +92,16 @@
data() { data() {
return { return {
id: '', id: '',
receiptJob: {},
received: false,
dataContent: {}, // dataContent: {}, //
detailSource: [], // detailSource: [], //
locationTypeList: [],
businessTypeInfo: {},
fromLocationInfo: {}, fromLocationInfo: {},
fromLocationCode: "", fromLocationCode: "",
toLocationCode: "", toLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
businessType: {}, businessType: {},
fromType: "",
showToLoaction: true showToLoaction: true
}; };
}, },
@ -240,40 +237,97 @@
return; return;
} }
uni.showLoading({ //
title: "提交中....",
mask: true // uni.showLoading({
}); // title: "....",
// mask: true
// });
// //
var itemCodes = []
//1:
// var itemCodes = []
// let conditions = [];
// this.detailSource.forEach(item => {
// debugger;
// let condition = {
// itemCode: item.itemCode,
// batch: item.batch,
// inventoryStatus: item.inInventoryStatus,
// locationCode: this.toLocationCode
// };
// conditions.push(condition)
// })
let itemAndLocationRelations = this.getItemAndLocationRelations();
validateItemAndLocation(itemAndLocationRelations, res => {
debugger;
});
let precisionStrategyParams = getPrecisionStrategyParamsByLocation(this.detailSource, this.toLocationCode);
return;
//2:
// getManagementPrecisions(itemCodes, this.toLocationCode, res => {
// if (res.success) {
// this.managementList = res.list;
// var params = this.setRecordParams(true)
// console.log("", JSON.stringify(params));
// putawayRecordSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
// } else {
// uni.hideLoading();
// this.showErrorMessage(res.message);
// }
// });
},
getItemAndLocationRelations() {
var itemList = []
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
itemCodes.push(item.itemCode) item.subList.forEach(detail => {
}) if (detail.scaned) {
// detail.toLocationCode = this.toLocationCode;
getManagementPrecisions(itemCodes, this.toLocationCode, res => { var filterResult = itemList.filter(res => {
if (res.success) { if (res.itemCode == item.itemCode &&
this.managementList = res.list; res.locationCode == detail.toLocationCode &&
var params = this.setRecordParams(true) res.batch == detail.batch &&
console.log("提交参数", JSON.stringify(params)); res.inventoryStatus == detail.inventoryStatus) {
return res
putawayRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购上架记录" + res.data, )
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
} }
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
}) })
} else { //
uni.hideLoading(); if (filterResult.length == 0) {
this.showErrorMessage(res.message); var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode,
batch: detail.batch,
inventoryStatus: detail.inventoryStatus,
}
itemList.push(result)
} }
});
}
})
})
return itemList;
}, },
setRecordParams(queryModel) { setRecordParams(queryModel) {

70
pages/transfer/job/receiptDetail.vue

@ -7,6 +7,9 @@
<view class="header_item"> <view class="header_item">
申请单号 : {{jobContent.requestNumber}} 申请单号 : {{jobContent.requestNumber}}
</view> </view>
<view class="header_item">
来源仓库 : {{jobContent.fromWarehouseCode}}
</view>
<u-line color="#D8D8D8" style="margin-bottom: 15rpx;margin-top: 10rpx;"></u-line> <u-line color="#D8D8D8" style="margin-bottom: 15rpx;margin-top: 10rpx;"></u-line>
</view> </view>
<view class="page-main"> <view class="page-main">
@ -37,7 +40,8 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> <win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack>
<!-- <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> -->
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> <detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<com-message ref="comMessage"></com-message> <com-message ref="comMessage"></com-message>
@ -57,7 +61,8 @@
navigateBack, navigateBack,
getPackingNumberAndBatch, getPackingNumberAndBatch,
getInventoryStatusName, getInventoryStatusName,
getDirectoryItemArray getDirectoryItemArray,
compareAsc
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -75,6 +80,7 @@
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import winScanPack from "@/mycomponents/scan/winScanPack.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import detailInfoPopup from '@/pages/transfer/coms/detailInfoPopup.vue' import detailInfoPopup from '@/pages/transfer/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
@ -85,7 +91,7 @@
winScanButton, winScanButton,
requiredLocation, requiredLocation,
comMessage, comMessage,
winScanPackAndLocation, winScanPack,
comDetailCard, comDetailCard,
detailInfoPopup, detailInfoPopup,
jobTop jobTop
@ -227,29 +233,45 @@
}, },
openScanPopup() { openScanPopup() {
let fromlocationCode = ''; this.$refs.scanPopup.openScanPopup();
let fromlocationList = []; },
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i]; getScanResult(result) {
item.subList.forEach(l => { try {
// var packingNumber = result.label.packingNumber;
var location = fromlocationList.filter(res => res.fromLocationCode != l.fromLocationCode) var batch = result.label.batch;
if (location.length == 0) { var qty = result.label.qty;
fromlocationList.push(l.fromLocationCode); var itemCode = result.label.itemCode;
} var detail = this.detailSource.find(r => r.itemCode == itemCode);
// if (detail == undefined) {
if (fromlocationCode == '') { this.showMessage("物料号【" + itemCode + "】不在列表中")
if (!l.scaned) { } else {
fromlocationCode = l.fromLocationCode; var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch);
if (itemDetail == undefined) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中")
} else {
if (itemDetail.scaned) {
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); //
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
var list = this.detailSource[0].subList;
} }
} }
})
} }
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
} catch (e) {
this.showErrorMessage(e.message)
}
},
getScanResult(result) { getScanResult1(result) {
try { try {
var packingNumber = result.label.packingNumber; var packingNumber = result.label.packingNumber;
var batch = result.label.batch; var batch = result.label.batch;
@ -273,7 +295,8 @@
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (this.jobContent.allowModifyInventoryStatus == "TRUE") { if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续入库?', res => { ']不一致,是否继续入库?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
@ -289,7 +312,8 @@
} }
}); });
} else { } else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => { ']不一致,不允许转移!', res => {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}); });

Loading…
Cancel
Save