|
|
@ -1,13 +1,33 @@ |
|
|
|
<template> |
|
|
|
<!-- <page-meta root-font-size="18px"></page-meta> --> |
|
|
|
<view class="page-wraper"> |
|
|
|
<view class="page-main"> |
|
|
|
<view class="" style="padding: 15rpx;font-size: 35rpx; "> |
|
|
|
<!-- <view class="" style="padding: 15rpx;font-size: 35rpx; "> |
|
|
|
车间代码 : {{jobContent.workShopCode}} |
|
|
|
</view> |
|
|
|
<u-line /> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<scroll-view scroll-y="true" class=""> |
|
|
|
<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> |
|
|
|
</view> |
|
|
@ -41,13 +61,20 @@ |
|
|
|
updateTitle, |
|
|
|
getRemoveOption, |
|
|
|
getISODateTime, |
|
|
|
getDirectoryItemArray |
|
|
|
getCurrDateTime, |
|
|
|
getDirectoryItemArray, |
|
|
|
getPackingNumberAndBatch, |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getDataSource |
|
|
|
} from '@/pages/issue/js/issue.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getManagementPrecisions |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
|
|
|
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' |
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue' |
|
|
@ -146,9 +173,6 @@ |
|
|
|
that.jobContent = res.data; |
|
|
|
that.subList = res.data.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(); |
|
|
|
uni.hideLoading(); |
|
|
|
} else { |
|
|
@ -173,35 +197,133 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// submit() { |
|
|
|
//3.如果是按批次先进先出发料提交时如果扫描的箱码不是先进的批次,则报错 |
|
|
|
//:请扫描XXX批次,改批次满足先进先出规则。否则可以直接提交 |
|
|
|
// var isOutIn = getApp().globalData.feed_configList.filter( |
|
|
|
// res => { |
|
|
|
// if (res.name == 'feed_isOutIn') { |
|
|
|
// return res; |
|
|
|
// } |
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
// 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() { |
|
|
|
//3.如果是按批次先进先出发料提交时如果扫描的箱码不是先进的批次,则报错 |
|
|
|
//:请扫描XXX批次,改批次满足先进先出规则。否则可以直接提交 |
|
|
|
// var isOutIn = getApp().globalData.feed_configList.filter( |
|
|
|
// res => { |
|
|
|
// if (res.name == 'feed_isOutIn') { |
|
|
|
// return res; |
|
|
|
// } |
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
|
|
|
|
this.dataContent.itemCodeList.forEach(res => { |
|
|
|
if (res.handleQty > res.recommendQty) { |
|
|
|
this.$refs.modal.showConfirmMessageModal('实际数量大于需求数量,是否提交?', confirm => { |
|
|
|
if (confirm) { |
|
|
|
//提交 |
|
|
|
uni.showToast({ |
|
|
|
title: "提交" |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
//目前任务只到一个库位 |
|
|
|
var itemCodes = [] |
|
|
|
let locationCode = this.detailSource[0].toLocationCode |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
}) |
|
|
|
|
|
|
|
//使用在途库,不查询管理模式 |
|
|
|
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 { |
|
|
|
uni.showToast({ |
|
|
|
title: "扫描的数量" + res.handleQty + "]小于推荐数量[" + res.recommendQty + "]" |
|
|
|
}) |
|
|
|
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 { |
|
|
|
var info = getPackingNumberAndBatch( |
|
|
|
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() { |
|
|
@ -241,15 +363,16 @@ |
|
|
|
if (item != undefined) { |
|
|
|
item.Locations.forEach(l => { |
|
|
|
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b |
|
|
|
.packingNumber == '') && b.batch == |
|
|
|
.packingNumber == null || b.packingNumber == '') && b.batch == |
|
|
|
record.batch); |
|
|
|
|
|
|
|
let handleQty = 0; |
|
|
|
batch.Records.forEach(res => { |
|
|
|
handleQty += Number(res.qty) |
|
|
|
}) |
|
|
|
batch.handleQty = handleQty; |
|
|
|
itemHandleQty += handleQty; |
|
|
|
if (batch != undefined) { |
|
|
|
batch.Records.forEach(res => { |
|
|
|
handleQty += Number(res.qty) |
|
|
|
}) |
|
|
|
batch.handleQty = handleQty; |
|
|
|
itemHandleQty += handleQty; |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// item.handleQty=itemHandleQty; |
|
|
@ -284,6 +407,14 @@ |
|
|
|
this.$refs.comMessage.showCommitSuccess(); |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
uni.navigateTo({ |
|
|
|
url: './issueJob' |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
showRescanMessage(message) { |
|
|
|
this.$refs.comMessage.showRescanMessage(message); |
|
|
|
}, |
|
|
|