2024-08-14 22:35:32 +08:00
|
|
|
<template>
|
2024-08-18 10:29:38 +08:00
|
|
|
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
2024-08-14 22:35:32 +08:00
|
|
|
<el-config-provider :locale="zhCn">
|
2024-08-18 10:29:38 +08:00
|
|
|
<div style="display: flex;justify-content: space-between;">
|
|
|
|
|
<el-row>
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-input v-model="vehicleIdQuery" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
2024-08-18 10:29:38 +08:00
|
|
|
:suffix-icon="Search" />
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-input v-model="standQuery" style="width: 256px; margin-right: 10px;" placeholder="工站"
|
2024-08-18 10:29:38 +08:00
|
|
|
:suffix-icon="Search" />
|
|
|
|
|
<el-button type="primary" @click="search()">搜索</el-button>
|
|
|
|
|
<el-button type="warning" @click="reset()">重置</el-button>
|
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
2024-08-14 22:35:32 +08:00
|
|
|
<br />
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-table :data="pickTaskList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
2024-08-18 10:29:38 +08:00
|
|
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
2024-08-14 22:35:32 +08:00
|
|
|
:cell-style="{ 'text-align': 'center' }">
|
|
|
|
|
<el-table-column width="65px" fixed="left">
|
|
|
|
|
<template v-slot="scope">
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-radio :label="scope.row.pickTaskId" v-model="pickTaskId"> </el-radio>
|
2024-08-14 22:35:32 +08:00
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-table-column prop="pickTaskId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
|
|
|
|
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" />
|
|
|
|
|
<el-table-column prop="standId" label="站台号" fixed="left" min-width="120px" />
|
|
|
|
|
<el-table-column prop="pickStatus" label="拣选状态" :formatter="pickStatusFormat" min-width="120px" />
|
|
|
|
|
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" show-overflow-tooltip
|
|
|
|
|
min-width="120px" />
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="120px">
|
2024-08-14 22:35:32 +08:00
|
|
|
<template v-slot="scope">
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
2024-08-14 22:35:32 +08:00
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</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"
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
|
|
|
|
@current-change="search" />
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-dialog v-model="dialogVisible" title="拣选任务详细信息" width="40%" draggable :show-close="false">
|
2024-08-18 10:29:38 +08:00
|
|
|
<div
|
|
|
|
|
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-form ref="pickTaskFormRef" :model="pickTaskFormEntity" :label-position="labelPosition"
|
2024-08-18 10:29:38 +08:00
|
|
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
|
|
|
|
<el-row :gutter="16">
|
|
|
|
|
<el-col :span="12" :offset="0">
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-form-item label="id" prop="pickTaskId">
|
|
|
|
|
<el-input v-model="pickTaskFormEntity.pickTaskId" disabled />
|
2024-08-18 10:29:38 +08:00
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-form-item label="工站" prop="vehicleId">
|
|
|
|
|
<el-input v-model="pickTaskFormEntity.vehicleId" disabled />
|
2024-08-18 10:29:38 +08:00
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row :gutter="16">
|
|
|
|
|
<el-col :span="12" :offset="0">
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-form-item label="小盒子" prop="standId">
|
|
|
|
|
<el-input v-model="pickTaskFormEntity.standId" disabled />
|
2024-08-18 10:29:38 +08:00
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-form-item label="任务状态" prop="pickStatus">
|
|
|
|
|
<el-select-v2 v-model="pickTaskFormEntity.pickStatus" placeholder="请选择任务状态"
|
|
|
|
|
:options="taskStatusOptions"></el-select-v2>
|
2024-08-18 10:29:38 +08:00
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
2024-08-14 22:35:32 +08:00
|
|
|
<template #footer>
|
|
|
|
|
<span class="dialog-footer">
|
|
|
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
2024-09-10 17:03:11 +08:00
|
|
|
<el-button type="primary" @click="submitInfo(pickTaskFormEntity)">
|
2024-08-14 22:35:32 +08:00
|
|
|
确定
|
|
|
|
|
</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</el-config-provider>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2024-08-18 10:29:38 +08:00
|
|
|
import store from '@/store'
|
2024-09-10 17:03:11 +08:00
|
|
|
import { getPickTasksByPage, updatePickTaskInfo } from '@/api/taskMonitor.js'
|
2024-09-20 18:35:31 +08:00
|
|
|
import { errorBox } from '@/utils/myMessageBox.js'
|
2024-09-10 17:03:11 +08:00
|
|
|
import { ElMessage } from 'element-plus'
|
2024-08-14 22:35:32 +08:00
|
|
|
import { ref, reactive } from 'vue'
|
2024-08-18 10:29:38 +08:00
|
|
|
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
|
|
|
|
import { Search } from '@element-plus/icons-vue'
|
2024-09-10 17:03:11 +08:00
|
|
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
2024-08-14 22:35:32 +08:00
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
2024-09-10 17:03:11 +08:00
|
|
|
name: 'pickTaskMonitor',
|
2024-08-14 22:35:32 +08:00
|
|
|
data() {
|
|
|
|
|
return {
|
2024-09-10 17:03:11 +08:00
|
|
|
pickTaskList: [],
|
2024-08-14 22:35:32 +08:00
|
|
|
currentPage: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
total: 0,
|
2024-09-10 17:03:11 +08:00
|
|
|
vehicleIdQuery: '',
|
|
|
|
|
standQuery: '',
|
2024-08-14 22:35:32 +08:00
|
|
|
loading: true,
|
|
|
|
|
dialogVisible: false,
|
2024-09-10 17:03:11 +08:00
|
|
|
pickTaskId: '',
|
|
|
|
|
pickTaskFormEntity: reactive({}),
|
|
|
|
|
pickTaskFormRef: ref(),
|
2024-08-14 22:35:32 +08:00
|
|
|
labelPosition: 'top',
|
2024-09-10 17:03:11 +08:00
|
|
|
rules: reactive({}),
|
|
|
|
|
taskStatusOptions: [
|
|
|
|
|
{
|
|
|
|
|
value: -1,
|
|
|
|
|
label: '暂存'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 0,
|
|
|
|
|
label: '待下发'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 1,
|
|
|
|
|
label: '已下发'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 2,
|
|
|
|
|
label: '已到达'
|
|
|
|
|
}
|
|
|
|
|
],
|
2024-08-14 22:35:32 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.search()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
search() {
|
|
|
|
|
this.loading = true
|
2024-08-18 10:29:38 +08:00
|
|
|
const request = {
|
2024-08-14 22:35:32 +08:00
|
|
|
pageNo: this.currentPage,
|
|
|
|
|
pageSize: this.pageSize,
|
2024-09-10 17:03:11 +08:00
|
|
|
vehicleId: this.vehicleIdQuery.trim(),
|
|
|
|
|
standId: this.standQuery.trim(),
|
2024-08-14 22:35:32 +08:00
|
|
|
userName: store.getters.getUserName
|
|
|
|
|
}
|
2024-09-10 17:03:11 +08:00
|
|
|
getPickTasksByPage(request).then(res => {
|
2024-08-14 22:35:32 +08:00
|
|
|
const tableResponse = res.data
|
|
|
|
|
if (tableResponse.code == 0) {
|
2024-09-10 17:03:11 +08:00
|
|
|
this.pickTaskList = tableResponse.returnData.lists
|
2024-08-14 22:35:32 +08:00
|
|
|
this.total = tableResponse.returnData.total
|
|
|
|
|
} else {
|
2024-09-20 18:35:31 +08:00
|
|
|
errorBox(tableResponse.message)
|
2024-08-14 22:35:32 +08:00
|
|
|
}
|
|
|
|
|
}).catch(err => {
|
2024-09-10 17:03:11 +08:00
|
|
|
ElMessage.error('查询拣选任务错误' + err.message)
|
2024-08-14 22:35:32 +08:00
|
|
|
})
|
|
|
|
|
this.loading = false
|
|
|
|
|
},
|
2024-08-18 10:29:38 +08:00
|
|
|
dateFormat: (row, column, cellValue, index) => {
|
|
|
|
|
return dateFormatter(cellValue)
|
2024-08-14 22:35:32 +08:00
|
|
|
},
|
|
|
|
|
timeFormat: (row, column, cellValue, index) => {
|
|
|
|
|
return timeFormatter(cellValue)
|
|
|
|
|
},
|
2024-09-10 17:03:11 +08:00
|
|
|
pickStatusFormat: (row, column, cellValue, index) => {
|
|
|
|
|
switch (cellValue) {
|
|
|
|
|
case -1:
|
|
|
|
|
return '暂存'
|
|
|
|
|
case 0:
|
|
|
|
|
return '待下发'
|
|
|
|
|
case 1:
|
|
|
|
|
return '已下发'
|
|
|
|
|
case 2:
|
|
|
|
|
return '已到达'
|
|
|
|
|
default:
|
|
|
|
|
return '未知'
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-08-14 22:35:32 +08:00
|
|
|
reset() {
|
2024-09-10 17:03:11 +08:00
|
|
|
this.vehicleIdQuery = ''
|
|
|
|
|
this.standQuery = ''
|
2024-08-14 22:35:32 +08:00
|
|
|
this.search()
|
|
|
|
|
},
|
2024-09-10 17:03:11 +08:00
|
|
|
editCurrentRow(row) {
|
|
|
|
|
this.pickTaskId = row.pickTaskId
|
|
|
|
|
this.pickTaskFormEntity = {
|
|
|
|
|
pickTaskId: row.pickTaskId,
|
|
|
|
|
vehicleId: row.vehicleId,
|
|
|
|
|
standId: row.standId,
|
|
|
|
|
pickStatus: row.pickStatus,
|
|
|
|
|
lastUpdateTime: row.lastUpdateTime
|
2024-08-14 22:35:32 +08:00
|
|
|
}
|
|
|
|
|
this.dialogVisible = true
|
|
|
|
|
},
|
2024-09-10 17:03:11 +08:00
|
|
|
submitInfo(formData) {
|
2024-08-18 10:29:38 +08:00
|
|
|
const params = {
|
2024-09-10 17:03:11 +08:00
|
|
|
pickTaskId: formData.pickTaskId,
|
|
|
|
|
pickStatus: formData.pickStatus,
|
2024-08-14 22:35:32 +08:00
|
|
|
userName: store.getters.getUserName
|
|
|
|
|
}
|
2024-09-10 17:03:11 +08:00
|
|
|
updatePickTaskInfo(params).then(res => {
|
2024-08-14 22:35:32 +08:00
|
|
|
if (res.data.code == 0) {
|
|
|
|
|
this.dialogVisible = false
|
|
|
|
|
ElMessage({
|
2024-09-10 17:03:11 +08:00
|
|
|
message: '更新拣选任务成功。',
|
2024-08-14 22:35:32 +08:00
|
|
|
type: 'success',
|
|
|
|
|
})
|
|
|
|
|
this.search()
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.data.message)
|
|
|
|
|
}
|
|
|
|
|
}).catch(err => {
|
2024-09-10 17:03:11 +08:00
|
|
|
ElMessage.error('更新拣选任务失败。')
|
2024-08-14 22:35:32 +08:00
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getCurrentRow(row) {
|
2024-09-10 17:03:11 +08:00
|
|
|
this.pickTaskId = row.pickTaskId
|
2024-08-14 22:35:32 +08:00
|
|
|
},
|
2024-08-18 10:29:38 +08:00
|
|
|
},
|
2024-08-14 22:35:32 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.el-pagination {
|
|
|
|
|
padding-left: 5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-row .el-button {
|
|
|
|
|
width: 72px;
|
|
|
|
|
margin-left: 0px;
|
|
|
|
|
margin-right: 5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table-class {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-row .el-form-item {
|
|
|
|
|
width: 10% inherit;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.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;
|
|
|
|
|
}
|
2024-08-18 10:29:38 +08:00
|
|
|
|
|
|
|
|
.title-area {
|
|
|
|
|
display: flex;
|
2024-09-10 17:03:11 +08:00
|
|
|
/* min-height: 10%; */
|
2024-08-18 10:29:38 +08:00
|
|
|
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;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
}
|
2024-08-14 22:35:32 +08:00
|
|
|
</style>
|