bonus-ui/src/views/business-examine/direct-rotation-apply/index.vue

208 lines
7.7 KiB
Vue
Raw Normal View History

2025-02-20 16:47:45 +08:00
<template>
2025-03-20 09:51:52 +08:00
<!-- 直转审核页面 -->
2025-03-05 18:35:45 +08:00
<div class="app-container">
2025-03-06 11:13:23 +08:00
<el-form :model="queryParams" ref="queryForm" size="small" inline>
2025-03-05 18:35:45 +08:00
<el-form-item label="申请日期" prop="timeRange">
<el-date-picker
2025-03-20 09:51:52 +08:00
clearable
2025-03-05 18:35:45 +08:00
type="daterange"
2025-03-20 09:51:52 +08:00
v-model="timeRange"
2025-03-05 18:35:45 +08:00
range-separator="至"
2025-03-20 09:51:52 +08:00
format="yyyy-MM-dd"
style="width: 240px"
2025-03-05 18:35:45 +08:00
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
clearable
2025-03-20 09:51:52 +08:00
placeholder="请输入关键字"
v-model="queryParams.keyWord"
2025-03-05 18:35:45 +08:00
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable>
<el-option
:key="item.value"
:label="item.label"
:value="item.value"
2025-03-20 09:51:52 +08:00
v-for="item in statusOptions"
2025-03-05 18:35:45 +08:00
/>
</el-select>
</el-form-item>
2025-02-21 01:27:24 +08:00
2025-03-05 18:35:45 +08:00
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
2025-02-21 01:27:24 +08:00
2025-08-21 11:24:07 +08:00
<el-table :data="tableList" fit highlight-current-row style="width: 100%" :max-height="650">
2025-03-05 18:35:45 +08:00
<!-- 多选 -->
2025-03-20 09:51:52 +08:00
<!-- <el-table-column type="selection" width="55" align="center" @selection-change="selectionChange" /> -->
2025-03-05 18:35:45 +08:00
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<el-table-column
2025-03-20 09:51:52 +08:00
v-for="column in tableColumns"
2025-07-24 14:23:57 +08:00
:show-overflow-tooltip="column.showTooltip"
2025-03-05 18:35:45 +08:00
:key="column.prop"
:label="column.label"
:prop="column.prop"
2025-07-24 14:23:57 +08:00
:width="column.width"
2025-03-05 18:35:45 +08:00
align="center"
>
<!-- 插槽 -->
<template v-slot="scope" v-if="column.prop == 'flowStatus'">
2025-03-06 11:13:23 +08:00
<el-tag v-if="scope.row.flowStatus == '0'" type="warning" size="mini">待审核</el-tag>
<el-tag v-else-if="scope.row.flowStatus == '1'" size="mini">审核中</el-tag>
2025-03-06 14:53:40 +08:00
<el-tag v-else-if="scope.row.flowStatus == '2'" type="success" size="mini">已通过</el-tag>
2025-09-23 15:59:28 +08:00
<el-tag v-else-if="scope.row.flowStatus == '3'" type="danger" size="mini">已驳回</el-tag>
2025-03-05 18:35:45 +08:00
</template>
</el-table-column>
<!-- 操作 -->
2025-03-06 11:13:23 +08:00
<el-table-column label="操作" align="center">
2025-03-05 18:35:45 +08:00
<template slot-scope="scope">
<el-button
type="text"
size="mini"
icon="el-icon-edit"
2025-03-20 09:51:52 +08:00
v-if="auditingShow(scope.row)"
2025-03-05 18:35:45 +08:00
@click="handleEdit(scope.row, 2)"
>
审核
</el-button>
2025-03-06 14:53:40 +08:00
<el-button
type="text"
size="mini"
icon="el-icon-search"
@click="handleEdit(scope.row, 1)"
>
查看
</el-button>
2025-03-05 18:35:45 +08:00
</template>
</el-table-column>
</el-table>
2025-02-21 01:27:24 +08:00
2025-03-05 18:35:45 +08:00
<!-- 分页 -->
<pagination
:total="total"
2025-03-20 09:51:52 +08:00
v-show="total > 0"
@pagination="getList"
2025-03-05 18:35:45 +08:00
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
/>
</div>
2025-02-20 16:47:45 +08:00
</template>
<script>
2025-03-20 09:51:52 +08:00
import { getDirectAuditListApi } from '@/api/business/index'
2025-02-21 01:27:24 +08:00
2025-02-20 16:47:45 +08:00
export default {
2025-05-14 09:31:18 +08:00
name: 'Direct-rotation-apply',
2025-03-05 18:35:45 +08:00
data() {
return {
2025-03-20 09:51:52 +08:00
userId: '',
timeRange: [],
// 表格数据
tableList: [],
2025-03-05 18:35:45 +08:00
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '', // 关键字
status: '1' // 审核状态
2025-03-05 18:35:45 +08:00
},
2025-03-06 11:13:23 +08:00
// 状态
2025-03-05 18:35:45 +08:00
statusOptions: [
{ label: '待审核', value: '0' },
{ label: '审核中', value: '1' },
{ label: '已完成', value: '2' },
{ label: '已驳回', value: '3' }
2025-03-05 18:35:45 +08:00
],
total: 0, // 总条数
// 表头
tableColumns: [
2025-07-24 14:23:57 +08:00
{ label: '申请时间', prop: 'createTime', showToolTip: true, width: '100' },
{ label: '申请人', prop: 'leaseMan', showToolTip: true, width: '80' },
2025-09-27 16:05:11 +08:00
{ label: '直转单号', prop: 'code', showToolTip: true },
2025-07-24 14:23:57 +08:00
{ label: '转出单位', prop: 'backUnitName', showToolTip: false },
{ label: '转出工程', prop: 'backProName', showToolTip: false },
{ label: '转入单位', prop: 'leaseUnitName', showToolTip: false },
{ label: '转入工程', prop: 'leaseProName', showToolTip: false },
{ label: '状态', prop: 'flowStatus', showToolTip: true, width: '80' }
2025-03-20 09:51:52 +08:00
]
2025-02-20 16:47:45 +08:00
}
},
2025-03-05 18:35:45 +08:00
created() {
2025-03-06 11:13:23 +08:00
this.userId = sessionStorage.getItem('userId')
// // 设置默认状态为第一个选项(待审核)
// if (this.statusOptions.length > 1) {
// this.queryParams.status = this.statusOptions[1].value
// }
2025-03-05 18:35:45 +08:00
this.getList()
2025-02-20 16:47:45 +08:00
},
2025-03-05 18:35:45 +08:00
methods: {
// 查询
handleQuery() {
this.getList()
},
// 重置
handleReset() {
2025-03-20 09:51:52 +08:00
this.timeRange = []
2025-03-05 18:35:45 +08:00
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.$refs.queryForm.resetFields()
this.getList()
},
// 获取列表
async getList() {
try {
const params = {
...this.queryParams,
2025-03-24 10:07:08 +08:00
startTime: this.timeRange ? this.timeRange[0] : '',
endTime: this.timeRange ? this.timeRange[1] : ''
2025-03-05 18:35:45 +08:00
}
2025-03-20 09:51:52 +08:00
const res = await getDirectAuditListApi(params)
2025-03-05 18:35:45 +08:00
this.tableList = res.rows
this.total = res.total || 0
} catch (error) {
this.tableList = []
this.total = 0
}
},
// 多选
2025-03-20 09:51:52 +08:00
selectionChange(val) {},
2025-03-05 18:35:45 +08:00
// 编辑
handleEdit(row, type) {
2025-03-20 09:51:52 +08:00
// ----type---- 1. 查看 2. 审核
2025-03-05 18:35:45 +08:00
// 跳转审核详情页面
this.$router.push({
name: 'direct-rotation-apply',
query: {
id: row.id,
flowId: row.flowId,
taskId: row.taskId,
type: type === 1 ? 'detail' : 'edit',
nodeId: row.nodeId
}
})
},
2025-03-06 11:13:23 +08:00
// 判断审核按钮显示隐藏
auditingShow(row) {
if (row.configValue) {
2025-03-06 16:57:53 +08:00
return (row.flowStatus == 1 || row.flowStatus == 0) && row.configValue.includes(this.userId)
2025-03-06 11:13:23 +08:00
}
2025-02-21 01:27:24 +08:00
}
2025-02-20 16:47:45 +08:00
}
}
</script>