home.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  1. <!--
  2. * @Title:
  3. * @Description: 首页
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="container">
  11. <!-- 导航栏 #3F9EFF-->
  12. <uni-nav-bar :fixed="true" backgroundColor="#3F9EFF" statusBar="false" height="75px">
  13. <block slot="left">
  14. <view style="display: flex;flex-direction: column;justify-content: center;">
  15. <image src="/static/images/logo_start.png" class="logo" mode="widthFix"></image>
  16. </view>
  17. </block>
  18. <view style="display: flex;flex:1,justify-content: center;align-items: center;">
  19. <text style="color: #ffffff; font-size: 1rem;font-family: Microsoft YaHei;">{{title}}</text>
  20. </view>
  21. <block slot="right">
  22. <view style="margin-right:20rpx" @click="onNoticeMoreClick">
  23. <uni-badge class="uni-badge-left-margin" absolute="rightTop" :is-dot="noticeDot" :text="noticeValue"
  24. size="small">
  25. <uni-icons class="input-uni-icon" type="notification" size="24" color="#FFFFFF" />
  26. </uni-badge>
  27. </view>
  28. </block>
  29. </uni-nav-bar>
  30. <!-- 头部按钮 -->
  31. <view class="nav">
  32. <u-grid :col="4" :border="false">
  33. <u-grid-item v-if="navButtonIndex[index]" bg-color="transparent" v-for="(item, index) in navButton"
  34. :key="index">
  35. <navigator v-if="item.badge" :url="item.url" hover-class="none" class="nav-item"
  36. open-type="navigate">
  37. <uni-badge class="uni-badge-left-margin" absolute="rightTop" :text="item.value" size="small">
  38. <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
  39. </uni-badge>
  40. <view style="font-size: 0.7rem;font-weight: bold;">{{ item.name }}</view>
  41. </navigator>
  42. <navigator v-else :url="item.url" hover-class="none" class="nav-item" open-type="navigate">
  43. <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
  44. <view style="font-size: 0.7rem;font-weight: bold;">{{ item.name }}</view>
  45. </navigator>
  46. </u-grid-item>
  47. </u-grid>
  48. </view>
  49. <!-- 新任务 -->
  50. <uni-section v-if="permission.companyServciePerson" title="新任务" titleColor="#5470c6" titleFontSize="0.7rem"
  51. :subTitle="realData.newCheckOrderCount">
  52. <template v-slot:right>
  53. <view v-if="loadMoreStatus === 'more'" class="line">
  54. <view class="block">
  55. <uni-icons class="input-uni-icon" type="more-filled" size="18" color="skyblue" />
  56. </view>
  57. <view class="block">
  58. <text style="margin-left: 2px;font-size:0.7rem;color:grey;"
  59. @click="onMoreUncomfireCheckOrderClick()">查看更多</text>
  60. </view>
  61. </view>
  62. <view v-else-if="loadMoreStatus === 'noMore'" class="line">
  63. <view class="block">
  64. <text style="font-size:0.7rem;color:gray;">暂无数据</text>
  65. </view>
  66. </view>
  67. <view v-else class="line">
  68. <view class="block">
  69. <text style="font-size:0.7rem;color:gray;">已全部加载</text>
  70. </view>
  71. </view>
  72. </template>
  73. <template v-slot:decoration>
  74. <view class="decoration"></view>
  75. </template>
  76. <uni-list style="min-height: 40px;">
  77. <uni-list-item v-for="item in unconfirmOrderList" :key="item.id">
  78. <template v-slot:body>
  79. <view class="item-block">
  80. <uni-row>
  81. <uni-col :span="18">
  82. <view class="line">
  83. <view class="block">
  84. <uni-icons class="input-uni-icon" type="home" size="18" color="grey" />
  85. </view>
  86. <view class="block rtu-name">
  87. {{item.rtuName}}
  88. </view>
  89. <view class="block rtu-code">
  90. [{{item.rtuCode}}]
  91. </view>
  92. </view>
  93. </uni-col>
  94. <uni-col :span="6">
  95. <view class="line-end">
  96. <view class="block"
  97. style="width: 140px;height:28px;border-radius:7px;background-color:lightblue"
  98. @click="onOrderItemClick(item.id)">
  99. <view class="line-center">
  100. <view class="block">
  101. <uni-icons class="input-uni-icon" type="auth" size="16"
  102. color="coral" />
  103. </view>
  104. <view class="block">
  105. <text
  106. style="padding-left:2px;color:black;font-size:0.7rem">查看任务</text>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </uni-col>
  112. </uni-row>
  113. <view class="item-text-line">
  114. <uni-icons class="input-uni-icon" type="location" size="18" color="lightblue" />
  115. <text class="item-text">{{item.areaName}}</text>
  116. </view>
  117. <view class="item-text-line">
  118. <uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
  119. <text class="item-text" style="width: 60px;">备注:</text>
  120. <text class="item-text-ell">{{item.orderDesc}}</text>
  121. </view>
  122. </view>
  123. </template>
  124. </uni-list-item>
  125. </uni-list>
  126. </uni-section>
  127. <!-- 测站统计信息 -->
  128. <uni-section style="margin-bottom: 0px;" title="测站统计信息" titleColor="#5470c6" titleFontSize="0.7rem">
  129. <template v-slot:decoration>
  130. <view class="decoration"></view>
  131. </template>
  132. <view class="count-info-block">
  133. <uni-row>
  134. <uni-col :span="24">
  135. <view class="rtuCount">
  136. <view>
  137. <text class="name">测站数量:</text>
  138. </view>
  139. <view style="margin-left:10px;text-decoration-line: underline;"
  140. @click="onRtuManageViewClick">
  141. <text class="count">{{realData.rtus}}</text>
  142. </view>
  143. </view>
  144. </uni-col>
  145. </uni-row>
  146. <uni-row style="margin-top: 4px;">
  147. <uni-col :span="24">
  148. <view class="warnRtuCount">
  149. <view>
  150. <text class="name">异常测站数量 :</text>
  151. </view>
  152. <view style="margin-left:10px;text-decoration-line: underline;"
  153. @click="onWarningRtuViewClick">
  154. <text class="count">{{realData.warningRtus}}</text>
  155. </view>
  156. </view>
  157. </uni-col>
  158. </uni-row>
  159. </view>
  160. </uni-section>
  161. <uni-section style="margin-bottom: 0px;" title="维修任务统计信息" titleColor="#5470c6" titleFontSize="0.7rem">
  162. <template v-slot:decoration>
  163. <view class="decoration"></view>
  164. </template>
  165. <view class="count-info-block">
  166. <uni-row>
  167. <uni-col :span="24">
  168. <view class="orderCount">
  169. <view>
  170. <text class="name">维修任务总数量:</text>
  171. </view>
  172. <view v-if="permission.companyServciePerson">
  173. <view v-if="realData.orderCount" style="margin-left:10px;">
  174. <text class="count">{{realData.orderCount}}</text>
  175. </view>
  176. </view>
  177. <view v-else>
  178. <view style="margin-left:10px;text-decoration-line: underline;"
  179. @click="onAllCheckOrderClick">
  180. <text class="count">{{realData.orderCount}}</text>
  181. </view>
  182. </view>
  183. </view>
  184. </uni-col>
  185. </uni-row>
  186. <uni-row style="margin-top: 4px;">
  187. <uni-col :span="24">
  188. <view class="unconfirmOrderCount">
  189. <view>
  190. <text class="name">未确认维修任务数量:</text>
  191. </view>
  192. <view v-if="realData.unconfirmOrderCount"
  193. style="margin-left:10px;text-decoration-line: underline;"
  194. @click="onUncomfirecheckorderViewClick">
  195. <text class="count">{{realData.unconfirmOrderCount}}</text>
  196. </view>
  197. <view v-else style="margin-left:10px;text-decoration-line: underline;"
  198. @click="onUncomfirecheckorderViewClick">
  199. <text class="count">0</text>
  200. </view>
  201. </view>
  202. </uni-col>
  203. </uni-row>
  204. <uni-row style="margin-top: 4px;">
  205. <uni-col :span="24">
  206. <view class="delayComfireOrders">
  207. <view>
  208. <text class="name">超时未确认维修任务数量:</text>
  209. </view>
  210. <view v-if="realData.delayComfireOrders"
  211. style="margin-left:10px;text-decoration-line: underline;"
  212. @click="onComfiredelaycheckorderClick">
  213. <text class="count">{{realData.delayComfireOrders}}</text>
  214. </view>
  215. <view v-else style="margin-left:10px;text-decoration-line: underline;"
  216. @click="onComfiredelaycheckorderClick">
  217. <text class="count">0</text>
  218. </view>
  219. </view>
  220. </uni-col>
  221. </uni-row>
  222. <uni-row style="margin-top: 4px;">
  223. <uni-col :span="24">
  224. <view class="processOrderCount">
  225. <view>
  226. <text class="name">维修处理中任务数量:</text>
  227. </view>
  228. <view v-if="realData.processOrderCount"
  229. style="margin-left:10px;text-decoration-line: underline;"
  230. @click="onProcessCheckorderViewClick">
  231. <text class="count">{{realData.processOrderCount}}</text>
  232. </view>
  233. <view v-else style="margin-left:10px;text-decoration-line: underline;"
  234. @click="onProcessCheckorderViewClick">
  235. <text class="count">0</text>
  236. </view>
  237. </view>
  238. </uni-col>
  239. </uni-row>
  240. <uni-row style="margin-top: 4px;">
  241. <uni-col :span="24">
  242. <view class="processOrderCount">
  243. <view>
  244. <text class="name">已处理任务数量:</text>
  245. </view>
  246. <view v-if="realData.reportOrder" style="margin-left:10px;text-decoration-line: underline;"
  247. @click="onReportCheckorderViewClick">
  248. <text class="count">{{realData.reportOrder}}</text>
  249. </view>
  250. <view v-else style="margin-left:10px;text-decoration-line: underline;"
  251. @click="onReportCheckorderViewClick">
  252. <text class="count">0</text>
  253. </view>
  254. </view>
  255. </uni-col>
  256. </uni-row>
  257. </view>
  258. </uni-section>
  259. <uni-section title="本年度设备巡检统计信息" titleColor="#5470c6" titleFontSize="0.7rem">
  260. <template v-slot:decoration>
  261. <view class="decoration"></view>
  262. </template>
  263. <view class="count-info-block">
  264. <uni-row>
  265. <uni-col :span="24">
  266. <view class="equipmentInspectionCount">
  267. <view>
  268. <text class="name">需巡检站点数量:</text>
  269. </view>
  270. <view style="margin-left: 10px;text-decoration-line: underline;"
  271. @click="onInspectionManageClick">
  272. <text class="count">{{realData.equipmentInspectionCount}}</text>
  273. </view>
  274. </view>
  275. </uni-col>
  276. </uni-row>
  277. <uni-row style="margin-top: 4px;">
  278. <uni-col :span="24">
  279. <view class="equipmentInspectionBeforeRainCount">
  280. <view>
  281. <text class="name">汛前已巡检设备数量:</text>
  282. </view>
  283. <view style="margin-left: 10px;text-decoration-line: underline;"
  284. @click="onFinishedBeforeRainInspectionClick">
  285. <text class="count">{{realData.equipmentInspectionBeforeRainReports}}</text>
  286. </view>
  287. </view>
  288. </uni-col>
  289. </uni-row>
  290. <uni-row style="margin-top: 4px;">
  291. <uni-col :span="24">
  292. <view class="equipmentInspectionRainFirstCount">
  293. <view>
  294. <text class="name">汛中(一)已巡检设备数量:</text>
  295. </view>
  296. <view style="margin-left: 10px;text-decoration-line: underline;"
  297. @click="onFinishedRainFirstInspectionClick">
  298. <text class="count">{{realData.equipmentInspectionRainFirstReports}}</text>
  299. </view>
  300. </view>
  301. </uni-col>
  302. </uni-row>
  303. <uni-row style="margin-top: 4px;">
  304. <uni-col :span="24">
  305. <view class="equipmentInspectionRainSecondCount">
  306. <view>
  307. <text class="name">汛中(二)已巡检设备数量:</text>
  308. </view>
  309. <view style="margin-left: 10px;text-decoration-line: underline;"
  310. @click="onFinishedRainSecondInspectionClick">
  311. <text class="count">{{realData.equipmentInspectionRainSecondReports}}</text>
  312. </view>
  313. </view>
  314. </uni-col>
  315. </uni-row>
  316. </view>
  317. </uni-section>
  318. <!-- 任务动态 -->
  319. <uni-section v-if="permission.admin || permission.orgAdmin || permission.companyAdmin"
  320. style="margin-bottom: 0px;" title="今日维修任务信息" titleColor="#5470c6" titleFontSize="0.7rem"
  321. :subTitle="realData.todayOrderProcessCount">
  322. <template v-slot:right>
  323. <view class="line-end">
  324. <uni-icons class="input-uni-icon" type="more-filled" size="18" color="skyblue" />
  325. <text style="margin-left: 4px;;font-size:0.7rem;color:grey;"
  326. @click="onMoreTodayCheckOrderReportClick()">查看更多</text>
  327. </view>
  328. </template>
  329. <template v-slot:decoration>
  330. <view class="decoration"></view>
  331. </template>
  332. <uni-list style="min-height: 40px;">
  333. <uni-list-item v-for="item in todayOrderProcessList" :key="item.id" showArrow clickable
  334. @click="onOrderReportItemClick(item.orderId)">
  335. <template v-slot:body>
  336. <view class="item-block">
  337. <view class="item-text-line">
  338. <view class="block">
  339. <image class="item-title-image" style="box-shadow:0 0 2px 2px lightblue"
  340. src="/static/images/list/order_item.png" mode="widthFix">
  341. </image>
  342. </view>
  343. <view class="block">
  344. <text class="rtu-name">{{item.rtuName}}</text>
  345. </view>
  346. <view class="block">
  347. <text class="rtu-code">[{{item.rtuCode}}]</text>
  348. </view>
  349. </view>
  350. <view class="item-text-line" style="margin-top: 2px;">
  351. <view class="block">
  352. <uni-icons class="input-uni-icon" type="loop" size="18" color="lightblue" />
  353. </view>
  354. <view class="block">
  355. <text class="item-text">状态:</text>
  356. </view>
  357. <view class="block">
  358. <text class="item-text">
  359. {{item.orderStatusName}}
  360. </text>
  361. </view>
  362. </view>
  363. <view class="item-text-line" style="margin-top: 2px;">
  364. <view class="block">
  365. <uni-icons class="input-uni-icon" type="person" size="18" color="lightblue" />
  366. </view>
  367. <view class="block">
  368. <text class="item-title">填报人:</text>
  369. </view>
  370. <view class="block">
  371. <text class="item-text">
  372. {{item.orderProcessUserName}}
  373. </text>
  374. </view>
  375. </view>
  376. <view class="item-text-line" style="margin-top: 2px;">
  377. <view class="block">
  378. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  379. </view>
  380. <view class="block">
  381. <text class="item-title">填报时间:</text>
  382. </view>
  383. <view class="block">
  384. <text class="item-text">
  385. {{item.updateTime}}
  386. </text>
  387. </view>
  388. </view>
  389. <view class="item-text-line" style="margin-top: 2px;">
  390. <view class="block">
  391. <uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
  392. </view>
  393. <view class="block">
  394. <text class="item-title" style="width: 50px;">说明:</text>
  395. </view>
  396. <text v-if="item.processDesc" class="item-text-ell">
  397. {{item.processDesc}}
  398. </text>
  399. </view>
  400. <!-- <view class="item-text-line" style="margin-top: 2px;">
  401. <text v-if="item.processDesc" class="item-text-ell">
  402. {{item.processDesc}}
  403. </text>
  404. </view> -->
  405. </view>
  406. </template>
  407. </uni-list-item>
  408. </uni-list>
  409. </uni-section>
  410. <!-- 巡检动态 -->
  411. <uni-section v-if="permission.admin || permission.orgAdmin || permission.companyAdmin" title="今日设备巡检信息"
  412. titleColor="#5470c6" titleFontSize="0.7rem" :subTitle="realData.todayIinspectionReportCount">
  413. <template v-slot:right>
  414. <view class="line-end">
  415. <uni-icons class="input-uni-icon" type="more-filled" size="18" color="skyblue" />
  416. <text style="font-size:0.7rem;color:grey;" @click="onMoreTodayInspectionReportInfoClick">查看更多</text>
  417. </view>
  418. </template>
  419. <template v-slot:decoration>
  420. <view class="decoration"></view>
  421. </template>
  422. <uni-list style="min-height: 40px;">
  423. <uni-list-item v-for="item in todayEquipmentInspectionList" :key="item.id" showArrow clickable
  424. @click="onInspectionItemClick(item.id,item.rainSeasonKind)">
  425. <template v-slot:body>
  426. <view class="item-block">
  427. <view class="item-text-line" style="margin-top: 2px;">
  428. <view class="block">
  429. <image class="item-title-image" style="box-shadow:0 0 2px 2px lightblue"
  430. src="/static/images/list/inspection_item.png" mode="widthFix">
  431. </image>
  432. </view>
  433. <view class="block">
  434. <text class="rtu-name">{{item.rtuName}}</text>
  435. </view>
  436. <view class="block">
  437. <text class="rtu-code">[{{item.rtuCode}}]</text>
  438. </view>
  439. </view>
  440. <view class="item-text-line" style="margin-top: 2px;">
  441. <view class="block">
  442. <uni-icons class="input-uni-icon" type="person" size="18" color="lightblue" />
  443. </view>
  444. <view class="block">
  445. <text class="item-title">填报人:</text>
  446. </view>
  447. <view class="block">
  448. <text class="item-text">
  449. {{item.servicePersonName}}
  450. </text>
  451. </view>
  452. </view>
  453. <view class="item-text-line" style="margin-top: 2px;">
  454. <view class="block">
  455. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  456. </view>
  457. <view class="block">
  458. <text class="item-title">填报时间:</text>
  459. </view>
  460. <view class="block">
  461. <text class="item-text">
  462. {{item.createTime}}
  463. </text>
  464. </view>
  465. </view>
  466. <view class="item-text-line" style="margin-top: 2px;">
  467. <view class="block">
  468. <uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
  469. </view>
  470. <view class="block">
  471. <text class="item-title" style="width: 50px;">说明:</text>
  472. </view>
  473. <text v-if="item.reportDesc" class="item-text-ell">
  474. {{item.reportDesc}}
  475. </text>
  476. </view>
  477. <!-- <view class="item-text-line" style="margin-top: 2px;">
  478. <text v-if="item.reportDesc" class="item-text-ell">
  479. {{item.reportDesc}}
  480. </text>
  481. </view> -->
  482. </view>
  483. </template>
  484. </uni-list-item>
  485. </uni-list>
  486. </uni-section>
  487. </view>
  488. </template>
  489. <script>
  490. import
  491. navBtns
  492. from "@/api/home.js";
  493. import {
  494. role
  495. } from "@/api/role.js";
  496. import http from '@/http/api.js';
  497. export default {
  498. components: {
  499. },
  500. data() {
  501. return {
  502. title: '山洪灾害监测预警平台运维系统',
  503. permission: {
  504. 'admin': false,
  505. 'orgAdmin': false,
  506. 'companyAdmin': false,
  507. 'companyServciePerson': false,
  508. },
  509. ywxtSubSystem: 0,
  510. yjxtSubSystem: 0,
  511. currentRole: '',
  512. current: 0,
  513. navButton: [],
  514. navButtonIndex: [],
  515. //more/loading/noMore
  516. loadMoreStatus: "noMore",
  517. timer: false,
  518. noticeDot: false,
  519. noticeValue: 0,
  520. unconfirmOrderList: [],
  521. todayEquipmentInspectionList: [],
  522. todayOrderProcessList: [],
  523. realData: {
  524. todayOrderProcessCount: '维修任务数量:0',
  525. todayIinspectionReportCount: '设备巡检数量:0',
  526. newCheckOrderCount: '新任务数量:0'
  527. },
  528. };
  529. },
  530. computed: {
  531. getProcessOrder() {
  532. if (this.realData.rtuCount && this.realData.unconfirmOrderCount) {
  533. return this.realData.rtuCount - this.realData.unconfirmOrderCount;
  534. }
  535. return 0;
  536. }
  537. },
  538. onLoad() {
  539. console.log("onLoad++++++++++++++ ")
  540. let subSystemSelectInfo = uni.getStorageSync("SubSystemSelectInfo");
  541. console.log("home " + JSON.stringify(subSystemSelectInfo))
  542. this.ywxtSubSystem = subSystemSelectInfo.ywxt;
  543. this.yjxtSubSystem = subSystemSelectInfo.yjxt;
  544. if (this.ywxtSubSystem == 1) {
  545. this.title = '山洪灾害监测预警平台运维系统';
  546. uni.setTabBarItem({
  547. "index": 1,
  548. "iconPath": "static/images/tabbar/workbench.png",
  549. "selectedIconPath": "static/images/tabbar/workbench_selected.png",
  550. "text": "管理工作台",
  551. })
  552. } else if (this.yjxtSubSystem == 1) {
  553. this.title = '山洪灾害监测预警平台应急系统';
  554. uni.setTabBarItem({
  555. "index": 1,
  556. "iconPath": "static/images/tabbar/warn.png",
  557. "selectedIconPath": "static/images/tabbar/warn_selected.png",
  558. "text": "监测预警",
  559. })
  560. }
  561. this.permission.admin = false;
  562. this.permission.orgAdmin = false;
  563. this.permission.companyAdmin = false;
  564. this.permission.companyServciePerson = false;
  565. this.navButton = navBtns.navButtons;
  566. if (this.userInfo.role_name === role.admin) {
  567. this.permission.admin = true;
  568. this.navButtonIndex = navBtns.sysAdminNavButton;
  569. this.currentRole = role.admin;
  570. } else if (this.userInfo.role_name === role.orgAdmin) {
  571. this.permission.orgAdmin = true;
  572. this.currentRole = role.orgAdmin;
  573. this.navButtonIndex = navBtns.orgAdminNavButton;
  574. } else if (this.userInfo.role_name === role.companyAdmin) {
  575. this.permission.companyAdmin = true;
  576. this.currentRole = role.companyAdmin;
  577. this.navButtonIndex = navBtns.companyAdminNavButton;
  578. } else if (this.userInfo.role_name === role.companyServciePerson) {
  579. this.permission.companyServciePerson = true;
  580. this.currentRole = role.companyServciePerson;
  581. this.navButtonIndex = navBtns.companyServicePersonNavButton;
  582. }
  583. if (this.$u.func.checkLogin()) {
  584. console.log("timer start +++++++ ")
  585. this.timer = true;
  586. setTimeout(this.timeCall, 10);
  587. }
  588. },
  589. onUnload() {
  590. console.log("onUnload++++++++++++++ ")
  591. this.timer = false;
  592. },
  593. onReady() {
  594. console.log("onReady++++++++++++++ ")
  595. if (this.$u.func.checkLogin()) {
  596. } else {
  597. this.$u.func.logout();
  598. }
  599. },
  600. onShow() {
  601. console.log("onShow++++++++++++++ " + this.currentRole)
  602. if (this.$u.func.checkLogin()) {
  603. let subSystemSelectInfo = uni.getStorageSync("SubSystemSelectInfo");
  604. console.log("home " + JSON.stringify(subSystemSelectInfo))
  605. this.ywxtSubSystem = subSystemSelectInfo.ywxt;
  606. this.yjxtSubSystem = subSystemSelectInfo.yjxt;
  607. if (this.ywxtSubSystem == 1) {
  608. this.title = '山洪灾害监测预警平台运维系统';
  609. uni.setTabBarItem({
  610. "index": 1,
  611. "iconPath": "static/images/tabbar/workbench.png",
  612. "selectedIconPath": "static/images/tabbar/workbench_selected.png",
  613. "text": "管理工作台",
  614. })
  615. } else if (this.yjxtSubSystem == 1) {
  616. this.title = '山洪灾害监测预警平台应急系统';
  617. uni.setTabBarItem({
  618. "index": 1,
  619. "iconPath": "static/images/tabbar/warn.png",
  620. "selectedIconPath": "static/images/tabbar/warn_selected.png",
  621. "text": "监测预警",
  622. })
  623. }
  624. if (this.userInfo.role_name !== this.currentRole) {
  625. this.permission.admin = false;
  626. this.permission.orgAdmin = false;
  627. this.permission.companyAdmin = false;
  628. this.permission.companyServciePerson = false;
  629. if (this.userInfo.role_name === role.admin) {
  630. this.permission.admin = true;
  631. this.navButtonIndex = navBtns.sysAdminNavButton;
  632. this.currentRole = role.admin;
  633. } else if (this.userInfo.role_name === role.orgAdmin) {
  634. this.permission.orgAdmin = true;
  635. this.currentRole = role.orgAdmin;
  636. this.navButtonIndex = navBtns.orgAdminNavButton;
  637. } else if (this.userInfo.role_name === role.companyAdmin) {
  638. this.permission.companyAdmin = true;
  639. this.currentRole = role.companyAdmin;
  640. this.navButtonIndex = navBtns.companyAdminNavButton;
  641. } else if (this.userInfo.role_name === role.companyServciePerson) {
  642. this.permission.companyServciePerson = true;
  643. this.navButtonIndex = navBtns.companyServicePersonNavButton;
  644. this.currentRole = role.companyServciePerson;
  645. }
  646. }
  647. if (this.timer == false) {
  648. console.log("timer start +++++++ ")
  649. this.timer = true;
  650. setTimeout(this.timeCall, 10);
  651. }
  652. } else {
  653. this.$u.func.logout();
  654. }
  655. },
  656. onHide() {
  657. console.log("onHide++++++++++++++ ")
  658. this.timer = false;
  659. },
  660. methods: {
  661. timeCall() {
  662. if (this.timer == true) {
  663. //console.log("time work ");
  664. this.getHomeInfo();
  665. setTimeout(this.timeCall, 10000);
  666. }
  667. },
  668. //跳转到工作台
  669. onRtuManageViewClick() {
  670. var url = '/pages/rtu-manage/rtumanage';
  671. uni.switchTab({
  672. url: url
  673. })
  674. },
  675. //查看设备异常信息
  676. onWarningRtuViewClick() {
  677. var url = '/pages/warning/warninglist';
  678. uni.navigateTo({
  679. url: url
  680. })
  681. },
  682. //跳转到维修任务
  683. onAllCheckOrderClick() {
  684. var url = '/pages/check-order/checkorderlist';
  685. uni.navigateTo({
  686. url: url
  687. })
  688. },
  689. //查看未确认维修任务
  690. onUncomfirecheckorderViewClick() {
  691. var url = '/pages/check-order/uncomfirecheckorderlistview';
  692. uni.navigateTo({
  693. url: url
  694. })
  695. },
  696. onProcessCheckorderViewClick() {
  697. var url = '/pages/check-order/processcheckorderlistview';
  698. uni.navigateTo({
  699. url: url
  700. })
  701. },
  702. onReportCheckorderViewClick() {
  703. if (this.permission.admin || this.permission.orgAdmin) {
  704. let url = '/pages/check-order/companycheckorderlist?type=4';
  705. uni.navigateTo({
  706. url: url
  707. })
  708. } else {
  709. let url = '/pages/check-order/servicepersoncheckorderlist?type=3';
  710. uni.navigateTo({
  711. url: url
  712. })
  713. }
  714. },
  715. //查看超时未确认维修任务
  716. onComfiredelaycheckorderClick() {
  717. var url = '/pages/check-order/comfiredelaycheckorderlist';
  718. uni.navigateTo({
  719. url: url
  720. })
  721. },
  722. onOrderReportItemClick(id) {
  723. console.log("opne record ", id)
  724. var url = '/pages/check-order/orderprocessreportdetail?orderId=' + id;
  725. uni.navigateTo({
  726. url: url
  727. })
  728. },
  729. onNoticeMoreClick() {
  730. uni.navigateTo({
  731. url: '/pages/news/noticelist'
  732. })
  733. },
  734. onMoreTodayCheckOrderReportClick() {
  735. uni.navigateTo({
  736. url: '/pages/check-order/todaycheckorderrprocesseportlist'
  737. })
  738. },
  739. onOrderItemClick(id) {
  740. let url =
  741. '/pages/check-order/orderconfirm?id=' + id;
  742. uni.navigateTo({
  743. url: url
  744. })
  745. },
  746. //跳转到待巡检页面
  747. onInspectionManageClick() {
  748. var url = '/pages/equipment-inspection/inspectionlist';
  749. uni.navigateTo({
  750. url: url
  751. })
  752. },
  753. onFinishedBeforeRainInspectionClick() {
  754. var url = '/pages/equipment-inspection/finishedinspectionreportlist?rainSeasonKind=1';
  755. uni.navigateTo({
  756. url: url
  757. })
  758. },
  759. onFinishedRainFirstInspectionClick() {
  760. var url = '/pages/equipment-inspection/finishedinspectionreportlist?rainSeasonKind=2';
  761. uni.navigateTo({
  762. url: url
  763. })
  764. },
  765. onFinishedRainSecondInspectionClick() {
  766. var url = '/pages/equipment-inspection/finishedinspectionreportlist?rainSeasonKind=3';
  767. uni.navigateTo({
  768. url: url
  769. })
  770. },
  771. onMoreTodayInspectionReportInfoClick() {
  772. uni.navigateTo({
  773. url: '/pages/equipment-inspection/todayinspectionreportlist'
  774. })
  775. },
  776. onInspectionItemClick(id, rainSeasonKind) {
  777. console.log("onInspectionItemClick " + id)
  778. var url = '/pages/equipment-inspection/inspectionreportview?id=' + id + "&type=" + rainSeasonKind;
  779. uni.navigateTo({
  780. url: url
  781. })
  782. },
  783. onMoreUncomfireCheckOrderClick() {
  784. uni.navigateTo({
  785. url: '/pages/check-order/uncomfirecheckorderlist'
  786. })
  787. },
  788. getHomeInfo() {
  789. //console.log("getHomeInfo ")
  790. let that = this;
  791. http.request({
  792. url: '/galaxy-business/home/real/info',
  793. method: 'GET'
  794. }).then(res => {
  795. // console.log("getHomeInfo "+JSON.stringify(res))
  796. if (res && res.success) {
  797. that.realData = res.data;
  798. that.realData['processOrderCount'] = that.realData.processCheckOrderCount;
  799. that.realData['todayOrderProcessCount'] = '今日已处理任务数量:' + that.realData
  800. .todayOrderProcessCount;
  801. that.realData['todayIinspectionReportCount'] = '今日已巡检数量:' + that.realData
  802. .todayIinspectionReportCount;
  803. that.realData['newCheckOrderCount'] = '新任务数量:' + that.realData
  804. .unconfirmOrderCount;
  805. if (that.realData.hasNewNotice) {
  806. that.noticeDot = true;
  807. that.noticeValue = that.realData.newNoticeCount;
  808. } else {
  809. that.noticeDot = false;
  810. that.noticeValue = 0;
  811. }
  812. that.getTodayOrderProcessList();
  813. that.getTodayInspectionReport();
  814. if (that.permission.companyServciePerson) {
  815. console.log("companyServciePerson")
  816. that.getUnconfirmOrderList();
  817. }
  818. }
  819. }).catch(err => {
  820. console.log(JOSN.stringify(err))
  821. })
  822. },
  823. getUnconfirmOrderList() {
  824. let that = this;
  825. let postData = {};
  826. http.request({
  827. url: '/galaxy-business/rtu/check/order/unconfirm/last/list',
  828. method: 'GET',
  829. data: postData,
  830. }).then(res => {
  831. if (res.data != null) {
  832. that.unconfirmOrderList = res.data;
  833. if (that.realData.unconfirmOrderCount > 0) {
  834. if (that.realData.unconfirmOrderCount > that.unconfirmOrderList.length) {
  835. that.loadMoreStatus = "more";
  836. } else {
  837. that.loadMoreStatus = "load";
  838. }
  839. } else {
  840. that.loadMoreStatus = "noMore";
  841. }
  842. }
  843. }).catch(err => {
  844. console.log(JOSN.stringify(err))
  845. })
  846. },
  847. getTodayOrderProcessList() {
  848. const that = this;
  849. http.request({
  850. url: '/galaxy-business/rtu/check/order/process/today/list',
  851. method: 'GET'
  852. }).then(res => {
  853. that.todayOrderProcessList = [];
  854. if (res.data != null && res.data.length > 0) {
  855. that.todayOrderProcessList.push(res.data[0]);
  856. }
  857. }).catch(err => {
  858. console.log(JOSN.stringify(err))
  859. })
  860. },
  861. getTodayInspectionReport() {
  862. const that = this;
  863. http.request({
  864. url: '/galaxy-business/equipment/inspection/report/today/list',
  865. method: 'GET'
  866. }).then(res => {
  867. that.todayEquipmentInspectionList = [];
  868. if (res.data != null && res.data.length > 0) {
  869. that.todayEquipmentInspectionList.push(res.data[0]);
  870. }
  871. }).catch(err => {
  872. console.log(JOSN.stringify(err))
  873. })
  874. },
  875. }
  876. };
  877. </script>
  878. <style lang="scss" scoped>
  879. $nav-height: 75px;
  880. .decoration {
  881. width: 6px;
  882. height: 6px;
  883. margin-right: 4px;
  884. border-radius: 50%;
  885. background-color: cadetblue;
  886. }
  887. .item-block {
  888. display: flex;
  889. flex-direction: column;
  890. justify-content: flex-start;
  891. width: 100%;
  892. }
  893. .line {
  894. display: flex;
  895. flex-direction: row;
  896. justify-content: flex-start;
  897. width: 100%;
  898. }
  899. .line .block {
  900. display: flex;
  901. flex-direction: column;
  902. justify-content: center;
  903. }
  904. .line-end {
  905. display: flex;
  906. flex-direction: row;
  907. justify-content: flex-end;
  908. width: 100%;
  909. }
  910. .line-end .block {
  911. display: flex;
  912. flex-direction: column;
  913. justify-content: center;
  914. }
  915. .line-center {
  916. display: flex;
  917. flex-direction: row;
  918. justify-content: center;
  919. width: 100%;
  920. height: 100%;
  921. }
  922. .line-center .block {
  923. display: flex;
  924. flex-direction: column;
  925. justify-content: center;
  926. }
  927. .rtu-name {
  928. margin-left: 5rpx;
  929. font-size: 0.7rem;
  930. font-weight: bold;
  931. }
  932. .rtu-code {
  933. margin-left: 5rpx;
  934. font-size: 0.6rem;
  935. color: gray;
  936. }
  937. .item-text-line {
  938. width: 100%;
  939. display: flex;
  940. flex-direction: row;
  941. align-items: flex-start;
  942. padding-left: 0px;
  943. padding-right: 0px;
  944. .block {
  945. height: 100%;
  946. display: flex;
  947. flex-direction: column;
  948. justify-content: center;
  949. align-items: center;
  950. }
  951. .item-title {
  952. font-size: 0.7rem;
  953. }
  954. .item-text {
  955. padding-left: 2px;
  956. padding-right: 5px;
  957. font-size: 0.7rem;
  958. }
  959. .item-text-ell {
  960. width: 100%;
  961. overflow: hidden;
  962. font-size: 0.7rem;
  963. white-space: nowrap;
  964. text-overflow: ellipsis;
  965. }
  966. .item-number {
  967. font-size: 0.7rem;
  968. margin-left: 2px;
  969. margin-right: 5px;
  970. }
  971. }
  972. .item-title-image {
  973. /* #ifndef APP-NVUE */
  974. display: block;
  975. /* #endif */
  976. margin-right: 5px;
  977. width: 20px;
  978. height: 20px;
  979. border-radius: 50%;
  980. }
  981. .uni-badge-left-margin {
  982. margin-left: 0px;
  983. }
  984. .logo {
  985. flex-shrink: 0;
  986. width: 100rpx;
  987. height: auto;
  988. }
  989. .container {
  990. background-color: #f7f7f7;
  991. min-height: 100vh;
  992. overflow: hidden;
  993. }
  994. .nav {
  995. margin: 0rpx 0;
  996. box-sizing: border-box;
  997. padding: 0 10rpx;
  998. background-color: white;
  999. &-item {
  1000. width: 100%;
  1001. box-sizing: border-box;
  1002. display: flex;
  1003. flex-direction: column;
  1004. align-items: center;
  1005. justify-content: space-between;
  1006. height: 130rpx;
  1007. &-img {
  1008. width: 80rpx;
  1009. height: 80rpx;
  1010. }
  1011. &-name {
  1012. font-size: 0.7rem;
  1013. font-family: PingFang SC;
  1014. font-weight: 500;
  1015. color: #585b61;
  1016. }
  1017. }
  1018. }
  1019. </style>