2 changed files with 566 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||||
|
import { createAPI } from "@/utils/httpRequest.js"; |
||||
|
|
||||
|
// 分页查询栈板扫描回调记录 - rqrq
|
||||
|
export const getPalletScanCallbackList = data => createAPI(`/automatedWarehouse/palletScanCallback/list`,'post',data) |
||||
|
|
||||
|
// 获取处理状态选项 - rqrq
|
||||
|
export const getStatusOptions = data => createAPI(`/automatedWarehouse/palletScanCallback/statusOptions`,'post',data) |
||||
|
|
||||
|
// 获取操作类型选项 - rqrq
|
||||
|
export const getActionTypeOptions = data => createAPI(`/automatedWarehouse/palletScanCallback/actionTypeOptions`,'post',data) |
||||
|
|
||||
@ -0,0 +1,555 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<!-- 查询表单 - rqrq --> |
||||
|
<el-form :inline="true" label-position="top" style="margin-top: 1px; margin-left: 0px;"> |
||||
|
|
||||
|
<el-form-item label="栈板ID"> |
||||
|
<el-input v-model="queryData.palletId" style="width: 120px" placeholder="栈板ID" clearable></el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="任务号"> |
||||
|
<el-input v-model="queryData.taskNo" style="width: 120px" placeholder="任务号" clearable></el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="处理状态"> |
||||
|
<el-select v-model="queryData.processStatus" placeholder="请选择" style="width: 120px" clearable> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option |
||||
|
v-for="item in statusOptions" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="操作类型"> |
||||
|
<el-select v-model="queryData.actionType" placeholder="请选择" style="width: 120px" clearable> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option |
||||
|
v-for="item in actionTypeOptions" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="创建时间从"> |
||||
|
<el-date-picker |
||||
|
v-model="queryData.startDate" |
||||
|
type="date" |
||||
|
style="width: 120px" |
||||
|
placeholder="开始日期" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
clearable> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="创建时间至"> |
||||
|
<el-date-picker |
||||
|
v-model="queryData.endDate" |
||||
|
type="date" |
||||
|
style="width: 120px" |
||||
|
placeholder="结束日期" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
clearable> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="getDataList()">查询</el-button> |
||||
|
<el-button @click="resetQuery()">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<!-- 数据表格 - rqrq --> |
||||
|
<el-table |
||||
|
:data="dataList" |
||||
|
:height="height" |
||||
|
border |
||||
|
highlight-current-row |
||||
|
v-loading="dataListLoading" |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnList" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed==''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="item.columnProp === 'processStatus'"> |
||||
|
<el-tag |
||||
|
:type="getStatusType(scope.row.processStatus)" |
||||
|
size="small"> |
||||
|
{{ getStatusLabel(scope.row.processStatus) }} |
||||
|
</el-tag> |
||||
|
</span> |
||||
|
<span v-else-if="item.columnProp === 'actionType'"> |
||||
|
<el-tag |
||||
|
:type="scope.row.actionType === '自动分拣' ? 'success' : 'warning'" |
||||
|
size="small"> |
||||
|
{{ scope.row.actionType || '-' }} |
||||
|
</el-tag> |
||||
|
</span> |
||||
|
<span v-else-if="item.columnProp === 'soreType'"> |
||||
|
{{ getSoreTypeLabel(scope.row.soreType) }} |
||||
|
</span> |
||||
|
<span v-else>{{ scope.row[item.columnProp] }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<!-- 操作列 - rqrq --> |
||||
|
<el-table-column |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
fixed="right" |
||||
|
width="100" |
||||
|
label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<a type="text" @click="viewDetail(scope.row)">查看明细</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<!-- 分页 - rqrq --> |
||||
|
<el-pagination |
||||
|
@size-change="sizeChangeHandle" |
||||
|
@current-change="currentChangeHandle" |
||||
|
:current-page="pageIndex" |
||||
|
:page-sizes="[20, 50, 100, 1000]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
|
||||
|
<!-- 明细弹窗 - rqrq --> |
||||
|
<el-dialog |
||||
|
title="回调明细" |
||||
|
:visible.sync="detailVisible" |
||||
|
:close-on-click-modal="false" |
||||
|
v-drag |
||||
|
width="80%"> |
||||
|
<el-row :gutter="20"> |
||||
|
<el-col :span="12"> |
||||
|
<el-card class="box-card"> |
||||
|
<div slot="header" class="clearfix"> |
||||
|
<span>基本信息</span> |
||||
|
</div> |
||||
|
<el-form label-width="150px"> |
||||
|
<el-form-item label="栈板ID:"> |
||||
|
<span>{{ detailData.palletId }}</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任务号:"> |
||||
|
<span>{{ detailData.taskNo }}</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="明细行号:"> |
||||
|
<span>{{ detailData.itemNo }}</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="操作类型:"> |
||||
|
<el-tag |
||||
|
:type="detailData.actionType === '自动分拣' ? 'success' : 'warning'" |
||||
|
size="small"> |
||||
|
{{ detailData.actionType || '-' }} |
||||
|
</el-tag> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="分拣方式:"> |
||||
|
<span>{{ getSoreTypeLabel(detailData.soreType) }}</span> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
|
||||
|
<el-col :span="12"> |
||||
|
<el-card class="box-card"> |
||||
|
<div slot="header" class="clearfix"> |
||||
|
<span>处理信息</span> |
||||
|
</div> |
||||
|
<el-form label-width="150px"> |
||||
|
<el-form-item label="处理状态:"> |
||||
|
<el-tag |
||||
|
:type="getStatusType(detailData.processStatus)" |
||||
|
size="small"> |
||||
|
{{ getStatusLabel(detailData.processStatus) }} |
||||
|
</el-tag> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="WCS扫描时间:"> |
||||
|
<span>{{ detailData.wcsScanTime }}</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="处理时间:"> |
||||
|
<span>{{ detailData.processTime || '-' }}</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="重试次数:"> |
||||
|
<span>{{ detailData.retryCount }}</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="错误信息:"> |
||||
|
<span style="color: #F56C6C;">{{ detailData.errorMsg || '-' }}</span> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-row :gutter="20" style="margin-top: 20px;"> |
||||
|
<el-col :span="24"> |
||||
|
<el-card class="box-card"> |
||||
|
<div slot="header" class="clearfix"> |
||||
|
<span>扫描条码列表 ({{ wcsBarcodes.length }})</span> |
||||
|
</div> |
||||
|
<div style="max-height: 300px; overflow-y: auto;"> |
||||
|
<el-tag |
||||
|
v-for="(barcode, index) in wcsBarcodes" |
||||
|
:key="index" |
||||
|
type="success" |
||||
|
size="small" |
||||
|
style="margin: 5px;"> |
||||
|
{{ barcode }} |
||||
|
</el-tag> |
||||
|
<div v-if="wcsBarcodes.length === 0" style="text-align: center; color: #999;"> |
||||
|
暂无数据 |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-row :gutter="20" style="margin-top: 20px;"> |
||||
|
<el-col :span="24"> |
||||
|
<el-card class="box-card"> |
||||
|
<div slot="header" class="clearfix"> |
||||
|
<span>JSON数据</span> |
||||
|
</div> |
||||
|
<div style="max-height: 400px; overflow-y: auto;"> |
||||
|
<pre style="background-color: #f5f7fa; padding: 10px; border-radius: 4px; font-size: 12px;">{{ jsonStr }}</pre> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button @click="detailVisible = false">关闭</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getPalletScanCallbackList, |
||||
|
getStatusOptions, |
||||
|
getActionTypeOptions |
||||
|
} from '@/api/warehouse/palletScanCallback.js' |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
// 查询条件 - rqrq |
||||
|
queryData: { |
||||
|
site: '', |
||||
|
palletId: '', |
||||
|
taskNo: '', |
||||
|
processStatus: '', |
||||
|
actionType: '', |
||||
|
startDate: '', |
||||
|
endDate: '', |
||||
|
page: 1, |
||||
|
limit: 20 |
||||
|
}, |
||||
|
// 表格高度 - rqrq |
||||
|
height: 450, |
||||
|
// 状态选项 - rqrq |
||||
|
statusOptions: [], |
||||
|
// 操作类型选项 - rqrq |
||||
|
actionTypeOptions: [], |
||||
|
// 表格列配置 - rqrq |
||||
|
columnList: [ |
||||
|
{ |
||||
|
columnProp: "palletId", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "栈板ID", |
||||
|
columnWidth: 120, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: "taskNo", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "任务号", |
||||
|
columnWidth: 150, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: "itemNo", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "明细行号", |
||||
|
columnWidth: 80, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: "actionType", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "操作类型", |
||||
|
columnWidth: 100, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: "soreType", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "分拣方式", |
||||
|
columnWidth: 100, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: "wcsTotalQuantity", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "扫描数量", |
||||
|
columnWidth: 80, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: "wcsScanTime", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "WCS扫描时间", |
||||
|
columnWidth: 150, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: "processStatus", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "处理状态", |
||||
|
columnWidth: 100, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: "processTime", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "处理时间", |
||||
|
columnWidth: 150, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: "retryCount", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "重试次数", |
||||
|
columnWidth: 80, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: "createdAt", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "创建时间", |
||||
|
columnWidth: 150, |
||||
|
columnSortable: false, |
||||
|
showOverflowTooltip: true, |
||||
|
fixed: "" |
||||
|
} |
||||
|
], |
||||
|
// 数据列表 - rqrq |
||||
|
dataList: [], |
||||
|
// 分页参数 - rqrq |
||||
|
pageIndex: 1, |
||||
|
pageSize: 20, |
||||
|
totalPage: 0, |
||||
|
dataListLoading: false, |
||||
|
// 明细弹窗 - rqrq |
||||
|
detailVisible: false, |
||||
|
detailData: {}, |
||||
|
wcsBarcodes: [], |
||||
|
jsonStr: '' |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
// 计算表格高度 - rqrq |
||||
|
this.height = window.innerHeight - 220; |
||||
|
}) |
||||
|
}, |
||||
|
activated() { |
||||
|
this.getDataList() |
||||
|
this.getStatusOptions() |
||||
|
this.getActionTypeOptions() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取数据列表 - rqrq |
||||
|
getDataList() { |
||||
|
this.dataListLoading = true |
||||
|
this.queryData.page = this.pageIndex |
||||
|
this.queryData.limit = this.pageSize |
||||
|
|
||||
|
getPalletScanCallbackList(this.queryData).then(({data}) => { |
||||
|
this.dataListLoading = false |
||||
|
if (data && data.code === 0) { |
||||
|
this.dataList = data.page.list || [] |
||||
|
this.totalPage = data.page.totalCount || 0 |
||||
|
} else { |
||||
|
this.dataList = [] |
||||
|
this.totalPage = 0 |
||||
|
this.$message.error(data.msg || '查询失败') |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
this.dataListLoading = false |
||||
|
console.error('查询栈板扫描回调记录失败:', error) |
||||
|
this.$message.error('查询失败') |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取状态选项 - rqrq |
||||
|
getStatusOptions() { |
||||
|
getStatusOptions().then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.statusOptions = data.options || [] |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
console.error('获取状态选项失败:', error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取操作类型选项 - rqrq |
||||
|
getActionTypeOptions() { |
||||
|
getActionTypeOptions().then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.actionTypeOptions = data.options || [] |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
console.error('获取操作类型选项失败:', error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 重置查询条件 - rqrq |
||||
|
resetQuery() { |
||||
|
this.queryData = { |
||||
|
site: '', |
||||
|
palletId: '', |
||||
|
taskNo: '', |
||||
|
processStatus: '', |
||||
|
actionType: '', |
||||
|
startDate: '', |
||||
|
endDate: '', |
||||
|
page: 1, |
||||
|
limit: 20 |
||||
|
} |
||||
|
this.pageIndex = 1 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 每页数量变化 - rqrq |
||||
|
sizeChangeHandle(val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 当前页变化 - rqrq |
||||
|
currentChangeHandle(val) { |
||||
|
this.pageIndex = val |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 获取状态标签类型 - rqrq |
||||
|
getStatusType(status) { |
||||
|
const statusMap = { |
||||
|
'PENDING': 'warning', |
||||
|
'PROCESSING': 'info', |
||||
|
'COMPLETED': 'success', |
||||
|
'FAILED': 'danger' |
||||
|
} |
||||
|
return statusMap[status] || 'info' |
||||
|
}, |
||||
|
|
||||
|
// 获取状态标签文本 - rqrq |
||||
|
getStatusLabel(status) { |
||||
|
const statusMap = { |
||||
|
'PENDING': '待处理', |
||||
|
'PROCESSING': '处理中', |
||||
|
'COMPLETED': '已完成', |
||||
|
'FAILED': '失败' |
||||
|
} |
||||
|
return statusMap[status] || '未知' |
||||
|
}, |
||||
|
|
||||
|
// 获取分拣方式文本 - rqrq |
||||
|
getSoreTypeLabel(soreType) { |
||||
|
const soreTypeMap = { |
||||
|
0: '人工', |
||||
|
1: '气胀轴', |
||||
|
2: '抱箱' |
||||
|
} |
||||
|
return soreTypeMap[soreType] || '-' |
||||
|
}, |
||||
|
|
||||
|
// 查看明细 - rqrq |
||||
|
viewDetail(row) { |
||||
|
this.detailData = row |
||||
|
|
||||
|
// 解析JSON数据 - rqrq |
||||
|
try { |
||||
|
this.wcsBarcodes = row.wcsBarcodeList ? JSON.parse(row.wcsBarcodeList) : [] |
||||
|
this.jsonStr = row.jsonStr ? JSON.stringify(JSON.parse(row.jsonStr), null, 2) : '暂无数据' |
||||
|
} catch (e) { |
||||
|
console.error('解析数据失败:', e) |
||||
|
this.wcsBarcodes = [] |
||||
|
this.jsonStr = row.jsonStr || '暂无数据' |
||||
|
} |
||||
|
|
||||
|
this.detailVisible = true |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
/* 表格样式优化 - rqrq */ |
||||
|
.mod-config { |
||||
|
padding: 10px; |
||||
|
} |
||||
|
|
||||
|
/* 卡片样式 - rqrq */ |
||||
|
.box-card { |
||||
|
margin-bottom: 20px; |
||||
|
} |
||||
|
|
||||
|
.clearfix:before, |
||||
|
.clearfix:after { |
||||
|
display: table; |
||||
|
content: ""; |
||||
|
} |
||||
|
|
||||
|
.clearfix:after { |
||||
|
clear: both; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue