index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. <template>
  2. <div class="cost-audit-management">
  3. <!-- 成本审核项目列表页面 -->
  4. <div v-if="activeView === 'list'" class="audit-list-container">
  5. <div class="search-section">
  6. <el-input
  7. v-model="searchQuery"
  8. placeholder="监审项目名称"
  9. style="width: 300px; margin-right: 10px"
  10. clearable
  11. />
  12. <el-button type="primary" @click="handleSearch">查询</el-button>
  13. </div>
  14. <el-table
  15. v-loading="loading"
  16. class="mb10"
  17. :data="auditProjectList"
  18. style="width: 100%"
  19. border
  20. default-expand-all
  21. row-key="id"
  22. :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
  23. >
  24. <el-table-column
  25. type="index"
  26. label="序号"
  27. width="80"
  28. header-align="center"
  29. align="center"
  30. >
  31. <template slot-scope="scope">
  32. <!-- 只显示父节点的序号 -->
  33. <span v-if="scope.row.children">
  34. {{ getParentNodeIndex(scope.row) }}
  35. </span>
  36. <span v-else></span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column
  40. prop="projectName"
  41. label="成本监审项目名称"
  42. show-overflow-tooltip
  43. header-align="center"
  44. align="left"
  45. />
  46. <el-table-column
  47. prop="auditObject"
  48. label="监审对象"
  49. header-align="center"
  50. align="left"
  51. />
  52. <el-table-column
  53. prop="auditPeriod"
  54. label="监审期间"
  55. header-align="center"
  56. align="center"
  57. width="120"
  58. />
  59. <el-table-column
  60. prop="source"
  61. label="立项来源"
  62. header-align="center"
  63. align="center"
  64. width="100"
  65. />
  66. <el-table-column
  67. prop="form"
  68. label="监审形式"
  69. header-align="center"
  70. align="center"
  71. width="100"
  72. />
  73. <el-table-column
  74. prop="currentNodeName"
  75. label="状态"
  76. align="center"
  77. width="80"
  78. >
  79. <template slot-scope="scope">
  80. <span v-if="!scope.row.isSubTask">
  81. {{ scope.row.currentNodeName }}
  82. </span>
  83. <span v-else>{{ scope.row.status }}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="操作" align="center" width="260">
  87. <template slot-scope="scope">
  88. <span v-if="!scope.row.isSubTask" class="action-buttons">
  89. <el-button type="text" @click="handleTaskDetail(scope.row)">
  90. 任务详情
  91. </el-button>
  92. <el-button
  93. v-if="scope.row.currentNode === 'sdsh'"
  94. type="text"
  95. @click="handleTaskProcess(scope.row)"
  96. >
  97. 任务办理
  98. </el-button>
  99. <el-button type="text" @click="handleCheckRecord(scope.row)">
  100. 备忘录
  101. </el-button>
  102. </span>
  103. <span v-if="scope.row.isSubTask" class="action-buttons">
  104. <el-button
  105. v-if="
  106. scope.row.currentNode === 'ccls' &&
  107. scope.row.status === '审核中'
  108. "
  109. type="text"
  110. @click="handleAuditReview(scope.row)"
  111. >
  112. 资料初审
  113. </el-button>
  114. <el-button
  115. v-if="scope.row.currentNode === 'sdsh'"
  116. type="text"
  117. @click="handleCostAudit(scope.row)"
  118. >
  119. 成本审核
  120. </el-button>
  121. </span>
  122. </template>
  123. </el-table-column>
  124. </el-table>
  125. <el-pagination
  126. background
  127. layout="total, sizes, prev, pager, next"
  128. :current-page="currentPage"
  129. :page-sizes="[10, 20, 30, 40]"
  130. :page-size="pageSize"
  131. :total="total"
  132. @current-change="handleCurrentChange"
  133. @size-change="handleSizeChange"
  134. />
  135. </div>
  136. <!-- 成本监审任务详情页面 -->
  137. <div v-else-if="activeView === 'detail'" class="audit-detail-container">
  138. <el-breadcrumb
  139. separator-class="el-icon-arrow-right"
  140. style="margin-bottom: 20px"
  141. >
  142. <el-breadcrumb-item>
  143. <a href="javascript:void(0)" @click="backToList">成本审核管理</a>
  144. </el-breadcrumb-item>
  145. <el-breadcrumb-item>成本监审任务详情</el-breadcrumb-item>
  146. </el-breadcrumb>
  147. <taskDetail
  148. ref="taskDetail"
  149. :workflow-list="workflowList"
  150. :form-data="formData"
  151. :material-data="materialData"
  152. />
  153. </div>
  154. <!-- 任务办理页面 -->
  155. <div v-else-if="activeView === 'process'" class="audit-process-container">
  156. <el-breadcrumb
  157. separator-class="el-icon-arrow-right"
  158. style="margin-bottom: 20px"
  159. >
  160. <el-breadcrumb-item>
  161. <a href="javascript:void(0)" @click="backToList">成本审核管理</a>
  162. </el-breadcrumb-item>
  163. <el-breadcrumb-item>成本监审任务办理</el-breadcrumb-item>
  164. </el-breadcrumb>
  165. <taskProcess ref="taskProcess" />
  166. </div>
  167. <div v-else-if="activeView === 'auditReview'">
  168. <el-breadcrumb
  169. separator-class="el-icon-arrow-right"
  170. style="margin-bottom: 20px"
  171. >
  172. <el-breadcrumb-item>
  173. <a href="javascript:void(0)" @click="backToList">成本审核管理</a>
  174. </el-breadcrumb-item>
  175. <el-breadcrumb-item>资料初审</el-breadcrumb-item>
  176. </el-breadcrumb>
  177. <auditReview
  178. :id="currentProject.id"
  179. :current-node="currentProject.currentNode"
  180. @handleBack="backToList"
  181. />
  182. </div>
  183. <div v-else-if="activeView === 'costAudit'">
  184. <el-breadcrumb
  185. separator-class="el-icon-arrow-right"
  186. style="margin-bottom: 20px"
  187. >
  188. <el-breadcrumb-item>
  189. <a href="javascript:void(0)" @click="backToList">成本审核管理</a>
  190. </el-breadcrumb-item>
  191. <el-breadcrumb-item>成本审核</el-breadcrumb-item>
  192. </el-breadcrumb>
  193. <costAudit @handleBack="backToList" />
  194. </div>
  195. </div>
  196. </template>
  197. <script>
  198. import taskDetail from './taskDetail.vue'
  199. import taskProcess from './taskProcess.vue'
  200. import auditReview from './auditReview.vue'
  201. import costAudit from './costAudit.vue'
  202. import taskMixins from './taskMixins.js'
  203. // 成本监审任务列表API
  204. import { getReviewTaskList } from '@/api/audit/auditIndex'
  205. export default {
  206. name: 'CostAuditManagement',
  207. components: {
  208. taskDetail,
  209. taskProcess,
  210. auditReview,
  211. costAudit,
  212. },
  213. mixins: [taskMixins],
  214. data() {
  215. return {
  216. // 分页相关
  217. currentPage: 1,
  218. pageSize: 10,
  219. total: 0,
  220. // 视图控制
  221. activeView: 'list', // list: 列表, detail: 详情, process: 办理
  222. // 搜索相关
  223. searchQuery: '',
  224. // 列表数据
  225. auditProjectList: [],
  226. // workflowList: [],
  227. notificationsList: [],
  228. templatesList: [],
  229. // 加载状态
  230. loading: false,
  231. // 当前选中的项目
  232. currentProject: null,
  233. }
  234. },
  235. created() {
  236. this.loadAuditProjectList()
  237. },
  238. methods: {
  239. // 获取父节点的连续序号
  240. getParentNodeIndex(row) {
  241. // 过滤出所有父节点
  242. const parentNodes = this.auditProjectList.filter(
  243. (item) => item.children && item.children.length > 0
  244. )
  245. // 找到当前行在父节点数组中的索引
  246. const index = parentNodes.findIndex((item) => item.id === row.id)
  247. // 返回序号(索引+1)
  248. return index + 1
  249. },
  250. // 加载审核项目列表
  251. async loadAuditProjectList() {
  252. try {
  253. this.loading = true
  254. // 调用API获取数据
  255. const params = {
  256. currentPage: this.currentPage,
  257. pageSize: this.pageSize,
  258. projectName: this.searchQuery,
  259. }
  260. const response = await getReviewTaskList(params)
  261. // 根据API返回格式处理数据
  262. if (response.state && response.value) {
  263. // 获取记录列表
  264. const records = response.value.records || []
  265. // 转换数据格式,将childTasks转换为children以适应表格组件
  266. this.auditProjectList = records.map((record) => {
  267. return {
  268. id: record.id,
  269. projectName: record.projectName,
  270. auditObject: record.auditedUnitName,
  271. auditPeriod: record.auditPeriod,
  272. source: this.getSourceTypeText(record.sourceType),
  273. form: this.getAuditTypeText(record.auditType),
  274. status: this.getStatusText(record.status),
  275. isSubTask: record.pid !== '0',
  276. currentNodeName: record.currentNodeName,
  277. currentNode: record.currentNode,
  278. children: record.childTasks
  279. ? record.childTasks.map((child) => ({
  280. id: child.id,
  281. projectName: child.projectName,
  282. auditObject: child.auditedUnitName,
  283. auditPeriod: record.auditPeriod, // 子任务可能使用父任务的审核期间
  284. source: '',
  285. form: '',
  286. currentNode: child.currentNode,
  287. status: child.status,
  288. isSubTask: true,
  289. }))
  290. : [],
  291. }
  292. })
  293. // 设置总数
  294. this.total = response.value.total || 0
  295. } else {
  296. this.auditProjectList = []
  297. this.total = 0
  298. this.$message.warning('未获取到审核项目数据')
  299. }
  300. } catch (error) {
  301. this.$message.error('加载审核项目列表失败')
  302. console.error('加载审核项目列表失败:', error)
  303. } finally {
  304. this.loading = false
  305. }
  306. },
  307. // 获取来源类型文本
  308. getSourceTypeText(type) {
  309. const typeMap = {
  310. 1: '年度计划内',
  311. 2: '年度计划外',
  312. // 可根据实际需求补充其他类型
  313. }
  314. return typeMap[type] || type
  315. },
  316. // 获取审核类型文本
  317. getAuditTypeText(type) {
  318. const typeMap = {
  319. 1: '定期监审',
  320. 2: '定调价监审',
  321. // 可根据实际需求补充其他类型
  322. }
  323. return typeMap[type] || type
  324. },
  325. // 获取状态文本
  326. getStatusText(status) {
  327. const statusMap = {
  328. ccls: '资料初审',
  329. 200: '审核通过',
  330. clcs: '审核中', // 添加clcs状态映射为审核中
  331. // 可根据实际需求补充其他状态
  332. }
  333. return statusMap[status] || status
  334. },
  335. // 搜索
  336. handleSearch() {
  337. // 搜索逻辑
  338. this.loadAuditProjectList()
  339. },
  340. // 任务详情
  341. handleTaskDetail(project) {
  342. this.currentProject = project
  343. this.activeView = 'detail'
  344. this.loadAuditProjectDetail(project.id)
  345. this.loadWorkflowList(project.id)
  346. this.loadNotificationsList(project.id)
  347. },
  348. // 任务办理
  349. handleTaskProcess(project) {
  350. this.currentProject = project
  351. this.activeView = 'process'
  352. this.loadTemplatesList()
  353. // 初始化集体审议表单中的项目信息
  354. if (project) {
  355. this.meetingForm.projectName = project.projectName
  356. this.meetingForm.auditUnit = project.auditObject
  357. }
  358. },
  359. handleAuditReview(project) {
  360. this.currentProject = project
  361. this.activeView = 'auditReview'
  362. },
  363. // 查记录
  364. handleCheckRecord(project) {
  365. // memoManage
  366. this.$router.push({
  367. name: 'memoManage',
  368. // params: { projectId: project.id }
  369. })
  370. },
  371. // 查看
  372. handleView(project) {
  373. this.currentProject = project
  374. this.activeView = 'detail'
  375. this.loadAuditProjectDetail(project.id)
  376. this.loadWorkflowList(project.id)
  377. this.loadNotificationsList(project.id)
  378. },
  379. // 成本审核
  380. handleCostAudit(project) {
  381. this.currentProject = project
  382. this.activeView = 'costAudit'
  383. this.loadAuditProjectDetail(project.id)
  384. this.loadWorkflowList(project.id)
  385. this.loadNotificationsList(project.id)
  386. },
  387. // 返回列表
  388. backToList() {
  389. this.activeView = 'list'
  390. // 刷新列表数据
  391. this.loadAuditProjectList()
  392. },
  393. // 返回详情
  394. backToDetail() {
  395. this.activeView = 'detail'
  396. },
  397. // 加载审核项目详情
  398. async loadAuditProjectDetail(id) {
  399. try {
  400. // 这里应该调用API获取数据,现在使用模拟数据
  401. this.basicForm = {
  402. projectName: '太原市电网输配电成本监审',
  403. costAuditTable: '电网企业成本监审表',
  404. region: 'shanxi',
  405. auditObject: '太原市热电厂、****热电厂、****公司',
  406. year: '2023',
  407. source: 'plan',
  408. form: 'price',
  409. startYear: '2023',
  410. endYear: '2024',
  411. isNew: '否',
  412. isDynamic: '否',
  413. basis: '太原市发改委关于开展2023年电网输配电成本监审的通知',
  414. attachments: [
  415. {
  416. name: '太原市发改委关于开展2023年电网输配电成本监审的通知.pct',
  417. },
  418. { name: '其他附件.pdf' },
  419. ],
  420. }
  421. } catch (error) {
  422. this.$message.error('加载审核项目详情失败')
  423. console.error('加载审核项目详情失败:', error)
  424. }
  425. },
  426. // 加载工作流程列表
  427. async loadWorkflowList(id) {
  428. try {
  429. // 这里应该调用API获取数据,现在使用模拟数据
  430. this.workflowList = [
  431. {
  432. id: '1',
  433. stepName: '提交材料',
  434. nodeType: '外部环节',
  435. handler: '张**、李**',
  436. opinions: '已提交相关材料',
  437. deadline: '2025-5-4',
  438. startTime: '2025-4-18 14:20',
  439. endTime: '2025-4-18 15:30',
  440. },
  441. {
  442. id: '2',
  443. stepName: '资料初审',
  444. nodeType: '内部环节',
  445. handler: '王**',
  446. opinions: '资料齐全,同意进入下一环节',
  447. deadline: '2025-5-4',
  448. startTime: '2025-5-4 10:10',
  449. endTime: '2025-5-4 16:30',
  450. },
  451. {
  452. id: '3',
  453. stepName: '实地审核',
  454. nodeType: '内部环节',
  455. handler: '张**',
  456. opinions: '正在审核中',
  457. deadline: '2025-5-6',
  458. startTime: '2025-5-6 09:00',
  459. endTime: '2025-5-6 18:30',
  460. },
  461. // 其他环节...
  462. {
  463. id: '8',
  464. stepName: '办结',
  465. nodeType: '内部环节',
  466. handler: '李**',
  467. opinions: '',
  468. deadline: '2025-5-30',
  469. startTime: '',
  470. endTime: '',
  471. },
  472. ]
  473. } catch (error) {
  474. this.$message.error('加载工作流程列表失败')
  475. console.error('加载工作流程列表失败:', error)
  476. }
  477. },
  478. // 加载消息通知列表
  479. async loadNotificationsList(id) {
  480. try {
  481. // 这里应该调用API获取数据,现在使用模拟数据
  482. this.notificationsList = [
  483. {
  484. id: '1',
  485. title: '材料收到通知',
  486. source: '山西省发改委-张**',
  487. target: 'A单位',
  488. content: '2025年收到你单位报送的材料...',
  489. sendTime: '2025-5-11 16:40',
  490. },
  491. {
  492. id: '2',
  493. title: '环节办理通知',
  494. source: '山西省发改委-张**',
  495. target: 'B单位',
  496. content: '2025年收到你单位报送的材料...',
  497. sendTime: '2025-5-12 16:56',
  498. },
  499. // 其他通知...
  500. {
  501. id: '9',
  502. title: '',
  503. source: '',
  504. target: '',
  505. content: '',
  506. sendTime: '2025-5-30 16:55',
  507. },
  508. ]
  509. } catch (error) {
  510. this.$message.error('加载消息通知列表失败')
  511. console.error('加载消息通知列表失败:', error)
  512. }
  513. },
  514. // 加载模板列表
  515. async loadTemplatesList() {
  516. try {
  517. // 这里应该调用API获取数据,现在使用模拟数据
  518. this.templatesList = [
  519. { id: '1', name: '成本监审通知书' },
  520. { id: '2', name: '成本监审工作方案' },
  521. { id: '3', name: '成本监审资料报送要求' },
  522. { id: '4', name: '成本监审意见告知书' },
  523. { id: '5', name: '成本监审结论告知书' },
  524. { id: '6', name: '成本监审报告' },
  525. { id: '7', name: '成本监审报告(送审稿)' },
  526. { id: '8', name: '成本监审结论告知书(适用返还)' },
  527. { id: '9', name: '成本监审结论告知书(适用返还)-送审稿' },
  528. ]
  529. this.selectedTemplate = '1'
  530. } catch (error) {
  531. this.$message.error('加载模板列表失败')
  532. console.error('加载模板列表失败:', error)
  533. }
  534. },
  535. // 分页处理
  536. handleSizeChange(size) {
  537. this.pageSize = size
  538. this.loadAuditProjectList()
  539. },
  540. handleCurrentChange(current) {
  541. this.currentPage = current
  542. this.loadAuditProjectList()
  543. },
  544. },
  545. }
  546. </script>
  547. <style scoped>
  548. .cost-audit-management {
  549. padding: 20px;
  550. }
  551. /* 列表页面样式 */
  552. .search-section {
  553. margin-bottom: 20px;
  554. }
  555. .action-buttons {
  556. font-size: 12px;
  557. }
  558. .action-buttons a {
  559. color: #409eff;
  560. text-decoration: none;
  561. }
  562. .separator {
  563. margin: 0 5px;
  564. color: #999;
  565. }
  566. .note-section {
  567. margin-top: 20px;
  568. }
  569. .note-text {
  570. color: #f56c6c;
  571. font-size: 12px;
  572. margin: 5px 0;
  573. }
  574. /* 详情页面样式 */
  575. .audit-detail-container {
  576. margin-top: 20px;
  577. }
  578. .detail-form {
  579. margin-top: 20px;
  580. }
  581. .tab-content {
  582. padding: 20px;
  583. background-color: #f9f9f9;
  584. min-height: 200px;
  585. }
  586. /* 办理页面样式 */
  587. .audit-process-container {
  588. margin-top: 20px;
  589. }
  590. .process-actions {
  591. margin-bottom: 20px;
  592. }
  593. .process-actions .el-button {
  594. margin-right: 10px;
  595. }
  596. /* 响应式设计 */
  597. @media (max-width: 768px) {
  598. .process-steps {
  599. flex-direction: column;
  600. }
  601. .step-line {
  602. width: 2px;
  603. height: 20px;
  604. margin: 5px 0;
  605. }
  606. .documents-layout {
  607. flex-direction: column;
  608. }
  609. .documents-type-list {
  610. width: 100%;
  611. margin-right: 0;
  612. margin-bottom: 20px;
  613. }
  614. .meeting-form .el-row {
  615. flex-direction: column;
  616. }
  617. .meeting-form .el-col {
  618. width: 100%;
  619. }
  620. }
  621. </style>