You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
366 lines
9.5 KiB
366 lines
9.5 KiB
<template>
|
|
<div class="nos-task-container">
|
|
<!-- 搜索区域 -->
|
|
<div class="search-panel">
|
|
<el-form :model="searchForm" inline>
|
|
|
|
<el-form-item label="执法单位:">
|
|
<el-input
|
|
v-model="searchForm.lawEnforcementAgency"
|
|
placeholder="请输入关键字"
|
|
class="search-input"
|
|
clearable
|
|
@keyup.enter="handleSearch"
|
|
/>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="执法人员:">
|
|
<el-input
|
|
v-model="searchForm.lawEnforcerName"
|
|
placeholder="请输入关键字"
|
|
class="search-input"
|
|
clearable
|
|
@keyup.enter="handleSearch"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="时间筛选:">
|
|
<el-date-picker
|
|
v-model="searchForm.timeRange"
|
|
type="datetimerange"
|
|
range-separator="至"
|
|
start-placeholder="开始时间"
|
|
end-placeholder="截止时间"
|
|
class="date-picker"
|
|
format="YYYY-MM-DD HH:mm"
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="企业名称:">
|
|
<el-input
|
|
v-model="searchForm.enterpriseName"
|
|
placeholder="请输入关键字"
|
|
class="search-input"
|
|
clearable
|
|
@keyup.enter="handleSearch"
|
|
/>
|
|
</el-form-item>
|
|
|
|
<el-form-item label="任务状态:">
|
|
<el-select v-model="searchForm.taskStatus" placeholder="请选择" class="search-select" clearable>
|
|
<el-option v-for="item in TASK_STATUS_OPTIONS" :key="item.value" :label="item.label" :value="item.value" />
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
<el-button type="primary" @click="handleSearch" :loading="loading">搜索</el-button>
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
<el-button @click="handleReset">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
|
|
<!-- 数据表格 -->
|
|
<div class="table-container">
|
|
<el-table
|
|
v-loading="loading"
|
|
:data="tableData"
|
|
height="100%"
|
|
class="nos-task-table"
|
|
border
|
|
:header-cell-style="{ backgroundColor: '#f5f7fa', fontWeight: 'bold' }"
|
|
@selection-change="handleSelectionChange"
|
|
>
|
|
<!-- <el-table-column type="selection" width="55" /> -->
|
|
|
|
<el-table-column prop="taskTypeName" label="类别" width="110" show-overflow-tooltip />
|
|
|
|
<el-table-column prop="lawEnforcementAgency" label="执法单位" min-width="160" show-overflow-tooltip />
|
|
|
|
<el-table-column label="执法人员" min-width="140" show-overflow-tooltip>
|
|
<template #default="{ row }">
|
|
{{ formatLawEnforcer(row) }}
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column prop="enterpriseName" label="企业名称" min-width="180" show-overflow-tooltip />
|
|
|
|
<el-table-column label="任务开始时间" width="150">
|
|
<template #default="{ row }">
|
|
{{ formatDateTime(row.createTime) }}
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="任务截止时间" width="150">
|
|
<template #default="{ row }">
|
|
{{ formatDateTime(row.deadline) }}
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="任务状态" width="140">
|
|
<template #default="{ row }">
|
|
<span :class="getStatusClass(row.taskStatus)">{{ row.taskStatusName || '--' }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="企业提交时间" width="150">
|
|
<template #default="{ row }">
|
|
{{ formatDateTime(row.enterpriseHandleTime) || '--' }}
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="操作" width="80" fixed="right">
|
|
<template #default="{ row }">
|
|
<el-button size="small" type="primary" link @click="handleDetail(row)">详情</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
|
|
<!-- 分页 -->
|
|
<div class="pagination-container">
|
|
<span class="total-text">共 {{ total }} 项数据</span>
|
|
<el-pagination
|
|
v-model:current-page="currentPage"
|
|
v-model:page-size="pageSize"
|
|
:total="total"
|
|
:page-sizes="[10, 20, 50, 100]"
|
|
layout="prev, pager, next, jumper, ->, total, sizes"
|
|
@size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
/>
|
|
</div>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
import { useRouter } from 'vue-router';
|
|
import { ElMessage } from 'element-plus';
|
|
import { getTaskPage } from '@/api/nos/index';
|
|
import type {
|
|
NosLawEnforcementTaskPageVO,
|
|
LawEnforcer,
|
|
Response as TaskPageResponse
|
|
} from '@/api/nos/type';
|
|
import { parseTime } from '@/utils/ruoyi';
|
|
import { lo } from 'element-plus/es/locale';
|
|
|
|
const TASK_TYPE_OPTIONS = [
|
|
{ label: '行政检查', value: 1 },
|
|
{ label: '材料备案', value: 2 },
|
|
{ label: '材料验证', value: 3 },
|
|
{ label: '待核实案件', value: 4 },
|
|
{ label: '巡查', value: 5 }
|
|
];
|
|
|
|
const TASK_STATUS_OPTIONS = [
|
|
{ label: '企业处理中', value: 1 },
|
|
{ label: '退回企业补正', value: 2 },
|
|
{ label: '待审核', value: 3 },
|
|
{ label: '已办结', value: 4 },
|
|
{ label: '已办结(超期)', value: 5 },
|
|
{ label: '待现场处置', value: 6 }
|
|
];
|
|
|
|
const router = useRouter();
|
|
|
|
const loading = ref(false);
|
|
const tableData = ref<NosLawEnforcementTaskPageVO[]>([]);
|
|
const total = ref(0);
|
|
const currentPage = ref(1);
|
|
const pageSize = ref(10);
|
|
const selectedRows = ref<NosLawEnforcementTaskPageVO[]>([]);
|
|
|
|
const searchForm = reactive({
|
|
timeRange: [] as string[],
|
|
lawEnforcementAgency: '',
|
|
lawEnforcerName: '',
|
|
enterpriseName: '',
|
|
taskStatus: undefined as number | undefined
|
|
});
|
|
|
|
const formatDateTime = (time?: string) => {
|
|
if (!time) return '';
|
|
return parseTime(time, '{y}-{m}-{d} {h}:{i}') || '';
|
|
};
|
|
|
|
const formatLawEnforcer = (row: NosLawEnforcementTaskPageVO) => {
|
|
const enforcers = (row as NosLawEnforcementTaskPageVO & { lawEnforcer?: LawEnforcer[] }).lawEnforcer;
|
|
if (enforcers?.length) {
|
|
return enforcers.map((item) => item.lawEnforcerName).join(',');
|
|
}
|
|
return '--';
|
|
};
|
|
|
|
const getStatusClass = (status?: number) => {
|
|
return status ? `list-card__status--${status}` : '';
|
|
};
|
|
|
|
const buildQueryParams = () => {
|
|
return {
|
|
taskTypeId: 3,
|
|
startTime: searchForm.timeRange[0] || undefined,
|
|
endTime: searchForm.timeRange[1] || undefined,
|
|
lawEnforcementAgency: searchForm.lawEnforcementAgency || undefined,
|
|
lawEnforcerName: searchForm.lawEnforcerName || undefined,
|
|
enterpriseName: searchForm.enterpriseName || undefined,
|
|
taskStatus: searchForm.taskStatus,
|
|
pageNo: currentPage.value,
|
|
pageSize: pageSize.value
|
|
};
|
|
};
|
|
|
|
const getList = async () => {
|
|
loading.value = true;
|
|
try {
|
|
const res = (await getTaskPage(buildQueryParams()) as unknown) as TaskPageResponse;
|
|
tableData.value = res.rows || [];
|
|
total.value = res.total || 0;
|
|
} catch (error) {
|
|
console.error('获取列表数据失败:', error);
|
|
ElMessage.error('获取数据失败,请检查网络连接');
|
|
} finally {
|
|
loading.value = false;
|
|
}
|
|
};
|
|
|
|
const handleSearch = () => {
|
|
currentPage.value = 1;
|
|
getList();
|
|
};
|
|
|
|
const handleReset = () => {
|
|
searchForm.timeRange = [];
|
|
searchForm.lawEnforcementAgency = '';
|
|
searchForm.lawEnforcerName = '';
|
|
searchForm.enterpriseName = '';
|
|
searchForm.taskStatus = undefined;
|
|
currentPage.value = 1;
|
|
getList();
|
|
};
|
|
|
|
const handleSelectionChange = (selection: NosLawEnforcementTaskPageVO[]) => {
|
|
selectedRows.value = selection;
|
|
};
|
|
|
|
const handleDetail = (row: NosLawEnforcementTaskPageVO) => {
|
|
if (!row.id) {
|
|
ElMessage.warning('任务ID不存在');
|
|
return;
|
|
}
|
|
router.push({
|
|
name: 'NosDetailVerify',
|
|
params: { id: String(row.id) }
|
|
});
|
|
};
|
|
|
|
const handleSizeChange = (val: number) => {
|
|
pageSize.value = val;
|
|
currentPage.value = 1;
|
|
getList();
|
|
};
|
|
|
|
const handleCurrentChange = (val: number) => {
|
|
currentPage.value = val;
|
|
getList();
|
|
};
|
|
|
|
onMounted(() => {
|
|
getList();
|
|
});
|
|
</script>
|
|
|
|
<style scoped>
|
|
.nos-task-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
padding: 20px;
|
|
background: #f5f7fa;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.search-panel {
|
|
flex-shrink: 0;
|
|
background: #fff;
|
|
padding: 16px 20px;
|
|
border-radius: 8px;
|
|
margin-bottom: 16px;
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
:deep(.el-form-item__label) {
|
|
white-space: nowrap;
|
|
margin-right: 8px;
|
|
}
|
|
|
|
.search-input,
|
|
.search-select {
|
|
width: 150px;
|
|
}
|
|
|
|
.date-picker {
|
|
width: 360px;
|
|
}
|
|
|
|
.table-container {
|
|
flex: 1;
|
|
min-height: 0;
|
|
overflow: hidden;
|
|
background: #fff;
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.nos-task-table {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.pagination-container {
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
background: #fff;
|
|
padding: 12px 20px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.total-text {
|
|
color: #909399;
|
|
}
|
|
|
|
.list-card__status--1 {
|
|
color: #1367fe; /* 企业处理中 */
|
|
}
|
|
|
|
.list-card__status--2 {
|
|
color: #ed6a0c; /* 退回企业补正 */
|
|
}
|
|
|
|
.list-card__status--3 {
|
|
color: #ed6a0c; /* 待审核 */
|
|
}
|
|
|
|
.list-card__status--4 {
|
|
color: #07c160; /* 已办结 */
|
|
}
|
|
|
|
.list-card__status--5 {
|
|
color: #ee0a24; /* 已办结(超期) */
|
|
}
|
|
|
|
.list-card__status--6 {
|
|
color: #ed6a0c; /* 待现场处置 */
|
|
}
|
|
</style>
|
|
|