|
|
@ -5,7 +5,8 @@ |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<com-detail-card :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
@remove="updateData" @updateData="updateData" @openDetail="openDetail"> |
|
|
|
@remove="updateData" @updateData="updateData" @openDetail="openDetail" |
|
|
|
:locationTypeList='locationTypeList'> |
|
|
|
</com-detail-card> |
|
|
|
</view> |
|
|
|
<u-line /> |
|
|
@ -14,7 +15,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode" |
|
|
|
@getLocation='getToLocationCode' :isShowEdit="jobContent.allowModifyLocation == 1" |
|
|
|
@getLocation='getToLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'" |
|
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
@ -30,7 +31,7 @@ |
|
|
|
|
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> |
|
|
|
|
|
|
|
|
|
|
|
<putaway-detail-info-popup ref="jobDetailPopup"></putaway-detail-info-popup> |
|
|
|
<com-message ref="comMessage"></com-message> |
|
|
|
</view> |
|
|
@ -40,7 +41,7 @@ |
|
|
|
import { |
|
|
|
getManagementPrecisions, |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
getPutawayJobDetail, |
|
|
|
getBasicLocationByCode, |
|
|
@ -53,7 +54,7 @@ |
|
|
|
getCurrDateTime, |
|
|
|
getPackingNumberAndBatch, |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
getDirectoryItemArray, |
|
|
|
getInventoryStatusName |
|
|
@ -71,7 +72,7 @@ |
|
|
|
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" |
|
|
|
import putawayDetailInfoPopup from '@/pages/putaway/coms/putawayDetailInfoPopup.vue' |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
winScanButton, |
|
|
@ -163,19 +164,19 @@ |
|
|
|
}); |
|
|
|
getPutawayJobDetail(that.id).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if(res.data==null){ |
|
|
|
if (res.data == null) { |
|
|
|
that.showMessage('未获取到详情'); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
if (res.data.subList.length > 0) { |
|
|
|
that.jobContent = res.data; |
|
|
|
that.subList = res.data.subList; |
|
|
|
that.detailSource = getDataSource(that.subList) |
|
|
|
|
|
|
|
|
|
|
|
that.fromLocationCode = that.subList[0].fromLocationCode |
|
|
|
that.toLocationCode = that.subList[0].toLocationCode |
|
|
|
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) |
|
|
|
that.getLocationInfo(that.toLocationCode); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
that.showMessage('列表数据为0'); |
|
|
|
} |
|
|
@ -284,7 +285,11 @@ |
|
|
|
']不一致,是否继续上架?', res => { |
|
|
|
if (res) { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
|
itemDetail.handleQty = Number(result.label.qty)>Number(result.balance.qty)?Number(result.balance.qty):Number(result.label.qty); |
|
|
|
itemDetail.balance = result.balance; |
|
|
|
itemDetail.balance.balanceQty = result.balance.qty; |
|
|
|
itemDetail.balance.stdPackQty =result.package.stdPackQty |
|
|
|
itemDetail.balance.stdPackUnit =result.package.stdPackUnit |
|
|
|
this.calcHandleQty(); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
@ -292,7 +297,11 @@ |
|
|
|
}); |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
|
itemDetail.handleQty = Number(result.label.qty)>Number(result.balance.qty)?Number(result.balance.qty):Number(result.label.qty); |
|
|
|
itemDetail.balance = result.balance; |
|
|
|
itemDetail.balance.balanceQty = result.balance.qty; |
|
|
|
itemDetail.balance.stdPackQty =result.package.stdPackQty |
|
|
|
itemDetail.balance.stdPackUnit =result.package.stdPackUnit |
|
|
|
this.calcHandleQty(); |
|
|
|
} |
|
|
|
} |
|
|
@ -304,101 +313,165 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
scanLocationCode(location, code) { |
|
|
|
this.toLocationCode = code |
|
|
|
this.toLocationInfo = location; |
|
|
|
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { |
|
|
|
this.toLocationCode = code |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
detail.toLocationCode = code |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
openDetail(item) { |
|
|
|
this.$refs.jobDetailPopup.openPopup(item) |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
checkLocation() { |
|
|
|
var isPass = true; |
|
|
|
if (this.toLocationCode == "") { |
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
this.showMessageHint('请扫描收货库位', callback => { |
|
|
|
this.$refs.comScanLocation.showLocation(); |
|
|
|
}) |
|
|
|
|
|
|
|
return isPass = false; |
|
|
|
} |
|
|
|
return isPass; |
|
|
|
}, |
|
|
|
|
|
|
|
showMessageHint(hint, callback) { |
|
|
|
this.$refs.comMessage.showErrorMessage(hint, res => { |
|
|
|
if (res) { |
|
|
|
callback() |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
this.scanCount = getScanCount(this.subList); |
|
|
|
if (!this.checkLocation()) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.scanCount == 0) { |
|
|
|
this.showErrorMessage("扫描数为0,请先扫描") |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//允许部分提交 |
|
|
|
if (this.jobContent.allowPartialComplete == "TRUE") { |
|
|
|
//扫描数量和任务数量相等,直接提交 |
|
|
|
if (this.scanCount == this.subList.length) { |
|
|
|
this.submitJob(); |
|
|
|
} else { |
|
|
|
this.scanCount = getScanCount(this.subList); |
|
|
|
if (this.scanCount < this.subList.length) { |
|
|
|
} else if (this.scanCount < this.subList.length) { |
|
|
|
//扫描数量小于任务数量,判断是否允许部分提交 |
|
|
|
if (this.jobContent.allowPartialComplete == "TRUE") { |
|
|
|
//提交 |
|
|
|
this.submitJob(); |
|
|
|
} else { |
|
|
|
//不允许部分提交,提示 |
|
|
|
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount + |
|
|
|
"]箱总共[" + this.subList.length + "]箱", res => { |
|
|
|
"]箱总共[" + this |
|
|
|
.subList.length + "]箱", res => { |
|
|
|
if (res) { |
|
|
|
this.openScanPopup(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async submitJob() { |
|
|
|
submitJob() { |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
var itemCodes = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
}) |
|
|
|
|
|
|
|
var param = { |
|
|
|
itemCode: itemCodes, |
|
|
|
locationCode: this.toLocationCode |
|
|
|
//如果目标库位等于null,不查询管理模式,否则查询管理模式 |
|
|
|
if (this.toLocationCode == null || this.toLocationCode == "") { |
|
|
|
var params = this.setParams(false) |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
// putawayJobSubmit( params).then(res => { |
|
|
|
// if (res.data) { |
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败"+res.msg) |
|
|
|
// } |
|
|
|
// uni.hideLoading() |
|
|
|
// }).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.setParams(true) |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
|
|
|
|
// putawayJobSubmit( params).then(res => { |
|
|
|
// if (res.data) { |
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败"+res.msg) |
|
|
|
// } |
|
|
|
// uni.hideLoading() |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交参数",JSON.stringify(params)); |
|
|
|
|
|
|
|
putawayJobSubmit(this.id, params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
var hint = res.data.Number; |
|
|
|
this.showCommitSuccessMessage("提交成功" + hint) |
|
|
|
|
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
setParams(queryModel) { |
|
|
|
var subList = [] |
|
|
|
var createTime = getCurrDateTime(); |
|
|
|
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; |
|
|
|
subList.push(detail) |
|
|
|
var subItem = {}; |
|
|
|
Object.assign(subItem, detail) |
|
|
|
if (queryModel) { |
|
|
|
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
|
detail.packingNumber, detail.batch); |
|
|
|
subItem.package ="" ; |
|
|
|
subItem.balance ="" ; |
|
|
|
subItem.toPackingNumber = info.packingNumber;; |
|
|
|
subItem.toContainerNumber = subItem.containerNumber |
|
|
|
subItem.toBatch = info.batch; |
|
|
|
subItem.toInventoryStatus = subItem.inventoryStatus |
|
|
|
subItem.toLocationCode = this.toLocationCode |
|
|
|
} else { |
|
|
|
subItem.package ="" ; |
|
|
|
subItem.balance ="" ; |
|
|
|
subItem.toPackingNumber = subItem.packingNumber; |
|
|
|
subItem.toContainerNumber = subItem.containerNumber |
|
|
|
subItem.toBatch = subItem.toBatch; |
|
|
|
subItem.toInventoryStatus = subItem.inventoryStatus |
|
|
|
subItem.toLocationCode = "" |
|
|
|
} |
|
|
|
|
|
|
|
subList.push(subItem) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.jobContent.subList = subList |
|
|
|
this.jobContent.createTime = createTime; |
|
|
|
this.jobContent.creator =creator; |
|
|
|
this.jobContent.creator = creator; |
|
|
|
return this.jobContent; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
|
setTimeout(r => { |
|
|
|