index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946
  1. <template>
  2. <view class="page home">
  3. <view class="page-back"></view>
  4. <view class="uni-page-head navgator justify-center align-center">
  5. <uni-row style="width: 100%; display: flex">
  6. <uni-col :span="6" />
  7. <uni-col :span="12">
  8. <view class="nav-title" style="text-align: center">{{
  9. $t("app.appName")
  10. }}</view>
  11. </uni-col>
  12. <uni-col
  13. :span="6"
  14. style="display: flex; justify-content: end; padding-right: 20px"
  15. >
  16. <uni-badge absolute="rightTop" size="small" :text="messageCount">
  17. <image
  18. src="~@/static/home/message.png"
  19. style="width: 20px; height: 20px; background-color: transparent"
  20. @click="navigatorTo('/pages/message/index')"
  21. />
  22. </uni-badge>
  23. </uni-col>
  24. </uni-row>
  25. </view>
  26. <view class="page-content flex-col">
  27. <uni-row class="row-full">
  28. <uni-col class="daiban-tixing flex-row align-center justify-between">
  29. <!-- <view class="dt-title">
  30. <view class="todo font-BiaoTiHei">
  31. {{ $t('home.todo') }}
  32. </view>
  33. <view class="remind font-BiaoTiHei">
  34. {{ $t('home.remind') }}
  35. </view>
  36. </view> -->
  37. <swiper
  38. class="dt-swiper"
  39. circular="true"
  40. :indicator-dots="false"
  41. :autoplay="true"
  42. :vertical="true"
  43. :interval="2000"
  44. :duration="500"
  45. >
  46. <swiper-item
  47. class="flex-col justify-between"
  48. v-for="{ item1, item2 } in overtimeTaskList"
  49. @click="navigatorTo('/pages/overtime/index')"
  50. >
  51. <view
  52. class="daiban flex-row align-center justify-around"
  53. style="margin-top: 10px"
  54. >
  55. <view class="dt-status green">
  56. <!-- 超时未保养 -->
  57. {{ item1.status }}
  58. </view>
  59. <view class="dt-content">
  60. <!-- 增压机十年使用到期保养 -->
  61. {{ item1.type + "-" + item1.title }}
  62. </view>
  63. <!-- <view class="dt-time">-->
  64. <!-- &lt;!&ndash; 1小时前 &ndash;&gt;-->
  65. <!-- {{ item1.createTime }}-->
  66. <!-- </view>-->
  67. </view>
  68. <view
  69. v-if="item2"
  70. class="daiban flex-row align-center justify-around"
  71. style="margin-bottom: 10px"
  72. >
  73. <view class="dt-status green">
  74. <!-- 超时未保养 -->
  75. {{ item2?.status }}
  76. </view>
  77. <view class="dt-content">
  78. <!-- 增压机十年使用到期保养 -->
  79. {{ item2?.type + "-" + item2?.title }}
  80. </view>
  81. <!-- <view class="dt-time">-->
  82. <!-- &lt;!&ndash; 1小时前 &ndash;&gt;-->
  83. <!-- {{ item2?.createTime }}-->
  84. <!-- </view>-->
  85. </view>
  86. </swiper-item>
  87. </swiper>
  88. </uni-col>
  89. </uni-row>
  90. <uni-row class="row-half flex-row justify-between">
  91. <!-- 运行记录填报 -->
  92. <uni-col
  93. :span="12"
  94. class="yunxingjilu flex-col justify-between"
  95. @click="navigatorTo('/pages/recordFilling/list')"
  96. >
  97. <view class="half-title">
  98. {{ $t("home.operationRecordFilling") }}
  99. </view>
  100. <view class="half-subtitle">
  101. {{ $t("home.fillDailyOperationRecord") }}
  102. </view>
  103. </uni-col>
  104. <!-- 保养工单 -->
  105. <uni-col
  106. :span="12"
  107. class="baoyang flex-col justify-between"
  108. @click="navigatorTo('/pages/maintenance/index')"
  109. >
  110. <view class="half-title">
  111. {{ $t("home.maintenanceWorkOrder") }}
  112. </view>
  113. <view class="half-subtitle">
  114. {{ $t("home.receiveMaintenanceWorkOrderAndSubmit") }}
  115. </view>
  116. </uni-col>
  117. </uni-row>
  118. <uni-row class="row-half" :gutter="5">
  119. <!-- 设备维修 -->
  120. <uni-col
  121. :span="12"
  122. class="shebeiweixiu flex-col justify-between"
  123. @click="navigatorTo('/pages/repair/index')"
  124. >
  125. <view class="half-title">
  126. {{ $t("home.equipmentMaintenance") }}
  127. </view>
  128. <view class="half-subtitle">
  129. {{ $t("home.fillMaintenanceWorkOrder") }}
  130. </view>
  131. </uni-col>
  132. <!-- 巡检工单 -->
  133. <uni-col
  134. :span="12"
  135. class="xunjian flex-col justify-between"
  136. @click="navigatorTo('/pages/inspection/index')"
  137. >
  138. <view class="half-title">
  139. {{ $t("home.inspectionWorkOrder") }}
  140. </view>
  141. <view class="half-subtitle">
  142. {{ $t("home.receiveInspectionWorkOrderAndSubmit") }}
  143. </view>
  144. </uni-col>
  145. </uni-row>
  146. <uni-row class="row-full">
  147. <!-- 故障上报 -->
  148. <uni-col
  149. class="guzhang flex-row align-center"
  150. @click="navigatorTo('/pages/fault/index')"
  151. >
  152. <view class="half-title" style="margin-right: 10px">
  153. {{ $t("home.faultReporting") }}
  154. </view>
  155. <view class="half-subtitle">
  156. {{ $t("home.fillAndReportFaultWorkOrder") }}
  157. </view>
  158. </uni-col>
  159. </uni-row>
  160. <view class="card">
  161. <!-- 瑞都日报 -->
  162. <view
  163. class="card-cell flex-row align-center justify-between"
  164. @click="navigatorTo('/pages/ruiDu/index')"
  165. v-if="isShowRuiduDaily"
  166. >
  167. <image src="/static/home/ribao.svg" mode="aspectFill"></image>
  168. <view class="cell-con flex-row align-center justify-between">
  169. <view class="cell-text flex-row align-center justify-start">
  170. <view class="title">
  171. {{ $t("home.dailyReportRuiDu") }}
  172. </view>
  173. <view class="subtitle">
  174. {{ $t("home.dailyReportRuiDuTip") }}
  175. </view>
  176. </view>
  177. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  178. </view>
  179. </view>
  180. <!-- 瑞都报表 -->
  181. <view
  182. class="card-cell flex-row align-center justify-between"
  183. @click="openRuiDuReportPopup"
  184. v-if="rdReportStatisticsFlag"
  185. >
  186. <image src="/static/home/ribao.svg" mode="aspectFill"></image>
  187. <view class="cell-con flex-row align-center justify-between">
  188. <view class="cell-text flex-row align-center justify-start">
  189. <view class="title">
  190. {{ $t("home.ruiDuReport") }}
  191. </view>
  192. <view class="subtitle">
  193. {{ $t("home.ruiDuReportTip") }}
  194. </view>
  195. </view>
  196. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  197. </view>
  198. </view>
  199. <!-- 瑞恒报表 -->
  200. <view
  201. class="card-cell flex-row align-center justify-between"
  202. @click="openRuiHengReportPopup"
  203. v-if="rdReportStatisticsFlag"
  204. >
  205. <image src="/static/home/rh.png" mode="aspectFill"></image>
  206. <view class="cell-con flex-row align-center justify-between">
  207. <view class="cell-text flex-row align-center justify-start">
  208. <view class="title">
  209. {{ $t("home.ruiHengReport") }}
  210. </view>
  211. <view class="subtitle">
  212. {{ $t("home.ruiDuReportTip") }}
  213. </view>
  214. </view>
  215. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  216. </view>
  217. </view>
  218. <view
  219. class="card-cell flex-row align-center justify-between"
  220. @click="navigatorTo('/pages/ruihen-task/index')"
  221. v-if="rhTaskFlag"
  222. >
  223. <image src="/static/home/ribao.svg" mode="aspectFill"></image>
  224. <view class="cell-con flex-row align-center justify-between">
  225. <view class="cell-text flex-row align-center justify-start">
  226. <view class="title">
  227. {{ $t("home.dailyReportRuiHen") }}
  228. </view>
  229. <view class="subtitle">
  230. {{ $t("home.dailyReportRuiHenTaskTip") }}
  231. </view>
  232. </view>
  233. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  234. </view>
  235. </view>
  236. <view
  237. class="card-cell flex-row align-center justify-between"
  238. @click="navigatorTo('/pages/ruihen/index?type=edit')"
  239. v-if="rhReportFlag"
  240. >
  241. <image src="/static/home/ribao.svg" mode="aspectFill"></image>
  242. <view class="cell-con flex-row align-center justify-between">
  243. <view class="cell-text flex-row align-center justify-start">
  244. <view class="title">
  245. {{ $t("home.dailyReportRuiHen") }}
  246. </view>
  247. <view class="subtitle">
  248. {{ $t("home.dailyReportRuiHenTip") }}
  249. </view>
  250. </view>
  251. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  252. </view>
  253. </view>
  254. <view
  255. class="card-cell flex-row align-center justify-between"
  256. @click="navigatorTo('/pages/ruihen/index?type=approval')"
  257. v-if="rhReportApprovalFlag"
  258. >
  259. <image src="/static/home/ribao.svg" mode="aspectFill"></image>
  260. <view class="cell-con flex-row align-center justify-between">
  261. <view class="cell-text flex-row align-center justify-start">
  262. <view class="title">
  263. {{ $t("home.dailyReportRuiHen") }}
  264. </view>
  265. <view class="subtitle">
  266. {{ $t("home.dailyReportRuiHenApproval") }}
  267. </view>
  268. </view>
  269. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  270. </view>
  271. </view>
  272. <view
  273. class="card-cell flex-row align-center justify-between"
  274. @click="navigatorTo('/pages/ruiying/index?type=edit')"
  275. v-if="ryReportFlag"
  276. >
  277. <image src="/static/home/ribao.svg" mode="aspectFill"></image>
  278. <view class="cell-con flex-row align-center justify-between">
  279. <view class="cell-text flex-row align-center justify-start">
  280. <view class="title">
  281. {{ $t("home.dailyReportRuiYing") }}
  282. </view>
  283. <view class="subtitle">
  284. {{ $t("home.dailyReportRuiYingTip") }}
  285. </view>
  286. </view>
  287. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  288. </view>
  289. </view>
  290. <view
  291. class="card-cell flex-row align-center justify-between"
  292. @click="navigatorTo('/pages/ruiying/index?type=approval')"
  293. v-if="ryReportApprovalFlag"
  294. >
  295. <image src="/static/home/ribao.svg" mode="aspectFill"></image>
  296. <view class="cell-con flex-row align-center justify-between">
  297. <view class="cell-text flex-row align-center justify-start">
  298. <view class="title">
  299. {{ $t("home.dailyReportRuiYing") }}
  300. </view>
  301. <view class="subtitle">
  302. {{ $t("home.dailyReportRuiYingApproval") }}
  303. </view>
  304. </view>
  305. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  306. </view>
  307. </view>
  308. <view
  309. class="card-cell flex-row align-center justify-between"
  310. @click="navigatorTo('/pages/ruiyingx/index?type=edit')"
  311. v-if="ryXjReportFlag"
  312. >
  313. <image src="/static/home/ribao.svg" mode="aspectFill"></image>
  314. <view class="cell-con flex-row align-center justify-between">
  315. <view class="cell-text flex-row align-center justify-start">
  316. <view class="title">
  317. {{ $t("home.dailyReportRuiYingX") }}
  318. </view>
  319. <view class="subtitle">
  320. {{ $t("home.dailyReportRuiYingXTip") }}
  321. </view>
  322. </view>
  323. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  324. </view>
  325. </view>
  326. <view
  327. class="card-cell flex-row align-center justify-between"
  328. @click="navigatorTo('/pages/ruiyingx/index?type=approval')"
  329. v-if="ryXjReportApprovalFlag"
  330. >
  331. <image src="/static/home/ribao.svg" mode="aspectFill"></image>
  332. <view class="cell-con flex-row align-center justify-between">
  333. <view class="cell-text flex-row align-center justify-start">
  334. <view class="title">
  335. {{ $t("home.dailyReportRuiYingX") }}
  336. </view>
  337. <view class="subtitle">
  338. {{ $t("home.dailyReportRuiYingXApproval") }}
  339. </view>
  340. </view>
  341. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  342. </view>
  343. </view>
  344. <!-- 库存查询 -->
  345. <view
  346. class="card-cell flex-row align-center justify-between"
  347. @click="navigatorTo('/pages/inventory/index')"
  348. >
  349. <image src="/static/home/kucun.svg" mode="aspectFill"></image>
  350. <view class="cell-con flex-row align-center justify-between">
  351. <view class="cell-text flex-row align-center justify-start">
  352. <view class="title">
  353. {{ $t("home.inventoryQuery") }}
  354. </view>
  355. <view class="subtitle">
  356. {{ $t("home.clickToQueryInventoryData") }}
  357. </view>
  358. </view>
  359. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  360. </view>
  361. </view>
  362. <!-- 保养查询 -->
  363. <view
  364. class="card-cell flex-row align-center justify-between"
  365. @click="navigatorTo('/pages/maintenance/search')"
  366. >
  367. <image src="/static/home/taizhang.svg" mode="aspectFill"></image>
  368. <view class="cell-con flex-row align-center justify-between">
  369. <view class="cell-text flex-row align-center justify-start">
  370. <view class="title">
  371. {{ $t("home.maintenanceSearch") }}
  372. </view>
  373. <view class="subtitle">
  374. {{ $t("home.maintenanceSearchTip") }}
  375. </view>
  376. </view>
  377. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  378. </view>
  379. </view>
  380. <!-- 设备台账 -->
  381. <view
  382. class="card-cell flex-row align-center justify-between"
  383. @click="navigatorTo('/pages/ledger/index')"
  384. >
  385. <image src="/static/home/taizhang.svg" mode="aspectFill"></image>
  386. <view class="cell-con flex-row align-center justify-between">
  387. <view class="cell-text flex-row align-center justify-start">
  388. <view class="title">
  389. {{ $t("home.equipmentLedger") }}
  390. </view>
  391. <view class="subtitle">
  392. {{ $t("home.viewEquipmentLedger") }}
  393. </view>
  394. </view>
  395. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  396. </view>
  397. </view>
  398. <!-- 设备状态变更 -->
  399. <view
  400. class="card-cell flex-row align-center justify-between"
  401. @click="navigatorTo('/pages/statusChange/index')"
  402. >
  403. <image
  404. src="/static/home/zhuangtaibiangeng.svg"
  405. mode="aspectFill"
  406. ></image>
  407. <view class="cell-con flex-row align-center justify-between">
  408. <view class="cell-text flex-row align-center justify-start">
  409. <view class="title">
  410. {{ $t("home.equipmentStatusChange") }}
  411. </view>
  412. <view class="subtitle">
  413. {{ $t("home.adjustEquipmentStatus") }}
  414. </view>
  415. </view>
  416. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  417. </view>
  418. </view>
  419. <!-- 设备责任人 -->
  420. <view
  421. class="card-cell flex-row align-center justify-between"
  422. @click="navigatorTo('/pages/deviceUser/index')"
  423. >
  424. <image src="/static/home/deviceUser.svg" mode="aspectFill"></image>
  425. <view class="cell-con flex-row align-center justify-between">
  426. <view class="cell-text flex-row align-center justify-start">
  427. <view class="title">
  428. {{ $t("home.deviceUser") }}
  429. </view>
  430. <view class="subtitle">
  431. {{ $t("home.deviceUserTip") }}
  432. </view>
  433. </view>
  434. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  435. </view>
  436. </view>
  437. <!-- 设备实时数据监控 -->
  438. <view
  439. class="card-cell flex-row align-center justify-between"
  440. @click="navigatorTo('/pages/realTimeData/index')"
  441. >
  442. <image src="/static/home/shujujiankong.svg" mode="aspectFill"></image>
  443. <view class="cell-con flex-row align-center justify-between">
  444. <view class="cell-text flex-row align-center justify-start">
  445. <view class="title">
  446. {{ $t("home.realTimeEquipmentDataMonitoring") }}
  447. </view>
  448. <view class="subtitle">
  449. {{ $t("home.viewRealTimeEquipmentData") }}
  450. </view>
  451. </view>
  452. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  453. </view>
  454. </view>
  455. <!-- 统计分析 -->
  456. <view
  457. class="card-cell flex-row align-center justify-between"
  458. @click="navigatorTo('/pages/statistic/index')"
  459. >
  460. <image src="/static/home/tongjifenxi.svg" mode="aspectFill"></image>
  461. <view class="cell-con flex-row align-center justify-between">
  462. <view class="cell-text flex-row align-center justify-start">
  463. <view class="title">
  464. {{ $t("home.statisticalAnalysis") }}
  465. </view>
  466. <view class="subtitle">
  467. {{ $t("home.equipmentDataStatisticalAnalysis") }}
  468. </view>
  469. </view>
  470. <uni-icons type="right" :color="'#CACCCF'" size="15" />
  471. </view>
  472. </view>
  473. </view>
  474. </view>
  475. <!-- 升级提示 -->
  476. <upgrade />
  477. <uni-popup
  478. ref="ruiDuReportPopup"
  479. type="bottom"
  480. background-color="#fff"
  481. border-radius="10px 10px 0 0"
  482. >
  483. <view class="report-popup">
  484. <view class="report-popup-header">
  485. {{ $t("ruiDuReport.selectTitle") }}
  486. </view>
  487. <view
  488. class="report-popup-item"
  489. @click="navigateToRuiDuReport('/pages/ruiDuReport/daily-detail')"
  490. >
  491. {{ $t("ruiDuReport.dailyDetail") }}
  492. </view>
  493. <view
  494. class="report-popup-item"
  495. @click="
  496. navigateToRuiDuReport('/pages/ruiDuReport/daily-team-statistic')
  497. "
  498. >
  499. {{ $t("ruiDuReport.dailyTeamStatistic") }}
  500. </view>
  501. <view class="report-popup-cancel" @click="closeRuiDuReportPopup">
  502. {{ $t("operation.cancel") }}
  503. </view>
  504. </view>
  505. </uni-popup>
  506. <!-- 瑞恒 -->
  507. <uni-popup
  508. ref="ruiHengReportPopup"
  509. type="bottom"
  510. background-color="#fff"
  511. border-radius="10px 10px 0 0"
  512. >
  513. <view class="report-popup">
  514. <view class="report-popup-header">
  515. {{ $t("ruiHengReport.selectTitle") }}
  516. </view>
  517. <view
  518. class="report-popup-item"
  519. @click="navigateToRuiHengReport('/pages/ruiHengReport/index')"
  520. >
  521. {{ $t("ruiDuReport.dailyDetail") }}
  522. </view>
  523. <view
  524. class="report-popup-item"
  525. @click="
  526. navigateToRuiHengReport('/pages/ruiDuReport/daily-team-statistic')
  527. "
  528. >
  529. {{ $t("ruiDuReport.dailyTeamStatistic") }}
  530. </view>
  531. <view class="report-popup-cancel" @click="closeRuiHengReportPopup">
  532. {{ $t("operation.cancel") }}
  533. </view>
  534. </view>
  535. </uni-popup>
  536. </view>
  537. </template>
  538. <script setup>
  539. import { onShow } from "@dcloudio/uni-app";
  540. import { nextTick, onMounted, ref } from "vue";
  541. import { getUnreadMessageCount } from "@/api/message";
  542. import { getOvertimeTaskList } from "@/api/task";
  543. import { getLoginUserInfo } from "@/api/login";
  544. import { useDataDictStore } from "@/store/modules/dataDict";
  545. import { useDeptStore } from "@/store/modules/dept";
  546. import { useDeviceStore } from "@/store/modules/device";
  547. import { messageNavigate } from "@/utils/navigate";
  548. import Upgrade from "@/components/upgrade.vue";
  549. const navigatorTo = (url) => {
  550. uni.navigateTo({
  551. url: url,
  552. });
  553. };
  554. const ruiDuReportPopup = ref(null);
  555. const openRuiDuReportPopup = () => {
  556. ruiDuReportPopup.value?.open();
  557. };
  558. const closeRuiDuReportPopup = () => {
  559. ruiDuReportPopup.value?.close();
  560. };
  561. // 瑞恒
  562. const ruiHengReportPopup = ref(null);
  563. const openRuiHengReportPopup = () => {
  564. ruiHengReportPopup.value?.open();
  565. };
  566. const closeRuiHengReportPopup = () => {
  567. ruiHengReportPopup.value?.close();
  568. };
  569. const navigateToRuiDuReport = (url) => {
  570. closeRuiDuReportPopup();
  571. uni.navigateTo({ url });
  572. };
  573. const navigateToRuiHengReport = (url) => {
  574. closeRuiHengReportPopup();
  575. uni.navigateTo({ url });
  576. };
  577. const messageCount = ref(0);
  578. onMounted(async () => {
  579. await Promise.all([
  580. useDataDictStore().loadDataDictList(),
  581. useDeptStore().loadDeptList(),
  582. useDeviceStore().loadDeviceTypeList(),
  583. ]);
  584. });
  585. // 是否展示瑞都日报入口
  586. const isShowRuiduDaily = ref(false);
  587. const rdReportStatisticsFlag = ref(false);
  588. const rhReportFlag = ref(false);
  589. const rhTaskFlag = ref(false);
  590. const rhReportApprovalFlag = ref(false);
  591. const ryReportFlag = ref(false);
  592. const ryReportApprovalFlag = ref(false);
  593. const ryXjReportFlag = ref(false);
  594. const ryXjReportApprovalFlag = ref(false);
  595. const userInfo = ref({});
  596. const getLoginUser = async () => {
  597. const response = await getLoginUserInfo();
  598. if (response.code === 0) {
  599. userInfo.value = response.data;
  600. isShowRuiduDaily.value = response.data.rdReportFlag;
  601. rdReportStatisticsFlag.value = response.data.rdReportStatisticsFlag;
  602. // isShowRuiduDaily.value = true;
  603. rhReportFlag.value = response.data.rhReportFlag;
  604. rhTaskFlag.value = response.data.rhReportFlag;
  605. // rhTaskFlag.value = true;
  606. rhReportApprovalFlag.value = response.data.rhReportApprovalFlag;
  607. ryReportFlag.value = response.data.ryReportFlag;
  608. // ryReportFlag.value = true;
  609. ryReportApprovalFlag.value = response.data.ryReportApprovalFlag;
  610. // ryReportApprovalFlag.value = true;
  611. ryXjReportFlag.value = response.data.ryXjReportFlag;
  612. // ryXjReportFlag.value = true;
  613. ryXjReportApprovalFlag.value = response.data.ryXjReportApprovalFlag;
  614. // ryXjReportApprovalFlag.value = true;
  615. }
  616. };
  617. getLoginUser();
  618. const overtimeTaskList = ref([]);
  619. const isNavigated = ref(false);
  620. // 处理缓存的钉钉消息传递的消息
  621. onShow(async () => {
  622. const response = await Promise.all([
  623. getUnreadMessageCount(),
  624. getOvertimeTaskList({ pageNo: 1, pageSize: 10 }),
  625. ]);
  626. // const response = await getUnreadMessageCount()
  627. // messageCount.value = response.data
  628. if (response[0].code === 0) {
  629. messageCount.value = response[0].data;
  630. }
  631. if (response[1].code === 0) {
  632. const list = response[1].data.list;
  633. const mapList = [];
  634. for (let i = 0; i < list.length; i += 2) {
  635. mapList.push({
  636. item1: list[i],
  637. item2: list[i + 1],
  638. });
  639. }
  640. overtimeTaskList.value = mapList;
  641. }
  642. // await getOvertimeTaskList({ pageNo: 1, pageSize: 10 })
  643. await nextTick(() => {
  644. const json = uni.getStorageSync("dingTalkJson");
  645. // console.log('home: dingTalkJson -> ' + json + `, isTrue: ${!!json}`)
  646. if (json) {
  647. const obj = JSON.parse(json);
  648. if (obj.type) {
  649. messageNavigate(obj);
  650. uni.removeStorageSync("dingTalkJson");
  651. // console.log('home: dingTalkJson -> ' + uni.getStorageSync('dingTalkJson'))
  652. }
  653. } else {
  654. if (isNavigated.value) return;
  655. let args = "";
  656. // #ifdef APP
  657. args = plus.runtime.arguments;
  658. // #endif
  659. // console.log('home: args -> ' + args)
  660. const parts = args.match(/^deepoil:\/\/([^/]+)\/([^/]+)$/);
  661. if (parts) {
  662. const type = parts[1];
  663. const id = parts[2];
  664. messageNavigate({ type, id });
  665. isNavigated.value = true;
  666. }
  667. }
  668. });
  669. });
  670. </script>
  671. <style lang="scss" scoped>
  672. .home {
  673. width: 100%;
  674. height: 100%;
  675. position: relative;
  676. box-sizing: border-box;
  677. overflow: hidden;
  678. }
  679. .report-popup {
  680. padding: 8px 16px calc(61px + env(safe-area-inset-bottom));
  681. background: #fff;
  682. box-sizing: border-box;
  683. }
  684. .report-popup-header {
  685. height: 44px;
  686. line-height: 44px;
  687. text-align: center;
  688. font-weight: 600;
  689. font-size: 16px;
  690. color: #333;
  691. border-bottom: 1px solid #f0f0f0;
  692. }
  693. .report-popup-item,
  694. .report-popup-cancel {
  695. height: 48px;
  696. line-height: 48px;
  697. text-align: center;
  698. font-size: 15px;
  699. color: #333;
  700. border-bottom: 1px solid #f5f5f5;
  701. }
  702. .report-popup-cancel {
  703. margin-top: 8px;
  704. color: #666;
  705. border-bottom: none;
  706. }
  707. .row-full {
  708. width: 100%;
  709. height: 64px;
  710. margin-bottom: 10px;
  711. }
  712. .row-half {
  713. width: 100%;
  714. height: 68px;
  715. margin-bottom: 5px;
  716. .uni-col {
  717. padding: 15px !important;
  718. box-sizing: border-box;
  719. }
  720. }
  721. .daiban-tixing {
  722. height: 100%;
  723. min-height: 128rpx;
  724. background-image: url("/static/home/kapian.png");
  725. background-repeat: no-repeat;
  726. background-size: 100% 100%;
  727. padding: 0 10px !important;
  728. padding-left: 15px !important;
  729. box-sizing: border-box;
  730. }
  731. .dt-title {
  732. width: 37px;
  733. font-size: 20px;
  734. line-height: 20px;
  735. text-shadow: 0 2px 4px rgba(98, 114, 125, 0.36);
  736. text-align: center;
  737. font-style: normal;
  738. .todo {
  739. color: #004098;
  740. }
  741. .remind {
  742. color: #333333;
  743. }
  744. }
  745. .dt-swiper {
  746. width: calc(100%);
  747. height: 100%;
  748. }
  749. .dt-status {
  750. width: 60px;
  751. height: 18px;
  752. background: #ffffff;
  753. box-shadow:
  754. 0 2px 4px 0 rgba(98, 114, 125, 0.36),
  755. 0 2px 4px 0 rgba(0, 0, 0, 0.13);
  756. border-radius: 6px;
  757. font-family:
  758. PingFangSC,
  759. PingFang SC;
  760. font-weight: 500;
  761. font-size: 10px;
  762. line-height: 18px;
  763. text-shadow: 0px 2px 4px rgba(98, 114, 125, 0.36);
  764. text-align: center;
  765. &.green {
  766. color: #2bbb80;
  767. }
  768. &.blue {
  769. color: #3b63c9;
  770. }
  771. }
  772. .dt-content {
  773. flex: 1;
  774. width: auto;
  775. margin-left: 10px;
  776. font-family:
  777. PingFangSC,
  778. PingFang SC;
  779. font-weight: 500;
  780. font-size: 10px;
  781. color: #595959;
  782. line-height: 14px;
  783. text-shadow: 0px 2px 4px rgba(98, 114, 125, 0.36);
  784. text-overflow: ellipsis;
  785. white-space: nowrap;
  786. overflow: hidden;
  787. }
  788. .dt-time {
  789. font-family:
  790. PingFangSC,
  791. PingFang SC;
  792. font-weight: 500;
  793. font-size: 10px;
  794. color: #646464;
  795. line-height: 14px;
  796. text-shadow: 0px 2px 4px rgba(98, 114, 125, 0.36);
  797. }
  798. .half-title {
  799. font-family:
  800. PingFangSC,
  801. PingFang SC;
  802. font-weight: 500;
  803. font-size: 14px;
  804. color: #ffffff;
  805. }
  806. .half-subtitle {
  807. font-family:
  808. PingFangSC,
  809. PingFang SC;
  810. font-weight: 500;
  811. font-size: 10px;
  812. color: #ffffff;
  813. }
  814. .yunxingjilu {
  815. width: calc(50% - 2.5px);
  816. height: 100%;
  817. background-image: url("/static/home/yunxingjilu.png");
  818. background-repeat: no-repeat;
  819. background-size: 100% 100%;
  820. margin-right: 2.5px;
  821. }
  822. .baoyang {
  823. width: calc(50% - 2.5px);
  824. height: 100%;
  825. background-image: url("/static/home/baoyang.png");
  826. background-repeat: no-repeat;
  827. background-size: 100% 100%;
  828. margin-left: 2.5px;
  829. }
  830. .shebeiweixiu {
  831. width: calc(50% - 2.5px);
  832. height: 100%;
  833. background-image: url("/static/home/shebeiweixiu.png");
  834. background-repeat: no-repeat;
  835. background-size: 100% 100%;
  836. margin-right: 2.5px;
  837. }
  838. .xunjian {
  839. width: calc(50% - 2.5px);
  840. height: 100%;
  841. background-image: url("/static/home/xunjian.png");
  842. background-repeat: no-repeat;
  843. background-size: 100% 100%;
  844. margin-left: 2.5px;
  845. }
  846. .guzhang {
  847. // width: 100%;
  848. height: 100%;
  849. background-image: url("/static/home/guzhang.png");
  850. background-repeat: no-repeat;
  851. background-size: 100% 100%;
  852. padding: 15px !important;
  853. box-sizing: border-box;
  854. }
  855. .card {
  856. width: 100%;
  857. background: #ffffff;
  858. border-radius: 6px;
  859. padding: 20px;
  860. box-sizing: border-box;
  861. }
  862. .card-cell {
  863. width: 100%;
  864. height: 50px;
  865. image {
  866. width: 32px;
  867. height: 32px;
  868. }
  869. }
  870. .cell-con {
  871. margin-left: 10px;
  872. margin-right: 10px;
  873. width: calc(100% - 32px - 10px - 10px);
  874. height: 100%;
  875. border-bottom: 0.5px solid #cacccf;
  876. }
  877. .cell-text {
  878. width: 100%;
  879. font-weight: 500;
  880. .title {
  881. font-size: 14px;
  882. color: #333333;
  883. line-height: 20px;
  884. }
  885. .subtitle {
  886. font-size: 12px;
  887. color: #999999;
  888. line-height: 17px;
  889. margin-left: 10px;
  890. }
  891. .icon {
  892. width: 6px;
  893. height: 10px;
  894. }
  895. }
  896. </style>