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 物品代码

41
common/balance.js

@ -4,6 +4,47 @@ import {
getBalanceByFilter
} 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": [],

1
common/record.js

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

1
common/style/pdabasic.css

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

124
pages/putaway/record/putawayRecord.vue

@ -41,7 +41,8 @@
<script>
import {
putawayRequestSubmit,
putawayRecordSubmit
putawayRecordSubmit,
validateItemAndLocation
} from '@/api/request2.js';
import {
@ -63,7 +64,9 @@
} from '@/common/record.js';
import {
getManagementPrecisions
getManagementPrecisions,
getPrecisionStrategyList,
getPrecisionStrategyParamsByLocation
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -89,22 +92,16 @@
data() {
return {
id: '',
receiptJob: {},
received: false,
dataContent: {}, //
detailSource: [], //
locationTypeList: [],
businessTypeInfo: {},
fromLocationInfo: {},
fromLocationCode: "",
toLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [],
tolocationTypeList: [],
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
fromType: "",
showToLoaction: true
};
},
@ -240,40 +237,97 @@
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 => {
itemCodes.push(item.itemCode)
})
//
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 + "]")
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
res.locationCode == detail.toLocationCode &&
res.batch == detail.batch &&
res.inventoryStatus == detail.inventoryStatus) {
return res
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode,
batch: detail.batch,
inventoryStatus: detail.inventoryStatus,
}
itemList.push(result)
}
});
}
})
})
return itemList;
},
setRecordParams(queryModel) {

70
pages/transfer/job/receiptDetail.vue

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

Loading…
Cancel
Save