Browse Source

库存转移任务

wms3.0_pda
lijuncheng 11 months ago
parent
commit
7c1667420a
  1. 3
      pages/inventoryMove/job/inventoryMoveDetail.vue
  2. 162
      pages/transfer/coms/comTransferRecord.vue
  3. 2
      pages/transfer/record/deliverRecord.vue
  4. 2
      static/config.json

3
pages/inventoryMove/job/inventoryMoveDetail.vue

@ -351,6 +351,7 @@
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
inventoryMoveSubmit(params).then(res => {
@ -380,7 +381,7 @@
if (detail.scaned) {
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode
&&res.locationCode == detail.locationCode) {
&&res.locationCode == detail.toLocationCode) {
return res
}
})

162
pages/transfer/coms/comTransferRecord.vue

@ -49,9 +49,13 @@
transferIssueRecordSubmit,
transferReceiptRecordSubmit
} from '@/api/request2.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
goHome,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
@ -116,12 +120,15 @@
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
managementList:[],
dataContent: {}
};
},
mounted(option) {
var typeCode =""
if(this.transferType=="TransferDeliver"){
typeCode = "TransferDeliver"
if(this.transferType=="Transfer"){
typeCode = "Transfer"
}else if(this.transferType=="TransferReceipt"){
typeCode = "TransferReceipt"
}
@ -251,57 +258,119 @@
this.showMessage("请先选择目标库位")
return;
}
//
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams();
console.log("提交" + JSON.stringify(params))
if(this.transferType=="transferIssue"){
// transferIssueRecordSubmit(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)
// })
if(this.detailSource.length > 0 && this.detailSource[0].subList.length > 0){
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
}else if(this.transferType=="transferReceipt"){
// transferReceiptRecordSubmit(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)
// })
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
if(this.transferType=="Transfer"){
transferIssueRecordSubmit(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 if(this.transferType=="TransferReceipt"){
// transferReceiptRecordSubmit(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 {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
}else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
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.locationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch);
// detail.toPackingNumber =info.packingNumber;
// detail.toBatch =info.batch;
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.locationCode, detail.batch);
detail.itemCode = detail.itemCode;
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch =info.batch;
detail.toBatch = info.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.locationCode;
subList.push(detail)
}
})
})
return subList;
this.dataContent.subList =subList;
this.dataContent.creator =creator;
return this.dataContent;
},
@ -338,14 +407,13 @@
this.openScanPopup();
},
getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.ToLocationCodeInfo = location;
// if (this.fromLocationCode == code) {
// uni.showToast({
// title: "[" + this.fromLocationCode + "][" + code + "]",
// duration: 2000
// })
// return
// }
this.toLocationCode = code;
},

2
pages/transfer/record/deliverRecord.vue

@ -1,6 +1,6 @@
<template>
<view class="page-wraper">
<comTransferRecord transferType="TransferDeliver"> </comTransferRecord>
<comTransferRecord transferType="Transfer"> </comTransferRecord>
</view>
</template>

2
static/config.json

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

Loading…
Cancel
Save