bonus-ui/src/views/EquipmentRetireApply/audit.vue

316 lines
8.5 KiB
Vue
Raw Normal View History

2025-11-16 23:55:09 +08:00
<template>
<div class="app-container">
<el-row>
<el-form ref="queryForm" size="small" label-width="auto" :model="queryParams">
<el-card class="search-box">
2025-11-24 18:47:53 +08:00
2025-11-16 23:55:09 +08:00
<el-row :gutter="20" style="display: flex; justify-content: space-between">
<el-col :span="5">
<el-form-item label="任务状态" prop="reviewStatus">
<el-select
v-model="queryParams.reviewStatus"
placeholder="请选择状态"
clearable
style="width: 100%"
>
<el-option label="待审批" value="0" />
<el-option label="审批中" value="1" />
<el-option label="审批完成" value="2" />
2025-11-27 20:35:03 +08:00
<el-option label="审批驳回" value="3" />
2025-11-16 23:55:09 +08:00
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="申请日期范围" prop="dateRange">
<el-date-picker
v-model="queryParams.dateRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :span="14" style="text-align: right;">
<el-button type="primary" icon="el-icon-search" size="mini" @click="onHandleQuery">
查询
</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="onHandleReset">重置</el-button>
</el-col>
</el-row>
</el-card>
</el-form>
<el-card class="content-box">
<div class="table-container">
2025-11-24 18:47:53 +08:00
<el-col :span="4">
<span style="font-size: 20px; font-weight: 800">退役审核列表</span>
</el-col>
2025-11-20 18:02:34 +08:00
<el-table :data="tableData" style="width: 100%" border stripe fit>
2025-11-16 23:55:09 +08:00
<el-table-column align="center" show-overflow-tooltip type="index" label="序号" width="50" />
<el-table-column align="center" show-overflow-tooltip prop="code" label="退役单号" />
<el-table-column align="center" show-overflow-tooltip prop="equipmentNum" label="退役装备数" />
<el-table-column align="center" show-overflow-tooltip prop="toolNum" label="退役工具数" />
<el-table-column align="center" show-overflow-tooltip prop="reviewStatus" label="任务状态">
<template slot-scope="scope">
<el-tag :type="getStatusType(scope.row.reviewStatus)">
{{ getStatusLabel(scope.row.reviewStatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" show-overflow-tooltip prop="createUser" label="申请人" />
<el-table-column align="center" show-overflow-tooltip prop="createTime" label="申请时间" />
2025-12-03 09:38:18 +08:00
<el-table-column align="center" show-overflow-tooltip label="操作">
2025-11-16 23:55:09 +08:00
<template slot-scope="scope">
2025-12-03 09:34:23 +08:00
<el-button size="mini" type="text" icon="el-icon-zoom-in" @click="onHandleView(scope.row)">查看</el-button>
<el-button v-if="scope.row.reviewStatus == 0" size="mini" type="text" icon="el-icon-edit" @click="onHandleAudit(scope.row)">审核</el-button>
2025-11-16 23:55:09 +08:00
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-wrapper">
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getRetireApplyAuditList"
/>
</div>
</el-card>
</el-row>
</div>
</template>
<script>
import { getRetireApplyListAPI } from '@/api/EquipmentRetireApply/index.js'
import pagination from '@/components/Pagination'
export default {
components: {
pagination
},
data() {
return {
queryParams: {
reviewStatus: undefined,
dateRange: undefined,
pageNum: 1,
pageSize: 10
},
tableData: [],
total: 0
}
},
methods: {
// 获取审核列表
async getRetireApplyAuditList() {
const params = {
...this.queryParams,
startDate: this.queryParams.dateRange ? this.queryParams.dateRange[0] : undefined,
endDate: this.queryParams.dateRange ? this.queryParams.dateRange[1] : undefined,
dateRange: undefined
}
const res = await getRetireApplyListAPI(params)
this.tableData = res.rows || []
this.total = res.total || 0
},
// 查询
onHandleQuery() {
this.queryParams.pageNum = 1
this.getRetireApplyAuditList()
},
// 重置
onHandleReset() {
this.queryParams = {
reviewStatus: undefined,
dateRange: undefined,
pageNum: 1,
pageSize: 10
}
this.getRetireApplyAuditList()
},
2025-12-03 09:34:23 +08:00
// 查看
onHandleView(row) {
this.$router.push({
name: 'RetireApplyDetail',
params: { id: row.id },
query: {
taskInfo: JSON.stringify(row),
mode: 'view' // 增加 mode 参数,标识为查看模式
}
})
},
2025-11-16 23:55:09 +08:00
// 审核
onHandleAudit(row) {
this.$router.push({
name: 'RetireApplyAuditDetail',
params: { id: row.id },
query: { taskInfo: JSON.stringify(row) }
})
},
// 获取状态标签
getStatusLabel(status) {
const statusMap = {
'0': '待审批',
'1': '审批中',
2025-11-27 20:35:03 +08:00
'2': '审批完成',
'3': '审批驳回'
2025-11-16 23:55:09 +08:00
}
return statusMap[status] || '未知'
},
// 获取状态类型
getStatusType(status) {
const typeMap = {
'0': 'warning',
'1': 'info',
2025-11-27 20:35:03 +08:00
'2': 'success',
'3': 'danger'
2025-11-16 23:55:09 +08:00
}
return typeMap[status] || 'info'
}
},
created() {
this.getRetireApplyAuditList()
}
}
</script>
<style lang="scss" scoped>
2025-11-20 18:02:34 +08:00
.el-form-item {
margin-bottom: 0; /* 取消form-item的默认下边距 */
}
/* 搜索栏样式 */
2025-11-16 23:55:09 +08:00
.search-box {
margin-bottom: 20px;
border-radius: 8px;
padding: 0;
2025-11-20 18:02:34 +08:00
::v-deep .el-card__body {
padding: 15px;
}
2025-11-16 23:55:09 +08:00
}
2025-11-20 18:02:34 +08:00
/* 内容容器样式 */
2025-11-16 23:55:09 +08:00
.content-box {
border-radius: 8px;
display: flex;
flex-direction: column;
overflow: hidden;
2025-11-20 18:02:34 +08:00
/* 卡片主体样式 */
2025-11-16 23:55:09 +08:00
::v-deep .el-card__body {
display: flex !important;
flex-direction: column !important;
2025-11-20 18:02:34 +08:00
padding: 15px;
height: auto !important;
2025-11-16 23:55:09 +08:00
}
2025-11-20 18:02:34 +08:00
/* 表格容器样式 */
2025-11-16 23:55:09 +08:00
.table-container {
overflow: hidden;
margin-bottom: 0;
display: flex;
flex-direction: column;
}
2025-11-20 18:02:34 +08:00
/* 分页容器样式 */
2025-11-16 23:55:09 +08:00
.pagination-wrapper {
flex-shrink: 0;
2025-11-20 18:02:34 +08:00
padding-top: 10px;
margin-top: 10px;
text-align: right;
2025-11-16 23:55:09 +08:00
::v-deep .pagination-container {
2025-11-20 18:02:34 +08:00
padding: 0 !important;
margin: 0;
2025-11-16 23:55:09 +08:00
}
}
2025-11-20 18:02:34 +08:00
/* 表格整体样式 */
2025-11-16 23:55:09 +08:00
::v-deep .el-table {
2025-11-20 18:02:34 +08:00
width: 100%;
border: 1px solid #E8E8E8;
border-radius: 4px;
2025-11-16 23:55:09 +08:00
2025-11-20 18:02:34 +08:00
/* 表头样式 */
2025-11-16 23:55:09 +08:00
.el-table__header {
2025-11-20 18:02:34 +08:00
background: #F5F5F5;
2025-11-16 23:55:09 +08:00
th {
2025-11-20 18:02:34 +08:00
background: #F5F5F5 !important;
color: #666;
font-weight: normal;
height: 40px;
border-right: 1px solid #E8E8E8;
&:last-child {
border-right: none;
}
}
}
/* 表格主体样式 */
.el-table__body {
td {
height: 40px;
border-right: 1px solid #E8E8E8;
&:last-child {
border-right: none;
}
2025-11-16 23:55:09 +08:00
}
}
2025-11-20 18:02:34 +08:00
/* 斑马纹样式 */
&.el-table--striped .el-table__body tr.el-table__row--striped td {
background-color: #F6FBFA !important;
}
/* 行hover样式 */
2025-11-16 23:55:09 +08:00
&.el-table--striped .el-table__body tr.el-table__row:hover>td.el-table__cell {
background-color: #CCF1E9 !important;
}
2025-11-20 18:02:34 +08:00
/* 表格边框合并 */
&::before {
height: 0;
}
}
/* 状态标签样式 */
::v-deep .el-tag {
border-radius: 2px;
padding: 2px 8px;
font-size: 12px;
}
/* 操作按钮样式 */
::v-deep .el-button--mini {
padding: 4px 10px;
border-radius: 2px;
&.el-button--primary {
background-color: #008859;
border-color: #008859;
&:hover {
background-color: #006644;
border-color: #006644;
}
}
&.el-button--danger {
background-color: #F5222D;
border-color: #F5222D;
&:hover {
background-color: #C41D1D;
border-color: #C41D1D;
}
}
2025-11-16 23:55:09 +08:00
}
}
</style>