|
@ -1,7 +1,7 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="page-wraper"> |
|
|
<view class="page-wraper"> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> |
|
|
<com-blank-view @goScan='showRequestPopup' v-if="detailSource.length==0"></com-blank-view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="page-wraper" v-if="detailSource.length>0"> |
|
|
<view class="page-wraper" v-if="detailSource.length>0"> |
|
|
<view class="page-main"> |
|
|
<view class="page-main"> |
|
@ -44,7 +44,6 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
repleinshRequestSubmit, |
|
|
|
|
|
repleinshRecordSubmit, |
|
|
repleinshRecordSubmit, |
|
|
getBalanceByBatchOffShelf |
|
|
getBalanceByBatchOffShelf |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
@ -52,7 +51,7 @@ |
|
|
import { |
|
|
import { |
|
|
goHome, |
|
|
goHome, |
|
|
updateTitle, |
|
|
updateTitle, |
|
|
|
|
|
getCurrDateTime |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -77,6 +76,10 @@ |
|
|
getDataSource |
|
|
getDataSource |
|
|
} from '@/pages/issue/js/issue.js'; |
|
|
} from '@/pages/issue/js/issue.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
getManagementPrecisions |
|
|
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
@ -107,32 +110,22 @@ |
|
|
return { |
|
|
return { |
|
|
id: '', |
|
|
id: '', |
|
|
receiptJob: {}, |
|
|
receiptJob: {}, |
|
|
received: false, |
|
|
|
|
|
isShowPackingCode: true, |
|
|
|
|
|
scanCount: 0, |
|
|
|
|
|
dataContent: {}, //任务内容 |
|
|
|
|
|
subList: [], //接口返回的任务subList |
|
|
subList: [], //接口返回的任务subList |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
locationTypeList: [], |
|
|
locationTypeList: [], |
|
|
toLocationInfo: {}, |
|
|
|
|
|
businessTypeInfo: {}, |
|
|
businessTypeInfo: {}, |
|
|
fromLocationInfo: {}, |
|
|
|
|
|
fromLocationCode: "", |
|
|
fromLocationCode: "", |
|
|
toLocationInfo: {}, |
|
|
|
|
|
toLocationCode: "", |
|
|
toLocationCode: "", |
|
|
isShowLocation: false, |
|
|
|
|
|
fromlocationTypeList: [], |
|
|
fromlocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
allowModifyLocation: false, |
|
|
allowModifyLocation: false, |
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
|
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
|
|
|
businessType: {}, |
|
|
businessType: {}, |
|
|
fromType: "", |
|
|
|
|
|
requestList: [], |
|
|
requestList: [], |
|
|
|
|
|
managementList: [], |
|
|
|
|
|
dataContent: {} |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
this.fromType = option.fromType |
|
|
|
|
|
var typeCode = "Repleinment" |
|
|
var typeCode = "Repleinment" |
|
|
getBusinessType(typeCode, res => { |
|
|
getBusinessType(typeCode, res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
@ -303,9 +296,6 @@ |
|
|
this.$forceUpdate(); |
|
|
this.$forceUpdate(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
removeItem(index, item) { |
|
|
removeItem(index, item) { |
|
|
this.detailSource.splice(index, 1) |
|
|
this.detailSource.splice(index, 1) |
|
|
}, |
|
|
}, |
|
@ -346,91 +336,104 @@ |
|
|
this.toLocationCode = location; |
|
|
this.toLocationCode = location; |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
submit() { |
|
|
commit() { |
|
|
|
|
|
if (this.toLocationCode == "") { |
|
|
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "提交中....", |
|
|
title: "提交中....", |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (this.fromType == "requestType") { |
|
|
//目前任务只到一个库位 |
|
|
var params = this.setRequestParams(); |
|
|
var itemCodes = [] |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
let locationCode = this.detailSource[0].toLocationCode |
|
|
|
|
|
this.detailSource.forEach(toLocation => { |
|
|
|
|
|
toLocation.Items.forEach(item => { |
|
|
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
// repleinshRequestSubmit(params).then(res => { |
|
|
//获取管理模式,封装参数 |
|
|
// uni.hideLoading() |
|
|
getManagementPrecisions(itemCodes, locationCode, res => { |
|
|
// if (res.data) { |
|
|
if (res.success) { |
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
this.managementList = res.list; |
|
|
// } else { |
|
|
this.submitJob(); |
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
|
|
// } |
|
|
|
|
|
// }).catch(error => { |
|
|
|
|
|
// uni.hideLoading() |
|
|
|
|
|
// this.showErrorMessage(error) |
|
|
|
|
|
// }) |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
// repleinshRecordSubmit(params).then(res => { |
|
|
uni.hideLoading(); |
|
|
// uni.hideLoading() |
|
|
this.showErrorMessage(res.message); |
|
|
// if (res.data) { |
|
|
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
|
|
// } |
|
|
|
|
|
// }).catch(error => { |
|
|
|
|
|
// uni.hideLoading() |
|
|
|
|
|
// this.showErrorMessage(error) |
|
|
|
|
|
// }) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setParams() { |
|
|
submitJob() { |
|
|
var subList = [] |
|
|
var params = this.setParams() |
|
|
this.detailSource.forEach(item => { |
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
item.subList.forEach(detail => { |
|
|
|
|
|
if (detail.scaned) { |
|
|
repleinshRecordSubmit(params).then(res => { |
|
|
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
uni.hideLoading() |
|
|
// detail.packingNumber, detail.batch); |
|
|
if (res.data) { |
|
|
// detail.toPackingNumber =info.packingNumber; |
|
|
this.showCommitSuccessMessage("提交成功<br>生成补料记录<br>" + res.data) |
|
|
// detail.toBatch =info.batch; |
|
|
} else { |
|
|
subList.push(detail) |
|
|
this.showErrorMessage("提交失败:" + res.msg) |
|
|
} |
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.showErrorMessage(error) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
return subList; |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
setParams() { |
|
|
setRequestParams() { |
|
|
|
|
|
var subList = [] |
|
|
var subList = [] |
|
|
var supplierCode = "" |
|
|
var createTime = getCurrDateTime(); |
|
|
this.detailSource.forEach(item => { |
|
|
var creator = this.$store.state.user.id |
|
|
item.subList.forEach(detail => { |
|
|
this.detailSource.forEach(toLocationCode => { |
|
|
if (detail.scaned) { |
|
|
toLocationCode.Items.forEach(item => { |
|
|
if (supplierCode == "") { |
|
|
item.Locations.forEach(fromLocation => { |
|
|
supplierCode = detail.package.supplierCode |
|
|
fromLocation.Batchs.forEach(batch => { |
|
|
} |
|
|
let subItem = batch.detail; |
|
|
subList.push(detail) |
|
|
subItem.recordList = []; |
|
|
|
|
|
if (batch.Records.length > 0) { |
|
|
|
|
|
batch.Records.forEach(r => { |
|
|
|
|
|
let record = {}; |
|
|
|
|
|
record.handleQty = r.qty; |
|
|
|
|
|
|
|
|
|
|
|
record.fromPackingNumber = r |
|
|
|
|
|
.packingNumber; |
|
|
|
|
|
record.fromBatch = r.batch; |
|
|
|
|
|
record.fromContainerNumber = r |
|
|
|
|
|
.ContainerNumber; |
|
|
|
|
|
|
|
|
|
|
|
record.toContainerNumber = r |
|
|
|
|
|
.ContainerNumber; |
|
|
|
|
|
record.toInventoryStatus = r |
|
|
|
|
|
.inventoryStatus; |
|
|
|
|
|
record.toLocationCode = subItem |
|
|
|
|
|
.toLocationCode; |
|
|
|
|
|
record.fromLocationCode = fromLocation.fromLocationCode |
|
|
|
|
|
record.supplierCode = r.supplierCode; |
|
|
|
|
|
|
|
|
|
|
|
var info = getPackingNumberAndBatch( |
|
|
|
|
|
this.managementList, r |
|
|
|
|
|
.itemCode, |
|
|
|
|
|
r.packingNumber, r |
|
|
|
|
|
.batch); |
|
|
|
|
|
record.toPackingNumber = info |
|
|
|
|
|
.packingNumber; |
|
|
|
|
|
record.toBatch = info.batch; |
|
|
|
|
|
subItem.recordList.push(record); |
|
|
|
|
|
}) |
|
|
|
|
|
subList.push(subItem); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
this.dataContent.subList = subList |
|
|
this.dataContent.subList = subList |
|
|
this.dataContent.supplierCode = supplierCode |
|
|
this.dataContent.createTime = createTime; |
|
|
this.dataContent.businessType = "PurchasePutaway" |
|
|
this.dataContent.creator = creator; |
|
|
this.dataContent.departmentCode = "研发部门"; |
|
|
|
|
|
this.dataContent.status = 1; |
|
|
|
|
|
this.dataContent.autoCommit = "FALSE"; |
|
|
|
|
|
this.dataContent.autoAgree = "FALSE"; |
|
|
|
|
|
this.dataContent.autoExecute = "FALSE"; |
|
|
|
|
|
this.dataContent.directCreateRecord = "FALSE"; |
|
|
|
|
|
return this.dataContent; |
|
|
return this.dataContent; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
showMessage(message) { |
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
if (res) {} |
|
|
if (res) {} |
|
@ -459,7 +462,6 @@ |
|
|
this.getToLocationCode(location, code) |
|
|
this.getToLocationCode(location, code) |
|
|
}, |
|
|
}, |
|
|
getFromLocationCode(location, code) { |
|
|
getFromLocationCode(location, code) { |
|
|
this.fromLocationInfo = location; |
|
|
|
|
|
this.fromLocationCode = code; |
|
|
this.fromLocationCode = code; |
|
|
this.openScanPopup(); |
|
|
this.openScanPopup(); |
|
|
}, |
|
|
}, |
|
@ -477,11 +479,16 @@ |
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
showCommitSuccessMessage(hint) { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.fromLocationCode = ''; |
|
|
this.clearData(); |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
clearData() { |
|
|
|
|
|
this.fromLocationCode = ''; |
|
|
|
|
|
this.detailSource = []; |
|
|
|
|
|
this.requestList = []; |
|
|
|
|
|
this.dataContent = {} |
|
|
|
|
|
this.managementList = [] |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|