524 lines
21 KiB
Vue
524 lines
21 KiB
Vue
<template>
|
||
<el-config-provider :locale="zhCn">
|
||
<el-container class="content">
|
||
<div class="work-area">
|
||
<fieldset class="title-area">
|
||
<legend>
|
||
工作台
|
||
</legend>
|
||
<div class="title-div">
|
||
<span class="title-text">Kitting备料执行</span>
|
||
</div>
|
||
<div class="station-div">
|
||
<span class="station-text">工作站:</span>
|
||
</div>
|
||
<div class="station-no-div">
|
||
<span class="station-no-text" @click="showStockDealDialog()">{{ standId }}</span>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset class="main-area">
|
||
<legend>
|
||
备料执行
|
||
</legend>
|
||
<el-form ref="workFormRef" :model="workFormEntity" :label-position="labelPosition"
|
||
label-width="150px" style="max-width: 100%" :rules="rules" status-icon>
|
||
<div style="display: flex;">
|
||
<div style="display: block; margin: 5px;">
|
||
<!-- <el-dialog v-model="dialogVisible" title="提醒" width="40%" draggable
|
||
:show-close="true">
|
||
<span style="color: green; margin-right: 16px; font-size: 35px;"> {{ workFormEntity.tip }}</span>
|
||
</el-dialog> -->
|
||
<div style="display: flex;">
|
||
<div style="display: flex; flex-direction: column;">
|
||
<div class="display-title-div">
|
||
<span class="display-title-text">料号</span>
|
||
</div>
|
||
<div class="display-form-div">
|
||
<el-input v-model="workFormEntity.goodsId" size="default" ref="goodsId"
|
||
v-on:keyup.enter="getCurrentWorkInfo()" clearable></el-input>
|
||
</div>
|
||
</div>
|
||
<div style="display: flex; flex-direction: column;">
|
||
<div class="display-title-div">
|
||
<span class="display-title-text">计划拣选数量</span>
|
||
</div>
|
||
<div style="display: flex; margin-top: 20px;">
|
||
<div class="display-form-div-left">
|
||
<el-input-number v-model.number="workFormEntity.planPickNum"
|
||
controls-position="right" :min="0" width="200px" disabled />
|
||
</div>
|
||
<div class="display-form-div-right">
|
||
<span class="display-form-text-right">PC</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div style="display: flex; flex-direction: column;">
|
||
<div class="display-title-div">
|
||
<span class="display-title-text">理论剩余数量</span>
|
||
</div>
|
||
<div style="display: flex; margin-top: 20px;">
|
||
<div class="display-form-div-left">
|
||
<el-input-number v-model.number="workFormEntity.remainNumOrigin"
|
||
controls-position="right" :min="0" disabled />
|
||
</div>
|
||
<div class="display-form-div-right">
|
||
<span class="display-form-text-right">PC</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div style="display: flex; flex-direction: column;">
|
||
<div class="display-title-div">
|
||
<span class="display-title-text">实际剩余数量</span>
|
||
</div>
|
||
<div style="display: flex; margin-top: 20px;">
|
||
<div class="display-form-div-left">
|
||
<el-input-number v-model.number="workFormEntity.remainNumReal"
|
||
controls-position="right" :min="0" />
|
||
</div>
|
||
<div class="display-form-div-right">
|
||
<span class="display-form-text-right">PC</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div style="display: flex; margin-top: 15px">
|
||
<div
|
||
style="display: inline-flex; justify-content: center; width: 160px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
|
||
<span style="align-self: center; font-weight: bold;font-size: 25px;">备注</span>
|
||
</div>
|
||
<div
|
||
style="display: inline-flex; justify-content: center; width: 700px; margin: 5px; padding: 5px; background-color: #00AAE8;">
|
||
<span style="align-self: center; font-weight: bold;font-size: 25px;">
|
||
{{ workFormEntity.remark }}
|
||
</span>
|
||
</div>
|
||
</div>
|
||
<div style="display: flex; margin-top: 5px; margin-top: 15px">
|
||
<div
|
||
style="display: inline-flex; justify-content: center; width: 160px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
|
||
<span
|
||
style="align-self: center; font-weight: bold;font-size: 20px;">当前进度:</span>
|
||
</div>
|
||
<div
|
||
style="display: inline-flex; justify-content: center; width: 240px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
|
||
<span style="align-self: center; font-weight: bold;font-size: 20px;">
|
||
{{ workFormEntity.finishedRows + '/' + workFormEntity.totalRows }}
|
||
</span>
|
||
</div>
|
||
<div
|
||
style="display: inline-flex; justify-content: center; width: 80px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
|
||
<span style="align-self: center; font-weight: bold;font-size: 20px;">行</span>
|
||
</div>
|
||
<div
|
||
style="display: inline-flex; justify-content: center; width: 240px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
|
||
<span style="align-self: center; font-weight: bold;font-size: 20px;">
|
||
{{ workFormEntity.finishedCounts + '/' + workFormEntity.totalCounts }}
|
||
</span>
|
||
</div>
|
||
<div
|
||
style="display: inline-flex; justify-content: center; width: 80px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
|
||
<span style="align-self: center; font-weight: bold;font-size: 20px;">
|
||
PC
|
||
</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div style="margin: 10px;">
|
||
<div class="arrow" @click="confirmTask()">
|
||
<span
|
||
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">完成确认</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</el-form>
|
||
</fieldset>
|
||
<el-dialog v-model="dialogVisible" title="异常箱料处理" width="40%" draggable :show-close="false">
|
||
<div style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||
<el-form ref="exceptionHandleFormRef" :model="exceptionHandleFormEntity" :label-position="labelPosition"
|
||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||
<el-row :gutter="16">
|
||
<el-col :span="12" :offset="0">
|
||
<el-form-item label="箱号" prop="vehicleId">
|
||
<el-input v-model="exceptionHandleFormEntity.vehicleId" clearable />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="料号" prop="goodsId">
|
||
<el-input v-model="exceptionHandleFormEntity.goodsId" clearable />
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
</el-form>
|
||
</div>
|
||
<template #footer>
|
||
<span class="dialog-footer">
|
||
<el-button @click="dialogVisible = false">取消</el-button>
|
||
<el-button type="primary" @click="exceptionHandle()">
|
||
确定
|
||
</el-button>
|
||
</span>
|
||
</template>
|
||
</el-dialog>
|
||
</div>
|
||
</el-container>
|
||
</el-config-provider>
|
||
</template>
|
||
|
||
<script setup>
|
||
import store from '@/store'
|
||
import { getWorkByStandAndGoods, confirmFinishWork, queryFinishByStandAndGoods } from '@/api/task'
|
||
import { handleExceptionStock } from '@/api/stock'
|
||
import { errorBox, warningBox } from '@/utils/myMessageBox.js'
|
||
import { ElMessage } from 'element-plus'
|
||
import { reactive, ref } from 'vue'
|
||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||
</script>
|
||
|
||
<script>
|
||
export default {
|
||
name: 'doKitting',
|
||
data() {
|
||
return {
|
||
standId: store.getters.getStandId,
|
||
timer: '',
|
||
labelPosition: 'top',
|
||
workFormRef: ref(),
|
||
workFormEntity: reactive({
|
||
goodsId: '',
|
||
planPickNum: 0,
|
||
remainNumOrigin: null,
|
||
remainNumReal: null,
|
||
remark: '',
|
||
finishedRows: 0,
|
||
totalRows: 0,
|
||
finishedCounts: 0,
|
||
totalCounts: 0,
|
||
tip: ''
|
||
}),
|
||
rules: reactive({
|
||
goodsId: [
|
||
{ required: true, message: '请输入料号' }
|
||
]
|
||
}),
|
||
exceptionHandleFormEntity: reactive({}),
|
||
exceptionHandleFormRef: ref(),
|
||
dialogVisible: false
|
||
}
|
||
},
|
||
mounted() {
|
||
this.$refs.goodsId.focus()
|
||
this.timer = setInterval(() => {
|
||
this.queryFinish()
|
||
}, 1500)
|
||
},
|
||
beforeUnmount() {
|
||
clearInterval(this.timer)
|
||
},
|
||
methods: {
|
||
// 获取当前工作信息
|
||
getCurrentWorkInfo() {
|
||
const request = {
|
||
standId: this.standId,
|
||
goodsId: this.workFormEntity.goodsId,
|
||
userName: store.getters.getUserName
|
||
}
|
||
getWorkByStandAndGoods(request).then(res => {
|
||
const response = res.data
|
||
if (response.code == 0) {
|
||
this.workFormEntity.goodsId = response.returnData.goodsId
|
||
this.workFormEntity.planPickNum = response.returnData.planPickNum
|
||
this.workFormEntity.remainNumOrigin = response.returnData.remainNumOrigin
|
||
this.workFormEntity.remainNumReal = response.returnData.remainNumReal
|
||
this.workFormEntity.remark = response.returnData.remark
|
||
this.workFormEntity.finishedRows = response.returnData.finishedRows
|
||
this.workFormEntity.totalRows = response.returnData.totalRows
|
||
this.workFormEntity.finishedCounts = response.returnData.finishedCounts
|
||
this.workFormEntity.totalCounts = response.returnData.totalCounts
|
||
this.workFormEntity.tip = response.returnData.tip
|
||
if (this.workFormEntity.remainNumOrigin == 0) {
|
||
this.workFormEntity.tip = "理论剩余库存为0,请确认。"
|
||
warningBox(this.workFormEntity.tip)
|
||
}
|
||
} else {
|
||
this.resetForms()
|
||
errorBox(response.message)
|
||
}
|
||
}).catch(err => {
|
||
console.log(err)
|
||
this.resetForms()
|
||
errorBox('查询工作信息错误')
|
||
})
|
||
},
|
||
// 查询是否完成
|
||
queryFinish() {
|
||
if (this.workFormEntity.goodsId == '') {
|
||
return
|
||
}
|
||
const request = {
|
||
standId: this.standId,
|
||
goodsId: this.workFormEntity.goodsId
|
||
}
|
||
queryFinishByStandAndGoods(request).then(res => {
|
||
const response = res.data
|
||
if (response.returnData != null) {
|
||
this.workFormEntity.finishedRows = response.returnData.finishedRows
|
||
this.workFormEntity.totalRows = response.returnData.totalRows
|
||
this.workFormEntity.finishedCounts = response.returnData.finishedCounts
|
||
this.workFormEntity.totalCounts = response.returnData.totalCounts
|
||
}
|
||
if (response.code == 0) {
|
||
if (response.returnData != null && response.returnData.tip != '') {
|
||
this.workFormEntity.tip = response.returnData.tip
|
||
warningBox(this.workFormEntity.tip)
|
||
} else {
|
||
ElMessage.success(response.message)
|
||
}
|
||
this.resetForms()
|
||
}
|
||
}).catch(err => {
|
||
console.log(err)
|
||
})
|
||
},
|
||
// 重置参数
|
||
resetForms() {
|
||
this.workFormEntity.goodsId = ''
|
||
this.workFormEntity.planPickNum = 0
|
||
this.workFormEntity.remainNumOrigin = null
|
||
this.workFormEntity.remainNumReal = null
|
||
this.workFormEntity.remark = ''
|
||
this.$refs.goodsId.focus()
|
||
},
|
||
// 确认完成工作
|
||
confirmTask() {
|
||
if (this.standId == '' || this.workFormEntity.goodsId == '') {
|
||
errorBox('站台号和料号不可缺少')
|
||
return
|
||
}
|
||
const confirmParams = {
|
||
standId: this.standId,
|
||
goodsId: this.workFormEntity.goodsId,
|
||
remainNumOrigin: this.workFormEntity.remainNumOrigin,
|
||
remainNumReal: this.workFormEntity.remainNumReal,
|
||
userName: store.getters.getUserName
|
||
}
|
||
confirmFinishWork(confirmParams).then(res => {
|
||
const response = res.data
|
||
if (response.code == 0) {
|
||
if (response.returnData != null && response.returnData.tip != '') {
|
||
this.workFormEntity.tip = response.returnData.tip
|
||
warningBox(this.workFormEntity.tip)
|
||
} else {
|
||
ElMessage.success(response.message)
|
||
}
|
||
this.resetForms()
|
||
} else {
|
||
errorBox(response.message)
|
||
}
|
||
}).catch(err => {
|
||
console.log(err)
|
||
errorBox('确认时发生异常')
|
||
})
|
||
},
|
||
showStockDealDialog() {
|
||
this.dialogVisible = true
|
||
},
|
||
exceptionHandle() {
|
||
if (this.exceptionHandleFormEntity.vehicleId == '' || this.exceptionHandleFormEntity.goodsId == '') {
|
||
errorBox('箱号和料号必须输入。')
|
||
return
|
||
}
|
||
const request = {
|
||
vehicleId: this.exceptionHandleFormEntity.vehicleId.trim(),
|
||
goodsId: this.exceptionHandleFormEntity.goodsId.trim(),
|
||
standId: this.standId,
|
||
userName: store.getters.getUserName
|
||
}
|
||
handleExceptionStock(request).then(res => {
|
||
const response = res.data
|
||
if (response.code == 0) {
|
||
ElMessage.success(response.message)
|
||
this.exceptionHandleFormEntity.vehicleId = ''
|
||
this.exceptionHandleFormEntity.goodsId = ''
|
||
this.dialogVisible = false
|
||
} else {
|
||
errorBox(response.message)
|
||
}
|
||
}).catch(err => {
|
||
console.log(err)
|
||
errorBox('确认时发生异常')
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
.content {
|
||
display: flex;
|
||
width: 100%;
|
||
}
|
||
|
||
.work-area {
|
||
width: 100%;
|
||
/* padding: 5px; */
|
||
}
|
||
|
||
.main-area {
|
||
margin: auto;
|
||
min-height: fit-content;
|
||
max-height: 90%;
|
||
margin-bottom: 10px;
|
||
min-width: inherit;
|
||
border: solid 1px;
|
||
border-radius: 10px;
|
||
box-shadow: 0px 15px 10px -15px #000;
|
||
overflow: auto;
|
||
}
|
||
|
||
.title-area {
|
||
display: flex;
|
||
/* min-height: 10%; */
|
||
max-height: max-content;
|
||
margin-bottom: 10px;
|
||
min-width: inherit;
|
||
border: solid 1px;
|
||
border-radius: 10px;
|
||
box-shadow: 0px 15px 10px -15px #000;
|
||
overflow: auto;
|
||
}
|
||
|
||
.arrow {
|
||
background: linear-gradient(-105deg,
|
||
transparent 50%,
|
||
#309330 50%,
|
||
#309330 100%) top right,
|
||
linear-gradient(-75deg,
|
||
transparent 50%,
|
||
#309330 50%,
|
||
#309330 100%) bottom right;
|
||
background-size: 100% 50%;
|
||
height: 400px;
|
||
width: 250px;
|
||
background-repeat: no-repeat;
|
||
display: inline-flex;
|
||
cursor: pointer;
|
||
}
|
||
|
||
:deep(.el-input) {
|
||
width: 195px;
|
||
height: 130px;
|
||
font-size: 25px;
|
||
}
|
||
|
||
:deep(.el-input-number) {
|
||
width: 125px;
|
||
height: 130px;
|
||
font-size: 25px;
|
||
}
|
||
|
||
/* :deep(.el-input .el-input__inner) {
|
||
font-size: 60px;
|
||
height: 130px;
|
||
}
|
||
|
||
:deep(.el-input-number .el-input__inner) {
|
||
font-size: 60px;
|
||
height: 130px;
|
||
} */
|
||
|
||
.title-div {
|
||
display: inline-flex;
|
||
width: -webkit-fill-available;
|
||
margin-right: 5px;
|
||
padding: 5px;
|
||
background-color: #CCCCCC;
|
||
}
|
||
|
||
.title-text {
|
||
align-self: center;
|
||
font-weight: bold;
|
||
font-size: 25px;
|
||
}
|
||
|
||
.station-div {
|
||
display: inline-flex;
|
||
justify-content: center;
|
||
width: 150px;
|
||
margin-left: 5px;
|
||
margin-right: 5px;
|
||
padding: 5px;
|
||
background-color: #FFFAAA;
|
||
}
|
||
|
||
.station-text {
|
||
align-self: center;
|
||
font-weight: bold;
|
||
font-size: 25px;
|
||
}
|
||
|
||
.station-no-div {
|
||
display: inline-flex;
|
||
justify-content: center;
|
||
width: 200px;
|
||
padding: 5px;
|
||
border: 5px double #000000;
|
||
}
|
||
|
||
.station-no-text {
|
||
align-self: center;
|
||
font-weight: bold;
|
||
font-size: 25px;
|
||
width: 100%;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.display-title-div {
|
||
display: inline-flex;
|
||
justify-content: center;
|
||
width: 205px;
|
||
height: 80px;
|
||
margin: 5px;
|
||
padding: 5px;
|
||
background-color: #FFFAAA;
|
||
}
|
||
|
||
.display-title-text {
|
||
align-self: center;
|
||
font-weight: bold;
|
||
font-size: 25px;
|
||
}
|
||
|
||
.display-form-div {
|
||
display: inline-flex;
|
||
justify-content: center;
|
||
width: 195px;
|
||
margin: 5px;
|
||
padding: 5px;
|
||
border: 5px double #000000;
|
||
margin-top: 25px;
|
||
}
|
||
|
||
.display-form-div-left {
|
||
display: inline-flex;
|
||
justify-content: center;
|
||
width: 125px;
|
||
margin: 5px;
|
||
padding: 5px;
|
||
border: 5px double #000000;
|
||
}
|
||
|
||
.display-form-div-right {
|
||
display: inline-flex;
|
||
justify-content: center;
|
||
width: 50px;
|
||
margin: 5px;
|
||
padding: 5px;
|
||
background-color: #CCCCCC;
|
||
}
|
||
|
||
.display-form-text-right {
|
||
align-self: center;
|
||
font-weight: bold;
|
||
font-size: 25px;
|
||
}
|
||
</style> |