|
@ -17,13 +17,12 @@ |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" |
|
|
|
|
|
@getLocation='getToLocationCode' :locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
|
|
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
<view class="page-footer"> |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
|
|
|
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" |
|
|
|
|
|
@getLocation='getToLocationCode' :locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
</view> |
|
|
</view> |
|
|
<view class=" uni-flex uni-row"> |
|
|
<view class=" uni-flex uni-row"> |
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
@ -42,7 +41,8 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
putawayRequestSubmit, |
|
|
putawayRequestSubmit, |
|
|
putawayRecordSubmit |
|
|
putawayRecordSubmit, |
|
|
|
|
|
validateItemAndLocation |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -56,12 +56,6 @@ |
|
|
getDirectoryItemArray |
|
|
getDirectoryItemArray |
|
|
} from '@/common/directory.js'; |
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
getDetailOption, |
|
|
|
|
|
getDetailRemoveOption, |
|
|
|
|
|
getDetailEditRemoveOption |
|
|
|
|
|
} from '@/common/array.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getBusinessType, |
|
|
getBusinessType, |
|
|
createItemInfo, |
|
|
createItemInfo, |
|
@ -70,7 +64,9 @@ |
|
|
} from '@/common/record.js'; |
|
|
} from '@/common/record.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getManagementPrecisions |
|
|
getManagementPrecisions, |
|
|
|
|
|
getPrecisionStrategyList, |
|
|
|
|
|
getPrecisionStrategyParamsByLocation |
|
|
} from '@/common/balance.js'; |
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
@ -96,35 +92,20 @@ |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
id: '', |
|
|
id: '', |
|
|
receiptJob: {}, |
|
|
|
|
|
received: false, |
|
|
|
|
|
dataContent: {}, //内容 |
|
|
dataContent: {}, //内容 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
locationTypeList: [], |
|
|
|
|
|
businessTypeInfo: {}, |
|
|
|
|
|
fromLocationInfo: {}, |
|
|
fromLocationInfo: {}, |
|
|
fromLocationCode: "", |
|
|
fromLocationCode: "", |
|
|
toLocationCode: "", |
|
|
toLocationCode: "", |
|
|
isShowLocation: false, |
|
|
|
|
|
fromlocationTypeList: [], |
|
|
fromlocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
businessType: {}, |
|
|
businessType: {}, |
|
|
fromType: "", |
|
|
|
|
|
showToLoaction: true |
|
|
showToLoaction: true |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
this.fromType = option.fromType |
|
|
|
|
|
if (this.fromType == "requestType") { |
|
|
|
|
|
this.showToLoaction = false |
|
|
|
|
|
updateTitle("原料上架申请") |
|
|
|
|
|
} else { |
|
|
|
|
|
updateTitle("原料上架记录") |
|
|
|
|
|
this.showToLoaction = true |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
var typeCode = "PurchasePutaway" |
|
|
var typeCode = "PurchasePutaway" |
|
|
getBusinessType(typeCode, res => { |
|
|
getBusinessType(typeCode, res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
@ -188,10 +169,10 @@ |
|
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
showErrorMessage(message) { |
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
if (res) { |
|
|
if (res) {} |
|
|
} |
|
|
|
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
calcHandleQty() { |
|
|
calcHandleQty() { |
|
|
for (let item of this.detailSource) { |
|
|
for (let item of this.detailSource) { |
|
|
item.qty = 0; |
|
|
item.qty = 0; |
|
@ -207,6 +188,7 @@ |
|
|
updateData() { |
|
|
updateData() { |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
removeItem(index, item) { |
|
|
removeItem(index, item) { |
|
|
this.detailSource.splice(index, 1) |
|
|
this.detailSource.splice(index, 1) |
|
|
}, |
|
|
}, |
|
@ -228,6 +210,7 @@ |
|
|
} |
|
|
} |
|
|
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); |
|
|
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showFromLocationPopup() { |
|
|
showFromLocationPopup() { |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.$refs.scanLocationCode.openScanPopup(); |
|
|
this.$refs.scanLocationCode.openScanPopup(); |
|
@ -254,115 +237,122 @@ |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
//查询库位零件关系 |
|
|
title: "提交中....", |
|
|
|
|
|
mask: true |
|
|
// uni.showLoading({ |
|
|
|
|
|
// title: "提交中....", |
|
|
|
|
|
// mask: true |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
//记录有目标库位,需要查询管理模式 |
|
|
|
|
|
|
|
|
|
|
|
//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; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (this.fromType == "requestType") { |
|
|
let precisionStrategyParams = getPrecisionStrategyParamsByLocation(this.detailSource, this.toLocationCode); |
|
|
var params = this.setRequestParams() |
|
|
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
return; |
|
|
// putawayRequestSubmit(params).then(res => { |
|
|
|
|
|
// uni.hideLoading() |
|
|
//2:获取管理模式,封装参数 |
|
|
// if (res.data) { |
|
|
// getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
// if (res.success) { |
|
|
// } else { |
|
|
// this.managementList = res.list; |
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
// var params = this.setRecordParams(true) |
|
|
// } |
|
|
// console.log("提交参数", JSON.stringify(params)); |
|
|
// }).catch(error => { |
|
|
|
|
|
// uni.hideLoading() |
|
|
// putawayRecordSubmit(params).then(res => { |
|
|
// this.showErrorMessage(error) |
|
|
// uni.hideLoading() |
|
|
// }) |
|
|
// if (res.data) { |
|
|
} else { |
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购上架记录" + res.data, ) |
|
|
//记录有目标库位,需要查询管理模式 |
|
|
// } else { |
|
|
var itemCodes = [] |
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
this.detailSource.forEach(item => { |
|
|
// } |
|
|
itemCodes.push(item.itemCode) |
|
|
// }).catch(error => { |
|
|
}) |
|
|
// uni.hideLoading() |
|
|
//获取管理模式,封装参数 |
|
|
// this.showErrorMessage(error) |
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
// }) |
|
|
if (res.success) { |
|
|
// } else { |
|
|
this.managementList = res.list; |
|
|
// uni.hideLoading(); |
|
|
var params = this.setRecordParams(true) |
|
|
// this.showErrorMessage(res.message); |
|
|
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); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setRecordParams(queryModel) { |
|
|
|
|
|
var subList = [] |
|
|
getItemAndLocationRelations() { |
|
|
var creator = this.$store.state.user.id |
|
|
var itemList = [] |
|
|
this.detailSource.forEach(item => { |
|
|
this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
item.subList.forEach(detail => { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned) { |
|
|
if (queryModel) { |
|
|
detail.toLocationCode = this.toLocationCode; |
|
|
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
var filterResult = itemList.filter(res => { |
|
|
detail.packingNumber, detail.batch); |
|
|
if (res.itemCode == item.itemCode && |
|
|
detail.toPackingNumber = info.packingNumber;; |
|
|
res.locationCode == detail.toLocationCode && |
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
res.batch == detail.batch && |
|
|
detail.toBatch = info.batch; |
|
|
res.inventoryStatus == detail.inventoryStatus) { |
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
return res |
|
|
detail.toLocationCode = this.toLocationCode |
|
|
} |
|
|
} else { |
|
|
}) |
|
|
// detail.toPackingNumber = detail.packingNumber; |
|
|
//去掉重复元素 |
|
|
// detail.toContainerNumber = detail.containerNumber |
|
|
if (filterResult.length == 0) { |
|
|
// detail.toBatch = detail.toBatch; |
|
|
var result = { |
|
|
// detail.toInventoryStatus = detail.inventoryStatus |
|
|
itemCode: item.itemCode, |
|
|
// detail.toLocationCode = "" |
|
|
locationCode: detail.toLocationCode, |
|
|
|
|
|
batch: detail.batch, |
|
|
|
|
|
inventoryStatus: detail.inventoryStatus, |
|
|
|
|
|
} |
|
|
|
|
|
itemList.push(result) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
subList.push(detail) |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
this.dataContent.subList = subList |
|
|
return itemList; |
|
|
this.dataContent.creator = creator; |
|
|
|
|
|
return this.dataContent; |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setRequestParams(){ |
|
|
setRecordParams(queryModel) { |
|
|
var subList = [] |
|
|
var subList = [] |
|
|
var supplierCode="" |
|
|
var creator = this.$store.state.user.id |
|
|
this.detailSource.forEach(item => { |
|
|
this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
item.subList.forEach(detail => { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned) { |
|
|
if(supplierCode==""){ |
|
|
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
supplierCode = detail.package.supplierCode |
|
|
detail.packingNumber, detail.batch); |
|
|
} |
|
|
detail.toPackingNumber = info.packingNumber;; |
|
|
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
|
|
detail.toBatch = info.batch; |
|
|
|
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
|
|
detail.toLocationCode = this.toLocationCode |
|
|
|
|
|
detail.package = null; |
|
|
subList.push(detail) |
|
|
subList.push(detail) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
this.dataContent.subList = subList |
|
|
this.dataContent.subList = subList |
|
|
this.dataContent.supplierCode = supplierCode |
|
|
this.dataContent.creator = creator; |
|
|
this.dataContent.businessType = "PurchasePutaway" |
|
|
|
|
|
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) {} |
|
|