index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  1. <template>
  2. <div class="dashboard-page">
  3. <el-row :gutter="20" class="mb-20 card-row">
  4. <el-col :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-select
  13. v-model="province"
  14. placeholder="请选择省份"
  15. style="width: 100px; margin-right: 10px"
  16. >
  17. <el-option label="山西省" value="山西省"></el-option>
  18. </el-select>
  19. <el-select
  20. v-model="year"
  21. placeholder="请选择年份"
  22. style="width: 100px"
  23. >
  24. <el-option label="2025" value="2025"></el-option>
  25. </el-select>
  26. </div>
  27. </div>
  28. <div
  29. ref="chartRef"
  30. style="width: 100%; height: 400px; margin-top: 20px"
  31. ></div>
  32. </el-card>
  33. </el-col>
  34. <el-col :span="11">
  35. <el-card shadow="hover">
  36. <div class="card-header">
  37. <div class="left-icon">
  38. <img src="@/assets/index_images/index-icon2@2x.png" alt="" />
  39. <h3>最新消息</h3>
  40. </div>
  41. <el-button type="text" size="small" @click="loadMoreNews">
  42. 更多 &gt;
  43. </el-button>
  44. </div>
  45. <ul class="news-list card-content">
  46. <li v-for="(item, idx) in newsList" :key="idx" class="news-item">
  47. <div class="news-content">
  48. <div class="news-title">
  49. <i class="icon-dot"></i>
  50. {{ item.content }}
  51. </div>
  52. <div class="news-meta">
  53. <div class="left-icon">
  54. <img
  55. style="width: 14px; height: 14px; vertical-align: middle"
  56. src="@/assets/index_images/index-icon3@2x.png"
  57. alt="管理员"
  58. />
  59. <span>管理员</span>
  60. </div>
  61. <div class="left-icon">
  62. <img
  63. style="width: 14px; height: 14px; vertical-align: middle"
  64. src="@/assets/index_images/index-icon4@2x.png"
  65. alt="时间"
  66. />
  67. <span>{{ item.date }}</span>
  68. </div>
  69. </div>
  70. </div>
  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. <el-select
  86. v-model="auditType"
  87. placeholder="请选择监审类型"
  88. style="width: 220px"
  89. >
  90. <el-option
  91. label="山西省公立幼儿园教育成本监审"
  92. value="山西省公立幼儿园教育成本监审"
  93. ></el-option>
  94. </el-select>
  95. </div>
  96. <el-table
  97. :data="todoList"
  98. style="width: 100%"
  99. :stripe="false"
  100. class="no-zebra"
  101. >
  102. <el-table-column label="预警" width="60">
  103. <template slot-scope="scope">
  104. <el-tag v-if="scope.row.warning" type="warning">预警</el-tag>
  105. </template>
  106. </el-table-column>
  107. <el-table-column prop="task" label="成本监审任务"></el-table-column>
  108. <el-table-column prop="unit" label="被监审单位"></el-table-column>
  109. <el-table-column
  110. prop="auditForm"
  111. label="监审形式"
  112. ></el-table-column>
  113. <el-table-column
  114. prop="auditPeriod"
  115. label="监审期间"
  116. ></el-table-column>
  117. <el-table-column prop="status" label="办理状态"></el-table-column>
  118. <el-table-column label="操作" width="100">
  119. <template slot-scope="scope">
  120. <el-button
  121. v-if="scope.row.op === '任务详情'"
  122. type="text"
  123. size="small"
  124. @click="handleOp('详情', scope.row)"
  125. >
  126. 任务详情
  127. </el-button>
  128. <el-button
  129. v-if="scope.row.op === '任务办理'"
  130. type="text"
  131. size="small"
  132. @click="handleOp('办理', scope.row)"
  133. >
  134. 任务办理
  135. </el-button>
  136. <el-button
  137. v-if="scope.row.op === '查看'"
  138. type="text"
  139. size="small"
  140. @click="handleOp('查看', scope.row)"
  141. >
  142. 查看
  143. </el-button>
  144. <el-button
  145. v-if="scope.row.op === '审核'"
  146. type="text"
  147. size="small"
  148. @click="handleOp('审核', scope.row)"
  149. >
  150. 审核
  151. </el-button>
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. </el-card>
  156. </el-col>
  157. </el-row>
  158. <!-- 第三行:本人备忘录 -->
  159. <el-row class="card-row">
  160. <el-col :span="24">
  161. <el-card shadow="hover">
  162. <div class="card-header">
  163. <h3>本人备忘录</h3>
  164. <div class="search-actions">
  165. <el-input
  166. v-model="searchKeyword"
  167. placeholder="请输入关键词"
  168. style="width: 180px"
  169. clearable
  170. ></el-input>
  171. <el-button
  172. type="primary"
  173. style="margin-left: 10px"
  174. size="small"
  175. icon="el-icon-search"
  176. @click="searchMemo"
  177. >
  178. 查询
  179. </el-button>
  180. </div>
  181. </div>
  182. <el-row class="mt20">
  183. <el-col :span="13">
  184. <div class="calendar-container">
  185. <div class="calendar-header">
  186. <el-button
  187. type="text"
  188. class="calendar-btn"
  189. @click="handlePrevMonth"
  190. >
  191. <i class="el-icon-arrow-left"></i>
  192. </el-button>
  193. <span class="month-text">{{ setCalendarTitle() }}年</span>
  194. <el-button
  195. type="text"
  196. class="calendar-btn"
  197. @click="handleNextMonth"
  198. >
  199. <i class="el-icon-arrow-right"></i>
  200. </el-button>
  201. </div>
  202. <el-calendar
  203. ref="calendar"
  204. v-model="selectedDate"
  205. :first-day-of-week="0"
  206. >
  207. <!-- 自定义日期单元格 -->
  208. <template slot="dateCell" slot-scope="{ date, data }">
  209. <el-tooltip placement="top">
  210. <div
  211. class="calendar-cell"
  212. @click="handleDateClick(date, data)"
  213. >
  214. <!-- 公历日期 -->
  215. <div class="calendar-date-number">
  216. {{ data.day.split('-').slice(-1)[0] }}
  217. </div>
  218. <!-- 农历日期和节日 -->
  219. <div class="calendar-lunar-info">
  220. <!-- 公历节日 -->
  221. {{ getLunarInfo(date).IDayCn }}
  222. <span class="calendar-festival">
  223. {{
  224. getLunarInfo(date).festival
  225. ? getLunarInfo(date).festival + ' '
  226. : ''
  227. }}
  228. {{
  229. getLunarInfo(date).lunarFestival
  230. ? getLunarInfo(date).lunarFestival + ' '
  231. : ''
  232. }}
  233. {{
  234. getLunarInfo(date).Term
  235. ? getLunarInfo(date).Term
  236. : ''
  237. }}
  238. </span>
  239. </div>
  240. <div
  241. v-if="getTasksByDate(date).length > 0"
  242. class="task-indicator"
  243. ></div>
  244. </div>
  245. <div slot="content">
  246. <template v-if="getTasksByDate(date).length > 0">
  247. <div
  248. v-for="(task, index) in getTasksByDate(date)"
  249. :key="index"
  250. class="task-item"
  251. >
  252. <div class="task-title">
  253. {{ index + 1 }}.{{ task.projectName }}
  254. </div>
  255. </div>
  256. </template>
  257. <template v-else>
  258. <div class="no-tasks">暂无任务安排</div>
  259. </template>
  260. </div>
  261. </el-tooltip>
  262. </template>
  263. </el-calendar>
  264. </div>
  265. </el-col>
  266. <el-col :span="10">
  267. <ul class="news-list card-content">
  268. <li
  269. v-for="(item, idx) in memoList"
  270. :key="idx"
  271. class="news-item mb10"
  272. >
  273. <div class="news-content">
  274. <div class="news-title mb10">
  275. <img
  276. v-if="item.type === 'warning'"
  277. src="@/assets/index_images/index-icon6-light@2x.png"
  278. alt=""
  279. style="width: 15px; height: 15px"
  280. />
  281. <img
  282. v-else
  283. src="@/assets/index_images/index-icon6@2x.png"
  284. alt=""
  285. style="width: 15px; height: 15px"
  286. />
  287. <span class="ml10">{{ item.projectName }}</span>
  288. </div>
  289. <div class="news-meta mb10">
  290. <div class="left-icon w40">
  291. <img
  292. style="
  293. width: 14px;
  294. height: 14px;
  295. vertical-align: middle;
  296. "
  297. src="@/assets/index_images/index-icon4@2x.png"
  298. />
  299. <span>{{ item.title }}</span>
  300. </div>
  301. <div class="left-icon">
  302. <img
  303. style="
  304. width: 14px;
  305. height: 14px;
  306. vertical-align: middle;
  307. "
  308. src="@/assets/index_images/index-icon4@2x.png"
  309. alt="时间"
  310. />
  311. <span>{{ item.memoDate }}</span>
  312. </div>
  313. </div>
  314. <div class="news-meta">
  315. <i class="el-icon-document"></i>
  316. <span class="content-text">{{ item.content }}</span>
  317. </div>
  318. </div>
  319. </li>
  320. </ul>
  321. </el-col>
  322. </el-row>
  323. </el-card>
  324. </el-col>
  325. </el-row>
  326. </div>
  327. </template>
  328. <script>
  329. import * as echarts from 'echarts'
  330. import { memoManageMixin } from '@/views/costAudit/projectInfo/auditProjectManage/memoManage/memoManageMixin'
  331. export default {
  332. name: 'Dashboard',
  333. mixins: [memoManageMixin],
  334. data() {
  335. return {
  336. province: '山西省',
  337. year: '2025',
  338. auditType: '山西省公立幼儿园教育成本监审',
  339. searchKeyword: '',
  340. newsList: [
  341. {
  342. content: '依据定价管理规范,全面开展《山西省定价目录》修订工作',
  343. date: '2025-05-06 14:00',
  344. },
  345. {
  346. content:
  347. '为适应市场发展新形势,正式启动定价管理范畴内《山西省定价目录》的调整优化工作',
  348. date: '2025-05-06 14:00',
  349. },
  350. {
  351. content:
  352. '按照定价管理的既定流程和标准,积极推进《山西省定价目录》的更新完善事宜',
  353. date: '2025-05-06 14:00',
  354. },
  355. {
  356. content:
  357. '基于当前价格管理工作的实际需求,着力实施定价管理中《山西省定价目录》的修改完善行动',
  358. date: '2025-05-06 14:00',
  359. },
  360. {
  361. content:
  362. '为进一步提升定价管理的科学性与精准性,全面开启《山西省定价目录》的深度修订进程',
  363. date: '2025-05-06 14:00',
  364. },
  365. ],
  366. todoList: [
  367. {
  368. warning: true,
  369. task: '山西省公立幼儿园教育成本监审',
  370. unit: 'XX幼儿园、YY幼儿园、ZZ幼儿园',
  371. auditForm: '实地监审',
  372. auditPeriod: '2023-2024年',
  373. status: '进行中',
  374. op: '任务办理',
  375. },
  376. {
  377. warning: false,
  378. task: '山西省公立医院医疗服务成本监审',
  379. unit: '山西省人民医院',
  380. auditForm: '实地监审',
  381. auditPeriod: '2023-2024年',
  382. status: '待审核',
  383. op: '审核',
  384. },
  385. {
  386. warning: false,
  387. task: '太原市生活垃圾处理成本监审',
  388. unit: '太原市环卫局',
  389. auditForm: '书面监审',
  390. auditPeriod: '2023-2024年',
  391. status: '已完成',
  392. op: '查看',
  393. },
  394. {
  395. warning: false,
  396. task: '山西省公立小学教育成本监审',
  397. unit: '太原市实验小学等10所学校',
  398. auditForm: '实地监审',
  399. auditPeriod: '2023-2024年',
  400. status: '待分配',
  401. op: '任务详情',
  402. },
  403. ],
  404. memoList: [],
  405. currentDate: new Date(),
  406. selectedDate: '',
  407. showTooltip: false,
  408. }
  409. },
  410. mounted() {
  411. this.$el.querySelector('div.el-calendar__header').remove()
  412. this.initChart()
  413. this.initCalendarData(5)
  414. },
  415. methods: {
  416. // 判断是否为周末
  417. isWeekend(date) {
  418. const day = date.getDay() // 0-6,0表示周日,6表示周六
  419. return day === 0 || day === 6 // 周日或周六为周末
  420. },
  421. initChart() {
  422. const chart = echarts.init(this.$refs.chartRef)
  423. let data = [
  424. { value: 10, name: '输配电' },
  425. { value: 5, name: '燃气' },
  426. { value: 20, name: '交通运输' },
  427. { value: 15, name: '供热' },
  428. { value: 30, name: '托育服务' },
  429. { value: 25, name: '养老服务' },
  430. { value: 40, name: '文化旅游' },
  431. ]
  432. const option = {
  433. tooltip: {
  434. trigger: 'axis',
  435. axisPointer: {
  436. type: 'shadow',
  437. },
  438. },
  439. legend: {
  440. show: true,
  441. itemWidth: 20,
  442. itemHeight: 8,
  443. itemGap: 10,
  444. data: ['已办', '在办'],
  445. },
  446. grid: {
  447. top: '20%',
  448. left: '3%',
  449. right: '4%',
  450. bottom: '2%', // 增加底部空间以容纳滚动条和旋转的标签
  451. containLabel: true,
  452. },
  453. xAxis: {
  454. type: 'category',
  455. data: data.map((item) => item.name),
  456. // 启用滚动条
  457. axisLabel: {
  458. interval: 0,
  459. rotate: 0,
  460. },
  461. axisTick: {
  462. alignWithLabel: true,
  463. },
  464. boundaryGap: true,
  465. // 滚动配置
  466. scrollBar: {
  467. show: true,
  468. height: 10,
  469. },
  470. },
  471. yAxis: {
  472. type: 'value',
  473. },
  474. series: [
  475. {
  476. name: '已办',
  477. type: 'bar',
  478. barWidth: '10%',
  479. data: [45, 38, 42, 39, 43, 48, 46, 44, 47, 52, 49, 51],
  480. itemStyle: {
  481. color: '#1890ff',
  482. },
  483. },
  484. {
  485. name: '在办',
  486. type: 'bar',
  487. barWidth: '10%',
  488. data: [18, 25, 16, 22, 20, 17, 19, 21, 24, 18, 23, 20],
  489. itemStyle: {
  490. color: '#ff9c6e',
  491. },
  492. },
  493. ],
  494. }
  495. chart.setOption(option)
  496. window.addEventListener('resize', () => {
  497. chart.resize()
  498. })
  499. },
  500. loadMoreNews() {
  501. // 跳转通知公告页面
  502. this.$router.push('/personal/notice')
  503. },
  504. handleOp(type, row) {
  505. this.$message.info(`执行【${type}】操作:${row.task}`)
  506. },
  507. searchMemo() {
  508. this.$message.info(`搜索备忘录,关键词:${this.searchKeyword}`)
  509. },
  510. hasEventOnDate(date) {
  511. // 检查指定日期是否有备忘录事件
  512. return this.memoList.some((item) => item.time === date.substring(5))
  513. },
  514. addMemo() {
  515. this.$message.info('添加新备忘录')
  516. },
  517. },
  518. }
  519. </script>
  520. <style scoped lang="scss">
  521. @import '@/views/costAudit/projectInfo/auditProjectManage/memoManage/memoManage.scss';
  522. .mb-20 {
  523. /* border: 1px solid red; */
  524. margin-bottom: 20px;
  525. }
  526. .icon-dot {
  527. width: 8px;
  528. height: 8px;
  529. background-color: #999999;
  530. border-radius: 50%;
  531. display: inline-block;
  532. }
  533. /* 确保同一行的卡片高度一致 */
  534. .card-row {
  535. display: flex;
  536. flex-wrap: wrap;
  537. }
  538. .card-row .el-card {
  539. height: 100%;
  540. display: flex;
  541. flex-direction: column;
  542. }
  543. ::v-deep .el-card__body {
  544. flex: 1;
  545. display: flex;
  546. flex-direction: column;
  547. padding: 0;
  548. }
  549. .card-header {
  550. width: 100%;
  551. display: flex;
  552. justify-content: space-between;
  553. align-items: center;
  554. background: linear-gradient(0deg, #e8edfc, #ffffff);
  555. padding: 10px 20px;
  556. box-sizing: border-box;
  557. }
  558. .header-actions {
  559. display: flex;
  560. align-items: center;
  561. }
  562. .calendar-actions {
  563. display: flex;
  564. align-items: center;
  565. }
  566. .search-actions {
  567. display: flex;
  568. align-items: center;
  569. }
  570. .news-list {
  571. width: 100%;
  572. }
  573. .card-content {
  574. width: 100%;
  575. padding: 20px;
  576. }
  577. .news-item {
  578. width: 100%;
  579. padding: 12px 0;
  580. border-bottom: 1px solid #f0f0f0;
  581. display: flex;
  582. align-items: flex-start;
  583. }
  584. .news-item:last-child {
  585. border-bottom: none;
  586. }
  587. .news-content {
  588. width: 100%;
  589. line-height: 1.6;
  590. font-size: 14px;
  591. flex: 1;
  592. }
  593. .news-title {
  594. display: flex;
  595. align-items: flex-center;
  596. margin-bottom: 8px;
  597. width: 95%;
  598. overflow: hidden;
  599. text-overflow: ellipsis;
  600. white-space: nowrap;
  601. }
  602. .news-title i {
  603. color: #f56c6c;
  604. margin-right: 8px;
  605. font-size: 14px;
  606. margin-top: 2px;
  607. flex-shrink: 0;
  608. }
  609. .news-meta {
  610. width: 100%;
  611. display: flex;
  612. align-items: center;
  613. margin-left: 22px;
  614. }
  615. .news-meta .left-icon {
  616. margin-right: 15px;
  617. }
  618. .news-meta .left-icon span {
  619. margin-left: 4px;
  620. color: #61657e;
  621. font-size: 14px;
  622. }
  623. .calendar-day {
  624. position: relative;
  625. text-align: center;
  626. padding: 10px 0;
  627. cursor: pointer;
  628. }
  629. .has-event {
  630. background-color: #f0f9eb;
  631. }
  632. .event-dot {
  633. position: absolute;
  634. bottom: 5px;
  635. left: 50%;
  636. transform: translateX(-50%);
  637. width: 6px;
  638. height: 6px;
  639. background-color: #67c23a;
  640. border-radius: 50%;
  641. }
  642. .left-icon {
  643. display: flex;
  644. align-items: center;
  645. img {
  646. width: 20px;
  647. }
  648. }
  649. .title {
  650. font-size: 18px;
  651. }
  652. /* 彻底移除表格斑马纹效果 */
  653. .no-zebra ::v-deep .el-table__row:nth-child(even) {
  654. background-color: transparent;
  655. }
  656. .no-zebra ::v-deep .el-table__body tr:hover > td {
  657. background-color: #f5f7fa !important;
  658. }
  659. .w40 {
  660. width: 40%;
  661. }
  662. .content-text {
  663. display: inline-block;
  664. width: 95%;
  665. overflow: hidden;
  666. text-overflow: ellipsis;
  667. white-space: nowrap;
  668. color: #61657e;
  669. font-size: 14px;
  670. }
  671. h3 {
  672. margin: 0;
  673. // font-size: 16px;
  674. font-weight: bolder;
  675. color: #333333;
  676. margin-left: 10px;
  677. }
  678. .event-dot {
  679. position: absolute;
  680. bottom: 5px;
  681. left: 50%;
  682. transform: translateX(-50%);
  683. width: 6px;
  684. height: 6px;
  685. background-color: #67c23a;
  686. border-radius: 50%;
  687. }
  688. .tooltip {
  689. position: absolute;
  690. top: 100%;
  691. left: 50%;
  692. transform: translateX(-50%);
  693. background-color: #333;
  694. color: white;
  695. padding: 8px 12px;
  696. border-radius: 4px;
  697. font-size: 12px;
  698. z-index: 1000;
  699. opacity: 0;
  700. transition: opacity 0.3s ease;
  701. }
  702. .tooltip.show {
  703. opacity: 1;
  704. }
  705. .tooltip-content {
  706. max-width: 200px;
  707. white-space: nowrap;
  708. overflow: hidden;
  709. text-overflow: ellipsis;
  710. }
  711. .calendar-header {
  712. width: 95%;
  713. margin: 15px auto 0;
  714. display: flex;
  715. justify-content: center;
  716. align-items: center;
  717. text-align: center;
  718. background: #f0f4fd;
  719. padding: 5px 0;
  720. }
  721. .calendar-btn {
  722. margin: 0 20px;
  723. cursor: pointer;
  724. font-size: 20px;
  725. color: #606266;
  726. transition: color 0.3s ease;
  727. &:hover {
  728. color: #409eff;
  729. }
  730. }
  731. /* 使星期几头部居中显示 */
  732. ::v-deep .el-calendar-table thead th {
  733. text-align: center !important;
  734. font-weight: 500;
  735. color: #606266;
  736. }
  737. </style>