代码更新:

1. 增加电子标签库位监控界面
2. 修复二维码入库界面的bug
This commit is contained in:
梁州 2024-10-08 19:23:26 +08:00
parent 43eab72bc6
commit 3e58b8ff75
4 changed files with 118 additions and 70 deletions

View File

@ -16,7 +16,25 @@ const updateLocation = (params) => {
}) })
} }
const getELocationsByPage = (params) => {
return request({
url: '/location/getELocationsByPage',
method: 'post',
data: params
})
}
const updateELocationInfo = (params) => {
return request({
url: '/location/updateELocationInfo',
method: 'post',
data: params
})
}
export { export {
getLocations, getLocations,
updateLocation, updateLocation,
getELocationsByPage,
updateELocationInfo
} }

View File

@ -320,7 +320,7 @@ export default {
}) })
}, },
showStockDealDialog() { showStockDealDialog() {
errorBox('暂未开放') this.dialogVisible = true
}, },
exceptionHandle() { exceptionHandle() {
if (this.exceptionHandleFormEntity.vehicleId == '' || this.exceptionHandleFormEntity.goodsId == '') { if (this.exceptionHandleFormEntity.vehicleId == '' || this.exceptionHandleFormEntity.goodsId == '') {
@ -339,6 +339,7 @@ export default {
ElMessage.success(response.message) ElMessage.success(response.message)
this.exceptionHandleFormEntity.vehicleId = '' this.exceptionHandleFormEntity.vehicleId = ''
this.exceptionHandleFormEntity.goodsId = '' this.exceptionHandleFormEntity.goodsId = ''
this.dialogVisible = false
} else { } else {
errorBox(response.message) errorBox(response.message)
} }

View File

@ -3,28 +3,37 @@
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<el-row> <el-row>
<el-input v-model="vehicleIdQuery" style="width: 256px; margin-right: 10px;" placeholder="箱号" <el-input v-model="eLocationIdQuery" style="width: 158px; margin-right: 10px;" placeholder="库位号"
:suffix-icon="Search" /> :suffix-icon="Search" />
<el-input v-model="standQuery" style="width: 256px; margin-right: 10px;" placeholder="工站" <el-input v-model="workStationQuery" style="width: 158px; margin-right: 10px;" placeholder="工站"
:suffix-icon="Search" /> :suffix-icon="Search" />
<el-select-v2 v-model="pickStatusQuery" style="width: 158px; margin-right: 10px;"
placeholder="请选择亮灯状态" :options="pickStatusOptions" @change="search()"></el-select-v2>
<el-button type="primary" @click="search()">搜索</el-button> <el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button> <el-button type="warning" @click="reset()">重置</el-button>
</el-row> </el-row>
</div> </div>
<br /> <br />
<el-table :data="pickTaskList" stripe border v-loading="loading" class="table-class" highlight-current-row <el-table :data="eLocationList" stripe border v-loading="loading" class="table-class" highlight-current-row
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }" max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
:cell-style="{ 'text-align': 'center' }"> :cell-style="{ 'text-align': 'center' }">
<el-table-column width="65px" fixed="left"> <el-table-column width="65px" fixed="left">
<template v-slot="scope"> <template v-slot="scope">
<el-radio :label="scope.row.pickTaskId" v-model="pickTaskId">&nbsp;</el-radio> <el-radio :label="scope.row.eLocationId" v-model="eLocationId">&nbsp;</el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="pickTaskId" label="id" fixed="left" min-width="120px" show-overflow-tooltip /> <el-table-column prop="eLocationId" label="库位号" fixed="left" min-width="120px" show-overflow-tooltip />
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" /> <el-table-column prop="workStation" label="工作站台" min-width="120px" show-overflow-tooltip />
<el-table-column prop="standId" label="站台号" fixed="left" min-width="120px" /> <el-table-column prop="sequenceId" label="顺序号" min-width="120px" />
<el-table-column prop="pickStatus" label="拣选状态" :formatter="pickStatusFormat" min-width="120px" /> <el-table-column prop="areaId" label="区域号" min-width="120px" />
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" show-overflow-tooltip <el-table-column prop="eLocationStatus" label="状态" :formatter="eLocationStatusFormat" min-width="120px"
show-overflow-tooltip />
<el-table-column prop="taskId" label="任务号" min-width="120px" show-overflow-tooltip />
<el-table-column prop="vehicleNo" label="料箱号" min-width="120px" show-overflow-tooltip />
<el-table-column prop="needNum" label="需求数量" min-width="120px" />
<el-table-column prop="confirmNum" label="确认数量" min-width="120px" />
<el-table-column prop="taskType" label="任务类型" :formatter="taskTypeFormat" min-width="120px" />
<el-table-column prop="pickStatus" label="拣选状态" :formatter="pickStatusFormat" show-overflow-tooltip
min-width="120px" /> min-width="120px" />
<el-table-column fixed="right" label="操作" width="120px"> <el-table-column fixed="right" label="操作" width="120px">
<template v-slot="scope"> <template v-slot="scope">
@ -37,33 +46,34 @@
:small="false" :disabled="false" :background="false" :default-page-size="10" :small="false" :disabled="false" :background="false" :default-page-size="10"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
@current-change="search" /> @current-change="search" />
<el-dialog v-model="dialogVisible" title="拣选任务详细信息" width="40%" draggable :show-close="false"> <el-dialog v-model="dialogVisible" title="灯光库位详细信息" width="40%" draggable :show-close="false">
<div <div
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;"> style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
<el-form ref="pickTaskFormRef" :model="pickTaskFormEntity" :label-position="labelPosition" <el-form ref="eLocationFormRef" :model="eLocationFormEntity" :label-position="labelPosition"
label-width="100px" style="width: 95%;" :rules="rules" status-icon> label-width="100px" style="width: 95%;" :rules="rules" status-icon>
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="id" prop="pickTaskId"> <el-form-item label="库位" prop="eLocationId">
<el-input v-model="pickTaskFormEntity.pickTaskId" disabled /> <el-input v-model="eLocationFormEntity.eLocationId" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="工站" prop="vehicleId"> <el-form-item label="工站" prop="workStation">
<el-input v-model="pickTaskFormEntity.vehicleId" disabled /> <el-input v-model="eLocationFormEntity.workStation" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="小盒子" prop="standId"> <el-form-item label="库位状态" prop="eLocationStatus">
<el-input v-model="pickTaskFormEntity.standId" disabled /> <el-select-v2 v-model="eLocationFormEntity.eLocationStatus" placeholder="请选择库位状态"
:options="eLocationStatusOptions"></el-select-v2>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="任务状态" prop="pickStatus"> <el-form-item label="拣选状态" prop="pickStatus">
<el-select-v2 v-model="pickTaskFormEntity.pickStatus" placeholder="请选择任务状态" <el-select-v2 v-model="eLocationFormEntity.pickStatus" placeholder="请选择拣选状态"
:options="taskStatusOptions"></el-select-v2> :options="pickStatusOptions"></el-select-v2>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -72,7 +82,7 @@
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitInfo(pickTaskFormEntity)"> <el-button type="primary" @click="submitInfo(eLocationFormEntity)">
确定 确定
</el-button> </el-button>
</span> </span>
@ -84,48 +94,54 @@
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { getPickTasksByPage, updatePickTaskInfo } from '@/api/taskMonitor.js' import { getELocationsByPage, updateELocationInfo } from '@/api/location.js'
import { errorBox } from '@/utils/myMessageBox.js' import { errorBox } from '@/utils/myMessageBox.js'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
import { Search } from '@element-plus/icons-vue' import { Search } from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script> </script>
<script> <script>
export default { export default {
name: 'pickTaskMonitor', name: 'eLocationTable',
data() { data() {
return { return {
pickTaskList: [], eLocationList: [],
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
vehicleIdQuery: '', eLocationIdQuery: '',
standQuery: '', workStationQuery: '',
pickStatusQuery: -99,
loading: true, loading: true,
dialogVisible: false, dialogVisible: false,
pickTaskId: '', eLocationId: '',
pickTaskFormEntity: reactive({}), eLocationFormEntity: reactive({}),
pickTaskFormRef: ref(), eLocationFormRef: ref(),
labelPosition: 'top', labelPosition: 'top',
rules: reactive({}), rules: reactive({}),
taskStatusOptions: [ pickStatusOptions: [
{ {
value: -1, value: -99,
label: '暂存' label: '全部'
}, },
{ {
value: 0, value: 0,
label: '待下发' label: '未亮灯'
}, },
{ {
value: 1, value: 1,
label: '已下发' label: '已亮灯'
}
],
eLocationStatusOptions: [
{
value: 0,
label: '可用'
}, },
{ {
value: 2, value: 1,
label: '已到达' label: '不可用'
} }
], ],
} }
@ -139,70 +155,82 @@ export default {
const request = { const request = {
pageNo: this.currentPage, pageNo: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
vehicleId: this.vehicleIdQuery.trim(), eLocationId: this.eLocationIdQuery.trim(),
standId: this.standQuery.trim(), workStation: this.workStationQuery.trim(),
pickStatus: this.pickStatusQuery == -99 ? null : this.pickStatusQuery,
userName: store.getters.getUserName userName: store.getters.getUserName
} }
getPickTasksByPage(request).then(res => { getELocationsByPage(request).then(res => {
const tableResponse = res.data const tableResponse = res.data
if (tableResponse.code == 0) { if (tableResponse.code == 0) {
this.pickTaskList = tableResponse.returnData.lists this.eLocationList = tableResponse.returnData.lists
this.total = tableResponse.returnData.total this.total = tableResponse.returnData.total
} else { } else {
errorBox(tableResponse.message) errorBox(tableResponse.message)
} }
}).catch(err => { }).catch(err => {
ElMessage.error('查询拣选任务错误' + err.message) ElMessage.error('查询灯光库位信息错误' + err.message)
}) })
this.loading = false this.loading = false
}, },
dateFormat: (row, column, cellValue, index) => {
return dateFormatter(cellValue)
},
timeFormat: (row, column, cellValue, index) => {
return timeFormatter(cellValue)
},
pickStatusFormat: (row, column, cellValue, index) => { pickStatusFormat: (row, column, cellValue, index) => {
switch (cellValue) { switch (cellValue) {
case -1:
return '暂存'
case 0: case 0:
return '待下发' return '未亮灯'
case 1: case 1:
return '已下发' return '已亮灯'
case 2:
return '已到达'
default: default:
return '未知' return '未知'
} }
}, },
eLocationStatusFormat: (row, column, cellValue, index) => {
switch (cellValue) {
case 0:
return '可用'
case 1:
return '不可用'
default:
return '未知'
}
},
taskTypeFormat: (row, column, cellValue, index) => {
switch (cellValue) {
case 1:
return '备料拣选'
case 2:
return '整理大盒子'
default:
return ''
}
},
reset() { reset() {
this.vehicleIdQuery = '' this.eLocationIdQuery = ''
this.standQuery = '' this.workStationQuery = ''
this.pickStatusQuery = -99
this.search() this.search()
}, },
editCurrentRow(row) { editCurrentRow(row) {
this.pickTaskId = row.pickTaskId this.eLocationId = row.eLocationId
this.pickTaskFormEntity = { this.eLocationFormEntity = {
pickTaskId: row.pickTaskId, eLocationId: row.eLocationId,
vehicleId: row.vehicleId, workStation: row.workStation,
standId: row.standId, eLocationStatus: row.eLocationStatus,
pickStatus: row.pickStatus, pickStatus: row.pickStatus
lastUpdateTime: row.lastUpdateTime
} }
this.dialogVisible = true this.dialogVisible = true
}, },
submitInfo(formData) { submitInfo(formData) {
const params = { const params = {
pickTaskId: formData.pickTaskId, eLocationId: formData.eLocationId,
pickStatus: formData.pickStatus, eLocationStatus: formData.eLocationStatus,
pickStatus: formData.pickStatus == -99 ? null : formData.pickStatus,
userName: store.getters.getUserName userName: store.getters.getUserName
} }
updatePickTaskInfo(params).then(res => { updateELocationInfo(params).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.dialogVisible = false this.dialogVisible = false
ElMessage({ ElMessage({
message: '更新拣选任务成功。', message: '更新灯光信息成功。',
type: 'success', type: 'success',
}) })
this.search() this.search()
@ -210,11 +238,11 @@ export default {
ElMessage.error(res.data.message) ElMessage.error(res.data.message)
} }
}).catch(err => { }).catch(err => {
ElMessage.error('更新拣选任务失败。') ElMessage.error('更新灯光信息失败。')
}) })
}, },
getCurrentRow(row) { getCurrentRow(row) {
this.pickTaskId = row.pickTaskId this.eLocationId = row.eLocationId
}, },
}, },
} }

View File

@ -154,6 +154,7 @@ export default {
resetForms() { resetForms() {
this.workFormEntity = reactive({ this.workFormEntity = reactive({
vehicleId: '', vehicleId: '',
qrcode: '',
goodsId: '', goodsId: '',
goodsNum: null goodsNum: null
}) })