|
@ -21,8 +21,8 @@ |
|
|
<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" |
|
|
<!-- <requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" |
|
|
@getLocation='getToLocationCode' :locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
@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,14 +42,15 @@ |
|
|
import { |
|
|
import { |
|
|
putawayRequestSubmit, |
|
|
putawayRequestSubmit, |
|
|
putawayRecordSubmit, |
|
|
putawayRecordSubmit, |
|
|
validateItemAndLocation |
|
|
validateItemAndLocation, |
|
|
|
|
|
getPutawayRecommendLocation |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
goHome, |
|
|
goHome, |
|
|
updateTitle, |
|
|
updateTitle, |
|
|
getCurrDateTime, |
|
|
getCurrDateTime, |
|
|
getPackingNumberAndBatch |
|
|
getPackingNumberAndBatchByList |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
import { |
|
|
import { |
|
|
getInventoryStatusDesc, |
|
|
getInventoryStatusDesc, |
|
@ -66,7 +67,7 @@ |
|
|
import { |
|
|
import { |
|
|
getManagementPrecisions, |
|
|
getManagementPrecisions, |
|
|
getPrecisionStrategyList, |
|
|
getPrecisionStrategyList, |
|
|
getPrecisionStrategyParamsByLocation |
|
|
getPrecisionStrategyParams |
|
|
} from '@/common/balance.js'; |
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
@ -102,7 +103,8 @@ |
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
businessType: {}, |
|
|
businessType: {}, |
|
|
showToLoaction: true |
|
|
showToLoaction: true, |
|
|
|
|
|
recommendLocationList: [] //推荐库位列表 |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
@ -130,6 +132,7 @@ |
|
|
onPullDownRefresh() {}, |
|
|
onPullDownRefresh() {}, |
|
|
|
|
|
|
|
|
mounted() {}, |
|
|
mounted() {}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
let balance = result.balance; |
|
|
let balance = result.balance; |
|
@ -141,10 +144,15 @@ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
|
|
|
// 获取推荐库位 |
|
|
|
|
|
this.getRecommendLocation(balance, pack, toLocationCode => { |
|
|
var itemp = createItemInfo(balance, pack); |
|
|
var itemp = createItemInfo(balance, pack); |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
|
|
newDetail.toLocationCode = toLocationCode; |
|
|
itemp.subList.push(newDetail); |
|
|
itemp.subList.push(newDetail); |
|
|
this.detailSource.push(itemp) |
|
|
this.detailSource.push(itemp) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
var detail = item.subList.find(r => { |
|
|
var detail = item.subList.find(r => { |
|
|
if (r.packingNumber == balance.packingNumber && |
|
|
if (r.packingNumber == balance.packingNumber && |
|
@ -164,7 +172,33 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//获取推荐库位 |
|
|
|
|
|
getRecommendLocation(balance, pack, callback) { |
|
|
|
|
|
let recommend = this.recommendLocationList.find(r => r.itemCode == balance.itemCode); |
|
|
|
|
|
if (recommend == undefined) { |
|
|
|
|
|
let param = { |
|
|
|
|
|
itemCode: balance.itemCode, |
|
|
|
|
|
batch: balance.batch, |
|
|
|
|
|
inventoryStatus: balance.inventoryStatus, |
|
|
|
|
|
supplierCode: pack.supplierCode |
|
|
|
|
|
}; |
|
|
|
|
|
console.log(JSON.stringify(param)) |
|
|
|
|
|
getPutawayRecommendLocation(param).then(res => { |
|
|
|
|
|
this.recommendLocationList.push({ |
|
|
|
|
|
itemCode: balance.itemCode, |
|
|
|
|
|
locationCode: res.data.code |
|
|
|
|
|
}) |
|
|
|
|
|
callback(res.data.code); |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.showErrorMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
callback(recommend.locationCode); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
showErrorMessage(message) { |
|
@ -215,8 +249,8 @@ |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.$refs.scanLocationCode.openScanPopup(); |
|
|
this.$refs.scanLocationCode.openScanPopup(); |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
closeScanPopup() { |
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
}, |
|
|
}, |
|
@ -232,11 +266,6 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
commit() { |
|
|
commit() { |
|
|
if (this.showToLoaction && this.toLocationCode == "") { |
|
|
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//查询库位零件关系 |
|
|
//查询库位零件关系 |
|
|
|
|
|
|
|
|
// uni.showLoading({ |
|
|
// uni.showLoading({ |
|
@ -245,56 +274,30 @@ |
|
|
// }); |
|
|
// }); |
|
|
|
|
|
|
|
|
//记录有目标库位,需要查询管理模式 |
|
|
//记录有目标库位,需要查询管理模式 |
|
|
|
|
|
let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource); |
|
|
//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; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
let precisionStrategyParams = getPrecisionStrategyParamsByLocation(this.detailSource, this.toLocationCode); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
//2:获取管理模式,封装参数 |
|
|
//2:获取管理模式,封装参数 |
|
|
// getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
getPrecisionStrategyList(precisionStrategyParams, this.toLocationCode, res => { |
|
|
// if (res.success) { |
|
|
if (res.success) { |
|
|
// this.managementList = res.list; |
|
|
this.managementList = res.list; |
|
|
// var params = this.setRecordParams(true) |
|
|
var params = this.setRecordParams(true) |
|
|
// console.log("提交参数", JSON.stringify(params)); |
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
|
|
|
|
|
// putawayRecordSubmit(params).then(res => { |
|
|
putawayRecordSubmit(params).then(res => { |
|
|
// uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
// if (res.data) { |
|
|
if (res.data) { |
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购上架记录" + res.data, ) |
|
|
this.showCommitSuccessMessage("提交成功<br>生成采购上架记录" + res.data, ) |
|
|
// } else { |
|
|
} else { |
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
// } |
|
|
} |
|
|
// }).catch(error => { |
|
|
}).catch(error => { |
|
|
// uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
// this.showErrorMessage(error) |
|
|
this.showErrorMessage(error) |
|
|
// }) |
|
|
}) |
|
|
// } else { |
|
|
} else { |
|
|
// uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
// this.showErrorMessage(res.message); |
|
|
this.showErrorMessage(res.message); |
|
|
// } |
|
|
} |
|
|
// }); |
|
|
}); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -336,13 +339,13 @@ |
|
|
this.detailSource.forEach(item => { |
|
|
this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
item.subList.forEach(detail => { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned) { |
|
|
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
detail.packingNumber, detail.batch); |
|
|
detail.packingNumber, detail.batch); |
|
|
detail.toPackingNumber = info.packingNumber;; |
|
|
detail.toPackingNumber = info.packingNumber;; |
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
detail.toBatch = info.batch; |
|
|
detail.toBatch = info.batch; |
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
// detail.toInventoryStatus = detail.inventoryStatus |
|
|
detail.toLocationCode = this.toLocationCode |
|
|
// detail.toLocationCode = detail.toLocationCode |
|
|
detail.package = null; |
|
|
detail.package = null; |
|
|
subList.push(detail) |
|
|
subList.push(detail) |
|
|
} |
|
|
} |
|
|