|
@ -1,13 +1,33 @@ |
|
|
<template> |
|
|
<template> |
|
|
<!-- <page-meta root-font-size="18px"></page-meta> --> |
|
|
|
|
|
<view class="page-wraper"> |
|
|
<view class="page-wraper"> |
|
|
<view class="page-main"> |
|
|
<view class="page-main"> |
|
|
<view class="" style="padding: 15rpx;font-size: 35rpx; "> |
|
|
<!-- <view class="" style="padding: 15rpx;font-size: 35rpx; "> |
|
|
车间代码 : {{jobContent.workShopCode}} |
|
|
车间代码 : {{jobContent.workShopCode}} |
|
|
</view> |
|
|
</view> --> |
|
|
<u-line /> |
|
|
|
|
|
<scroll-view scroll-y="true" class=""> |
|
|
<scroll-view scroll-y="true" class=""> |
|
|
<view v-for="(toLocation, index) in detailSource"> |
|
|
<view v-for="(toLocation, index) in detailSource"> |
|
|
|
|
|
<view class="cen_card" style="padding: 20rpx;"> |
|
|
|
|
|
<view class="cell_box uni-flex uni-row"> |
|
|
|
|
|
<view class="cell_info"> |
|
|
|
|
|
<view class="text_lightblue">车间</view> |
|
|
|
|
|
<view>{{jobContent.workShopCode}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="cell_info"> |
|
|
|
|
|
<view class="text_lightblue">生产线</view> |
|
|
|
|
|
<view>{{toLocation.productionLineCode}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="cell_info"> |
|
|
|
|
|
<view class="text_lightblue">工位</view> |
|
|
|
|
|
<view>{{ toLocation.workStationCode }}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="cell_info"> |
|
|
|
|
|
<view class="text_lightblue">原材料库</view> |
|
|
|
|
|
<view>{{ toLocation.toLocationCode}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<u-line /> |
|
|
|
|
|
</view> |
|
|
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'> |
|
|
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'> |
|
|
</com-issue-detail-card> |
|
|
</com-issue-detail-card> |
|
|
</view> |
|
|
</view> |
|
@ -41,13 +61,20 @@ |
|
|
updateTitle, |
|
|
updateTitle, |
|
|
getRemoveOption, |
|
|
getRemoveOption, |
|
|
getISODateTime, |
|
|
getISODateTime, |
|
|
getDirectoryItemArray |
|
|
getCurrDateTime, |
|
|
|
|
|
getDirectoryItemArray, |
|
|
|
|
|
getPackingNumberAndBatch, |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getDataSource |
|
|
getDataSource |
|
|
} from '@/pages/issue/js/issue.js'; |
|
|
} from '@/pages/issue/js/issue.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
getManagementPrecisions |
|
|
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' |
|
|
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue' |
|
|
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue' |
|
@ -146,9 +173,6 @@ |
|
|
that.jobContent = res.data; |
|
|
that.jobContent = res.data; |
|
|
that.subList = res.data.subList; |
|
|
that.subList = res.data.subList; |
|
|
that.detailSource = getDataSource(that.detailSource, that.subList) |
|
|
that.detailSource = getDataSource(that.detailSource, that.subList) |
|
|
// that.fromLocationCode = that.subList[0].fromLocationCode |
|
|
|
|
|
// that.toLocationCode = that.subList[0].toLocationCode |
|
|
|
|
|
// that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) |
|
|
|
|
|
that.resizeCollapse(); |
|
|
that.resizeCollapse(); |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
} else { |
|
|
} else { |
|
@ -173,7 +197,7 @@ |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
submit() { |
|
|
// submit() { |
|
|
//3.如果是按批次先进先出发料提交时如果扫描的箱码不是先进的批次,则报错 |
|
|
//3.如果是按批次先进先出发料提交时如果扫描的箱码不是先进的批次,则报错 |
|
|
//:请扫描XXX批次,改批次满足先进先出规则。否则可以直接提交 |
|
|
//:请扫描XXX批次,改批次满足先进先出规则。否则可以直接提交 |
|
|
// var isOutIn = getApp().globalData.feed_configList.filter( |
|
|
// var isOutIn = getApp().globalData.feed_configList.filter( |
|
@ -184,24 +208,122 @@ |
|
|
// }); |
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.dataContent.itemCodeList.forEach(res => { |
|
|
|
|
|
// if (res.handleQty > res.recommendQty) { |
|
|
|
|
|
// this.$refs.modal.showConfirmMessageModal('实际数量大于需求数量,是否提交?', confirm => { |
|
|
|
|
|
// if (confirm) { |
|
|
|
|
|
// //提交 |
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
// title: "提交" |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// } else { |
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
// title: "扫描的数量" + res.handleQty + "]小于推荐数量[" + res.recommendQty + "]" |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
submit() { |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "提交中....", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
this.dataContent.itemCodeList.forEach(res => { |
|
|
//目前任务只到一个库位 |
|
|
if (res.handleQty > res.recommendQty) { |
|
|
var itemCodes = [] |
|
|
this.$refs.modal.showConfirmMessageModal('实际数量大于需求数量,是否提交?', confirm => { |
|
|
let locationCode = this.detailSource[0].toLocationCode |
|
|
if (confirm) { |
|
|
this.detailSource.forEach(item => { |
|
|
//提交 |
|
|
itemCodes.push(item.itemCode) |
|
|
uni.showToast({ |
|
|
|
|
|
title: "提交" |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
//使用在途库,不查询管理模式 |
|
|
|
|
|
if (this.jobContent.useOnTheWayLocation == 'TRUE') { |
|
|
|
|
|
this.submitJob(); |
|
|
|
|
|
} else { |
|
|
|
|
|
//获取管理模式,封装参数 |
|
|
|
|
|
getManagementPrecisions(itemCodes, locationCode, res => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.managementList = res.list; |
|
|
|
|
|
this.submitJob(); |
|
|
|
|
|
} else { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
this.showErrorMessage(res.message); |
|
|
} |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
submitJob() { |
|
|
|
|
|
var params = this.setParams() |
|
|
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
|
|
|
|
|
|
|
|
issueJobSubmit(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) |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setParams() { |
|
|
|
|
|
var subList = [] |
|
|
|
|
|
var createTime = getCurrDateTime(); |
|
|
|
|
|
var creator = this.$store.state.user.id |
|
|
|
|
|
this.detailSource.forEach(toLocationCode => { |
|
|
|
|
|
toLocationCode.Items.forEach(item => { |
|
|
|
|
|
item.Locations.forEach(fromLocation => { |
|
|
|
|
|
fromLocation.Batchs.forEach(batch => { |
|
|
|
|
|
let subItem = batch.detail; |
|
|
|
|
|
subItem.recordList = []; |
|
|
|
|
|
if (batch.Records.length > 0) { |
|
|
|
|
|
batch.Records.forEach(r => { |
|
|
|
|
|
let record = {}; |
|
|
|
|
|
record.handleQty = r.qty; |
|
|
|
|
|
record.toContainerNumber = r |
|
|
|
|
|
.ContainerNumber; |
|
|
|
|
|
record.toInventoryStatus = r |
|
|
|
|
|
.inventoryStatus; |
|
|
|
|
|
record.toLocationCode = subItem |
|
|
|
|
|
.toLocationCode; |
|
|
|
|
|
record.supplierCode = r.supplierCode; |
|
|
|
|
|
|
|
|
|
|
|
//使用在途库不改变管理模式 |
|
|
|
|
|
if (this.jobContent.useOnTheWayLocation == |
|
|
|
|
|
'TRUE') { |
|
|
|
|
|
record.toPackingNumber = r |
|
|
|
|
|
.packingNumber; |
|
|
|
|
|
record.toBatch = r.batch; |
|
|
} else { |
|
|
} else { |
|
|
uni.showToast({ |
|
|
var info = getPackingNumberAndBatch( |
|
|
title: "扫描的数量" + res.handleQty + "]小于推荐数量[" + res.recommendQty + "]" |
|
|
this.managementList, r |
|
|
|
|
|
.itemCode, |
|
|
|
|
|
r.packingNumber, r |
|
|
|
|
|
.batch); |
|
|
|
|
|
record.toPackingNumber = info |
|
|
|
|
|
.packingNumber; |
|
|
|
|
|
record.toBatch = info.batch; |
|
|
|
|
|
} |
|
|
|
|
|
subItem.recordList.push(record); |
|
|
}) |
|
|
}) |
|
|
|
|
|
subList.push(subItem); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.jobContent.subList = subList |
|
|
|
|
|
this.jobContent.createTime = createTime; |
|
|
|
|
|
this.jobContent.creator = creator; |
|
|
|
|
|
return this.jobContent; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
cancel() { |
|
|
cancel() { |
|
@ -241,15 +363,16 @@ |
|
|
if (item != undefined) { |
|
|
if (item != undefined) { |
|
|
item.Locations.forEach(l => { |
|
|
item.Locations.forEach(l => { |
|
|
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b |
|
|
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b |
|
|
.packingNumber == '') && b.batch == |
|
|
.packingNumber == null || b.packingNumber == '') && b.batch == |
|
|
record.batch); |
|
|
record.batch); |
|
|
|
|
|
|
|
|
let handleQty = 0; |
|
|
let handleQty = 0; |
|
|
|
|
|
if (batch != undefined) { |
|
|
batch.Records.forEach(res => { |
|
|
batch.Records.forEach(res => { |
|
|
handleQty += Number(res.qty) |
|
|
handleQty += Number(res.qty) |
|
|
}) |
|
|
}) |
|
|
batch.handleQty = handleQty; |
|
|
batch.handleQty = handleQty; |
|
|
itemHandleQty += handleQty; |
|
|
itemHandleQty += handleQty; |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
// item.handleQty=itemHandleQty; |
|
|
// item.handleQty=itemHandleQty; |
|
@ -284,6 +407,14 @@ |
|
|
this.$refs.comMessage.showCommitSuccess(); |
|
|
this.$refs.comMessage.showCommitSuccess(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url: './issueJob' |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
showRescanMessage(message) { |
|
|
showRescanMessage(message) { |
|
|
this.$refs.comMessage.showRescanMessage(message); |
|
|
this.$refs.comMessage.showRescanMessage(message); |
|
|
}, |
|
|
}, |
|
|