index.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439
  1. <template>
  2. <div class="dashboard-page">
  3. <el-row :gutter="20" class="mb-20 card-row">
  4. <el-col v-if="curOrg != '企业单位'" :span="13">
  5. <el-card shadow="hover">
  6. <div class="card-header">
  7. <div class="left-icon">
  8. <img src="@/assets/index_images/index-icon1@2x.png" alt="" />
  9. <h3>成本监审办理情况</h3>
  10. </div>
  11. <div class="header-actions">
  12. <el-cascader
  13. v-model="areaCode"
  14. :options="districtTree"
  15. :show-all-levels="false"
  16. :props="districtTreeCascaderProps"
  17. style="width: 120px; margin-right: 10px"
  18. placeholder="请选择"
  19. />
  20. <el-date-picker
  21. v-model="year"
  22. type="year"
  23. placeholder="选择年"
  24. format="yyyy"
  25. value-format="yyyy"
  26. style="width: 120px"
  27. ></el-date-picker>
  28. </div>
  29. </div>
  30. <div
  31. ref="chartRef"
  32. style="width: 100%; height: 320px; margin-top: 20px"
  33. ></div>
  34. <!-- 轮播显示器 -->
  35. <ul
  36. class="carousel"
  37. @mouseenter="pauseCarousel"
  38. @mouseleave="resumeCarousel"
  39. >
  40. <li
  41. v-for="(item, idx) in totalPages"
  42. :key="idx"
  43. @click="goToPage(idx)"
  44. >
  45. <i :class="{ active: idx === chartCurrentPage }"></i>
  46. </li>
  47. </ul>
  48. </el-card>
  49. </el-col>
  50. <el-col :span="curOrg != '企业单位' ? 11 : 24">
  51. <el-card shadow="hover">
  52. <div class="card-header">
  53. <div class="left-icon">
  54. <img src="@/assets/index_images/index-icon2@2x.png" alt="" />
  55. <h3>最新消息</h3>
  56. </div>
  57. <el-button type="text" size="small" @click="loadMoreNews">
  58. 更多 &gt;
  59. </el-button>
  60. </div>
  61. <ul class="news-list card-content">
  62. <li
  63. v-for="(item, idx) in newsList"
  64. :key="idx"
  65. class="news-item-new"
  66. >
  67. <span class="news-dot"></span>
  68. <span class="news-title-text">{{ item.noticeTitle }}</span>
  69. <span class="news-author">{{ item.remark || '管理员' }}</span>
  70. <span class="news-time">{{ item.createTime }}</span>
  71. </li>
  72. </ul>
  73. </el-card>
  74. </el-col>
  75. </el-row>
  76. <!-- 第二行:本人待办事项 -->
  77. <el-row class="mb-20">
  78. <el-col :span="24">
  79. <el-card shadow="hover">
  80. <div class="card-header">
  81. <div class="left-icon">
  82. <img src="@/assets/index_images/index-icon5@2x.png" alt="" />
  83. <h3>本人待办事项</h3>
  84. </div>
  85. <div class="search-actions">
  86. <el-input
  87. v-model="todoSearchQuery"
  88. placeholder="监审项目名称"
  89. style="width: 300px; margin-right: 10px"
  90. clearable
  91. />
  92. <el-button type="primary" @click="handleTodoSearch">
  93. 查询
  94. </el-button>
  95. </div>
  96. </div>
  97. <el-table
  98. v-loading="loading"
  99. :data="todoList"
  100. style="width: 100%"
  101. :stripe="false"
  102. class="no-zebra"
  103. border
  104. default-expand-all
  105. row-key="id"
  106. :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
  107. >
  108. <el-table-column
  109. type="index"
  110. label="序号"
  111. width="80"
  112. header-align="center"
  113. align="center"
  114. >
  115. <template slot-scope="scope">
  116. <span v-if="curOrg == '企业单位'">
  117. {{ scope.$index + 1 }}
  118. </span>
  119. <!-- 只显示父节点的序号 -->
  120. <div v-else>
  121. <span v-if="scope.row.children">
  122. {{ getParentNodeIndex(scope.row) }}
  123. </span>
  124. <span v-else></span>
  125. </div>
  126. </template>
  127. </el-table-column>
  128. <el-table-column
  129. prop="projectName"
  130. label="成本监审项目名称"
  131. show-overflow-tooltip
  132. header-align="center"
  133. align="left"
  134. />
  135. <el-table-column
  136. :prop="curOrg == '企业单位' ? 'auditedUnitName' : 'auditObject'"
  137. label="监审对象"
  138. header-align="center"
  139. align="left"
  140. show-overflow-tooltip
  141. />
  142. <el-table-column
  143. prop="auditPeriod"
  144. label="监审期间"
  145. header-align="center"
  146. align="center"
  147. width="120"
  148. show-overflow-tooltip
  149. />
  150. <el-table-column
  151. v-if="curOrg != '企业单位'"
  152. prop="source"
  153. label="立项来源"
  154. header-align="center"
  155. align="center"
  156. width="100"
  157. />
  158. <el-table-column
  159. v-if="curOrg != '企业单位'"
  160. prop="form"
  161. label="监审形式"
  162. header-align="center"
  163. align="center"
  164. width="100"
  165. />
  166. <el-table-column
  167. prop="currentNodeName"
  168. label="状态"
  169. align="center"
  170. width="150"
  171. >
  172. <template slot-scope="scope">
  173. <span v-if="!scope.row.isSubTask">
  174. <span>
  175. {{ scope.row.currentNodeName }}-{{ scope.row.statusName }}
  176. </span>
  177. </span>
  178. <span v-else>{{ scope.row.statusName }}</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="操作" align="center" width="260">
  182. <template slot-scope="scope">
  183. <div v-if="curOrg == '企业单位'">
  184. <el-button
  185. v-if="
  186. (scope.row.currentNode === 'clcs' ||
  187. scope.row.currentNode === 'tjcl') &&
  188. (scope.row.status === '100' ||
  189. scope.row.status === '500' ||
  190. scope.row.status === '600')
  191. "
  192. size="mini"
  193. type="text"
  194. @click="handleEdit(scope.row)"
  195. >
  196. 填报任务
  197. </el-button>
  198. <el-button
  199. v-if="
  200. scope.row.currentNode === 'yjfk' &&
  201. scope.row.status === '250'
  202. "
  203. size="mini"
  204. type="text"
  205. @click="handleEdit(scope.row)"
  206. >
  207. 意见反馈
  208. </el-button>
  209. <el-button
  210. size="mini"
  211. type="text"
  212. @click="handleMessage(scope.row)"
  213. >
  214. 查看
  215. </el-button>
  216. </div>
  217. <div v-else>
  218. <span v-if="!scope.row.isSubTask" class="action-buttons">
  219. <el-button
  220. type="text"
  221. size="small"
  222. @click="handleViewTaskDetail(scope.row)"
  223. >
  224. 任务详情
  225. </el-button>
  226. <el-button
  227. type="text"
  228. size="small"
  229. @click="handleOpenMainDetails(scope.row)"
  230. >
  231. 任务办理
  232. </el-button>
  233. <el-button
  234. type="text"
  235. size="small"
  236. @click="handleCheckRecord(scope.row)"
  237. >
  238. 备忘录
  239. </el-button>
  240. </span>
  241. <span v-if="scope.row.isSubTask" class="action-buttons">
  242. <el-button
  243. v-if="
  244. scope.row.currentNode === 'clcs' &&
  245. (scope.row.status === '200' ||
  246. scope.row.status === '600')
  247. "
  248. type="text"
  249. size="small"
  250. @click="handleOpenDetails(scope.row)"
  251. >
  252. 资料初审
  253. </el-button>
  254. <el-button
  255. v-if="
  256. (scope.row.currentNode === 'sdsh' ||
  257. scope.row.currentNode === 'yjfk') &&
  258. scope.row.status === '200'
  259. "
  260. type="text"
  261. size="small"
  262. @click="handleOpenDetails(scope.row)"
  263. >
  264. 成本审核
  265. </el-button>
  266. <el-button
  267. v-if="
  268. scope.row.currentNode === 'yjgz' &&
  269. scope.row.status === '200'
  270. "
  271. type="text"
  272. size="small"
  273. @click="handleOpenDetails(scope.row)"
  274. >
  275. 意见告知
  276. </el-button>
  277. <el-button
  278. v-if="
  279. scope.row.currentNode === 'yjfk' &&
  280. scope.row.status === '260'
  281. "
  282. type="text"
  283. size="small"
  284. @click="handleOpenDetails(scope.row)"
  285. >
  286. 审核
  287. </el-button>
  288. <el-button
  289. v-if="scope.row.status === '300'"
  290. type="text"
  291. size="small"
  292. @click="handleHf(scope.row)"
  293. >
  294. 恢复
  295. </el-button>
  296. <el-button
  297. type="text"
  298. size="small"
  299. @click="handleMessage(scope.row, 'chengben')"
  300. >
  301. 查看
  302. </el-button>
  303. </span>
  304. </div>
  305. </template>
  306. </el-table-column>
  307. </el-table>
  308. </el-card>
  309. </el-col>
  310. </el-row>
  311. <!-- 第三行:本人备忘录 -->
  312. <el-row v-if="curOrg != '企业单位'" class="card-row">
  313. <el-col :span="24">
  314. <el-card shadow="hover">
  315. <div class="card-header">
  316. <h3>本人备忘录</h3>
  317. <div class="search-actions">
  318. <el-input
  319. v-model="searchKeyword"
  320. placeholder="请输入关键词"
  321. style="width: 180px"
  322. clearable
  323. ></el-input>
  324. <el-button
  325. type="primary"
  326. style="margin-left: 10px"
  327. size="small"
  328. icon="el-icon-search"
  329. @click="handleSearch"
  330. >
  331. 查询
  332. </el-button>
  333. </div>
  334. </div>
  335. <el-row class="mt20">
  336. <el-col :span="13">
  337. <div class="calendar-container">
  338. <div class="calendar-header">
  339. <el-button
  340. type="text"
  341. class="calendar-btn"
  342. @click="handlePrevMonth"
  343. >
  344. <i class="el-icon-arrow-left"></i>
  345. </el-button>
  346. <span class="month-text">{{ setCalendarTitle() }}年</span>
  347. <el-button
  348. type="text"
  349. class="calendar-btn"
  350. @click="handleNextMonth"
  351. >
  352. <i class="el-icon-arrow-right"></i>
  353. </el-button>
  354. </div>
  355. <el-calendar
  356. ref="calendar"
  357. v-model="selectedDate"
  358. :first-day-of-week="0"
  359. >
  360. <!-- 自定义日期单元格 -->
  361. <template slot="dateCell" slot-scope="{ date, data }">
  362. <el-tooltip placement="top">
  363. <div
  364. class="calendar-cell"
  365. @click="handleDateClick(date, data)"
  366. >
  367. <!-- 公历日期 -->
  368. <div class="calendar-date-number">
  369. {{ data.day.split('-').slice(-1)[0] }}
  370. </div>
  371. <!-- 农历日期和节日 -->
  372. <div class="calendar-lunar-info">
  373. <!-- 公历节日 -->
  374. {{ getLunarInfo(date).IDayCn }}
  375. <span class="calendar-festival">
  376. {{
  377. getLunarInfo(date).festival
  378. ? getLunarInfo(date).festival + ' '
  379. : ''
  380. }}
  381. {{
  382. getLunarInfo(date).lunarFestival
  383. ? getLunarInfo(date).lunarFestival + ' '
  384. : ''
  385. }}
  386. {{
  387. getLunarInfo(date).Term
  388. ? getLunarInfo(date).Term
  389. : ''
  390. }}
  391. </span>
  392. </div>
  393. <div
  394. v-if="getTasksByDate(date).length > 0"
  395. class="task-indicator"
  396. ></div>
  397. </div>
  398. <div slot="content">
  399. <template v-if="getTasksByDate(date).length > 0">
  400. <div
  401. v-for="(task, index) in getTasksByDate(date)"
  402. :key="index"
  403. class="task-item"
  404. >
  405. <div class="task-title">
  406. {{ index + 1 }}.{{ task.projectName }}[{{
  407. task.timePeriod
  408. }}]
  409. </div>
  410. </div>
  411. </template>
  412. <template v-else>
  413. <div class="no-tasks">暂无任务安排</div>
  414. </template>
  415. </div>
  416. </el-tooltip>
  417. </template>
  418. </el-calendar>
  419. </div>
  420. </el-col>
  421. <el-col :span="10">
  422. <ul class="news-list card-content">
  423. <li
  424. v-for="(item, idx) in memoList"
  425. :key="idx"
  426. class="news-item mb10"
  427. >
  428. <div class="news-content">
  429. <div class="news-title mb10">
  430. <img
  431. v-if="item.type === 'warning'"
  432. src="@/assets/index_images/index-icon6-light@2x.png"
  433. alt=""
  434. style="width: 15px; height: 15px"
  435. />
  436. <img
  437. v-else
  438. src="@/assets/index_images/index-icon6@2x.png"
  439. alt=""
  440. style="width: 15px; height: 15px"
  441. />
  442. <span class="ml10">{{ item.task }}</span>
  443. </div>
  444. <div class="news-meta mb10">
  445. <div class="left-icon w40">
  446. <img
  447. style="
  448. width: 14px;
  449. height: 14px;
  450. vertical-align: middle;
  451. "
  452. src="@/assets/index_images/index-icon8@2x.png"
  453. />
  454. <span>{{ item.title }}</span>
  455. </div>
  456. <div class="left-icon">
  457. <img
  458. style="
  459. width: 14px;
  460. height: 14px;
  461. vertical-align: middle;
  462. "
  463. src="@/assets/index_images/index-icon4@2x.png"
  464. />
  465. <span>{{ item.memoDate }}</span>
  466. </div>
  467. </div>
  468. <div class="news-meta">
  469. <div class="left-icon content-text">
  470. <img
  471. style="
  472. width: 14px;
  473. height: 14px;
  474. vertical-align: middle;
  475. "
  476. src="@/assets/index_images/index-icon9@2x.png"
  477. />
  478. <span class="content-text">{{ item.content }}</span>
  479. </div>
  480. </div>
  481. </div>
  482. </li>
  483. </ul>
  484. <!-- 分页 -->
  485. <el-pagination
  486. v-if="listTotal > 0"
  487. :current-page="searchParams.page"
  488. :page-size="searchParams.pageSize"
  489. :page-sizes="[50, 100]"
  490. layout="total, sizes, prev, pager, next, jumper"
  491. :total="listTotal"
  492. @size-change="handleSizeChange"
  493. @current-change="handleCurrentChange"
  494. ></el-pagination>
  495. </el-col>
  496. </el-row>
  497. </el-card>
  498. </el-col>
  499. </el-row>
  500. <!-- 详情弹窗组件 -->
  501. <details-dialog
  502. :id="selectedProject && selectedProject.id"
  503. ref="detailsRef"
  504. :selected-project="selectedProject"
  505. :visible.sync="detailsVisible"
  506. :current-node="selectedProject && selectedProject.currentNode"
  507. :current-status="selectedProject && selectedProject.status"
  508. :task-info="selectedProject"
  509. @close="handleDetailsClose"
  510. @refresh="handleRefresh"
  511. />
  512. <!-- 主详情弹窗组件 -->
  513. <mainDetailsDialog
  514. :id="selectedProject && selectedProject.id"
  515. ref="mainDetailsRef"
  516. :visible.sync="mainDetailsVisible"
  517. :current-node="selectedProject && selectedProject.currentNode"
  518. :current-status="selectedProject && selectedProject.status"
  519. @close="handleMainDetailsClose"
  520. @refresh="handleMainRefresh"
  521. />
  522. <taskInfo ref="taskInfo" />
  523. <!-- 成本监审信息弹窗 -->
  524. <cbjs-info
  525. :id="cbjsInfoData && cbjsInfoData.id"
  526. :selected-project="cbjsInfoData"
  527. :visible.sync="cbjsInfoVisible"
  528. :current-node="cbjsInfoData && cbjsInfoData.currentNode"
  529. :current-status="cbjsInfoData && cbjsInfoData.status"
  530. />
  531. <taskDetail ref="taskDetail" />
  532. <!-- 填报任务侧边弹窗 -->
  533. <task-fill-in
  534. ref="taskFillIn"
  535. :visible.sync="taskFillInVisible"
  536. :task-info="currentTaskInfo"
  537. :view-mode="taskViewMode"
  538. @close="handleTaskFillInClose"
  539. @refresh="handleTaskFillInRefresh"
  540. />
  541. </div>
  542. </template>
  543. <script>
  544. // 引入地区选择混入
  545. import { regionMixin } from '@/mixins/useDict'
  546. import * as echarts from 'echarts'
  547. import { memoManageMixin } from '@/views/costAudit/projectInfo/auditProjectManage/memoManage/memoManageMixin'
  548. import { doProcessBtn } from '@/api/dataPreliminaryReview'
  549. import { getReviewTaskList } from '@/api/audit/auditIndex'
  550. import { getChartList, getMsgList, getEnterpriseList } from '@/api/home'
  551. import detailsDialog from '@/views/costAudit/auditInfo/auditManage/details.vue'
  552. import mainDetailsDialog from '@/views/costAudit/auditInfo/auditManage/mainDetails.vue'
  553. import taskInfo from '@/components/task/taskInfo.vue'
  554. import cbjsInfo from '@/components/task/cbjsInfo.vue'
  555. import taskDetail from '@/components/task/taskDetail.vue'
  556. import TaskFillIn from '@/views/EntDeclaration/auditTaskManagement/taskFillIn.vue'
  557. export default {
  558. name: 'Dashboard',
  559. components: {
  560. detailsDialog,
  561. taskInfo,
  562. cbjsInfo,
  563. mainDetailsDialog,
  564. taskDetail,
  565. TaskFillIn,
  566. },
  567. mixins: [regionMixin, memoManageMixin],
  568. data() {
  569. return {
  570. areaCode: '140000',
  571. year: '2025',
  572. auditType: '山西省公立幼儿园教育成本监审',
  573. searchKeyword: '',
  574. todoSearchQuery: '',
  575. // 轮播相关变量
  576. chart: null,
  577. chartTimer: null,
  578. chartCurrentPage: 0,
  579. chartPageSize: 9,
  580. totalPages: 0,
  581. allCategories: [],
  582. allCompletedData: [],
  583. allInProgressData: [],
  584. newsList: [],
  585. todoList: [],
  586. memoList: [],
  587. currentDate: new Date(),
  588. selectedDate: '',
  589. showTooltip: false,
  590. // 成本审核列表相关
  591. currentPage: 1,
  592. pageSize: 100,
  593. total: 0,
  594. loading: false,
  595. detailsVisible: false,
  596. selectedProject: null,
  597. cbjsInfoVisible: false,
  598. cbjsInfoData: null,
  599. mainDetailsVisible: false,
  600. curOrg: '',
  601. // 填报任务弹窗相关
  602. taskFillInVisible: false,
  603. currentTaskInfo: {},
  604. taskViewMode: false,
  605. }
  606. },
  607. watch: {
  608. // 监听年份变化
  609. year(newVal) {
  610. if (newVal) {
  611. this.loadChartData()
  612. }
  613. },
  614. // 监听地区变化
  615. areaCode(newVal) {
  616. if (newVal) {
  617. this.loadChartData()
  618. }
  619. },
  620. },
  621. mounted() {
  622. this.$el.querySelector('div.el-calendar__header').remove()
  623. let user = this.$permission.getUserInfo()
  624. this.curOrg = this.$store.state.user.userInfo.curOrg
  625. if (user.dataScope === 0) {
  626. this.areaCode = user.provinceCode
  627. } else if (user.dataScope === 1) {
  628. this.areaCode = user.cityCode
  629. } else if (user.dataScope === 2) {
  630. this.areaCode = user.countyCode
  631. }
  632. if (this.curOrg != '企业单位') {
  633. this.initChart()
  634. this.initCalendarData('index')
  635. }
  636. this.getTodoList()
  637. this.loadNewsList()
  638. },
  639. methods: {
  640. getTodoList() {
  641. if (this.curOrg === '企业单位') {
  642. this.getEnterpriseTodoList()
  643. } else {
  644. this.loadAuditProjectList()
  645. }
  646. },
  647. // 加载最新消息
  648. async loadNewsList() {
  649. try {
  650. const response = await getMsgList()
  651. if (response.state && response.value) {
  652. this.newsList = response.value || []
  653. }
  654. } catch (error) {
  655. console.error('加载最新消息失败:', error)
  656. }
  657. },
  658. // 待办事项搜索
  659. handleTodoSearch() {
  660. this.currentPage = 1
  661. if (this.curOrg === '企业单位') {
  662. this.getEnterpriseTodoList()
  663. } else {
  664. this.loadAuditProjectList()
  665. }
  666. },
  667. // 获取企业待办列表
  668. async getEnterpriseTodoList() {
  669. try {
  670. this.loading = true
  671. const params = {
  672. currentPage: this.currentPage,
  673. pageSize: this.pageSize,
  674. projectName: this.todoSearchQuery,
  675. }
  676. const response = await getEnterpriseList(params)
  677. if (response.state && response.value) {
  678. const records = response.value.records || []
  679. this.todoList = records
  680. }
  681. } catch (error) {
  682. console.error('获取企业待办列表失败:', error)
  683. } finally {
  684. this.loading = false
  685. }
  686. },
  687. // 填报任务
  688. handleEdit(row) {
  689. console.log('填报任务', row)
  690. this.currentTaskInfo = row || {}
  691. this.taskViewMode = false
  692. // 使用ref调用组件的open方法
  693. this.$nextTick(() => {
  694. if (this.$refs.taskFillIn) {
  695. this.$refs.taskFillIn.open(row, false)
  696. }
  697. })
  698. },
  699. // 填报任务提交成功后刷新列表
  700. handleTaskFillInRefresh() {
  701. // 刷新列表数据
  702. this.getEnterpriseTodoList()
  703. },
  704. // 填报任务弹窗关闭
  705. handleTaskFillInClose() {
  706. this.taskFillInVisible = false
  707. this.currentTaskInfo = {}
  708. },
  709. // 加载审核项目列表
  710. async loadAuditProjectList() {
  711. try {
  712. this.loading = true
  713. const params = {
  714. currentPage: this.currentPage,
  715. pageSize: this.pageSize,
  716. projectName: this.todoSearchQuery,
  717. }
  718. const response = await getReviewTaskList(params)
  719. if (response.state && response.value) {
  720. const records = response.value.records || []
  721. // 转换数据格式,将childTasks转换为children以适应表格组件
  722. this.todoList = records.map((record) => {
  723. return {
  724. id: record.id,
  725. projectName: record.projectName,
  726. auditObject: record.auditedUnitName,
  727. auditPeriod: record.auditPeriod,
  728. source: this.getSourceTypeText(record.sourceType),
  729. form: this.getAuditTypeText(record.auditType),
  730. status: this.getStatusText(record.status),
  731. statusName: record.statusName,
  732. isSubTask: record.pid !== '0',
  733. currentNodeName: record.currentNodeName,
  734. currentNode: record.currentNode,
  735. projectId: record.projectId,
  736. auditedUnitId: record.auditedUnitId,
  737. children: record.childTasks
  738. ? record.childTasks.map((child) => ({
  739. id: child.id,
  740. projectName: child.projectName,
  741. auditObject: child.auditedUnitName,
  742. auditPeriod: record.auditPeriod,
  743. source: '',
  744. form: '',
  745. currentNode: child.currentNode,
  746. status: child.status,
  747. statusName: child.statusName,
  748. isSubTask: true,
  749. projectId: child.projectId,
  750. auditedUnitId: child.auditedUnitId,
  751. taskId: child.id,
  752. catalogId: child.catalogId,
  753. }))
  754. : [],
  755. }
  756. })
  757. this.total = response.value.total || 0
  758. } else {
  759. this.todoList = []
  760. this.total = 0
  761. }
  762. } catch (error) {
  763. console.error('加载审核项目列表失败:', error)
  764. } finally {
  765. this.loading = false
  766. }
  767. },
  768. // 获取父节点的连续序号
  769. getParentNodeIndex(row) {
  770. // 过滤出所有父节点
  771. const parentNodes = this.todoList.filter(
  772. (item) => item.children && item.children.length > 0
  773. )
  774. // 找到当前行在父节点数组中的索引
  775. const index = parentNodes.findIndex((item) => item.id === row.id)
  776. // 返回序号(索引+1)
  777. return index + 1
  778. },
  779. // 获取来源类型文本
  780. getSourceTypeText(type) {
  781. const typeMap = {
  782. 1: '年度计划内',
  783. 2: '年度计划外',
  784. }
  785. return typeMap[type] || type
  786. },
  787. // 获取审核类型文本
  788. getAuditTypeText(type) {
  789. const typeMap = {
  790. 1: '定期监审',
  791. 2: '定调价监审',
  792. }
  793. return typeMap[type] || type
  794. },
  795. // 获取状态文本
  796. getStatusText(status) {
  797. const statusMap = {
  798. ccls: '资料初审',
  799. 200: '审核通过',
  800. clcs: '审核中',
  801. }
  802. return statusMap[status] || status
  803. },
  804. // 查记录
  805. handleCheckRecord(project) {
  806. this.$router.push({
  807. name: 'memoManage',
  808. })
  809. },
  810. // 判断是否为周末
  811. isWeekend(date) {
  812. const day = date.getDay() // 0-6,0表示周日,6表示周六
  813. return day === 0 || day === 6 // 周日或周六为周末
  814. },
  815. initChart() {
  816. // 保存图表实例到组件实例中
  817. this.chart = echarts.init(this.$refs.chartRef)
  818. // 加载图表数据
  819. this.loadChartData()
  820. // 监听窗口大小变化
  821. window.addEventListener('resize', () => {
  822. this.chart.resize()
  823. })
  824. // 组件销毁时清除定时器
  825. this.$once('hook:beforeDestroy', () => {
  826. if (this.chartTimer) {
  827. clearInterval(this.chartTimer)
  828. }
  829. })
  830. },
  831. // 加载图表数据
  832. async loadChartData() {
  833. try {
  834. const params = {
  835. year: this.year,
  836. region: this.areaCode[this.areaCode.length - 1],
  837. }
  838. const response = await getChartList(params)
  839. if (response.state && response.value) {
  840. const data = response.value || []
  841. // 解析接口返回的数据
  842. this.allCategories = data.map((item) => ({ name: item.name }))
  843. this.allCompletedData = data.map((item) => item.finish)
  844. this.allInProgressData = data.map((item) => item.nFinish)
  845. // 每页显示9个数据
  846. this.chartPageSize = 9
  847. this.chartCurrentPage = 0
  848. this.totalPages = Math.ceil(
  849. this.allCategories.length / this.chartPageSize
  850. )
  851. // 初始加载第一页数据
  852. this.updateChartData()
  853. // 设置定时器,每5秒切换一页数据
  854. if (this.chartTimer) {
  855. clearInterval(this.chartTimer)
  856. }
  857. this.chartTimer = setInterval(() => {
  858. this.chartCurrentPage =
  859. this.totalPages > 1
  860. ? (this.chartCurrentPage + 1) % this.totalPages
  861. : 0
  862. this.updateChartData()
  863. }, 5000)
  864. } else {
  865. // 如果接口没有数据,使用初始化默认数据
  866. this.initChartData()
  867. this.updateChartData()
  868. }
  869. } catch (error) {
  870. console.error('加载图表数据失败:', error)
  871. // 出错时使用默认数据
  872. this.initChartData()
  873. this.updateChartData()
  874. }
  875. },
  876. // 初始化图表数据
  877. initChartData() {
  878. // 扩展数据,确保有足够的数据用于轮播
  879. this.allCategories = []
  880. // 每页显示9个数据
  881. this.chartPageSize = 9
  882. this.chartCurrentPage = 0
  883. this.totalPages = Math.ceil(
  884. this.allCategories.length / this.chartPageSize
  885. )
  886. },
  887. // 跳转到指定页面
  888. goToPage(index) {
  889. if (index >= 0 && index < this.totalPages) {
  890. // 清除现有定时器
  891. if (this.chartTimer) {
  892. clearInterval(this.chartTimer)
  893. }
  894. // 更新当前页
  895. this.chartCurrentPage = index
  896. this.updateChartData()
  897. // 重新设置定时器
  898. this.resumeCarousel()
  899. }
  900. },
  901. // 暂停轮播
  902. pauseCarousel() {
  903. if (this.chartTimer) {
  904. clearInterval(this.chartTimer)
  905. this.chartTimer = null
  906. }
  907. },
  908. // 恢复轮播
  909. resumeCarousel() {
  910. if (!this.chartTimer && this.totalPages > 1) {
  911. this.chartTimer = setInterval(() => {
  912. this.chartCurrentPage =
  913. (this.chartCurrentPage + 1) % this.totalPages
  914. this.updateChartData()
  915. }, 5000)
  916. }
  917. },
  918. // 更新图表数据的方法
  919. updateChartData(
  920. categories = null,
  921. completedData = null,
  922. inProgressData = null
  923. ) {
  924. if (!this.chart) {
  925. return
  926. }
  927. let currentCategories, currentCompletedData, currentInProgressData
  928. // 如果提供了新数据,则使用新数据
  929. if (categories && completedData && inProgressData) {
  930. currentCategories = categories
  931. currentCompletedData = completedData
  932. currentInProgressData = inProgressData
  933. } else {
  934. // 否则使用当前页的数据
  935. const startIndex = this.chartCurrentPage * this.chartPageSize
  936. const endIndex = Math.min(
  937. startIndex + this.chartPageSize,
  938. this.allCategories.length
  939. )
  940. currentCategories = this.allCategories.slice(startIndex, endIndex)
  941. currentCompletedData = this.allCompletedData.slice(
  942. startIndex,
  943. endIndex
  944. )
  945. currentInProgressData = this.allInProgressData.slice(
  946. startIndex,
  947. endIndex
  948. )
  949. }
  950. const option = {
  951. tooltip: {
  952. trigger: 'axis',
  953. axisPointer: {
  954. type: 'shadow',
  955. },
  956. },
  957. legend: {
  958. show: true,
  959. itemWidth: 20,
  960. itemHeight: 8,
  961. itemGap: 10,
  962. data: ['已办', '在办'],
  963. },
  964. grid: {
  965. top: '20%',
  966. left: '3%',
  967. right: '4%',
  968. bottom: '2%',
  969. containLabel: true,
  970. },
  971. xAxis: {
  972. type: 'category',
  973. data: currentCategories.map((item) => item.name),
  974. axisLabel: {
  975. interval: 0,
  976. rotate: 0,
  977. },
  978. axisTick: {
  979. alignWithLabel: true,
  980. },
  981. boundaryGap: true,
  982. scrollBar: {
  983. show: true,
  984. height: 10,
  985. },
  986. },
  987. yAxis: {
  988. type: 'value',
  989. },
  990. series: [
  991. {
  992. name: '已办',
  993. type: 'bar',
  994. barWidth: '10%',
  995. data: currentCompletedData,
  996. itemStyle: {
  997. color: '#1890ff',
  998. },
  999. },
  1000. {
  1001. name: '在办',
  1002. type: 'bar',
  1003. barWidth: '10%',
  1004. data: currentInProgressData,
  1005. itemStyle: {
  1006. color: '#ff9c6e',
  1007. },
  1008. },
  1009. ],
  1010. }
  1011. this.chart.setOption(option, true)
  1012. },
  1013. loadMoreNews() {
  1014. // 跳转通知公告页面
  1015. this.$router.push('/personal/notice')
  1016. },
  1017. handleOp(type, row) {
  1018. if (type === '详情') {
  1019. this.$refs.taskDetail.open(row, 'chengben')
  1020. } else if (type === '办理') {
  1021. this.selectedProject = row
  1022. this.mainDetailsVisible = true
  1023. } else if (type === '查看') {
  1024. this.cbjsInfoData = row
  1025. this.cbjsInfoVisible = true
  1026. } else if (type === '审核') {
  1027. this.selectedProject = row
  1028. this.detailsVisible = true
  1029. }
  1030. },
  1031. // 打开详情弹窗
  1032. handleOpenDetails(project) {
  1033. this.selectedProject = project
  1034. this.detailsVisible = true
  1035. },
  1036. handleOpenMainDetails(project) {
  1037. this.selectedProject = project
  1038. this.mainDetailsVisible = true
  1039. },
  1040. // 详情弹窗关闭处理
  1041. handleDetailsClose() {
  1042. this.selectedProject = null
  1043. this.detailsVisible = false
  1044. },
  1045. // 主详情弹窗关闭处理
  1046. handleMainDetailsClose() {
  1047. this.selectedProject = null
  1048. this.mainDetailsVisible = false
  1049. },
  1050. // 刷新表格数据
  1051. handleRefresh() {
  1052. this.loadAuditProjectList()
  1053. },
  1054. // 主详情刷新处理
  1055. handleMainRefresh() {
  1056. this.loadAuditProjectList()
  1057. },
  1058. // 恢复任务
  1059. async handleHf(row) {
  1060. if (!row || !row.id) {
  1061. this.$message.error('缺少任务ID')
  1062. return
  1063. }
  1064. this.$confirm('确定要恢复此任务吗?', '恢复任务', {
  1065. confirmButtonText: '确定',
  1066. cancelButtonText: '取消',
  1067. type: 'warning',
  1068. })
  1069. .then(async () => {
  1070. try {
  1071. const params = {
  1072. taskId: row.id,
  1073. key: 2,
  1074. status: 200,
  1075. processNodeKey: row.currentNode,
  1076. }
  1077. const response = await doProcessBtn(params)
  1078. if (response && response.code === 200) {
  1079. this.$message.success('恢复任务成功')
  1080. this.loadAuditProjectList()
  1081. } else {
  1082. this.$message.error(response?.message || '恢复任务失败')
  1083. }
  1084. } catch (error) {
  1085. console.error('恢复任务失败:', error)
  1086. }
  1087. })
  1088. .catch(() => {
  1089. this.$message.info('已取消恢复任务')
  1090. })
  1091. },
  1092. // 查看
  1093. handleMessage(row, type) {
  1094. if (type === 'chengben') {
  1095. this.cbjsInfoData = row
  1096. this.cbjsInfoVisible = true
  1097. } else {
  1098. this.$refs.taskInfo.open(row, type)
  1099. }
  1100. },
  1101. // 查看任务详情
  1102. handleViewTaskDetail(row) {
  1103. this.$refs.taskDetail.open(row, 'chengben')
  1104. },
  1105. searchMemo() {
  1106. this.$message.info(`搜索备忘录,关键词:${this.searchKeyword}`)
  1107. },
  1108. hasEventOnDate(date) {
  1109. // 检查指定日期是否有备忘录事件
  1110. return this.memoList.some((item) => item.time === date.substring(5))
  1111. },
  1112. addMemo() {
  1113. this.$message.info('添加新备忘录')
  1114. },
  1115. },
  1116. }
  1117. </script>
  1118. <style scoped lang="scss">
  1119. @import '@/views/costAudit/projectInfo/auditProjectManage/memoManage/memoManage.scss';
  1120. .mb-20 {
  1121. /* border: 1px solid red; */
  1122. margin-bottom: 20px;
  1123. }
  1124. .icon-dot {
  1125. width: 8px;
  1126. height: 8px;
  1127. background-color: #999999;
  1128. border-radius: 50%;
  1129. display: inline-block;
  1130. }
  1131. /* 确保同一行的卡片高度一致 */
  1132. .card-row {
  1133. display: flex;
  1134. flex-wrap: wrap;
  1135. }
  1136. .card-row .el-card {
  1137. height: 100%;
  1138. display: flex;
  1139. flex-direction: column;
  1140. }
  1141. ::v-deep .el-card__body {
  1142. flex: 1;
  1143. display: flex;
  1144. flex-direction: column;
  1145. padding: 0;
  1146. }
  1147. .card-header {
  1148. width: 100%;
  1149. display: flex;
  1150. justify-content: space-between;
  1151. align-items: center;
  1152. background: linear-gradient(0deg, #e8edfc, #ffffff);
  1153. padding: 10px 20px;
  1154. box-sizing: border-box;
  1155. }
  1156. .header-actions {
  1157. display: flex;
  1158. align-items: center;
  1159. }
  1160. .calendar-actions {
  1161. display: flex;
  1162. align-items: center;
  1163. }
  1164. .search-actions {
  1165. display: flex;
  1166. align-items: center;
  1167. }
  1168. .news-list {
  1169. width: 100%;
  1170. }
  1171. .card-content {
  1172. width: 90%;
  1173. padding: 20px;
  1174. }
  1175. .news-item {
  1176. width: 100%;
  1177. padding: 12px 0;
  1178. border-bottom: 1px solid #f0f0f0;
  1179. display: flex;
  1180. align-items: flex-start;
  1181. }
  1182. .news-item:last-child {
  1183. border-bottom: none;
  1184. }
  1185. /* 新的消息列表样式 */
  1186. .news-item-new {
  1187. width: 100%;
  1188. padding: 10px 0;
  1189. display: flex;
  1190. align-items: center;
  1191. border-bottom: 1px solid #f0f0f0;
  1192. font-size: 14px;
  1193. line-height: 1.5;
  1194. }
  1195. .news-item-new:last-child {
  1196. border-bottom: none;
  1197. }
  1198. .news-dot {
  1199. width: 6px;
  1200. height: 6px;
  1201. background-color: #409eff;
  1202. border-radius: 50%;
  1203. margin-right: 12px;
  1204. flex-shrink: 0;
  1205. }
  1206. .news-title-text {
  1207. flex: 1;
  1208. color: #333333;
  1209. overflow: hidden;
  1210. text-overflow: ellipsis;
  1211. white-space: nowrap;
  1212. margin-right: 20px;
  1213. }
  1214. .news-author {
  1215. color: #999999;
  1216. margin-right: 20px;
  1217. flex-shrink: 0;
  1218. min-width: 60px;
  1219. }
  1220. .news-time {
  1221. color: #cccccc;
  1222. flex-shrink: 0;
  1223. min-width: 140px;
  1224. text-align: right;
  1225. }
  1226. .news-content {
  1227. width: 100%;
  1228. line-height: 1.6;
  1229. font-size: 14px;
  1230. flex: 1;
  1231. }
  1232. .news-title {
  1233. display: flex;
  1234. align-items: flex-center;
  1235. margin-bottom: 8px;
  1236. width: 95%;
  1237. overflow: hidden;
  1238. text-overflow: ellipsis;
  1239. white-space: nowrap;
  1240. }
  1241. .news-title i {
  1242. color: #f56c6c;
  1243. margin-right: 8px;
  1244. font-size: 14px;
  1245. margin-top: 2px;
  1246. flex-shrink: 0;
  1247. }
  1248. .news-meta {
  1249. width: 100%;
  1250. display: flex;
  1251. align-items: center;
  1252. margin-left: 22px;
  1253. }
  1254. .news-meta .left-icon {
  1255. margin-right: 15px;
  1256. }
  1257. .news-meta .left-icon span {
  1258. margin-left: 4px;
  1259. color: #61657e;
  1260. font-size: 14px;
  1261. }
  1262. .calendar-day {
  1263. position: relative;
  1264. text-align: center;
  1265. padding: 10px 0;
  1266. cursor: pointer;
  1267. }
  1268. .has-event {
  1269. background-color: #f0f9eb;
  1270. }
  1271. .event-dot {
  1272. position: absolute;
  1273. bottom: 5px;
  1274. left: 50%;
  1275. transform: translateX(-50%);
  1276. width: 6px;
  1277. height: 6px;
  1278. background-color: #67c23a;
  1279. border-radius: 50%;
  1280. }
  1281. .left-icon {
  1282. display: flex;
  1283. align-items: center;
  1284. img {
  1285. width: 20px;
  1286. }
  1287. }
  1288. .title {
  1289. font-size: 18px;
  1290. }
  1291. /* 彻底移除表格斑马纹效果 */
  1292. .no-zebra ::v-deep .el-table__row:nth-child(even) {
  1293. background-color: transparent;
  1294. }
  1295. .no-zebra ::v-deep .el-table__body tr:hover > td {
  1296. background-color: #f5f7fa !important;
  1297. }
  1298. .w40 {
  1299. width: 40%;
  1300. }
  1301. .content-text {
  1302. display: flex;
  1303. align-items: center;
  1304. width: 95%;
  1305. overflow: hidden;
  1306. text-overflow: ellipsis;
  1307. white-space: nowrap;
  1308. color: #61657e;
  1309. font-size: 14px;
  1310. }
  1311. h3 {
  1312. margin: 0;
  1313. // font-size: 16px;
  1314. font-weight: bolder;
  1315. color: #333333;
  1316. margin-left: 10px;
  1317. }
  1318. .event-dot {
  1319. position: absolute;
  1320. bottom: 5px;
  1321. left: 50%;
  1322. transform: translateX(-50%);
  1323. width: 6px;
  1324. height: 6px;
  1325. background-color: #67c23a;
  1326. border-radius: 50%;
  1327. }
  1328. .tooltip {
  1329. position: absolute;
  1330. top: 100%;
  1331. left: 50%;
  1332. transform: translateX(-50%);
  1333. background-color: #333;
  1334. color: white;
  1335. padding: 8px 12px;
  1336. border-radius: 4px;
  1337. font-size: 12px;
  1338. z-index: 1000;
  1339. opacity: 0;
  1340. transition: opacity 0.3s ease;
  1341. }
  1342. .tooltip.show {
  1343. opacity: 1;
  1344. }
  1345. .tooltip-content {
  1346. max-width: 200px;
  1347. white-space: nowrap;
  1348. overflow: hidden;
  1349. text-overflow: ellipsis;
  1350. }
  1351. .calendar-header {
  1352. width: 95%;
  1353. margin: 15px auto 0;
  1354. display: flex;
  1355. justify-content: center;
  1356. align-items: center;
  1357. text-align: center;
  1358. background: #f0f4fd;
  1359. padding: 5px 0;
  1360. }
  1361. .calendar-btn {
  1362. margin: 0 20px;
  1363. cursor: pointer;
  1364. font-size: 20px;
  1365. color: #606266;
  1366. transition: color 0.3s ease;
  1367. &:hover {
  1368. color: #409eff;
  1369. }
  1370. }
  1371. /* 使星期几头部居中显示 */
  1372. ::v-deep .el-calendar-table thead th {
  1373. text-align: center !important;
  1374. font-weight: 500;
  1375. color: #606266;
  1376. }
  1377. .carousel {
  1378. display: flex;
  1379. justify-content: center;
  1380. align-items: center;
  1381. margin-top: 20px;
  1382. li {
  1383. list-style: none;
  1384. margin: 0 8px;
  1385. cursor: pointer;
  1386. transition: transform 0.2s ease;
  1387. &:hover {
  1388. transform: scale(1.1);
  1389. }
  1390. }
  1391. i {
  1392. display: inline-block;
  1393. width: 12px;
  1394. height: 8px;
  1395. background-color: #e0e0e0;
  1396. border-radius: 50%;
  1397. transition: all 0.3s ease;
  1398. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  1399. }
  1400. i.active {
  1401. background-color: #409eff;
  1402. width: 24px;
  1403. border-radius: 6px;
  1404. }
  1405. }
  1406. </style>