代码更新:
1.出库修复 2.增加托盘库功能
This commit is contained in:
parent
3761fccb25
commit
cc78ef3e2a
|
|
@ -16,7 +16,7 @@ const sendGoodsOutTask = (params) => {
|
|||
})
|
||||
}
|
||||
|
||||
const getTasks = () => {
|
||||
const getTasks = (params) => {
|
||||
return request({
|
||||
url: '/task/getTasks',
|
||||
method: 'post',
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ export default {
|
|||
this.tempVehicleId = ''
|
||||
this.tempOriginPoint = ''
|
||||
this.totalWeight = 0
|
||||
this.isEmptyTask == null
|
||||
this.isEmptyTask = null
|
||||
formEl.resetFields()
|
||||
this.disabledEmpty = false
|
||||
} else {
|
||||
|
|
|
|||
388
src/layout/goodsInTP.vue
Normal file
388
src/layout/goodsInTP.vue
Normal file
|
|
@ -0,0 +1,388 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="left">
|
||||
<fieldset class="display-area">
|
||||
<legend>
|
||||
入库暂存信息
|
||||
</legend>
|
||||
<el-table :data="tempTasks" stripe border class="table-class" max-height="684px"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="vehicleId" label="载具号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="goodsId" label="物料编号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="goodsNum" label="数量" min-width="120px" />
|
||||
<el-table-column prop="goodsName" label="物料名称" min-width="120px" />
|
||||
<el-table-column prop="singleWeight" label="单个物料重量" min-width="120px" />
|
||||
<el-table-column prop="weight" label="物料总重量" min-width="120px" />
|
||||
<el-table-column prop="originPoint" label="入库站点" min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template #default>
|
||||
<el-button plain type="primary" @click="deleteRowTask(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="right">
|
||||
<fieldset class="input-area">
|
||||
<legend>输入入库信息</legend>
|
||||
<el-form ref="taskInRequestRef" :model="taskInRequestEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="载具号" prop="vehicleId">
|
||||
<el-input v-model="taskInRequestEntity.vehicleId" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料编号" prop="goodsId">
|
||||
<el-input v-model="taskInRequestEntity.goodsId" :disabled="disabledEmpty"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="数量" prop="goodsNum">
|
||||
<el-input-number v-model.number="taskInRequestEntity.goodsNum" clearable
|
||||
controls-position="right" :min="1" :disabled="disabledEmpty"
|
||||
@blur="calWeight(taskInRequestEntity)"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料名称" prop="goodsName">
|
||||
<el-input v-model="taskInRequestEntity.goodsName" :disabled="disabledEmpty"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="单个物料重量" prop="singleWeight">
|
||||
<el-input-number v-model.number="taskInRequestEntity.singleWeight" clearable
|
||||
controls-position="right" :min="0" :precision="3" :disabled="disabledEmpty"
|
||||
@blur="calWeight(taskInRequestEntity)"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料总重量" prop="weight">
|
||||
<el-input-number v-model.number="taskInRequestEntity.weight" clearable
|
||||
controls-position="right" :min="0" :precision="3"
|
||||
:disabled="disabledEmpty"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="入库站点" prop="originPoint">
|
||||
<el-select-v2 v-model="taskInRequestEntity.originPoint" placeholder="请选择入库站点"
|
||||
:options="standOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否空托" prop="isEmpty">
|
||||
<el-select-v2 v-model="taskInRequestEntity.isEmpty" placeholder="请选择入库类型"
|
||||
:options="stockTypeOptions"
|
||||
@change="autoCompleteEmptyInfo(taskInRequestEntity)"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16" class="btn-area">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item>
|
||||
<el-button type="primary" round
|
||||
@click="addTempTasks(taskInRequestRef)">绑定信息</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="success" round
|
||||
@click="submitGoodsInTask(taskInRequestRef)">下发任务</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="danger" round @click="resetForm(taskInRequestRef)">清空信息</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { sendGoodsInTask } from '@/api/task'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import store from '@/store'
|
||||
const taskInRequestRef = ref()
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'goodsInTP',
|
||||
data() {
|
||||
return {
|
||||
areaId: 1,
|
||||
labelPosition: "top",
|
||||
tempTasks: [],
|
||||
tempVehicleId: '',
|
||||
tempOriginPoint: '',
|
||||
totalWeight: 0,
|
||||
isEmptyTask: null,
|
||||
disabledEmpty: false,
|
||||
taskInRequestEntity: reactive({
|
||||
vehicleId: '',
|
||||
originPoint: 'RC1',
|
||||
goodsId: '',
|
||||
goodsName: '',
|
||||
singleWeight: 0,
|
||||
goodsNum: 1,
|
||||
weight: 0,
|
||||
isEmpty: '1'
|
||||
}),
|
||||
rules: reactive({
|
||||
vehicleId: [
|
||||
{ required: true, message: '请输入载具号' }
|
||||
],
|
||||
goodsId: [
|
||||
{ required: true, message: '请输入物料号' }
|
||||
],
|
||||
goodsNum: [
|
||||
{ required: true, message: '请输入数量' },
|
||||
{ type: 'number', message: '请输入数字' }
|
||||
]
|
||||
}),
|
||||
standOptions: [
|
||||
{
|
||||
value: "RC1",
|
||||
label: '入库口'
|
||||
}
|
||||
],
|
||||
stockTypeOptions: [
|
||||
{
|
||||
value: '0',
|
||||
label: '空载具入库'
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: '带料入库'
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
autoCompleteEmptyInfo(taskInRequestEntity) {// 自动补全空托入库信息
|
||||
if (taskInRequestEntity.isEmpty == '0') {// 空托入库
|
||||
taskInRequestEntity.goodsId = 'empty'
|
||||
taskInRequestEntity.goodsName = '空载具'
|
||||
taskInRequestEntity.goodsNum = 1
|
||||
taskInRequestEntity.singleWeight = 0
|
||||
taskInRequestEntity.weight = 0
|
||||
this.disabledEmpty = true
|
||||
} else {
|
||||
taskInRequestEntity.goodsId = ''
|
||||
taskInRequestEntity.goodsName = ''
|
||||
taskInRequestEntity.goodsNum = 1
|
||||
taskInRequestEntity.singleWeight = 0
|
||||
taskInRequestEntity.weight = 0
|
||||
this.disabledEmpty = false
|
||||
}
|
||||
},
|
||||
calWeight(taskInRequestEntity) {
|
||||
if (taskInRequestEntity.singleWeight != null | undefined) {
|
||||
taskInRequestEntity.weight = taskInRequestEntity.singleWeight * taskInRequestEntity.goodsNum
|
||||
}
|
||||
},
|
||||
addTempTasks(taskInRequestRef) {// 生成入库任务
|
||||
if (!taskInRequestRef) return
|
||||
taskInRequestRef.validate((valid) => {
|
||||
if (!valid) {
|
||||
ElMessage({
|
||||
message: '请输入必须的入库信息!',
|
||||
type: 'warning',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.isEmptyTask != null | undefined) {
|
||||
if (this.isEmptyTask) {
|
||||
ElMessage({
|
||||
message: '当前载具已绑定空载具入库',
|
||||
type: 'warning',
|
||||
})
|
||||
return
|
||||
} else {
|
||||
if (this.taskInRequestEntity.isEmpty == '1' && this.tempTasks.length != 0) {
|
||||
ElMessage({
|
||||
message: '当前载具已绑定过任务,不允许再绑定空载具入库',
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.tempOriginPoint != '' && this.tempOriginPoint != this.taskInRequestEntity.originPoint) {
|
||||
ElMessage({
|
||||
message: '入库站台不一致!',
|
||||
type: 'warning',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.tempVehicleId != '' && this.tempVehicleId != this.taskInRequestEntity.vehicleId) {
|
||||
ElMessage({
|
||||
message: '载具号不一致',
|
||||
type: 'warning',
|
||||
})
|
||||
return
|
||||
}
|
||||
this.tempVehicleId = this.taskInRequestEntity.vehicleId
|
||||
this.tempOriginPoint = this.taskInRequestEntity.originPoint
|
||||
this.totalWeight = this.totalWeight + this.taskInRequestEntity.weight
|
||||
if (this.taskInRequestEntity.isEmpty == '0') {
|
||||
this.isEmptyTask = true
|
||||
} else {
|
||||
this.isEmptyTask = false
|
||||
}
|
||||
const tempTask = {
|
||||
vehicleId: this.taskInRequestEntity.vehicleId,
|
||||
originPoint: this.taskInRequestEntity.originPoint,
|
||||
goodsId: this.taskInRequestEntity.goodsId,
|
||||
goodsName: this.taskInRequestEntity.goodsName,
|
||||
singleWeight: this.taskInRequestEntity.singleWeight,
|
||||
goodsNum: this.taskInRequestEntity.goodsNum,
|
||||
weight: this.taskInRequestEntity.weight
|
||||
}
|
||||
this.tempTasks.push(tempTask)
|
||||
// 清空物料相关信息
|
||||
if (!this.isEmptyTask) {
|
||||
this.taskInRequestEntity.goodsId = ''
|
||||
this.taskInRequestEntity.goodsName = ''
|
||||
this.taskInRequestEntity.goodsNum = 1
|
||||
this.taskInRequestEntity.singleWeight = 0
|
||||
this.taskInRequestEntity.weight = 0
|
||||
this.taskInRequestEntity.isEmpty = '1'
|
||||
this.disabledEmpty = false
|
||||
}
|
||||
ElMessage({
|
||||
message: '绑定成功!',
|
||||
type: 'success',
|
||||
})
|
||||
})
|
||||
},
|
||||
submitGoodsInTask(formEl) {// 下发入库任务
|
||||
const inParams = {
|
||||
areaId: this.areaId,
|
||||
vehicleId: this.tempVehicleId,
|
||||
originPoint: this.tempOriginPoint,
|
||||
totalWeight: this.totalWeight,
|
||||
userName: store.getters.getUserName,
|
||||
goodsList: this.isEmptyTask == false && this.tempTasks.length > 0 ? this.tempTasks : null
|
||||
}
|
||||
sendGoodsInTask(inParams).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '创建入库任务成功!',
|
||||
type: 'success',
|
||||
})
|
||||
this.tempTasks = []
|
||||
this.tempVehicleId = ''
|
||||
this.tempOriginPoint = ''
|
||||
this.totalWeight = 0
|
||||
this.isEmptyTask = null
|
||||
formEl.resetFields()
|
||||
this.disabledEmpty = false
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('创建入库任务错误!' + err.message)
|
||||
})
|
||||
},
|
||||
resetForm(formEl) {// 重置表单信息
|
||||
if (!formEl) return
|
||||
formEl.resetFields()
|
||||
},
|
||||
deleteRowTask(row) {// 删除当前行的入库任务
|
||||
this.tempTasks.splice(this.tempTasks.indexOf(row), 1)
|
||||
if (this.tempTasks.length == 0) {
|
||||
this.tempVehicleId = ''
|
||||
this.tempOriginPoint = ''
|
||||
this.totalWeight = 0
|
||||
this.isEmptyTask = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 30% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* .btn-area .el-form-item {
|
||||
width: 30% inherit;
|
||||
padding-left: 15px;
|
||||
} */
|
||||
|
||||
.el-row .el-form-item .el-select {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 40%;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.left {
|
||||
width: 60%;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.input-area {
|
||||
margin: auto;
|
||||
max-width: inherit;
|
||||
height: 632px;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
}
|
||||
|
||||
.display-area {
|
||||
margin: auto;
|
||||
min-width: inherit;
|
||||
height: 632px;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -201,6 +201,7 @@ export default {
|
|||
mounted() {
|
||||
this.timer = setInterval(() => {
|
||||
this.getAllTasks()
|
||||
this.getPickTaskDetails()
|
||||
}, 2000)
|
||||
},
|
||||
beforeUnmount() {
|
||||
|
|
@ -310,7 +311,9 @@ export default {
|
|||
areaId: this.areaId,
|
||||
}
|
||||
getTasks(request).then(res1 => {
|
||||
console.log(request)
|
||||
if (res1.data.code == 0) {
|
||||
console.log(res1.data.returnData)
|
||||
if (res1.data.returnData.length > 0) {
|
||||
const currentFinishTask = res1.data.returnData[0];
|
||||
if (currentFinishTask.taskId == this.pickConfirmEntity.taskId) {// 信息没更新
|
||||
|
|
|
|||
488
src/layout/goodsOutTP.vue
Normal file
488
src/layout/goodsOutTP.vue
Normal file
|
|
@ -0,0 +1,488 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="left">
|
||||
<fieldset class="display-area">
|
||||
<legend>
|
||||
当前WMS出库任务
|
||||
</legend>
|
||||
<!-- 此表格现在显示当前当前站台正在执行的出库任务 -->
|
||||
<el-table :data="tasks" stripe border class="table-class" max-height="250px"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="goodsRelated.goodsId" label="物料编号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="vehicleId" label="载具号" min-width="120px" />
|
||||
<el-table-column prop="goodsRelated.originNum" label="库存数量" min-width="120px" />
|
||||
<el-table-column prop="goodsRelated.opNum" label="操作数量" min-width="120px" />
|
||||
<el-table-column prop="origin" label="起始位置" min-width="120px" />
|
||||
<el-table-column prop="destination" label="目标位置" min-width="120px" />
|
||||
<el-table-column prop="isPicking" label="是否拣选" min-width="120px" />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" />
|
||||
<el-table-column prop="createTime" label="运行时长" :formatter="dueFormat" min-width="120px" />
|
||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
||||
min-width="120px" />
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 25, 50]" :small="false" :disabled="false" :background="false"
|
||||
:default-page-size="10" @size-change="getAllTasks" @current-change="getAllTasks"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" />
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="right">
|
||||
<fieldset class="input-area-up">
|
||||
<legend>出库输入信息</legend>
|
||||
<el-form ref="taskOutRequestRef" :model="taskOutRequestEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="载具号" prop="vehicleId">
|
||||
<el-input v-model="taskOutRequestEntity.vehicleId" clearable
|
||||
placeholder="此处输入载具号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料编号" prop="goodsId">
|
||||
<el-input v-model="taskOutRequestEntity.goodsId" clearable placeholder="此处输入物料编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="数量" prop="goodsNum">
|
||||
<el-input-number v-model.number="taskOutRequestEntity.goodsNum"
|
||||
controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="起始库位" prop="originPoint">
|
||||
<el-input v-model="taskOutRequestEntity.originPoint" clearable
|
||||
placeholder="此处输入起始库位,格式为A-01-01-01" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="是否拣选" prop="isPicking">
|
||||
<el-select-v2 v-model="taskOutRequestEntity.isPicking" placeholder="请选择是否拣选"
|
||||
:options="pickOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="出库站台" prop="destinationPoint">
|
||||
<el-select-v2 v-model="taskOutRequestEntity.destinationPoint" placeholder="请选择出库站台"
|
||||
:options="destinationPointOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16" class="btn-area">
|
||||
<el-col :span="8" :offset="8">
|
||||
<el-form-item>
|
||||
<el-button type="success" round
|
||||
@click="submitGoodsOutTask(taskOutRequestRef, taskOutRequestEntity)">下发任务</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<fieldset class="input-area-down" style="margin-top: 15px;">
|
||||
<legend>拣选确认信息</legend>
|
||||
<el-form ref="pickConfirmRef" :model="pickConfirmEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="载具号" prop="vehicleId">
|
||||
<el-input v-model="pickConfirmEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料编号" prop="goodsId">
|
||||
<el-input v-model="pickConfirmEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库存数量" prop="originNum">
|
||||
<el-input-number v-model.number="pickConfirmEntity.originNum" clearable
|
||||
controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="拣选数量" prop="opNum">
|
||||
<el-input-number v-model.number="pickConfirmEntity.opNum" clearable
|
||||
controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16" class="btn-area">
|
||||
<el-col :span="8" :offset="8">
|
||||
<el-form-item>
|
||||
<el-button type="success" round
|
||||
@click="confirmTask(pickConfirmRef, pickConfirmEntity)">拣货完成确认回库</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { sendGoodsOutTask, getTasksByPage, getTasks, finishPickingAndBack } from '@/api/task'
|
||||
import { taskStatusFormatter, dueFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
const taskOutRequestRef = ref()
|
||||
const pickConfirmRef = ref()
|
||||
const rules = reactive({
|
||||
destinationPointOptions: [
|
||||
{ required: true, message: '请选择出库站台' }
|
||||
]
|
||||
})
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'goodsOutTP',
|
||||
data() {
|
||||
return {
|
||||
areaId: 1,
|
||||
timer: '',
|
||||
tasks: [],
|
||||
pageInfo: {},
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
labelPosition: 'top',
|
||||
taskOutRequestEntity: {
|
||||
vehicleId: '',
|
||||
goodsId: '',
|
||||
goodsNum: 0,
|
||||
originPoint: '',
|
||||
isPicking: 0,
|
||||
destinationPoint: '',
|
||||
userName: store.getters.getUserName,
|
||||
},
|
||||
pickConfirmEntity: {
|
||||
taskId: '',
|
||||
vehicleId: '',
|
||||
goodsId: '',
|
||||
opNum: 0,
|
||||
originNum: 0,
|
||||
userName: store.getters.getUserName,
|
||||
},
|
||||
destinationPointOptions: [
|
||||
{
|
||||
value: "RC1",
|
||||
label: '入库口'
|
||||
},
|
||||
{
|
||||
value: "P1",
|
||||
label: '拣选台'
|
||||
}
|
||||
],
|
||||
pickOptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: '非拣选任务'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '拣选任务'
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.timer = setInterval(() => {
|
||||
this.getAllTasks()
|
||||
this.getPickTaskDetails()
|
||||
}, 2000)
|
||||
},
|
||||
beforeUnmount() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
getAllTasks() {
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
taskType: 2
|
||||
}
|
||||
getTasksByPage(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code != 0) {
|
||||
ElMessage.error(tableResponse.message)
|
||||
}
|
||||
this.tasks = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询任务错误')
|
||||
})
|
||||
},
|
||||
// 任务状态中文化
|
||||
taskStatusFormat: (row, column, cellValue, index) => {
|
||||
return taskStatusFormatter(cellValue)
|
||||
},
|
||||
// 任务时长中文化
|
||||
dueFormat: (row, column, cellValue, index) => {
|
||||
return dueFormatter(cellValue)
|
||||
},
|
||||
// 时间格式化
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
submitGoodsOutTask(formEl, formData) {
|
||||
if (!formEl) return
|
||||
formEl.validate((valid) => {
|
||||
if (!valid) {
|
||||
ElMessage({
|
||||
message: '请输入必须的出库信息!',
|
||||
type: 'warning',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (formData.vehicleId == '' && formData.goodsId == '' && formData.originPoint == '') {
|
||||
ElMessage({
|
||||
message: '载具号、物料号、起始库位号必须至少输入一个',
|
||||
type: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (formData.goodsNum <= 0) {
|
||||
ElMessage({
|
||||
message: '数量必须要大于0的数字',
|
||||
type: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
if ((formData.isPicking == 1 && formData.destinationPoint != 'P1')) {
|
||||
ElMessage({
|
||||
message: '拣选任务必须选拣选站台',
|
||||
type: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (formData.isPicking == 0 && formData.destinationPoint == 'P1') {
|
||||
ElMessage({
|
||||
message: '非拣选任务不得选拣选站台',
|
||||
type: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
const outParams = {
|
||||
areaId: this.areaId,
|
||||
goodsId: formData.goodsId,
|
||||
goodsNum: formData.goodsNum,
|
||||
vehicleId: formData.vehicleId,
|
||||
originPoint: formData.originPoint,
|
||||
destinationPoint: formData.destinationPoint,
|
||||
userName: store.getters.getUserName,
|
||||
isPicking: formData.isPicking,
|
||||
pickStand: formData.destinationPoint
|
||||
}
|
||||
sendGoodsOutTask(outParams).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '创建出库任务成功!',
|
||||
type: 'success',
|
||||
})
|
||||
formEl.resetFields()
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('创建出库任务错误!')
|
||||
})
|
||||
})
|
||||
},
|
||||
getPickTaskDetails() {
|
||||
const request = {
|
||||
taskType: 2,
|
||||
isPicking: 1,
|
||||
taskStatus: 8,
|
||||
areaId: this.areaId,
|
||||
}
|
||||
getTasks(request).then(res1 => {
|
||||
if (res1.data.code == 0) {
|
||||
if (res1.data.returnData.length > 0) {
|
||||
const currentFinishTask = res1.data.returnData[0];
|
||||
if (currentFinishTask.taskId == this.pickConfirmEntity.taskId) {// 信息没更新
|
||||
return
|
||||
}
|
||||
this.pickConfirmEntity.taskId = currentFinishTask.taskId
|
||||
this.pickConfirmEntity.goodsId = currentFinishTask.goodsRelated.goodsId
|
||||
this.pickConfirmEntity.vehicleId = currentFinishTask.vehicleId
|
||||
this.pickConfirmEntity.opNum = currentFinishTask.goodsRelated.opNum
|
||||
this.pickConfirmEntity.originNum = currentFinishTask.goodsRelated.originNum
|
||||
|
||||
} else {
|
||||
this.pickConfirmEntity.taskId = ''
|
||||
this.pickConfirmEntity.goodsId = ''
|
||||
this.pickConfirmEntity.vehicleId = ''
|
||||
this.pickConfirmEntity.opNum = 0
|
||||
this.pickConfirmEntity.originNum = 0
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('查询任务错误')
|
||||
})
|
||||
},
|
||||
confirmTask(formEl, formData) {
|
||||
if (!formEl) return
|
||||
formEl.validate((valid) => {
|
||||
if (!valid) {
|
||||
ElMessage({
|
||||
message: '确认信息验证失败',
|
||||
type: 'warning',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (formData.taskId = '' || formData.vehicleId == '' || formData.goodsId == '') {
|
||||
ElMessage({
|
||||
message: '载具号、物料号、任务号不可缺少',
|
||||
type: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
const confirmParams = {
|
||||
areaId: this.areaId,
|
||||
taskId: formData.taskId,
|
||||
vehicleId: formData.vehicleId,
|
||||
goodsId: formData.goodsId,
|
||||
opNum: formData.opNum,
|
||||
originNum: formData.originNum,
|
||||
userName: formData.userName
|
||||
}
|
||||
finishPickingAndBack(confirmParams).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '确认成功!',
|
||||
type: 'success',
|
||||
})
|
||||
formEl.resetFields()
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('创建出库任务错误!')
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 30% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-area .el-form-item {
|
||||
width: 30% inherit;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 40%;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.left {
|
||||
width: 60%;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.input-area-up {
|
||||
margin: auto;
|
||||
max-width: inherit;
|
||||
height: 300px;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
}
|
||||
|
||||
.input-area-down {
|
||||
margin: auto;
|
||||
max-width: inherit;
|
||||
height: 300px;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
}
|
||||
|
||||
.display-area {
|
||||
margin: auto;
|
||||
min-width: inherit;
|
||||
height: 632px;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.qr-code-container {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.card-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.text-over {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 130px;
|
||||
}
|
||||
|
||||
.objectDialogFlowPrint .myPrint {
|
||||
/* 打印的时候是否显示底色 */
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.objectDialogFlowPrint .pageWarp {
|
||||
/*这句话很重要,控制时候强制分页 https://www.w3school.com.cn/cssref/pr_page-break-after.asp*/
|
||||
page-break-after: always;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin: 5px auto;
|
||||
padding: auto;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -41,7 +41,7 @@ function taskStatusFormatter(value) {
|
|||
case 7:
|
||||
return '正在回库'
|
||||
case 8:
|
||||
return '盘点中'
|
||||
return '拣选中/盘点中'
|
||||
case 100:
|
||||
return '任务完成'
|
||||
case 998:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user