home.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206
  1. <template>
  2. <view class="container">
  3. <uni-nav-bar :fixed="true" backgroundColor="#3F9EFF" statusBar="false" height="75px">
  4. <block slot="left">
  5. <view style="display: flex;flex-direction: column;justify-content: center;">
  6. <image src="/static/images/nav_logo.png" class="logo" mode="widthFix"></image>
  7. </view>
  8. </block>
  9. <view style="display: flex;flex:1,justify-content: center;align-items: center;">
  10. <text style="color: #ffffff; font-size: 1rem;font-family: Microsoft YaHei;">山洪灾害监测预警平台运维系统</text>
  11. </view>
  12. <block slot="right">
  13. <view style="margin-right:20rpx">
  14. <uni-badge class="uni-badge-left-margin" absolute="rightTop" :is-dot="noticeDot" :text="noticeValue"
  15. size="small">
  16. <uIcons class="input-uni-icon" type="notification" size="24" color="#FFFFFF"
  17. @click="onNoticeMoreClick" />
  18. </uni-badge>
  19. </view>
  20. </block>
  21. </uni-nav-bar>
  22. <!-- 头部按钮 start -->
  23. <view class="nav">
  24. <u-grid :col="4" :border="false">
  25. <u-grid-item bg-color="transparent" v-for="(item, index) in navButton" :key="index">
  26. <navigator v-if="item.badge" :url="item.url" hover-class="none" class="nav-item"
  27. open-type="navigate">
  28. <uni-badge class="uni-badge-left-margin" absolute="rightTop" :text="item.value" size="small">
  29. <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
  30. </uni-badge>
  31. <view style="font-size: 0.7rem;font-weight: bold;">{{ item.name }}</view>
  32. </navigator>
  33. <navigator v-else :url="item.url" hover-class="none" class="nav-item" open-type="navigate">
  34. <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
  35. <view style="font-size: 0.7rem;font-weight: bold;">{{ item.name }}</view>
  36. </navigator>
  37. </u-grid-item>
  38. </u-grid>
  39. </view>
  40. <!-- 头部按钮 end -->
  41. <view v-if="showHome.admin">
  42. <uSection style="margin-bottom: 0px;" title="实时统计" type="line">
  43. <uGroup>
  44. <uni-grid :column="4" :highlight="true">
  45. <uni-grid-item>
  46. <view class="grid-item-box" style="background-color: #fff;">
  47. <text class="text" style="font-size: 1rem;color: orangered;">{{realData.rtus}}</text>
  48. <text style="font-size: 0.7rem;font-weight: bold;">测站总数</text>
  49. </view>
  50. </uni-grid-item>
  51. <uni-grid-item>
  52. <view class="grid-item-box" style="background-color: #fff;">
  53. <text class="text"
  54. style="font-size: 1rem;color: orangered;">{{realData.warningRtus}}</text>
  55. <text style="font-size: 0.7rem;font-weight: bold;">预警设备</text>
  56. </view>
  57. </uni-grid-item>
  58. <uni-grid-item>
  59. <view class="grid-item-box" style="background-color: #fff;">
  60. <text class="text"
  61. style="font-size: 1rem;color: orangered;">{{realData.unconfirmOrderCount}}</text>
  62. <text style="font-size: 0.7rem;font-weight: bold;">未接工单</text>
  63. </view>
  64. </uni-grid-item>
  65. <uni-grid-item>
  66. <view class="grid-item-box" style="background-color: #fff;">
  67. <text class="text"
  68. style="font-size: 1rem;color: orangered;">{{realData.equipmentInspectionPercent}}</text>
  69. <text style="font-size: 0.7rem;font-weight: bold;">已完成巡检</text>
  70. </view>
  71. </uni-grid-item>
  72. </uni-grid>
  73. </uGroup>
  74. </uSection>
  75. <uSection style="margin-bottom: 0px;" title="预警统计" type="line">
  76. <uGroup>
  77. <uni-table ref="rtu_table" border stripe type="" emptyText="暂无更多数据">
  78. <uni-tr>
  79. <uni-th width="150" align="center">
  80. <view style="text-align: center;color: black;">机构名称</view>
  81. </uni-th>
  82. <uni-th align="center">
  83. <view style="text-align: center;color: black;">测站数量</view>
  84. </uni-th>
  85. <uni-th align="center">
  86. <view style="text-align: center;color: black;">预警数量</view>
  87. </uni-th>
  88. </uni-tr>
  89. <uni-tr v-for="item in rtuStatisticsList" :key="item.id">
  90. <uni-td align="center">
  91. <view style="text-align: center;">{{ item.orgName }}</view>
  92. </uni-td>
  93. <uni-td align="center">
  94. <view style="text-align: center;">{{ item.rtuCount }}</view>
  95. </uni-td>
  96. <uni-td align="center">
  97. <view style="text-align: center;">{{ item.warningRtuCount }}</view>
  98. </uni-td>
  99. </uni-tr>
  100. </uni-table>
  101. </uGroup>
  102. </uSection>
  103. </view>
  104. <view v-if="showHome.orgAdmin">
  105. <uSection title="实时统计" type="line">
  106. <uGroup>
  107. <uni-grid :column="4" :highlight="true">
  108. <uni-grid-item>
  109. <view class="grid-item-box" style="background-color: #fff;">
  110. <text style="font-size: 1rem;color: orangered;">{{realData.rtus}}</text>
  111. <text style="font-size: 0.7rem;font-weight: bold;">测站总数</text>
  112. </view>
  113. </uni-grid-item>
  114. <uni-grid-item>
  115. <view class="grid-item-box" style="background-color: #fff;">
  116. <text style="font-size: 1rem;color: orangered;">{{realData.warningRtus}}</text>
  117. <text style="font-size: 0.7rem;font-weight: bold;">预警设备</text>
  118. </view>
  119. </uni-grid-item>
  120. <uni-grid-item>
  121. <view class="grid-item-box" style="background-color: #fff;">
  122. <text style="font-size: 1rem;color: orangered;">{{realData.unconfirmOrderCount}}</text>
  123. <text style="font-size: 0.7rem;font-weight: bold;">未接工单</text>
  124. </view>
  125. </uni-grid-item>
  126. <uni-grid-item>
  127. <view class="grid-item-box" style="background-color: #fff;">
  128. <text
  129. style="font-size: 1rem;color: orangered;">{{realData.equipmentInspectionPercent}}%</text>
  130. <text style="font-size: 0.7rem;font-weight: bold;">已完成巡检</text>
  131. </view>
  132. </uni-grid-item>
  133. </uni-grid>
  134. </uGroup>
  135. </uSection>
  136. <uSection style="margin-bottom: 0px;" title="今日工单动态" titleFontSize="0.8rem" type="line">
  137. <uGroup>
  138. <uni-list>
  139. <uni-list-item v-for="item in todayOrderProcessList" :key="item.id" showArrow clickable
  140. @click="toOrderProcessDetail(item.id)">
  141. <template v-slot:body>
  142. <view style="display: flex;flex-direction: column;width:100%;">
  143. <view
  144. style="display:flex;flex-direction: row;justify-content: start;align-items: center;">
  145. <image class="order-title-image" style="box-shadow:0 0 2px 2px lightblue"
  146. src="/static/images/logo_app.png" mode="widthFix">
  147. </image>
  148. <view style="margin-left:5px;">
  149. <text style="font-size:1rem;font-weight: bold;">{{item.rtuName}}</text>
  150. </view>
  151. <view style="margin-left:5px;">
  152. <text style="font-size:0.9rem;">[{{item.rtuCode}}]</text>
  153. </view>
  154. </view>
  155. <view>
  156. <uIcons class="input-uni-icon" type="loop" size="18" color="skyblue" />
  157. <text style="font-size:0.8rem;padding-left: 5px;">状态:</text>
  158. <text
  159. style="font-size:0.8rem;padding-left: 5px;">{{item.orderStatusName}}</text>
  160. </view>
  161. <view>
  162. <uIcons class="input-uni-icon" type="auth" size="18" color="skyblue" />
  163. <text
  164. style="font-size:0.8rem;padding-left: 5px;">{{item.orderProcessUserName}}</text>
  165. <text style="font-size:0.8rem;padding-left: 5px;"></text>
  166. <text style="font-size:0.8rem;padding-left: 5px;">{{item.updateTime}}</text>
  167. </view>
  168. <view style="display:flex;flex-direction:row;align-items: center;">
  169. <uIcons class="input-uni-icon" type="compose" size="18" color="skyblue" />
  170. <text style="font-size:0.8rem;padding-left: 10rpx;">{{item.processDesc}}</text>
  171. </view>
  172. </view>
  173. </template>
  174. </uni-list-item>
  175. </uni-list>
  176. </uGroup>
  177. </uSection>
  178. <uSection style="margin-bottom: 0px;" title="今日巡检动态" titleFontSize="0.8rem" type="line">
  179. <uGroup>
  180. <uni-list>
  181. <uni-list-item v-for="item in todayEquipmentInspectionList" :key="item.id" showArrow clickable
  182. @click="onEquipmentInspectionItemClick(item.id)">
  183. <template v-slot:body>
  184. <view style="display: flex;flex-direction: column;width:100%;">
  185. <view
  186. style="display:flex;flex-direction: row;justify-content: start;align-items: center;">
  187. <image class="order-title-image" style="box-shadow:0 0 2px 2px lightblue"
  188. src="/static/images/home/n3.png" mode="widthFix">
  189. </image>
  190. <view style="margin-left:5px;">
  191. <text style="font-size:1rem;font-weight: bold;">{{item.rtuName}}</text>
  192. </view>
  193. <view style="margin-left:5px;">
  194. <text style="font-size:0.9rem;">[{{item.rtuCode}}]</text>
  195. </view>
  196. </view>
  197. <view>
  198. <uIcons class="input-uni-icon" type="auth" size="18" color="skyblue" />
  199. <text
  200. style="font-size:0.8rem;padding-left: 5px;">{{item.servicePersonName}}</text>
  201. <text style="font-size:0.8rem;padding-left: 5px;">时间:</text>
  202. <text style="font-size:0.8rem;padding-left: 5px;">{{item.createTime}}</text>
  203. </view>
  204. <view style="display:flex;flex-direction:row;align-items: center;">
  205. <uIcons class="input-uni-icon" type="compose" size="18" color="skyblue" />
  206. <text style="font-size:0.8rem;padding-left: 10rpx;">{{item.reportDesc}}</text>
  207. </view>
  208. </view>
  209. </template>
  210. </uni-list-item>
  211. </uni-list>
  212. </uGroup>
  213. </uSection>
  214. </view>
  215. <view v-if="showHome.orgServicePerson">
  216. <uSection style="margin-bottom: 10px;" title="未接工单" titleFontSize="1rem" type="line">
  217. <template v-slot:right>
  218. <view style="margin-right:20px;">
  219. <text style="font-size:0.8rem;color:grey;">工单数量:</text>
  220. <text style="font-size:0.8rem;color:orangered;font-weight: bold;">{{unconfirmOrderCount}}</text>
  221. </view>
  222. </template>
  223. <uni-list>
  224. <uni-list-item v-for="item in unconfirmOrderList" :key="item.id">
  225. <template v-slot:body>
  226. <view style="display: flex;flex-direction: column;width:100%;">
  227. <view
  228. style="display:flex;flex-direction: row;justify-content: start;align-items: center;">
  229. <view
  230. style="width:74%;display:flex;flex-direction: row;justify-content: start;align-items: center;">
  231. <image class="order-title-image" style="box-shadow:0 0 2px 2px lightblue"
  232. src="/static/images/logo_app.png" mode="widthFix">
  233. </image>
  234. <view style="margin-left:5px;">
  235. <text style="font-size:1rem;font-weight: bold;">{{item.rtuName}}</text>
  236. </view>
  237. <view style="margin-left:5px;">
  238. <text style="font-size:0.9rem;">[{{item.rtuCode}}]</text>
  239. </view>
  240. </view>
  241. <view style="width:26%;display:flex;flex-direction: row;justify-content: flex-end;">
  242. <view
  243. style="display:flex;flex-direction: row;justify-content: center;align-items: center; width: 100px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  244. @click="onOrderItemClick(item.id)">
  245. <uIcons class="input-uni-icon" type="compose" size="18" color="coral" />
  246. <view style="padding-left:5px;">
  247. <text style="color:black;font-size:0.7rem">接单确认</text>
  248. </view>
  249. </view>
  250. </view>
  251. </view>
  252. <view>
  253. <uIcons class="input-uni-icon" type="notification" size="18" color="skyblue" />
  254. <text style="font-size:0.8rem;padding-left: 5px;">报单时间:</text>
  255. <text style="font-size:0.8rem;padding-left: 5px;">{{item.createTime}}</text>
  256. </view>
  257. <view style="display:flex;flex-direction:row;align-items: center;">
  258. <image class="slot-image" src="/static/images/icon_warning.png" mode="widthFix">
  259. </image>
  260. <text style="font-size:0.8rem;padding-left: 10rpx;">{{item.orderDesc}}</text>
  261. </view>
  262. </view>
  263. </template>
  264. </uni-list-item>
  265. </uni-list>
  266. </uSection>
  267. </view>
  268. </view>
  269. </template>
  270. <script>
  271. import {
  272. fakePosition,
  273. fakeBannerList,
  274. fakeNavButton,
  275. fakeServiceButton
  276. } from "@/api/mock/home.js";
  277. import http from '@/http/api.js';
  278. import uBadge from '@/uni_modules/uni-badge/components/uni-badge/uni-badge.vue'
  279. import uGroup from '@/uni_modules/uni-group/uni-group.vue'
  280. import uSection from '@/uni_modules/uni-section/uni-section.vue'
  281. import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
  282. import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
  283. import pageNav from '@/components/page-nav/page-nav.vue';
  284. import uTable from '@/uni_modules/uni-table/components/uni-table/uni-table.vue'
  285. import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
  286. import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
  287. import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
  288. import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
  289. import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  290. export default {
  291. components: {
  292. uGroup,
  293. uSection,
  294. uNavBar,
  295. uDataPicker,
  296. pageNav,
  297. uList,
  298. uListItem,
  299. uTable,
  300. uBreadcrumb,
  301. uPagination,
  302. uIcons,
  303. },
  304. data() {
  305. return {
  306. timer: null,
  307. noticeDot: false,
  308. noticeValue: 0,
  309. value: 1,
  310. customStyle: {
  311. backgroundColor: '#62ed0d',
  312. color: '#fff'
  313. },
  314. unconfirmOrderCount: '0',
  315. position: '',
  316. positionArr: [],
  317. status: 'loadmore',
  318. list: 15,
  319. page: 0,
  320. keyword: '',
  321. focus: false,
  322. bannerList: [],
  323. noticeList: [],
  324. warningList: [],
  325. navButton: [],
  326. unconfirmOrderList: [],
  327. todayEquipmentInspectionList: [],
  328. todayOrderProcessList: [],
  329. rtuStatisticsList: [],
  330. role: {
  331. 'admin': 'admin',
  332. 'orgAdmin': 'org_admin',
  333. 'orgServicePerson': 'org_servcie_person',
  334. },
  335. showHome: {
  336. 'admin': false,
  337. 'orgAdmin': false,
  338. 'orgServicePerson': false,
  339. },
  340. realData: {
  341. rtuCount: 0,
  342. warningRtuCount: 0,
  343. orderDelayProcess: 0,
  344. equipmentinspectionRtu: 0,
  345. },
  346. adminNavBtnlist: [{
  347. name: '实时数据',
  348. img: '/static/images/manage/site.png',
  349. url: '/pages/rtu-manage/rtudata',
  350. badge: false,
  351. value: 0,
  352. },
  353. {
  354. name: '工单查询',
  355. img: '/static/images/home/order_manage.png',
  356. url: '/pages/check-order/admincheckorderlist',
  357. badge: false,
  358. value: 0,
  359. },
  360. {
  361. name: '巡检查询',
  362. img: '/static/images/home/my_inspection.png',
  363. url: '/pages/equipment-inspection/equipmentinspectionreportlist',
  364. badge: false,
  365. value: 0,
  366. },
  367. {
  368. name: '统计报表',
  369. img: '/static/images/manage/statistics.png',
  370. url: '/pages/report-forms/adminreport',
  371. badge: false,
  372. value: 0,
  373. },
  374. {
  375. name: '通讯录',
  376. img: '/static/images/manage/g3.png',
  377. url: '/pages/report-forms/contact',
  378. badge: false,
  379. value: 0,
  380. }
  381. ],
  382. orgAdminNavBtnlist: [{
  383. name: '我的工单',
  384. img: '/static/images/home/my_order.png',
  385. url: '/pages/check-order/mycheckorderlist',
  386. badge: false,
  387. value: 0,
  388. },
  389. {
  390. name: '工单查询',
  391. img: '/static/images/home/order_manage.png',
  392. url: '/pages/check-order/checkorderlist',
  393. badge: false,
  394. value: 0,
  395. },
  396. {
  397. name: '巡检任务',
  398. img: '/static/images/home/inspection.png',
  399. url: '/pages/equipment-inspection/equipmentinspectionlist',
  400. badge: false,
  401. value: 0,
  402. },
  403. {
  404. name: '巡检查询',
  405. img: '/static/images/home/my_inspection.png',
  406. url: '/pages/equipment-inspection/equipmentinspectionreportlist',
  407. badge: false,
  408. value: 0,
  409. },
  410. {
  411. name: '统计报表',
  412. img: '/static/images/manage/statistics.png',
  413. url: '/pages/report-forms/report',
  414. badge: false,
  415. value: 0,
  416. }
  417. ],
  418. orgServicePersonNavBtnlist: [{
  419. name: '我的工单',
  420. img: '/static/images/home/my_order.png',
  421. url: '/pages/check-order/mycheckorderlist',
  422. badge: false,
  423. value: 0,
  424. },
  425. {
  426. name: '工单查询',
  427. img: '/static/images/home/order_manage.png',
  428. url: '/pages/check-order/checkorderlist',
  429. badge: false,
  430. value: 0,
  431. },
  432. {
  433. name: '巡检任务',
  434. img: '/static/images/home/inspection.png',
  435. url: '/pages/equipment-inspection/equipmentinspectionlist',
  436. badge: false,
  437. value: 0,
  438. },
  439. {
  440. name: '巡检历史',
  441. img: '/static/images/home/my_inspection.png',
  442. url: '/pages/equipment-inspection/myequipmentinspectionreportlist',
  443. badge: false,
  444. value: 0,
  445. },
  446. ],
  447. };
  448. },
  449. onLoad() {
  450. this.getHomeInfo();
  451. if (this.userInfo.role_name === this.role['admin']) {
  452. this.showHome.admin = true;
  453. this.showHome.orgAdmin = false;
  454. this.showHome.orgServicePerson = false;
  455. this.navButton = this.adminNavBtnlist;
  456. this.getRtuStatisticsList();
  457. } else if (this.userInfo.role_name === this.role['orgAdmin']) {
  458. this.showHome.admin = false;
  459. this.showHome.orgAdmin = true;
  460. this.showHome.orgServicePerson = false;
  461. this.navButton = this.orgAdminNavBtnlist;
  462. this.getTodayOrderProcessList();
  463. this.getTodayEquipmentInspectionReport();
  464. } else if (this.userInfo.role_name === this.role['orgServicePerson']) {
  465. this.showHome.admin = false;
  466. this.showHome.orgAdmin = false;
  467. this.showHome.orgServicePerson = true;
  468. this.navButton = this.orgServicePersonNavBtnlist;
  469. this.getUnconfirmOrderList();
  470. } else {
  471. this.$u.route({
  472. url: '/pages/login/login-account'
  473. })
  474. }
  475. this.timer = setInterval(() => {
  476. //TODO
  477. this.getHomeInfo();
  478. if (this.userInfo.role_name === this.role['admin']) {
  479. this.getRtuStatisticsList();
  480. } else if (this.userInfo.role_name === this.role['orgAdmin']) {
  481. this.getTodayOrderProcessList();
  482. this.getTodayEquipmentInspectionReport();
  483. } else if (this.userInfo.role_name === this.role['orgServicePerson']) {
  484. this.getUnconfirmOrderList();
  485. }
  486. }, 5000);
  487. },
  488. onUnload() {
  489. if (this.timer != null) {
  490. clearTimeout(this.timer);
  491. }
  492. },
  493. onShow() {
  494. this.getHomeInfo();
  495. if (this.userInfo.role_name === this.role['admin']) {
  496. this.showHome.admin = true;
  497. this.showHome.orgAdmin = false;
  498. this.showHome.orgServicePerson = false;
  499. this.navButton = this.adminNavBtnlist;
  500. this.getRtuStatisticsList();
  501. } else if (this.userInfo.role_name === this.role['orgAdmin']) {
  502. this.showHome.admin = false;
  503. this.showHome.orgAdmin = true;
  504. this.showHome.orgServicePerson = false;
  505. this.navButton = this.orgAdminNavBtnlist;
  506. this.getTodayOrderProcessList();
  507. this.getTodayEquipmentInspectionReport();
  508. } else if (this.userInfo.role_name === this.role['orgServicePerson']) {
  509. this.showHome.admin = false;
  510. this.showHome.orgAdmin = false;
  511. this.showHome.orgServicePerson = true;
  512. this.navButton = this.orgServicePersonNavBtnlist;
  513. this.getUnconfirmOrderList();
  514. } else {
  515. this.$u.route({
  516. url: '/pages/login/login-account'
  517. })
  518. }
  519. },
  520. onHide() {
  521. // if (this.timer != null) {
  522. // clearTimeout(this.timer);
  523. // }
  524. },
  525. onReachBottom() {
  526. // 后续将改为与后端联动
  527. // if (this.page >= 3) return;
  528. // this.status = 'loading';
  529. // this.page = ++this.page;
  530. // setTimeout(() => {
  531. // this.list += 10;
  532. // if (this.page >= 3) this.status = 'nomore';
  533. // else this.status = 'loading';
  534. // this.newsList.push(...[{}, {}]);
  535. // }, 2000);
  536. },
  537. methods: {
  538. toOrderProcessDetail(id) {
  539. console.log("opne record ", id)
  540. var url = '/pages/check-order/orderprocessreportdetail?processId=' + id;
  541. uni.navigateTo({
  542. url: url
  543. })
  544. },
  545. onNoticeMoreClick() {
  546. uni.navigateTo({
  547. url: '/pages/news/noticelist'
  548. })
  549. },
  550. onNoticeItemClick(id) {
  551. console.log('执行click事件', id)
  552. uni.navigateTo({
  553. url: '/pages/news/detail?id=' + id
  554. })
  555. },
  556. onOrderMoreClick() {
  557. uni.navigateTo({
  558. url: '/pages/check-order/todaycheckorderlist'
  559. })
  560. },
  561. onOrderItemClick(id) {
  562. var that = this;
  563. uni.showModal({
  564. content: '确定进行接单确认操作?',
  565. showCancel: true,
  566. success(res) {
  567. if (res.confirm) {
  568. var postData2 = {};
  569. postData2['id'] = id;
  570. http.request({
  571. url: '/galaxy-test/rtu/check/order/confirm',
  572. method: 'POST',
  573. data: postData2
  574. }).then(res => {
  575. console.log(res)
  576. if (res.success) {
  577. uni.showModal({
  578. content: '接单已成功,是否立即填报?',
  579. showCancel: true,
  580. success(res) {
  581. if (res.confirm) {
  582. var url =
  583. '/pages/check-order/orderprocesslist?id=' + id;
  584. uni.navigateTo({
  585. url: url
  586. })
  587. }
  588. }
  589. });
  590. }
  591. }).catch(err => {
  592. console.log(err)
  593. })
  594. }
  595. }
  596. });
  597. },
  598. onEquipmentinspectionMoreClick() {
  599. uni.navigateTo({
  600. url: '/pages/equipment-inspection/todayequipmentinspectionreportlist'
  601. })
  602. },
  603. onEquipmentInspectionItemClick(id) {
  604. var url = '/pages/equipment-inspection/equipmentinspectionreportdetail?id=' + id;
  605. uni.navigateTo({
  606. url: url
  607. })
  608. },
  609. getHomeInfo() {
  610. const that = this;
  611. http.request({
  612. url: '/galaxy-test/real/data/home/info',
  613. method: 'GET'
  614. }).then(res => {
  615. if (res.data != null) {
  616. that.realData = res.data;
  617. if (that.userInfo.role_name === that.role['orgServicePerson']) {
  618. if (that.realData.myOrderCount > 0) {
  619. that.navButton[0].badge = true;
  620. that.navButton[0].value = that.realData.myOrderCount;
  621. } else {
  622. that.navButton[0].badge = false;
  623. }
  624. if (that.realData.equipmentInspectionCount > 0) {
  625. that.navButton[2].badge = true;
  626. that.navButton[2].value = that.realData.equipmentInspectionCount;
  627. } else {
  628. that.navButton[2].badge = false;
  629. }
  630. } else if (that.userInfo.role_name === that.role['orgAdmin']) {
  631. if (that.realData.myOrderCount > 0) {
  632. that.navButton[0].badge = true;
  633. that.navButton[0].value = that.realData.myOrderCount;
  634. } else {
  635. that.navButton[0].badge = false;
  636. }
  637. if (that.realData.equipmentInspectionCount > 0) {
  638. that.navButton[2].badge = true;
  639. that.navButton[2].value = that.realData.equipmentInspectionCount;
  640. } else {
  641. that.navButton[2].badge = false;
  642. }
  643. } else if (that.userInfo.role_name === that.role['admin']) {
  644. }
  645. that.noticeDot = res.data.hasNewNotice;
  646. that.noticeValue = res.data.newNoticeCount;
  647. }
  648. }).catch(err => {
  649. console.log(err)
  650. })
  651. },
  652. getLastNotice() {
  653. const that = this;
  654. http.request({
  655. url: '/galaxy-test/notice/last/list',
  656. method: 'GET'
  657. }).then(res => {
  658. if (res.data != null) {
  659. const len = res.data['length'];
  660. var list = [];
  661. for (var i = 0; i < len; i++) {
  662. let dict = res.data['' + i];
  663. list.push(dict);
  664. }
  665. that.noticeList = list;
  666. }
  667. }).catch(err => {
  668. console.log(err)
  669. })
  670. },
  671. getRtuStatisticsList() {
  672. const that = this;
  673. http.request({
  674. url: '/galaxy-test/rtu/base/statistics',
  675. method: 'GET'
  676. }).then(res => {
  677. if (res.data != null) {
  678. that.rtuStatisticsList = res.data;
  679. }
  680. }).catch(err => {
  681. console.log(err)
  682. })
  683. },
  684. getUnconfirmOrderList() {
  685. const that = this;
  686. http.request({
  687. url: '/galaxy-test/rtu/check/order/unconfirm/list',
  688. method: 'GET'
  689. }).then(res => {
  690. if (res.data != null) {
  691. that.unconfirmOrderList = res.data;
  692. that.unconfirmOrderCount = "" + res.data.length;
  693. }
  694. }).catch(err => {
  695. console.log(err)
  696. })
  697. },
  698. getTodayOrderProcessList() {
  699. const that = this;
  700. http.request({
  701. url: '/galaxy-test/rtu/check/order/process/today/list',
  702. method: 'GET'
  703. }).then(res => {
  704. if (res.data != null) {
  705. that.todayOrderProcessList = res.data;
  706. }
  707. }).catch(err => {
  708. console.log(err)
  709. })
  710. },
  711. getTodayEquipmentInspectionReport() {
  712. const that = this;
  713. http.request({
  714. url: '/galaxy-test/equipment/inspection/report/today/list',
  715. method: 'GET'
  716. }).then(res => {
  717. if (res.data != null) {
  718. that.todayEquipmentInspectionList = res.data;
  719. }
  720. }).catch(err => {
  721. console.log(err)
  722. })
  723. },
  724. changePicker(e) {
  725. console.log(this.pickerArr[e.detail.value].name);
  726. this.position = this.pickerArr[e.detail.value].name;
  727. },
  728. handleFocus() {
  729. this.focus = !this.focus;
  730. },
  731. handleSearchBlur() {
  732. this.focus = false;
  733. },
  734. }
  735. };
  736. </script>
  737. <style lang="scss">
  738. $nav-height: 75px;
  739. .order-title-image {
  740. /* #ifndef APP-NVUE */
  741. display: block;
  742. /* #endif */
  743. // margin-right: 10px;
  744. width: 20px;
  745. height: 20px;
  746. border-radius: 50%;
  747. }
  748. .uni-badge-left-margin {
  749. margin-left: 0px;
  750. }
  751. .uni-badge-absolute {
  752. margin-left: 40px;
  753. }
  754. .slot-image {
  755. /* #ifndef APP-NVUE */
  756. display: block;
  757. /* #endif */
  758. // margin-right: 10px;
  759. width: 20px;
  760. height: 20px;
  761. }
  762. .nav-item-name {
  763. font-size: 0.9rem;
  764. font-weight: bold;
  765. }
  766. .logo {
  767. flex-shrink: 0;
  768. width: 100rpx;
  769. height: auto;
  770. }
  771. .nav-title {
  772. height: $nav-height;
  773. }
  774. .nav-title-left {
  775. /* #ifndef APP-PLUS-NVUE */
  776. display: flex;
  777. /* #endif */
  778. flex-direction: row;
  779. align-items: center;
  780. justify-content: flex-start;
  781. // width: 160rpx;
  782. margin-left: 4px;
  783. }
  784. .nav-title-box {
  785. /* #ifndef APP-PLUS-NVUE */
  786. display: flex;
  787. /* #endif */
  788. flex-direction: row;
  789. // width: 500rpx;
  790. flex: 1;
  791. background-color: #f8f8f8;
  792. height: $nav-height;
  793. border-radius: 15px;
  794. padding: 0 15px;
  795. flex-wrap: nowrap;
  796. margin: 7px 0;
  797. line-height: $nav-height;
  798. }
  799. .input-view {
  800. /* #ifndef APP-PLUS-NVUE */
  801. display: flex;
  802. /* #endif */
  803. flex-direction: row;
  804. // width: 500rpx;
  805. flex: 1;
  806. // background-color: #f8f8f8;
  807. // height: $nav-height;
  808. // border-radius: 15px;
  809. // padding: 0 15px;
  810. flex-wrap: nowrap;
  811. // margin: 7px 0;
  812. // line-height: $nav-height;
  813. }
  814. .grid-item-box {
  815. flex: 1;
  816. // position: relative;
  817. /* #ifndef APP-NVUE */
  818. display: flex;
  819. /* #endif */
  820. flex-direction: column;
  821. align-items: center;
  822. justify-content: center;
  823. padding: 15px 0;
  824. }
  825. .grid-item-box-row {
  826. flex: 1;
  827. // position: relative;
  828. /* #ifndef APP-NVUE */
  829. display: flex;
  830. /* #endif */
  831. flex-direction: row;
  832. align-items: center;
  833. justify-content: center;
  834. padding: 15px 0;
  835. }
  836. .grid-dot {
  837. position: absolute;
  838. top: 5px;
  839. right: 15px;
  840. }
  841. .container {
  842. background-color: #f7f7f7;
  843. min-height: 100vh;
  844. overflow: hidden;
  845. }
  846. .head {
  847. position: relative;
  848. top: 0;
  849. left: 0;
  850. z-index: 1;
  851. }
  852. .head-bg {
  853. position: absolute;
  854. left: 0px;
  855. top: 75px;
  856. z-index: -1;
  857. width: 750rpx;
  858. height: 270rpx;
  859. background: #0bb9c8;
  860. }
  861. .nav-wrap {
  862. width: 100%;
  863. padding: 0 22rpx;
  864. display: flex;
  865. justify-content: space-between;
  866. align-items: center;
  867. .picker-box {
  868. flex: 1;
  869. display: flex;
  870. align-items: center;
  871. justify-content: flex-start;
  872. font-size: 32rpx;
  873. font-family: Microsoft YaHei;
  874. font-weight: bold;
  875. color: #ffffff;
  876. .arrow {
  877. margin-left: 10rpx;
  878. }
  879. }
  880. .logo {
  881. flex-shrink: 0;
  882. width: 100rpx;
  883. height: auto;
  884. }
  885. .search-input {
  886. width: 300rpx;
  887. height: 50rpx;
  888. }
  889. .tool {
  890. flex: 1;
  891. display: flex;
  892. align-items: center;
  893. justify-content: flex-end;
  894. .icon {
  895. height: auto;
  896. }
  897. .search-icon {
  898. width: 40rpx;
  899. margin-right: 34rpx;
  900. }
  901. .message-icon {
  902. width: 32rpx;
  903. margin-right: 27rpx;
  904. }
  905. .qr-icon {
  906. width: 37rpx;
  907. }
  908. }
  909. }
  910. .swiper-box {
  911. margin: 50rpx auto 0;
  912. width: 710rpx;
  913. height: 253rpx;
  914. .swiper-item {
  915. width: 100%;
  916. height: 100%;
  917. .banner {
  918. width: 100%;
  919. height: 100%;
  920. }
  921. }
  922. }
  923. .nav {
  924. margin: 0rpx 0;
  925. box-sizing: border-box;
  926. padding: 0 10rpx;
  927. &-item {
  928. width: 100%;
  929. box-sizing: border-box;
  930. display: flex;
  931. flex-direction: column;
  932. align-items: center;
  933. justify-content: space-between;
  934. height: 130rpx;
  935. &-img {
  936. width: 80rpx;
  937. height: 80rpx;
  938. }
  939. &-name {
  940. font-size: 0.7rem;
  941. font-family: PingFang SC;
  942. font-weight: 500;
  943. color: #585b61;
  944. }
  945. }
  946. }
  947. .video-box {
  948. display: flex;
  949. justify-content: flex-start;
  950. flex-direction: column;
  951. width: 100%;
  952. .video-body {
  953. display: flex;
  954. justify-content: center;
  955. flex-direction: row;
  956. }
  957. .video-title {
  958. display: flex;
  959. justify-content: center;
  960. flex-direction: row;
  961. .text {
  962. margin-top: 10rpx;
  963. margin-bottom: 10rpx;
  964. width: 640rpx;
  965. // flex: 1;
  966. min-width: 0;
  967. overflow: hidden;
  968. text-overflow: ellipsis;
  969. display: -webkit-box;
  970. -webkit-line-clamp: 1;
  971. -webkit-box-orient: vertical;
  972. }
  973. }
  974. }
  975. .notice-box {
  976. display: flex;
  977. align-items: center;
  978. background: #ffffff;
  979. border-radius: 20px 20px 20px 20px;
  980. margin: 0 20rpx;
  981. padding: 30rpx 20rpx;
  982. .img {
  983. width: 75rpx;
  984. height: auto;
  985. margin-right: 36rpx;
  986. margin-left: 10rpx;
  987. }
  988. .notice-info {
  989. flex: 1;
  990. .notice-cell:first-of-type {
  991. margin-bottom: 15rpx;
  992. }
  993. }
  994. .notice-cell {
  995. display: flex;
  996. align-items: center;
  997. font-size: 24rpx;
  998. font-family: PingFang SC;
  999. font-weight: 500;
  1000. color: #585b61;
  1001. .icon {
  1002. width: 63rpx;
  1003. margin-right: 18rpx;
  1004. }
  1005. .text {
  1006. flex: 1;
  1007. min-width: 0;
  1008. overflow: hidden;
  1009. text-overflow: ellipsis;
  1010. display: -webkit-box;
  1011. -webkit-line-clamp: 1;
  1012. -webkit-box-orient: vertical;
  1013. }
  1014. }
  1015. }
  1016. .service-box {
  1017. background: #ffffff;
  1018. border-radius: 20px 20px 20px 20px;
  1019. margin: 30rpx 20rpx 0;
  1020. padding: 0rpx 20rpx;
  1021. .service-item {
  1022. display: flex;
  1023. flex-direction: column;
  1024. justify-content: space-between;
  1025. align-items: center;
  1026. width: 100%;
  1027. height: 120rpx;
  1028. font-size: 26rpx;
  1029. font-family: PingFang SC;
  1030. font-weight: 500;
  1031. color: #585b61;
  1032. .img {
  1033. width: 70rpx;
  1034. height: auto;
  1035. }
  1036. }
  1037. }
  1038. .more {
  1039. display: flex;
  1040. align-items: center;
  1041. font-size: 26rpx;
  1042. font-family: PingFang SC;
  1043. font-weight: 500;
  1044. color: #a6abb5;
  1045. }
  1046. .orders {
  1047. background: #ffffff;
  1048. border-radius: 20px 20px 20px 20px;
  1049. margin: 30rpx 20rpx 60rpx;
  1050. padding: 30rpx 20rpx;
  1051. .cell {
  1052. display: flex;
  1053. justify-content: space-between;
  1054. align-items: center;
  1055. .ctitle {
  1056. font-size: 32rpx;
  1057. font-family: PingFang SC;
  1058. font-weight: bold;
  1059. color: #585b61;
  1060. }
  1061. .more {
  1062. display: flex;
  1063. align-items: center;
  1064. font-size: 26rpx;
  1065. font-family: PingFang SC;
  1066. font-weight: 500;
  1067. color: #a6abb5;
  1068. }
  1069. }
  1070. .orders-list {
  1071. margin-top: 30rpx;
  1072. .orders-item {
  1073. &:not(:last-of-type) {
  1074. padding: 0 0 30rpx;
  1075. margin-bottom: 30rpx;
  1076. border-bottom: 1px solid #eeeeee;
  1077. }
  1078. display: flex;
  1079. align-items: center;
  1080. justify-content: space-between;
  1081. .left {
  1082. flex: 1;
  1083. height: 160rpx;
  1084. display: flex;
  1085. flex-direction: column;
  1086. justify-content: space-around;
  1087. .info {
  1088. min-width: 0;
  1089. overflow: hidden;
  1090. text-overflow: ellipsis;
  1091. display: -webkit-box;
  1092. -webkit-line-clamp: 2;
  1093. -webkit-box-orient: vertical;
  1094. font-size: 28rpx;
  1095. font-family: PingFang SC;
  1096. font-weight: 500;
  1097. color: #585b61;
  1098. line-height: 36rpx;
  1099. }
  1100. .date {
  1101. display: flex;
  1102. align-items: center;
  1103. .icon {
  1104. width: 21rpx;
  1105. height: 21rpx;
  1106. margin-right: 9rpx;
  1107. }
  1108. font-size: 26rpx;
  1109. font-family: PingFang SC;
  1110. font-weight: 500;
  1111. color: #a6abb5;
  1112. }
  1113. }
  1114. // .img {
  1115. // flex-shrink: 0;
  1116. // width: 252rpx;
  1117. // height: 160rpx;
  1118. // border-radius: 20rpx;
  1119. // background-color: #82848a;
  1120. // }
  1121. }
  1122. }
  1123. }
  1124. </style>