|
@ -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> |
|
@ -56,12 +55,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, |
|
@ -116,15 +109,6 @@ |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
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 +172,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 +191,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 +213,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(); |
|
@ -259,110 +245,60 @@ |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (this.fromType == "requestType") { |
|
|
//记录有目标库位,需要查询管理模式 |
|
|
var params = this.setRequestParams() |
|
|
var itemCodes = [] |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
|
|
// putawayRequestSubmit(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 { |
|
|
|
|
|
//记录有目标库位,需要查询管理模式 |
|
|
|
|
|
var itemCodes = [] |
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
|
|
}) |
|
|
|
|
|
//获取管理模式,封装参数 |
|
|
|
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.managementList = res.list; |
|
|
|
|
|
var params = this.setRecordParams(true) |
|
|
|
|
|
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 = [] |
|
|
|
|
|
var creator = this.$store.state.user.id |
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
itemCodes.push(item.itemCode) |
|
|
if (detail.scaned) { |
|
|
}) |
|
|
if (queryModel) { |
|
|
//获取管理模式,封装参数 |
|
|
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
detail.packingNumber, detail.batch); |
|
|
if (res.success) { |
|
|
detail.toPackingNumber = info.packingNumber;; |
|
|
this.managementList = res.list; |
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
var params = this.setRecordParams(true) |
|
|
detail.toBatch = info.batch; |
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
|
|
detail.toLocationCode = this.toLocationCode |
|
|
putawayRecordSubmit(params).then(res => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成采购上架记录" + res.data, ) |
|
|
} else { |
|
|
} else { |
|
|
// detail.toPackingNumber = detail.packingNumber; |
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
// detail.toContainerNumber = detail.containerNumber |
|
|
|
|
|
// detail.toBatch = detail.toBatch; |
|
|
|
|
|
// detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
|
|
// detail.toLocationCode = "" |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.showErrorMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
this.showErrorMessage(res.message); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
subList.push(detail) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
this.dataContent.subList = subList |
|
|
|
|
|
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) {} |
|
|