|
|
@@ -4,14 +4,14 @@
|
|
|
<div class="search-panel">
|
|
|
<el-form :model="searchForm" inline>
|
|
|
<el-form-item label="年度:">
|
|
|
- <el-select v-model="searchForm.year" placeholder="请选择年度">
|
|
|
- <el-option
|
|
|
- v-for="year in years"
|
|
|
- :key="year"
|
|
|
- :label="year + '年'"
|
|
|
- :value="year"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="searchForm.year"
|
|
|
+ type="year"
|
|
|
+ placeholder="请选择年度"
|
|
|
+ format="yyyy"
|
|
|
+ value-format="yyyy"
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="监审项目名称:">
|
|
|
<el-input
|
|
|
@@ -29,23 +29,94 @@
|
|
|
|
|
|
<!-- 表格视图 -->
|
|
|
<div v-if="activeTab === 'list'">
|
|
|
- <CostAuditTable
|
|
|
- :table-data="tableData"
|
|
|
- :columns="tableColumns"
|
|
|
- :loading="loading"
|
|
|
- :pagination="pagination"
|
|
|
- :show-index="true"
|
|
|
- @pagination-change="handlePaginationChange"
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ class="mb10"
|
|
|
+ :data="tableData"
|
|
|
+ style="width: 100%"
|
|
|
+ border
|
|
|
+ default-expand-all
|
|
|
+ row-key="id"
|
|
|
+ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
>
|
|
|
- <template slot="operation" slot-scope="scope">
|
|
|
- <el-button type="text" size="small" @click="backToList(scope.row)">
|
|
|
- 查看
|
|
|
- </el-button>
|
|
|
- <el-button type="text" size="small" @click="handleDetail(scope.row)">
|
|
|
- 任务详情
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </CostAuditTable>
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="序号"
|
|
|
+ width="80"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- 只显示父节点的序号 -->
|
|
|
+ <span v-if="scope.row.children">
|
|
|
+ {{ getParentNodeIndex(scope.row) }}
|
|
|
+ </span>
|
|
|
+ <span v-else></span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="projectName"
|
|
|
+ label="成本监审项目名称"
|
|
|
+ show-overflow-tooltip
|
|
|
+ header-align="center"
|
|
|
+ align="left"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="auditObject"
|
|
|
+ label="监审对象"
|
|
|
+ header-align="center"
|
|
|
+ align="left"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="auditPeriod"
|
|
|
+ label="监审期间"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="source"
|
|
|
+ label="立项来源"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="form"
|
|
|
+ label="监审形式"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ />
|
|
|
+ <el-table-column label="操作" align="center" width="160">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="!scope.row.isSubTask" class="action-buttons">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="handleViewTaskDetail(scope.row)"
|
|
|
+ >
|
|
|
+ 任务详情
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ <span v-if="scope.row.isSubTask" class="action-buttons">
|
|
|
+ <el-button type="text" size="small" @click="handleView(row)">
|
|
|
+ 查看
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="total, sizes, prev, pager, next"
|
|
|
+ :current-page="pagination.currentPage"
|
|
|
+ :page-sizes="[10, 20, 30, 40]"
|
|
|
+ :page-size="pagination.pageSize"
|
|
|
+ :total="pagination.total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ />
|
|
|
</div>
|
|
|
|
|
|
<!-- 任务详情视图 -->
|
|
|
@@ -61,17 +132,20 @@
|
|
|
</el-breadcrumb>
|
|
|
<taskDetail />
|
|
|
</div>
|
|
|
+ <!-- 任务信息弹窗 -->
|
|
|
+ <taskInfo ref="taskInfo" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
|
|
|
+ import { getCompletedSupervisionList } from '@/api/audit/reviewTask'
|
|
|
import taskDetail from '@/views/costAudit/auditInfo/auditManage/taskDetail.vue'
|
|
|
+ import taskInfo from '@/components/task/taskInfo.vue'
|
|
|
export default {
|
|
|
name: 'CompletedSupervisionQuery',
|
|
|
components: {
|
|
|
- CostAuditTable,
|
|
|
taskDetail,
|
|
|
+ taskInfo,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -80,50 +154,8 @@
|
|
|
year: '2025',
|
|
|
projectName: '',
|
|
|
},
|
|
|
- // 年度选项
|
|
|
- years: ['2022', '2023', '2024', '2025'],
|
|
|
// 表格数据
|
|
|
tableData: [],
|
|
|
- // 表格列配置
|
|
|
- tableColumns: [
|
|
|
- {
|
|
|
- prop: 'year',
|
|
|
- label: '立项年度',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'projectName',
|
|
|
- label: '成本监审项目名称',
|
|
|
- showOverflowTooltip: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'auditObject',
|
|
|
- label: '监审对象',
|
|
|
- showOverflowTooltip: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'auditPeriod',
|
|
|
- label: '监审期间',
|
|
|
- width: 150,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'source',
|
|
|
- label: '立项来源',
|
|
|
- width: 120,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'auditType',
|
|
|
- label: '监审形式',
|
|
|
- width: 120,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'operation',
|
|
|
- label: '操作',
|
|
|
- width: 160,
|
|
|
- fixed: 'right',
|
|
|
- slotName: 'operation',
|
|
|
- },
|
|
|
- ],
|
|
|
// 分页配置
|
|
|
pagination: {
|
|
|
currentPage: 1,
|
|
|
@@ -144,59 +176,90 @@
|
|
|
this.fetchData()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取父节点的连续序号
|
|
|
+ getParentNodeIndex(row) {
|
|
|
+ // 过滤出所有父节点
|
|
|
+ const parentNodes = this.tableData.filter(
|
|
|
+ (item) => item.children && item.children.length > 0
|
|
|
+ )
|
|
|
+ // 找到当前行在父节点数组中的索引
|
|
|
+ const index = parentNodes.findIndex((item) => item.id === row.id)
|
|
|
+ // 返回序号(索引+1)
|
|
|
+ return index + 1
|
|
|
+ },
|
|
|
// 获取数据
|
|
|
- fetchData() {
|
|
|
- this.loading = true
|
|
|
- // 模拟API请求
|
|
|
- setTimeout(() => {
|
|
|
- // 根据用户提供的截图创建模拟数据
|
|
|
- this.tableData = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- year: '2025',
|
|
|
- projectName: '省内油气管道运输成本监审',
|
|
|
- auditObject: '山西省油气管道公司、太原市油气公司',
|
|
|
- auditPeriod: '2023-2024年',
|
|
|
- source: '年度计划外',
|
|
|
- auditType: '定期监审',
|
|
|
- subtasks: [
|
|
|
- {
|
|
|
- name: '子任务',
|
|
|
- auditObject: '山西省油气管道公司',
|
|
|
- auditPeriod: '2023-2024年',
|
|
|
- },
|
|
|
- {
|
|
|
- name: '子任务',
|
|
|
- auditObject: '太原市油气公司',
|
|
|
- auditPeriod: '2023-2024年',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- year: '2024',
|
|
|
- projectName: '太原市电网输配电成本监审',
|
|
|
- auditObject: '太原热电厂、太原第二热电厂',
|
|
|
- auditPeriod: '2021-2023年',
|
|
|
- source: '年度计划内',
|
|
|
- auditType: '定期监审',
|
|
|
- subtasks: [
|
|
|
- {
|
|
|
- name: '子任务',
|
|
|
- auditObject: '太原热电厂',
|
|
|
- auditPeriod: '2021-2023年',
|
|
|
- },
|
|
|
- {
|
|
|
- name: '子任务',
|
|
|
- auditObject: '太原第二热电厂',
|
|
|
- auditPeriod: '2021-2023年',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ]
|
|
|
- this.pagination.total = this.tableData.length
|
|
|
+ async fetchData() {
|
|
|
+ try {
|
|
|
+ this.loading = true
|
|
|
+ const params = {
|
|
|
+ currentPage: this.pagination.currentPage,
|
|
|
+ pageSize: this.pagination.pageSize,
|
|
|
+ year: this.searchForm.year,
|
|
|
+ projectName: this.searchForm.projectName,
|
|
|
+ }
|
|
|
+ const response = await getCompletedSupervisionList(params)
|
|
|
+
|
|
|
+ // 根据API返回格式处理数据
|
|
|
+ if (response.state && response.value) {
|
|
|
+ // 获取记录列表
|
|
|
+ const records = response.value.records || []
|
|
|
+ // 转换数据格式,将childTasks转换为children以适应表格组件
|
|
|
+ this.tableData = records.map((record) => {
|
|
|
+ return {
|
|
|
+ id: record.id,
|
|
|
+ projectName: record.projectName,
|
|
|
+ auditObject: record.auditedUnitName,
|
|
|
+ auditPeriod: record.auditPeriod,
|
|
|
+ source: this.getSourceTypeText(record.sourceType),
|
|
|
+ form: this.getAuditTypeText(record.auditType),
|
|
|
+ isSubTask: record.pid !== '0',
|
|
|
+ children: record.childTasks
|
|
|
+ ? record.childTasks.map((child) => ({
|
|
|
+ id: child.id,
|
|
|
+ projectName: child.projectName,
|
|
|
+ auditObject: child.auditedUnitName,
|
|
|
+ auditPeriod: record.auditPeriod, // 子任务可能使用父任务的审核期间
|
|
|
+ source: '',
|
|
|
+ form: '',
|
|
|
+ isSubTask: true,
|
|
|
+ projectId: child.projectId,
|
|
|
+ auditedUnitId: child.auditedUnitId,
|
|
|
+ taskId: child.id,
|
|
|
+ }))
|
|
|
+ : [],
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 设置总数
|
|
|
+ this.pagination.total = response.value.total || 0
|
|
|
+ } else {
|
|
|
+ this.tableData = []
|
|
|
+ this.pagination.total = 0
|
|
|
+ this.$message.warning('未获取到数据')
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error('加载列表失败')
|
|
|
+ console.error('加载列表失败:', error)
|
|
|
+ this.tableData = []
|
|
|
+ this.pagination.total = 0
|
|
|
+ } finally {
|
|
|
this.loading = false
|
|
|
- }, 500)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取来源类型文本
|
|
|
+ getSourceTypeText(type) {
|
|
|
+ const typeMap = {
|
|
|
+ 1: '年度计划内',
|
|
|
+ 2: '年度计划外',
|
|
|
+ }
|
|
|
+ return typeMap[type] || type
|
|
|
+ },
|
|
|
+ // 获取审核类型文本
|
|
|
+ getAuditTypeText(type) {
|
|
|
+ const typeMap = {
|
|
|
+ 1: '定期监审',
|
|
|
+ 2: '定调价监审',
|
|
|
+ }
|
|
|
+ return typeMap[type] || type
|
|
|
},
|
|
|
backToList() {
|
|
|
this.activeTab = 'list'
|
|
|
@@ -219,20 +282,24 @@
|
|
|
},
|
|
|
|
|
|
// 处理分页变化
|
|
|
- handlePaginationChange(pagination) {
|
|
|
- this.pagination.currentPage = pagination.currentPage
|
|
|
- this.pagination.pageSize = pagination.pageSize
|
|
|
+ handleCurrentChange(current) {
|
|
|
+ this.pagination.currentPage = current
|
|
|
+ this.fetchData()
|
|
|
+ },
|
|
|
+ handleSizeChange(size) {
|
|
|
+ this.pagination.pageSize = size
|
|
|
+ this.pagination.currentPage = 1
|
|
|
this.fetchData()
|
|
|
},
|
|
|
|
|
|
- // 查看任务
|
|
|
+ // 查看任务(打开taskInfo弹窗)
|
|
|
handleView(row) {
|
|
|
- // 这里可以实现查看任务的逻辑
|
|
|
- this.$message.info('查看任务:' + row.projectName)
|
|
|
+ // 打开taskInfo弹窗,传入任务数据和类型
|
|
|
+ this.$refs.taskInfo.open(row, 'chengben')
|
|
|
},
|
|
|
|
|
|
// 查看任务详情
|
|
|
- handleDetail(row) {
|
|
|
+ handleViewTaskDetail(row) {
|
|
|
this.selectedTask = row
|
|
|
this.activeTab = 'detail'
|
|
|
this.showTaskDetail = true
|