wms_client_kate_suzhou/src/layout/inventory.vue

403 lines
13 KiB
Vue
Raw Normal View History

2024-07-02 08:16:55 +08:00
<template>
<el-config-provider :locale="zhCn">
<el-container class="content">
<div class="work-area">
<fieldset class="title-area">
2024-07-02 08:16:55 +08:00
<legend>
工作台
2024-07-02 08:16:55 +08:00
</legend>
<div class="title-div">
<span class="title-text">物料盘点</span>
</div>
<div class="station-div">
<span class="station-text">工作站</span>
</div>
<div class="station-no-div">
<span class="station-no-text">{{ standId }}</span>
</div>
2024-07-02 08:16:55 +08:00
</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;">
<!-- <div
style="display: inline-flex; justify-content: center; height: 60px; width: 655px; margin: 5px; padding: 5px;">
<UploadExcelPart></UploadExcelPart>
</div> -->
<div style="height: 50px; margin-bottom: 20px"><UploadInventoryList></UploadInventoryList></div>
<div
style="display: inline-flex; justify-content: center; height: 40px; width: 655px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<span style="align-self: center; font-weight: bold;font-size: 25px;">
{{ workFormEntity.tip }}
</span>
</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">
<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 class="display-form-div">
<el-input v-model="workFormEntity.vehicleId" size="default" ref="vehicleId"
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.realNum" ref="realNum"
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>
<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>
2024-07-02 08:16:55 +08:00
</el-form>
</fieldset>
</div>
</el-container>
</el-config-provider>
</template>
<script setup>
import store from '@/store'
import { getWorkByStandAndGoods, confirmFinishWork, queryFinishByStandAndGoods } from '@/api/task'
2024-07-02 08:16:55 +08:00
import { reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import UploadInventoryList from '@/excel/UploadInventoryList.vue'
2024-07-02 08:16:55 +08:00
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script>
<script>
export default {
name: 'doKitting',
2024-07-02 08:16:55 +08:00
data() {
return {
standId: store.getters.getStandId,
2024-07-02 08:16:55 +08:00
timer: '',
labelPosition: 'top',
workFormRef: ref(),
workFormEntity: reactive({
2024-07-02 08:16:55 +08:00
goodsId: '',
planPickNum: 0,
remainNumOrigin: null,
remainNumReal: null,
remark: '',
finishedRows: 0,
totalRows: 0,
finishedCounts: 0,
totalCounts: 0,
tip: ''
}),
rules: reactive({
goodsId: [
{ required: true, message: '请输入料号' }
]
}),
2024-07-02 08:16:55 +08:00
}
},
mounted() {
this.$refs.goodsId.focus()
2024-07-02 08:16:55 +08:00
this.timer = setInterval(() => {
this.queryFinish()
2024-07-02 08:16:55 +08:00
}, 2000)
},
beforeUnmount() {
clearInterval(this.timer)
},
methods: {
// 获取当前工作信息
getCurrentWorkInfo() {
const request = {
standId: this.standId,
goodsId: this.workFormEntity.goodsId
2024-07-02 08:16:55 +08:00
}
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
} else {
this.resetForms()
ElMessage.error(response.message)
2024-07-02 08:16:55 +08:00
}
}).catch(err => {
console.log(err)
this.resetForms()
ElMessage.error('查询工作信息错误')
2024-07-02 08:16:55 +08:00
})
},
// 查询是否完成
queryFinish() {
if (this.workFormEntity.goodsId == '') {
return
}
const request = {
standId: this.standId,
goodsId: this.workFormEntity.goodsId
2024-07-02 08:16:55 +08:00
}
queryFinishByStandAndGoods(request).then(res => {
const response = res.data
if (response.code == 0) {
if (response.returnData != null) {
this.workFormEntity.tip = response.returnData.tip
2024-07-02 08:16:55 +08:00
}
this.resetForms()
ElMessage.success(response.message)
2024-07-02 08:16:55 +08:00
}
}).catch(err => {
console.log(err)
})
},
// 重置参数
resetForms() {
this.workFormEntity = reactive({
goodsId: '',
planPickNum: 0,
remainNumOrigin: null,
remainNumReal: null,
remark: '',
finishedRows: 0,
totalRows: 0,
finishedCounts: 0,
totalCounts: 0,
tip: ''
2024-07-02 08:16:55 +08:00
})
this.$refs.goodsId.focus()
2024-07-02 08:16:55 +08:00
},
// 确认完成工作
confirmTask() {
if (this.standId == '' || this.workFormEntity.goodsId == '') {
2024-07-02 08:16:55 +08:00
ElMessage({
message: '站台号和料号不可缺少',
2024-07-02 08:16:55 +08:00
type: 'error',
})
return
}
const confirmParams = {
standId: this.standId,
goodsId: this.workFormEntity.goodsId,
remainNumOrigin: this.workFormEntity.remainNumOrigin,
remainNumReal: this.workFormEntity.remainNumReal
}
confirmFinishWork(confirmParams).then(res => {
const response = res.data
if (response.code == 0) {
if (response.returnData != null) {
this.workFormEntity.tip = response.returnData.tip
}
this.resetForms()
ElMessage.success(response.message)
2024-07-02 08:16:55 +08:00
} else {
ElMessage.error(response.message)
2024-07-02 08:16:55 +08:00
}
}).catch(err => {
console.log(err)
ElMessage.error('确认时发生异常')
2024-07-02 08:16:55 +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%;
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;
2024-07-02 08:16:55 +08:00
}
.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;
2024-07-02 08:16:55 +08:00
}
:deep(.el-input) {
width: 195px;
height: 130px;
font-size: 25px;
2024-07-02 08:16:55 +08:00
}
:deep(.el-input-number) {
width: 125px;
height: 130px;
font-size: 25px;
2024-07-02 08:16:55 +08:00
}
/* :deep(.el-input .el-input__inner) {
font-size: 60px;
height: 130px;
2024-07-02 08:16:55 +08:00
}
: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;
2024-07-02 08:16:55 +08:00
}
.station-div {
display: inline-flex;
justify-content: center;
width: 150px;
margin-left: 5px;
margin-right: 5px;
2024-07-02 08:16:55 +08:00
padding: 5px;
background-color: #FFFAAA;
2024-07-02 08:16:55 +08:00
}
.station-text {
align-self: center;
font-weight: bold;
font-size: 25px;
}
.station-no-div {
display: inline-flex;
justify-content: center;
width: 200px;
2024-07-02 08:16:55 +08:00
padding: 5px;
border: 5px double #000000;
2024-07-02 08:16:55 +08:00
}
.station-no-text {
align-self: center;
font-weight: bold;
font-size: 25px;
2024-07-02 08:16:55 +08:00
}
.display-title-div {
display: inline-flex;
justify-content: center;
width: 205px;
height: 80px;
margin: 5px;
padding: 5px;
background-color: #FFFAAA;
2024-07-02 08:16:55 +08:00
}
.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;
2024-07-02 08:16:55 +08:00
}
.display-form-text-right {
align-self: center;
font-weight: bold;
font-size: 25px;
2024-07-02 08:16:55 +08:00
}
</style>