wms_client_kate_suzhou/src/layout/callEmptyVehicle.vue

422 lines
14 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">呼叫空箱</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-30 21:02:00 +08:00
呼叫空箱
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">
2024-07-26 17:00:49 +08:00
<span class="display-title-text">物料种类选择</span>
2024-07-22 17:02:52 +08:00
</div>
<div class="display-form-div">
2024-07-26 17:00:49 +08:00
<el-select-v2 v-model="workFormEntity.vehicleType2" placeholder="请选择类型"
:options="vehicleType2Options"
@change="vehicleType2ChangeHandle()"></el-select-v2>
<!-- <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>
2024-07-30 21:02:00 +08:00
<!-- <div v-if="displayVehicleType1Selection"
2024-07-26 17:00:49 +08:00
style="display: flex; flex-direction: column;">
2024-07-22 17:02:52 +08:00
<div class="display-title-div">
2024-07-26 17:00:49 +08:00
<span class="display-title-text">料箱种类选择</span>
2024-07-22 17:02:52 +08:00
</div>
2024-07-26 17:00:49 +08:00
<div class="display-form-div">
<el-select-v2 v-model="workFormEntity.vehicleType1" placeholder="请选择类型"
:options="vehicleType1Options"></el-select-v2>
</div>
2024-07-30 21:02:00 +08:00
</div> -->
2024-07-26 17:00:49 +08:00
<div v-if="displayGoods" 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"
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">
2024-07-26 17:00:49 +08:00
<span class="display-title-text">料箱数量</span>
2024-07-22 17:02:52 +08:00
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
2024-07-26 17:00:49 +08:00
<el-input-number v-model.number="workFormEntity.needNum"
2024-07-22 17:02:52 +08:00
controls-position="right" :min="0" />
</div>
<div class="display-form-div-right">
2024-07-26 17:00:49 +08:00
<span class="display-form-text-right"></span>
2024-07-22 17:02:52 +08:00
</div>
</div>
</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'
2024-07-26 17:00:49 +08:00
import { callEmptyVehicle } 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: 'callEmptyVehicle',
2024-07-22 17:02:52 +08:00
data() {
return {
standId: store.getters.getStandId,
2024-07-26 17:00:49 +08:00
displayGoods: false,// 是否显示料号输入
2024-07-30 21:02:00 +08:00
// displayVehicleType1Selection: false,// 是否显示料箱类型选择
// timer: '',
2024-07-22 17:02:52 +08:00
labelPosition: 'top',
workFormRef: ref(),
workFormEntity: reactive({
2024-07-30 21:02:00 +08:00
// vehicleType1: '',
2024-07-26 17:00:49 +08:00
vehicleType2: '',
2024-07-22 17:02:52 +08:00
goodsId: '',
2024-07-26 17:00:49 +08:00
needNum: 0
2024-07-22 17:02:52 +08:00
}),
rules: reactive({
goodsId: [
{ required: true, message: '请输入料号' }
]
}),
2024-07-30 21:02:00 +08:00
// vehicleType1Options: [],
2024-07-26 17:00:49 +08:00
vehicleType2Options: [
{
value: 'CLC一箱一料',
label: 'CLC一箱一料'
},
{
value: 'CLC一箱两料',
label: 'CLC一箱两料'
},
{
value: 'No-CLC',
label: 'No-CLC'
},
{
value: '间接物料',
label: '间接物料'
}
]
2024-07-22 17:02:52 +08:00
}
},
mounted() {
// this.timer = setInterval(() => {
// // this.getAllTasks()
// }, 2000)
},
beforeUnmount() {
// clearInterval(this.timer)
2024-07-22 17:02:52 +08:00
},
methods: {
2024-07-26 17:00:49 +08:00
vehicleType2ChangeHandle() {
if (this.workFormEntity.vehicleType2 == '间接物料') {
this.displayGoods = true
2024-07-30 21:02:00 +08:00
// this.displayVehicleType1Selection = false
// this.vehicleType1Options = [
// {
// value: 'FB02',
// label: '分包1/2个料箱'
// },
// {
// value: 'FB03',
// label: '分包1/3个料箱'
// },
// {
// value: 'FB04',
// label: '分包1/4个料箱'
// },
// {
// value: 'FB05',
// label: '分包1/5个料箱'
// },
// {
// value: 'FB06',
// label: '分包1/6个料箱'
// }
// ]
2024-07-26 17:00:49 +08:00
} else if (this.workFormEntity.vehicleType2 == 'CLC一箱一料') {
this.displayGoods = false
2024-07-30 21:02:00 +08:00
// this.displayVehicleType1Selection = false
// this.vehicleType1Options = [
// {
// value: 'FC01',
// label: '822整体1个'
// }
// ]
2024-07-26 17:00:49 +08:00
} else if (this.workFormEntity.vehicleType2 == 'CLC一箱两料') {
2024-07-30 21:02:00 +08:00
this.displayGoods = false
// this.displayVehicleType1Selection = false
// this.vehicleType1Options = [
// {
// value: 'LR01',
// label: '810左右4个'
// },
// {
// value: 'UD01',
// label: '911上下2个'
// }
// ]
2024-07-26 17:00:49 +08:00
} else {
this.displayGoods = false
2024-07-30 21:02:00 +08:00
// this.displayVehicleType1Selection = false
// this.vehicleType1Options = [
// {
// value: 'FB01',
// label: '分包1个料箱'
// },
// ]
2024-07-24 22:13:40 +08:00
}
},
resetForms() {
this.workFormEntity = reactive({
2024-07-30 21:02:00 +08:00
// vehicleType1: '',
2024-07-26 17:00:49 +08:00
vehicleType2: '',
goodsId: '',
2024-07-26 17:00:49 +08:00
needNum: 0
})
2024-07-22 17:02:52 +08:00
},
confirmTask() {
2024-07-30 21:02:00 +08:00
if (this.workFormEntity.vehicleType2 == '') {
2024-07-26 17:00:49 +08:00
ElMessage({
2024-07-30 21:02:00 +08:00
message: '请选择物料种类',
2024-07-26 17:00:49 +08:00
type: 'error',
})
return
}
if (this.workFormEntity.needNum <= 0) {
ElMessage({
2024-07-26 17:00:49 +08:00
message: '料箱数量必须为大于0的整数',
type: 'error',
})
return
}
2024-07-26 17:00:49 +08:00
const request = {
2024-07-30 21:02:00 +08:00
// vehicleType1: this.workFormEntity.vehicleType1,
2024-07-26 17:00:49 +08:00
vehicleType2: this.workFormEntity.vehicleType2,
goodsId: this.workFormEntity.goodsId,
2024-07-30 21:02:00 +08:00
needNum: this.workFormEntity.needNum,
userName: store.getters.getUserName
}
2024-07-26 17:00:49 +08:00
callEmptyVehicle(request).then(res => {
const response = res.data
if (response.code == 0) {
2024-07-22 17:02:52 +08:00
ElMessage({
2024-07-30 21:02:00 +08:00
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)
2024-07-26 17:00:49 +08:00
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%;
2024-07-26 17:00:49 +08:00
height: 270px;
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) {
2024-07-26 17:00:49 +08:00
width: 230px;
2024-07-22 17:02:52 +08:00
height: 130px;
font-size: 25px;
}
:deep(.el-input-number) {
2024-07-26 17:00:49 +08:00
width: 150px;
height: 130px;
font-size: 25px;
}
:deep(.el-select-v2__wrapper) {
width: 230px;
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;
2024-07-26 17:00:49 +08:00
width: 240px;
2024-07-22 17:02:52 +08:00
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;
2024-07-26 17:00:49 +08:00
width: 230px;
2024-07-22 17:02:52 +08:00
margin: 5px;
padding: 5px;
border: 5px double #000000;
margin-top: 25px;
}
.display-form-div-left {
display: inline-flex;
justify-content: center;
2024-07-26 17:00:49 +08:00
width: 150px;
2024-07-22 17:02:52 +08:00
margin: 5px;
padding: 5px;
border: 5px double #000000;
}
.display-form-div-right {
display: inline-flex;
justify-content: center;
2024-07-26 17:00:49 +08:00
width: 60px;
2024-07-22 17:02:52 +08:00
margin: 5px;
padding: 5px;
background-color: #CCCCCC;
}
.display-form-text-right {
align-self: center;
font-weight: bold;
font-size: 25px;
}
</style>