|
@@ -34,7 +34,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="立项年度:">
|
|
<el-form-item label="立项年度:">
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
- v-model="searchForm.initiationYear"
|
|
|
|
|
|
|
+ v-model="searchForm.year"
|
|
|
type="year"
|
|
type="year"
|
|
|
placeholder="选择立项年度"
|
|
placeholder="选择立项年度"
|
|
|
style="width: 150px"
|
|
style="width: 150px"
|
|
@@ -58,19 +58,21 @@
|
|
|
<!-- 表格区域 -->
|
|
<!-- 表格区域 -->
|
|
|
<div class="table-area">
|
|
<div class="table-area">
|
|
|
<cost-audit-table
|
|
<cost-audit-table
|
|
|
- :table-data="tableData"
|
|
|
|
|
|
|
+ :table-data="auditProjectList"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:pagination="pagination"
|
|
:pagination="pagination"
|
|
|
:show-pagination="true"
|
|
:show-pagination="true"
|
|
|
:show-index="true"
|
|
:show-index="true"
|
|
|
:border="true"
|
|
:border="true"
|
|
|
:stripe="true"
|
|
:stripe="true"
|
|
|
|
|
+ :span-method="handleSpanMethod"
|
|
|
|
|
+ :processed-row-class-name="processedRowClassName"
|
|
|
@pagination-change="handlePaginationChange"
|
|
@pagination-change="handlePaginationChange"
|
|
|
>
|
|
>
|
|
|
<!-- 项目名称链接 -->
|
|
<!-- 项目名称链接 -->
|
|
|
- <!-- <template #projectName="{ row }">
|
|
|
|
|
|
|
+ <template #projectName="{ row }">
|
|
|
<a href="javascript:;" class="link-text">{{ row.projectName }}</a>
|
|
<a href="javascript:;" class="link-text">{{ row.projectName }}</a>
|
|
|
- </template> -->
|
|
|
|
|
|
|
+ </template>
|
|
|
|
|
|
|
|
<!-- 下载按钮组 -->
|
|
<!-- 下载按钮组 -->
|
|
|
<template #download="{ row }">
|
|
<template #download="{ row }">
|
|
@@ -88,7 +90,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
|
|
import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
|
|
|
-
|
|
|
|
|
|
|
+ import { getReviewTaskList } from '@/api/audit/auditIndex'
|
|
|
export default {
|
|
export default {
|
|
|
name: 'ComprehensiveQuery',
|
|
name: 'ComprehensiveQuery',
|
|
|
components: {
|
|
components: {
|
|
@@ -102,77 +104,28 @@
|
|
|
startYear: '',
|
|
startYear: '',
|
|
|
endYear: '',
|
|
endYear: '',
|
|
|
auditedUnit: '',
|
|
auditedUnit: '',
|
|
|
- initiationYear: '',
|
|
|
|
|
|
|
+ year: '',
|
|
|
},
|
|
},
|
|
|
// 表格数据
|
|
// 表格数据
|
|
|
- tableData: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 1,
|
|
|
|
|
- initiationYear: '2025年',
|
|
|
|
|
- auditRegion: '山西省',
|
|
|
|
|
- projectName: '太原市电网输配电成本监审',
|
|
|
|
|
- auditObject: '太原市热电厂',
|
|
|
|
|
- auditPeriod: '2021-2022',
|
|
|
|
|
- auditForm: '定期审审',
|
|
|
|
|
- auditSubject: '山西省发改委-成本调查监审局',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 2,
|
|
|
|
|
- initiationYear: '2024年',
|
|
|
|
|
- auditRegion: '太原市',
|
|
|
|
|
- projectName: '太原市区自来水成本监审',
|
|
|
|
|
- auditObject: '通用自来水公司',
|
|
|
|
|
- auditPeriod: '2021-2022',
|
|
|
|
|
- auditForm: '定价调查审',
|
|
|
|
|
- auditSubject: '太原市发改委-成本调查监审局',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 3,
|
|
|
|
|
- initiationYear: '2024年',
|
|
|
|
|
- auditRegion: '太原市',
|
|
|
|
|
- projectName: '太原市区自来水成本监审',
|
|
|
|
|
- auditObject: '通用自来水公司',
|
|
|
|
|
- auditPeriod: '2021-2022',
|
|
|
|
|
- auditForm: '定价调查审',
|
|
|
|
|
- auditSubject: '太原市发改委-成本调查监审局',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 4,
|
|
|
|
|
- initiationYear: '2024年',
|
|
|
|
|
- auditRegion: '太原市',
|
|
|
|
|
- projectName: '太原市区自来水成本监审',
|
|
|
|
|
- auditObject: '通用自来水公司',
|
|
|
|
|
- auditPeriod: '2021-2022',
|
|
|
|
|
- auditForm: '定价调查审',
|
|
|
|
|
- auditSubject: '太原市发改委-成本调查监审局',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 5,
|
|
|
|
|
- initiationYear: '2024年',
|
|
|
|
|
- auditRegion: '太原市',
|
|
|
|
|
- projectName: '太原市区自来水成本监审',
|
|
|
|
|
- auditObject: '通用自来水公司',
|
|
|
|
|
- auditPeriod: '2021-2022',
|
|
|
|
|
- auditForm: '定价调查审',
|
|
|
|
|
- auditSubject: '太原市发改委-成本调查监审局',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ auditProjectList: [],
|
|
|
|
|
+ // 行合并映射表
|
|
|
|
|
+ rowSpanMap: {},
|
|
|
// 表格列配置
|
|
// 表格列配置
|
|
|
columns: [
|
|
columns: [
|
|
|
{
|
|
{
|
|
|
- prop: 'initiationYear',
|
|
|
|
|
|
|
+ prop: 'year',
|
|
|
label: '立项年度',
|
|
label: '立项年度',
|
|
|
width: 100,
|
|
width: 100,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- prop: 'auditRegion',
|
|
|
|
|
|
|
+ prop: 'areaName',
|
|
|
label: '监审地区',
|
|
label: '监审地区',
|
|
|
width: 100,
|
|
width: 100,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'projectName',
|
|
prop: 'projectName',
|
|
|
label: '成本监审项目名称',
|
|
label: '成本监审项目名称',
|
|
|
- // slotName: 'projectName',
|
|
|
|
|
|
|
+ slotName: 'projectName',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'auditObject',
|
|
prop: 'auditObject',
|
|
@@ -184,12 +137,12 @@
|
|
|
width: 120,
|
|
width: 120,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- prop: 'auditForm',
|
|
|
|
|
|
|
+ prop: 'auditType',
|
|
|
label: '监审形式',
|
|
label: '监审形式',
|
|
|
width: 120,
|
|
width: 120,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- prop: 'auditSubject',
|
|
|
|
|
|
|
+ prop: 'orgName',
|
|
|
label: '监审主体',
|
|
label: '监审主体',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -206,16 +159,97 @@
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ // 获取项目列表
|
|
|
|
|
+ this.handleQuery()
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
- // 处理查询
|
|
|
|
|
- handleQuery() {
|
|
|
|
|
- // 这里应该调用API获取数据
|
|
|
|
|
- console.log('查询条件:', this.searchForm)
|
|
|
|
|
- // 模拟查询
|
|
|
|
|
- this.loading = true
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
|
|
+ // 加载项目列表
|
|
|
|
|
+ async handleQuery() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ // 调用API获取数据
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ pageNum: this.pagination.currentPage,
|
|
|
|
|
+ pageSize: this.pagination.pageSize,
|
|
|
|
|
+ ...this.searchForm,
|
|
|
|
|
+ }
|
|
|
|
|
+ const response = await getReviewTaskList(params)
|
|
|
|
|
+
|
|
|
|
|
+ // 根据API返回格式处理数据
|
|
|
|
|
+ if (response.state && response.value) {
|
|
|
|
|
+ // 获取记录列表
|
|
|
|
|
+ const records = response.value.records || []
|
|
|
|
|
+ console.log('原始数据:', records)
|
|
|
|
|
+ // 展平数据并添加行合并标记
|
|
|
|
|
+ this.auditProjectList = []
|
|
|
|
|
+ this.rowSpanMap = {} // 用于存储需要合并的行数
|
|
|
|
|
+
|
|
|
|
|
+ records.forEach((record) => {
|
|
|
|
|
+ // 处理父项
|
|
|
|
|
+ const parentRow = {
|
|
|
|
|
+ ...record,
|
|
|
|
|
+ projectName: record.projectName,
|
|
|
|
|
+ auditObject: record.auditedUnitName,
|
|
|
|
|
+ auditPeriod: record.auditPeriod,
|
|
|
|
|
+ status: this.getStatusText(record.status),
|
|
|
|
|
+ isSubTask: record.pid !== '0',
|
|
|
|
|
+ isParent: true,
|
|
|
|
|
+ hasChildren:
|
|
|
|
|
+ !!record.childTasks && record.childTasks.length > 0,
|
|
|
|
|
+ }
|
|
|
|
|
+ this.auditProjectList.push(parentRow)
|
|
|
|
|
+
|
|
|
|
|
+ // 如果有子项,添加子项
|
|
|
|
|
+ if (record.childTasks && record.childTasks.length > 0) {
|
|
|
|
|
+ // 记录父项需要合并的行数
|
|
|
|
|
+ this.rowSpanMap[record.id] = record.childTasks.length + 1
|
|
|
|
|
+
|
|
|
|
|
+ // 处理子项
|
|
|
|
|
+ record.childTasks.forEach((child) => {
|
|
|
|
|
+ this.auditProjectList.push({
|
|
|
|
|
+ ...child,
|
|
|
|
|
+ projectName: record.projectName, // 子项使用父项的项目名称
|
|
|
|
|
+ auditObject:
|
|
|
|
|
+ child.auditedUnitName || record.auditedUnitName,
|
|
|
|
|
+ auditPeriod: child.auditPeriod || record.auditPeriod, // 优先使用子项自己的审核期间
|
|
|
|
|
+ auditType: child.auditType || record.auditType, // 优先使用子项自己的监审形式
|
|
|
|
|
+ status: this.getStatusText(child.status),
|
|
|
|
|
+ isSubTask: true,
|
|
|
|
|
+ parentId: record.id,
|
|
|
|
|
+ isParent: false,
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ // 设置总行数
|
|
|
|
|
+ this.pagination.total = this.auditProjectList.length
|
|
|
|
|
+ console.log('处理后的数据:', this.auditProjectList)
|
|
|
|
|
+ console.log('行合并映射:', this.rowSpanMap)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.auditProjectList = []
|
|
|
|
|
+ this.rowSpanMap = {}
|
|
|
|
|
+ this.pagination.total = 0
|
|
|
|
|
+ this.$message.warning('未获取到项目数据')
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ // this.$message.error('加载审核项目列表失败')
|
|
|
|
|
+ console.error('加载审核项目列表失败:', error)
|
|
|
|
|
+ this.rowSpanMap = {}
|
|
|
|
|
+ } finally {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
- }, 500)
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取状态文本
|
|
|
|
|
+ getStatusText(status) {
|
|
|
|
|
+ const statusMap = {
|
|
|
|
|
+ ccls: '资料初审',
|
|
|
|
|
+ 200: '审核通过',
|
|
|
|
|
+ clcs: '审核中', // 添加clcs状态映射为审核中
|
|
|
|
|
+ // 可根据实际需求补充其他状态
|
|
|
|
|
+ }
|
|
|
|
|
+ return statusMap[status] || status
|
|
|
},
|
|
},
|
|
|
// 处理重置
|
|
// 处理重置
|
|
|
handleReset() {
|
|
handleReset() {
|
|
@@ -224,7 +258,7 @@
|
|
|
startYear: '',
|
|
startYear: '',
|
|
|
endYear: '',
|
|
endYear: '',
|
|
|
auditedUnit: '',
|
|
auditedUnit: '',
|
|
|
- initiationYear: '',
|
|
|
|
|
|
|
+ year: '',
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 处理分页变化
|
|
// 处理分页变化
|
|
@@ -248,6 +282,31 @@
|
|
|
// 这里实现下载逻辑
|
|
// 这里实现下载逻辑
|
|
|
this.$message.success('监审卷宗功能待实现')
|
|
this.$message.success('监审卷宗功能待实现')
|
|
|
},
|
|
},
|
|
|
|
|
+ // 处理表格行合并
|
|
|
|
|
+ handleSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
|
|
+ // 需要合并的列:立项年度、监审地区、成本监审项目名称
|
|
|
|
|
+ const mergeColumns = ['year', 'areaName', 'projectName']
|
|
|
|
|
+ const columnProp = column.property
|
|
|
|
|
+ // 如果是需要合并的列
|
|
|
|
|
+ if (mergeColumns.includes(columnProp)) {
|
|
|
|
|
+ if (row.isParent) {
|
|
|
|
|
+ // 父项合并显示
|
|
|
|
|
+ const spanCount = this.rowSpanMap[row.id] || 1
|
|
|
|
|
+ return { rowspan: spanCount, colspan: 1 }
|
|
|
|
|
+ } else if (row.parentId) {
|
|
|
|
|
+ // 子项隐藏这些列
|
|
|
|
|
+ return { rowspan: 0, colspan: 0 }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return { rowspan: 1, colspan: 1 }
|
|
|
|
|
+ },
|
|
|
|
|
+ processedRowClassName({ row, column, rowIndex, columnIndex }) {
|
|
|
|
|
+ // 需要合并的列:立项年度、监审地区、成本监审项目名称
|
|
|
|
|
+ const mergeColumns = ['year', 'areaName', 'projectName']
|
|
|
|
|
+ if (!mergeColumns.includes(column.property)) {
|
|
|
|
|
+ return row.isParent ? 'parent-row' : 'show-row'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -257,4 +316,10 @@
|
|
|
.comprehensive-query {
|
|
.comprehensive-query {
|
|
|
padding: 20px;
|
|
padding: 20px;
|
|
|
}
|
|
}
|
|
|
|
|
+ .parent-row {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
|
|
+ .show-row {
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|