Browse Source

添加管理模式多个参数查询

wms3.0_pda
lijuncheng 11 months ago
parent
commit
c006e5d2db
  1. 23
      api/request2.js
  2. 32
      common/balance.js
  3. 37
      common/basic.js
  4. 134
      pages/inventoryMove/job/inventoryMoveDetail.vue
  5. 2
      static/config.json

23
api/request2.js

@ -2081,8 +2081,8 @@ export function transferReceiptJobSubmit(params) {
*/ */
export function transferReceiptRecordSubmit(params) { export function transferReceiptRecordSubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit", url: baseApi + "/wms/transferreceipt-record-main/create",
method: "put", method: "post",
data: params, data: params,
}); });
} }
@ -2162,8 +2162,8 @@ export function transferIssueJobSubmit(params) {
*/ */
export function transferIssueRecordSubmit(params) { export function transferIssueRecordSubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit", url: baseApi + "/wms/transferissue-record-main/create",
method: "put", method: "post",
data: params, data: params,
}); });
} }
@ -3012,6 +3012,21 @@ export function getBalanceByFilter(param) {
}); });
} }
/**
* 查询管理精度多个零件多个库位
* @param {*}
*
*/
export function getPrecisionStrategy(param) {
return request({
url: baseApi + "/wms/rule/getPrecisionStrategy",
method: "post",
data: param,
});
}
/** /**
* 删除文件 * 删除文件

32
common/balance.js

@ -1,8 +1,40 @@
import { import {
getManagementPrecision, getManagementPrecision,
getPrecisionStrategy,
getBalanceByFilter getBalanceByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
/**
* "itemCode": [],
"locationCode":"INSPECT"
管理精度策略
* @param {*}
*
*/
export function getPrecisionStrategyList(itemList, callback) {
// let jsonParem = JSON.stringify(param)
let result = {
list: [],
success: true,
message: ''
};
getPrecisionStrategy(itemList).then(res => {
if (res.data == null) {
result.success = false
result.message = '未查询到管理精度信息'
} else {
result.list = res.data;
}
callback(result);
}).catch(error => {
result.success = false;
result.message = error;
callback(result);
})
}
/** /**
* "itemCode": [], * "itemCode": [],
"locationCode":"INSPECT" "locationCode":"INSPECT"

37
common/basic.js

@ -606,6 +606,43 @@ export function getInspectReasonList(value) {
// else return 'Other' // else return 'Other'
// } // }
export function getPackingNumberAndBatchByList(managementList, itemCode, packingNumber,locationCode, batch) {
var itemInfo = {
packingNumber: "",
batch: ""
}
var manageType = queryManageModelByList(managementList, itemCode,locationCode)
if (manageType == "BY_QUANTITY") {
itemInfo.packingNumber = ""
itemInfo.batch = ""
} else if (manageType == "BY_BATCH") {
itemInfo.packingNumber = ""
itemInfo.batch = batch
} else if (manageType == "BY_PACKAGING") {
itemInfo.packingNumber = packingNumber
itemInfo.batch = batch
} else if (manageType == "BY_UNIQUE_ID") {
itemInfo.packingNumber = packingNumber
itemInfo.batch = batch
}
return itemInfo;
}
export function queryManageModelByList(managementList, itemCode,locationCode) {
var result = managementList.filter(res => {
if (res.itemCode == itemCode&&res.locationCode==locationCode) {
return res.ManagementPrecision
}
})
if (result != undefined) {
return result[0].ManagementPrecision
} else {
return ""
}
}
// 获取业务类型字典项 // 获取业务类型字典项
export function getBusinessTypeDesc(type) { export function getBusinessTypeDesc(type) {

134
pages/inventoryMove/job/inventoryMoveDetail.vue

@ -48,7 +48,8 @@
inventoryMoveSubmit inventoryMoveSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
getManagementPrecisions getManagementPrecisions,
getPrecisionStrategyList
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
@ -61,7 +62,7 @@
updateTitle, updateTitle,
navigateBack, navigateBack,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch, getPackingNumberAndBatchByList,
getInventoryStatusName getInventoryStatusName
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -203,7 +204,7 @@
this.scanPopupGetFocus(); this.scanPopupGetFocus();
} }
}, },
openDetail(item) { openDetail(item) {
this.$refs.jobDetailPopup.openPopup(item) this.$refs.jobDetailPopup.openPopup(item)
}, },
@ -264,16 +265,17 @@
} else { } else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
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;
itemDetail.handleQty = Number(result.balance.qty) ; itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus; itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance; itemDetail.balance = result.balance;
itemDetail.balance.balanceQty =Number(result.balance.qty) ; itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty) itemDetail.balance.stdPackQty = Number(result.package.stdPackQty)
itemDetail.balance.stdPackUnit = result.package.stdPackUnit itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
@ -281,15 +283,16 @@
this.scanPopupGetFocus(); this.scanPopupGetFocus();
} }
}); });
}else { } else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => { ']不一致,不允许转移!', res => {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}); });
} }
}else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty) ; itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus; itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance; itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty); itemDetail.balance.balanceQty = Number(result.balance.qty);
@ -297,27 +300,6 @@
itemDetail.balance.stdPackUnit = result.package.stdPackUnit itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} }
// if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
// this.showQuestionMessage('[' + balanceStatus + '][' + itemStatus +
// '],?', res => {
// if (res) {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty) ;
// itemDetail.toInventoryStatus = result.balance.inventoryStatus;
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.stdPackQty = result.package.stdPackQty
// itemDetail.balance.stdPackUnit = result.package.stdPackUnit
// this.calcHandleQty();
// } else {
// this.scanPopupGetFocus();
// }
// });
// } else {
// }
} }
} }
} }
@ -362,35 +344,59 @@
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
this.managementList = [];
//
// this.detailSource.forEach(item => {
// item.subList.forEach(detail => {
// if (detail.scaned) {
// getManagementPrecisions(item.itemCode,detail.toLocationCode,res=>{
// if (res.success) {
// this.managementList = this.managementList.concat(res.list)
// }
// })
// }
// })
// })
var params = this.setParams(); //
console.log("提交" + JSON.stringify(params)) this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
inventoryMoveSubmit(params).then(res => { getPrecisionStrategyList(precisionStrategParams, res => {
uni.hideLoading() if (res.success) {
if (res.data) { this.managementList = res.list;
this.showCommitSuccessMessage("提交成功<br>生成库存转移记录<br>" + res.data) var params = this.setParams()
console.log("提交" + JSON.stringify(params))
inventoryMoveSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成库存转移记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") uni.hideLoading();
this.showErrorMessage(res.message);
} }
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
}) })
},
setPrecisionStrategParams(){
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode
&&res.locationCode == detail.locationCode) {
return res
}
})
//
if(filterResult.length==0){
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
}, },
setParams() { setParams() {
@ -400,12 +406,12 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
detail.toPackingNumber = detail.packingNumber; detail.toPackingNumber = info.packingNumber;
detail.toBatch = detail.batch; detail.toBatch = info.batch;
detail.toContainerNumber = ''; detail.toContainerNumber = '';
detail.toLocationCode = detail.toLocationCode; detail.toLocationCode = detail.toLocationCode;
subList.push(detail) subList.push(detail)
} }
@ -478,7 +484,7 @@
navigateBack(1) navigateBack(1)
}) })
}, },
} }
} }

2
static/config.json

@ -18,7 +18,7 @@
"request_url": { "request_url": {
"name": "request_url", "name": "request_url",
"value": "http://192.168.0.230:12080/admin-api", "value": "http://192.168.0.159:12080/admin-api",
"dev2": "http://192.168.0.157:12080/admin-api", "dev2": "http://192.168.0.157:12080/admin-api",
"chefang": "http://192.168.0.180:12080/admin-api", "chefang": "http://192.168.0.180:12080/admin-api",
"chenxinming": "http://192.168.0.230:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api",

Loading…
Cancel
Save