wms_client_kate_suzhou/src/layout/doKitting.vue

413 lines
15 KiB
Vue
Raw Normal View History

2024-07-22 17:02:52 +08:00
<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>
2024-07-22 17:02:52 +08:00
</div>
<div class="station-div">
<span class="station-text">工作站</span>
</div>
<div class="station-no-div">
<span class="station-no-text">{{ standId }}</span>
</div>
</fieldset>
<fieldset class="main-area">
<legend>
备料执行
2024-07-22 17:02:52 +08:00
</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;">
<div style="display: none;">{{ workFormEntity.tip }}</div>
<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">
2024-07-24 22:13:40 +08:00
<el-input v-model="workFormEntity.goodsId" size="default"
v-on:keyup.enter="getCurrentWorkInfo()" clearable></el-input>
2024-07-22 17:02:52 +08:00
</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" />
</div>
<div class="display-form-div-right">
2024-07-24 22:13:40 +08:00
<span class="display-form-text-right">{{ workFormEntity.goodsUnit
}}</span>
2024-07-22 17:02:52 +08:00
</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.actualDifference"
controls-position="right" :min="0" />
</div>
<div class="display-form-div-right">
2024-07-24 22:13:40 +08:00
<span class="display-form-text-right">{{ workFormEntity.goodsUnit
}}</span>
2024-07-22 17:02:52 +08:00
</div>
</div>
</div>
</div>
<div style="display: flex; margin-top: 15px">
2024-07-22 17:02:52 +08:00
<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>
2024-07-22 17:02:52 +08:00
</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;">
{{ workFormEntity.goodsUnit }}
</span>
2024-07-22 17:02:52 +08:00
</div>
</div>
</div>
<div style="margin: 10px;">
<div class="arrow" @click="confirmTask()">
2024-07-22 17:02:52 +08:00
<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>
</div>
</el-container>
</el-config-provider>
</template>
<script setup>
import store from '@/store'
import { getWorkByStandAndGoods, confirmFinishWork } from '@/api/task'
2024-07-22 17:02:52 +08:00
import { reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script>
<script>
export default {
name: 'doKitting',
2024-07-22 17:02:52 +08:00
data() {
return {
standId: store.getters.getStandId,
// timer: '',
2024-07-22 17:02:52 +08:00
labelPosition: 'top',
workFormRef: ref(),
workFormEntity: reactive({
goodsId: '',
goodsUnit: '',
planPickNum: 0,
actualDifference: 0,
remark: '',
finishedRows: 0,
totalRows: 0,
finishedCounts: 0,
totalCounts: 0,
tip: ''
}),
rules: reactive({
goodsId: [
{ required: true, message: '请输入料号' }
]
}),
}
},
mounted() {
// this.timer = setInterval(() => {
// // this.getAllTasks()
// }, 2000)
},
beforeUnmount() {
// clearInterval(this.timer)
2024-07-22 17:02:52 +08:00
},
methods: {
getCurrentWorkInfo() {
2024-07-24 22:13:40 +08:00
// this.workFormEntity = {
// goodsId: 'text0001',
// goodsUnit: 'PC',
// planPickNum: 10,
// actualDifference: 0,
// remark: '装盒子',
// finishedRows: 800,
// totalRows: 2500,
// finishedCounts: 2500,
// totalCounts: 6000,
// tip: ''
2024-07-22 17:02:52 +08:00
// }
2024-07-24 22:13:40 +08:00
const request = {
standId: this.standId,
goodsId: this.workFormEntity.goodsId
}
getWorkByStandAndGoods(request).then(res => {
const response = res.data
if (response.code == 0) {
this.workFormEntity.goodsId = response.returnData.goodsId
this.workFormEntity.goodsUnit = response.returnData.goodsUnit
this.workFormEntity.planPickNum = response.returnData.planPickNum
this.workFormEntity.actualDifference = response.returnData.actualDifference
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
} else {
this.resetForms()
ElMessage.error(response.message)
2024-07-24 22:13:40 +08:00
}
}).catch(err => {
console.log(err)
this.resetForms()
ElMessage.error('查询工作信息错误')
})
},
resetForms() {
this.workFormEntity = reactive({
goodsId: '',
goodsUnit: '',
planPickNum: 0,
actualDifference: 0,
remark: '',
finishedRows: 0,
totalRows: 0,
finishedCounts: 0,
totalCounts: 0,
tip: ''
})
2024-07-22 17:02:52 +08:00
},
confirmTask() {
if (this.standId == '' || this.workFormEntity.goodsId == '') {
ElMessage({
message: '站台号和料号不可缺少',
type: 'error',
})
return
}
const confirmParams = {
standId: this.standId,
goodsId: this.workFormEntity.goodsId,
actualDifference: this.workFormEntity.actualDifference
}
confirmFinishWork(confirmParams).then(res => {
const response = res.data
if (response.code == 0) {
2024-07-22 17:02:52 +08:00
ElMessage({
message: response.message,
type: 'success',
2024-07-22 17:02:52 +08:00
})
this.resetForms()
} else {
ElMessage.error(response.message)
2024-07-22 17:02:52 +08:00
}
}).catch(err => {
console.log(err)
ElMessage.error('确认时发生异常')
2024-07-22 17:02:52 +08:00
})
}
}
}
</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%;
2024-07-22 17:02:52 +08:00
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;
2024-07-22 17:02:52 +08:00
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;
2024-07-22 17:02:52 +08:00
width: 250px;
background-repeat: no-repeat;
display: inline-flex;
cursor: pointer;
2024-07-22 17:02:52 +08:00
}
:deep(.el-input) {
height: 130px;
font-size: 25px;
}
:deep(.el-input-number) {
2024-07-26 17:00:49 +08:00
width: 270px;
2024-07-22 17:02:52 +08:00
height: 130px;
font-size: 25px;
}
.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: 125px;
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: 75px;
padding: 5px;
border: 5px double #000000;
}
.station-no-text {
align-self: center;
font-weight: bold;
font-size: 25px;
}
.display-title-div {
display: inline-flex;
justify-content: center;
width: 280px;
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: 270px;
margin: 5px;
padding: 5px;
border: 5px double #000000;
margin-top: 25px;
}
.display-form-div-left {
display: inline-flex;
justify-content: center;
width: 170px;
margin: 5px;
padding: 5px;
border: 5px double #000000;
}
.display-form-div-right {
display: inline-flex;
justify-content: center;
width: 80px;
margin: 5px;
padding: 5px;
background-color: #CCCCCC;
}
.display-form-text-right {
align-self: center;
font-weight: bold;
font-size: 25px;
}
</style>