Browse Source

修改发料功能

wms3.0_pda
niexiting 12 months ago
parent
commit
b897fb611f
  1. 27
      common/balance.js
  2. 1
      mycomponents/qty/balanceQtyEdit.vue
  3. 1
      mycomponents/record/recordComDetailCard.vue
  4. 8
      pages/issue/coms/comScanIssuePack.vue
  5. 112
      pages/issue/job/issueDetail.vue
  6. 1
      pages/issue/js/issue.js
  7. 1
      pages/productDismantle/record/productDismantleRecord.vue
  8. 2
      static/config.json

27
common/balance.js

@ -1,4 +1,3 @@
import { import {
getManagementPrecision, getManagementPrecision,
getBalanceByFilter getBalanceByFilter
@ -38,7 +37,7 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) {
}) })
} }
export function getBalanceByManagementPrecision(label, locationCode,fromInventoryStatuses, callback) { export function getBalanceByManagementPrecision(label, locationCode, fromInventoryStatuses, callback) {
let result = { let result = {
list: [], list: [],
success: true, success: true,
@ -53,25 +52,25 @@ export function getBalanceByManagementPrecision(label, locationCode,fromInventor
let managementPrecision = res.data[0].ManagementPrecision; let managementPrecision = res.data[0].ManagementPrecision;
switch (managementPrecision) { switch (managementPrecision) {
case 'BY_PACKAGING': case 'BY_PACKAGING':
byPacking(label, locationCode,fromInventoryStatuses, res => { byPacking(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision; res.managementPrecision = managementPrecision;
callback(res); callback(res);
}); });
break; break;
case 'BY_BATCH': case 'BY_BATCH':
byBatch(label, locationCode,fromInventoryStatuses, res => { byBatch(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision; res.managementPrecision = managementPrecision;
callback(res); callback(res);
}); });
break; break;
case 'BY_QUANTITY': case 'BY_QUANTITY':
byQuantity(label, locationCode,fromInventoryStatuses, res => { byQuantity(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision; res.managementPrecision = managementPrecision;
callback(res); callback(res);
}); });
break; break;
case 'BY_UNIQUEID': case 'BY_UNIQUEID':
byUniqueId(label,fromInventoryStatuses, res => { byUniqueId(label, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision; res.managementPrecision = managementPrecision;
callback(res); callback(res);
}); });
@ -90,7 +89,7 @@ export function getBalanceByManagementPrecision(label, locationCode,fromInventor
* @param {Object} locationCode * @param {Object} locationCode
* @param {Object} callback * @param {Object} callback
*/ */
export function byPacking(label, locationCode,fromInventoryStatuses, callback) { export function byPacking(label, locationCode, fromInventoryStatuses, callback) {
let result = { let result = {
success: true, success: true,
message: '', message: '',
@ -117,7 +116,7 @@ export function byPacking(label, locationCode,fromInventoryStatuses, callback) {
action: "==", action: "==",
value: locationCode value: locationCode
}) })
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
action: "in", action: "in",
@ -157,7 +156,7 @@ export function byPacking(label, locationCode,fromInventoryStatuses, callback) {
* @param {Object} locationCode * @param {Object} locationCode
* @param {Object} callback * @param {Object} callback
*/ */
export function byBatch(label, locationCode,fromInventoryStatuses, callback) { export function byBatch(label, locationCode, fromInventoryStatuses, callback) {
var filters = [] var filters = []
filters.push({ filters.push({
column: "itemCode", column: "itemCode",
@ -175,7 +174,7 @@ export function byBatch(label, locationCode,fromInventoryStatuses, callback) {
value: locationCode value: locationCode
}) })
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
action: "in", action: "in",
@ -218,7 +217,7 @@ export function byBatch(label, locationCode,fromInventoryStatuses, callback) {
* @param {Object} locationCode * @param {Object} locationCode
* @param {Object} callback * @param {Object} callback
*/ */
export function byQuantity(label, locationCode,fromInventoryStatuses, callback) { export function byQuantity(label, locationCode, fromInventoryStatuses, callback) {
let result = { let result = {
success: true, success: true,
message: '', message: '',
@ -237,7 +236,7 @@ export function byQuantity(label, locationCode,fromInventoryStatuses, callback)
value: locationCode value: locationCode
}) })
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
action: "in", action: "in",
@ -274,7 +273,7 @@ export function byQuantity(label, locationCode,fromInventoryStatuses, callback)
* @param {Object} locationCode * @param {Object} locationCode
* @param {Object} callback * @param {Object} callback
*/ */
export function byUniqueId(label, locationCode,fromInventoryStatuses, callback) { export function byUniqueId(label, locationCode, fromInventoryStatuses, callback) {
let param = { let param = {
packingNumber: label.packingNumber packingNumber: label.packingNumber
}; };
@ -291,7 +290,7 @@ export function byUniqueId(label, locationCode,fromInventoryStatuses, callback)
value: label.packingNumber value: label.packingNumber
}) })
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
action: "in", action: "in",

1
mycomponents/qty/balanceQtyEdit.vue

@ -122,7 +122,6 @@
}, },
methods: { methods: {
openEditPopup(item, handleQty) { openEditPopup(item, handleQty) {
debugger;
this.dataContent = item this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus this.inventoryStatus = this.dataContent.inventoryStatus
this.toInventoryStatus = this.dataContent.toInventoryStatus this.toInventoryStatus = this.dataContent.toInventoryStatus

1
mycomponents/record/recordComDetailCard.vue

@ -141,7 +141,6 @@
edit(item) { edit(item) {
this.editItem = item; this.editItem = item;
debugger
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.qty); this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.qty);
}, },

8
pages/issue/coms/comScanIssuePack.vue

@ -205,7 +205,6 @@
this.showErrorMessage('发料库位【' + fromlocation + '】不存在') this.showErrorMessage('发料库位【' + fromlocation + '】不存在')
} }
}, },
onScan(result) { onScan(result) {
try { try {
let that = this; let that = this;
@ -233,8 +232,7 @@
title: '加载中', title: '加载中',
mask: true mask: true
}) })
getBalanceByManagementPrecision(result.label, that.fromLocationCode, "OK", balanceRes => {
getBalanceByManagementPrecision(result.label, that.fromLocationCode, balanceRes => {
if (balanceRes.success) { if (balanceRes.success) {
if (balanceRes.data.list.length == 0) { if (balanceRes.data.list.length == 0) {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录',
@ -359,7 +357,7 @@
inventoryStatus: balance.inventoryStatus, inventoryStatus: balance.inventoryStatus,
balance: balance, balance: balance,
toLocationCode: this.toLocationCode, toLocationCode: this.toLocationCode,
supplierCode:label.supplierCode supplierCode: label.supplierCode
} }
return record; return record;
}, },
@ -409,7 +407,7 @@
edit(item) { edit(item) {
this.editItem = item; this.editItem = item;
// item.balance.balanceQty = item.balance.qty; // item.balance.balanceQty = item.balance.qty;
item.balance.balanceQty=item.balance.qty; item.balance.balanceQty = item.balance.qty;
this.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty); this.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
}, },

112
pages/issue/job/issueDetail.vue

@ -197,43 +197,36 @@
}); });
}, },
submit() { // submit() {
//3. //3.
//:XXX //:XXX
// var isOutIn = getApp().globalData.feed_configList.filter( // var isOutIn = getApp().globalData.feed_configList.filter(
// res => { // res => {
// if (res.name == 'feed_isOutIn') { // if (res.name == 'feed_isOutIn') {
// return res; // return res;
// } // }
// }); // });
uni.showLoading({
title: '提交中...', // this.dataContent.itemCodeList.forEach(res => {
mask: true // if (res.handleQty > res.recommendQty) {
}) // this.$refs.modal.showConfirmMessageModal(',?', confirm => {
// if (confirm) {
this.submitJob(); // //
// uni.showToast({
// title: ""
// this.dataContent.itemCodeList.forEach(res => { // })
// if (res.handleQty > res.recommendQty) { // }
// this.$refs.modal.showConfirmMessageModal(',?', confirm => { // })
// if (confirm) { // } else {
// // // uni.showToast({
// uni.showToast({ // title: "" + res.handleQty + "][" + res.recommendQty + "]"
// title: "" // })
// }) // }
// } // })
// }) // },
// } else {
// uni.showToast({
// title: "" + res.handleQty + "][" + res.recommendQty + "]"
// })
// }
// })
},
submitJob() { submit() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -248,13 +241,13 @@
//使 //使
if (this.jobContent.useOnTheWayLocation == 'TRUE') { if (this.jobContent.useOnTheWayLocation == 'TRUE') {
this.submit(); this.submitJob();
} else { } else {
// //
getManagementPrecisions(itemCodes, locationCode, res => { getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
this.submit(); this.submitJob();
} else { } else {
uni.hideLoading(); uni.hideLoading();
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
@ -263,6 +256,23 @@
} }
}, },
submitJob() {
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
issueJobSubmit(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)
})
},
setParams() { setParams() {
var subList = [] var subList = []
var createTime = getCurrDateTime(); var createTime = getCurrDateTime();
@ -316,24 +326,6 @@
return this.jobContent; return this.jobContent;
}, },
submit() {
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
issueJobSubmit(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)
})
},
cancel() { cancel() {
let that = this; let that = this;
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的零件和目标库位信息?', res => { this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的零件和目标库位信息?', res => {
@ -415,6 +407,14 @@
this.$refs.comMessage.showCommitSuccess(); this.$refs.comMessage.showCommitSuccess();
}, },
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
uni.navigateTo({
url: './issueJob'
})
})
},
showRescanMessage(message) { showRescanMessage(message) {
this.$refs.comMessage.showRescanMessage(message); this.$refs.comMessage.showRescanMessage(message);
}, },

1
pages/issue/js/issue.js

@ -33,7 +33,6 @@ export function createDetailInfo(location, detail) {
item.Locations.push(location); item.Locations.push(location);
} else { } else {
//在库位下查找批次 //在库位下查找批次
debugger;
let batch = location.Batchs.find(r => r.batch == detail.batch); let batch = location.Batchs.find(r => r.batch == detail.batch);
if (batch == undefined) { if (batch == undefined) {
let batch = createBatchInfo(detail); let batch = createBatchInfo(detail);

1
pages/productDismantle/record/productDismantleRecord.vue

@ -137,7 +137,6 @@
mounted() {}, mounted() {},
methods: { methods: {
getScanResult(result) { getScanResult(result) {
debugger
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;

2
static/config.json

@ -18,7 +18,7 @@
"request_url": { "request_url": {
"name": "request_url", "name": "request_url",
"value": "http://dev.ccwin-in.com:25100/api/admin-api", "value": "http://192.168.0.230:12080/admin-api",
"dev2":"http://192.168.0.157:12080/admin-api", "dev2":"http://192.168.0.157:12080/admin-api",
"dev":"http://dev.ccwin-in.com:25100/api/admin-api", "dev":"http://dev.ccwin-in.com:25100/api/admin-api",
"local":"http://localhost:12080", "local":"http://localhost:12080",

Loading…
Cancel
Save