inspectionlist.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  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="wrap">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view class="nav-title">
  14. <text>{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <uni-section title="查询" titleFontSize="0.8rem" type="line">
  19. <view class="search-block">
  20. <view class="adcd-adnm">
  21. <uni-data-picker placeholder="请选择地区" popup-title="请选择所在地区" :localdata="regionTree"
  22. v-model="selectedTreeNode" @change="onTreeChange" @nodeclick="onTreeNodeClick"
  23. @popupopened="onTreePopupOpened" @popupclosed="onTreePopupClosed" :clear-icon="false">
  24. </uni-data-picker>
  25. </view>
  26. <view class="rtu-code">
  27. <uni-easyinput :styles="inputStyles" @input="searchRtuCodeValClear" prefixIcon="search"
  28. v-model="searchRtuCodeVal" placeholder="请输入测站编码">
  29. </uni-easyinput>
  30. </view>
  31. <view class="rtu-name">
  32. <uni-easyinput :styles="inputStyles" @input="searchRtuNameValClear" prefixIcon="search"
  33. v-model="searchRtuNameVal" placeholder="请输入测站名称">
  34. </uni-easyinput>
  35. </view>
  36. <view class="submit-btn">
  37. <button type="default" @click="search">查 询</button>
  38. </view>
  39. </view>
  40. </uni-section>
  41. <view class="line" style="margin-top: 5px;">
  42. <view class="lineText">
  43. <text class="inspectionCount">当前汛期: </text>
  44. <text v-if="countInfo.rainKind==1" class="content">汛前巡检</text>
  45. <text v-else-if="countInfo.rainKind==2" class="content">汛中(一)巡检</text>
  46. <text v-else-if="countInfo.rainKind==3" class="content">汛中(二)巡检</text>
  47. <text v-else class="content">--</text>
  48. </view>
  49. <view class="lineText">
  50. <text class="beforeRainInspectionCount">巡检设备总数量: </text>
  51. <text class="content">{{ countInfo.rtus }}</text>
  52. </view>
  53. <view class="lineText">
  54. <text class="rainSencodInspectionCount">剩余待巡检设备数量: </text>
  55. <text class="content">{{ countInfo.remaininspectionrtus }}</text>
  56. </view>
  57. </view>
  58. <uni-list>
  59. <uni-list-item v-for="item in list" :key="item.rtuCode">
  60. <template v-slot:body>
  61. <view class="list-item-block">
  62. <view class="items-line">
  63. <image class="item-title-run-status-icon" style="box-shadow:0 0 2px 2px lightblue"
  64. src="/static/images/list/inspection_item.png" mode="widthFix">
  65. </image>
  66. <text class="item-title-rtu-name">{{item.rtuName}}</text>
  67. <text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
  68. </view>
  69. <view class="items-line">
  70. <uni-icons class="input-uni-icon" type="map" size="18" color="lightblue" />
  71. <text class="item-text-lable">行政区划:</text>
  72. <text class="item-text-content">{{getAreaName(item)}}</text>
  73. </view>
  74. <view class="items-line">
  75. <uni-icons class="input-uni-icon" type="location" size="18" color="lightblue" />
  76. <text class="item-text-lable">安装位置:</text>
  77. <text class="item-text-content-ellipsis">{{item.locationDesc}}</text>
  78. </view>
  79. <view class="items-line">
  80. <uni-icons class="input-uni-icon" type="home" size="18" color="lightblue" />
  81. <text class="item-text-lable">测站类型:</text>
  82. <text class="item-text-content">{{getSiteKind(item)}}</text>
  83. </view>
  84. <view v-if="item.runStatusId==1" class="items-line">
  85. <image class="item-title-run-status-icon" mode="widthFix"
  86. src="/static/images/icon_warning.png">
  87. </image>
  88. <text class="item-text-lable">站点异常:</text>
  89. <text class="item-text-content-ellipsis">{{item.warnKindInfo}}</text>
  90. </view>
  91. <view class="item-button-group">
  92. <view class="item-button" @click="onLocationClick(item)">
  93. <view class="items-line">
  94. <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
  95. <text class="button-text">导航</text>
  96. </view>
  97. </view>
  98. <!-- <view v-if="item.runStatusId==1" class="item-button" @click="onWarnInfoViewClick(item.rtuCode)">
  99. <view class="items-line">
  100. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  101. <text class="button-text">异常信息</text>
  102. </view>
  103. </view> -->
  104. <!-- <view v-if="(permission.companyAdmin || permission.companyServciePerson) && item.orderStatus==1 && (item.orderConfirm ==0 || item.myOrder ==1)" class="item-button" @click="onComfireCheckOrderClick(item)">
  105. <view class="items-line">
  106. <uni-icons class="input-uni-icon" type="compose" size="18" color="coral" />
  107. <text class="button-text">异常处理</text>
  108. </view>
  109. </view> -->
  110. <!-- <view v-if="(permission.companyAdmin || permission.companyServciePerson) && item.orderStatus==1 && item.orderConfirm ==1 && item.myOrder ==0" class="item-button" @click="onCheckOrderReportClick(item)">
  111. <view class="items-line">
  112. <uni-icons class="input-uni-icon" type="compose" size="18" color="coral" />
  113. <text class="button-text">维修填报</text>
  114. </view>
  115. </view> -->
  116. <view v-if="item.orderStatus==1" class="item-button"
  117. @click="onCheckOrderProcessClick(item)">
  118. <view class="items-line">
  119. <uni-icons class="input-uni-icon" type="compose" size="18" color="coral" />
  120. <text class="button-text">维修任务</text>
  121. </view>
  122. </view>
  123. <view v-if="permission.companyAdmin || permission.companyServciePerson"
  124. class="item-button" @click="onReportClick(item.rtuCode)">
  125. <view class="items-line">
  126. <uni-icons class="input-uni-icon" type="compose" size="18" color="coral" />
  127. <text class="button-text">开始填报</text>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. </template>
  133. </uni-list-item>
  134. </uni-list>
  135. <uni-group>
  136. <view class="pagination-block">
  137. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  138. @change="pageChange" />
  139. </view>
  140. </uni-group>
  141. </view>
  142. </view>
  143. </template>
  144. <script>
  145. import {
  146. role
  147. } from "@/api/role.js";
  148. import http from '@/http/api.js';
  149. export default {
  150. components: {
  151. },
  152. onLoad(option) {
  153. if (this.userInfo.role_name === role['admin']) {
  154. this.permission.admin = true;
  155. } else if (this.userInfo.role_name === role['orgAdmin']) {
  156. this.permission.orgAdmin = true;
  157. } else if (this.userInfo.role_name === role['companyAdmin']) {
  158. this.permission.companyAdmin = true;
  159. } else if (this.userInfo.role_name === role['companyServciePerson']) {
  160. this.permission.companyServciePerson = true;
  161. }
  162. this.getRegionTree();
  163. },
  164. data() {
  165. return {
  166. title: '待巡检设备',
  167. permission: {
  168. 'admin': false,
  169. 'orgAdmin': false,
  170. 'companyAdmin': false,
  171. 'companyServciePerson': false,
  172. },
  173. countInfo: {
  174. rainKind: 0,
  175. },
  176. //planId: 0,
  177. //orgId: '',
  178. //projectId: '',
  179. list: [],
  180. pageSize: 10,
  181. // 当前页
  182. pageCurrent: 1,
  183. // 数据总量
  184. total: 0,
  185. regionTree: [],
  186. regionCode: '',
  187. selectedTreeNode: '',
  188. searchRtuNameVal: '',
  189. searchRtuCodeVal: '',
  190. query: {},
  191. inputStyles: {
  192. color: '#808080',
  193. borderColor: '#d3d3d3'
  194. }
  195. }
  196. },
  197. computed: {
  198. getIcon() {
  199. return path => {
  200. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  201. }
  202. },
  203. },
  204. onShow() {
  205. this.pageCurrent = 1;
  206. this.getPage()
  207. },
  208. methods: {
  209. toBack() {
  210. uni.navigateBack({
  211. delta: 1
  212. })
  213. },
  214. onBackPress() {
  215. // #ifdef APP-PLUS
  216. plus.key.hideSoftKeybord();
  217. // #endif
  218. },
  219. // 分页触发
  220. pageChange(e) {
  221. this.pageCurrent = e.current;
  222. this.getPage()
  223. },
  224. onTreeNodeClick(node) {
  225. console.log(JSON.stringify(node))
  226. },
  227. onTreePopupOpened(e) {
  228. console.log(JSON.stringify(e))
  229. },
  230. onTreePopupClosed(e) {
  231. console.log(JSON.stringify(e))
  232. },
  233. onTreeChange(e) {
  234. console.log(JSON.stringify(e))
  235. let nodes = e.detail.value;
  236. if (nodes.length > 0) {
  237. let node = nodes[nodes.length - 1];
  238. this.regionCode = node.value;
  239. this.query = {};
  240. this.query['adCode'] = this.regionCode;
  241. this.searchRtuNameVal = '';
  242. this.searchRtuCodeVal = '';
  243. this.pageCurrent = 1;
  244. this.getPage();
  245. //this.getCountInfo(this.regionCode);
  246. } else {
  247. this.regionCode = '';
  248. this.query = {};
  249. this.searchRtuNameVal = '';
  250. this.searchRtuCodeVal = '';
  251. this.pageCurrent = 1;
  252. this.getPage();
  253. //this.getCountInfo(this.regionCode);
  254. }
  255. },
  256. onDetailViewClick(rtuCode) {
  257. console.log("onDetailViewClick " + rtuCode)
  258. var url = '/pages/equipment-inspection/inspectionreportview?rtuCode=' + rtuCode;
  259. uni.navigateTo({
  260. url: url
  261. })
  262. },
  263. onReportClick(rtuCode) {
  264. console.log("onReportClick " + rtuCode)
  265. var url = '/pages/equipment-inspection/equipmentinspectionreport?rtuCode=' + rtuCode;
  266. uni.navigateTo({
  267. url: url
  268. })
  269. },
  270. onLocationClick(item) {
  271. if (item.lat && item.lat) {
  272. let lat = item.lat;
  273. let lng = item.lng;
  274. let name = item.rtuName;
  275. let add = '';
  276. if (item.locationDesc) {
  277. add = item.locationDesc;
  278. }
  279. uni.openLocation({
  280. latitude: Number(lat),
  281. longitude: Number(lng),
  282. name: name,
  283. address: "",
  284. success() {}
  285. })
  286. } else {
  287. uni.showModal({
  288. content: '经纬度为空,请确认!',
  289. showCancel: true,
  290. success(res) {
  291. if (res.confirm) {
  292. }
  293. }
  294. });
  295. }
  296. },
  297. onWarnInfoViewClick(rtuCode) {
  298. uni.navigateTo({
  299. url: '/pages/warning/rtuwarninglist?rtuCode=' + rtuCode
  300. })
  301. },
  302. onCheckOrderProcessClick(item) {
  303. var that = this;
  304. console.log("order id " + item.orderId)
  305. if (this.permission.admin || this.permission.orgAdmin) {
  306. let url = '/pages/check-order/orderprocessreportdetail?orderId=' + item.orderId;
  307. uni.navigateTo({
  308. url: url
  309. })
  310. } else {
  311. if (item.orderConfirm == 0) {
  312. // uni.showModal({
  313. // content: '确定接受该维修任务?',
  314. // showCancel: true,
  315. // success(res) {
  316. // if (res.confirm) {
  317. // let url =
  318. // '/pages/check-order/orderconfirm?id=' + item.orderId;
  319. // uni.navigateTo({
  320. // url: url
  321. // })
  322. // }
  323. // }
  324. // });
  325. let url =
  326. '/pages/check-order/orderconfirm?id=' + item.orderId;
  327. uni.navigateTo({
  328. url: url
  329. })
  330. } else {
  331. if (item.myOrder == 1) {
  332. uni.showModal({
  333. content: '确定继续进行维修任务填报?',
  334. showCancel: true,
  335. success(res) {
  336. if (res.confirm) {
  337. let url = '/pages/check-order/orderprocessreport?orderId=' + item.orderId;
  338. uni.navigateTo({
  339. url: url
  340. })
  341. }
  342. }
  343. });
  344. } else {
  345. let url = '/pages/check-order/orderprocessreportdetail?orderId=' + item.orderId;
  346. uni.navigateTo({
  347. url: url
  348. })
  349. }
  350. }
  351. }
  352. },
  353. // onCheckOrderReportClick(item){
  354. // console.log("order id" + item.orderId)
  355. // var url = '/pages/check-order/orderprocessreport?orderId=' + item.orderId;
  356. // uni.navigateTo({
  357. // url: url
  358. // })
  359. // },
  360. // onViewCheckOrderInfoClick(item){
  361. // let url = '/pages/check-order/orderprocessreportdetail?orderId=' + item.orderId;
  362. // uni.navigateTo({
  363. // url: url
  364. // })
  365. // },
  366. //录入查询
  367. search() {
  368. this.pageCurrent = 1;
  369. // console.log(JSON.stringify(res))
  370. let params = {};
  371. if (this.searchRtuCodeVal.length > 0) {
  372. params['rtuCode'] = this.searchRtuCodeVal;
  373. }
  374. if (this.searchRtuNameVal.length > 0) {
  375. params['rtuName'] = this.searchRtuNameVal;
  376. }
  377. this.getPage(params);
  378. },
  379. searchRtuNameValClear(e) {
  380. if (e == null || e.length == 0) {
  381. this.searchRtuNameVal = '';
  382. if (this.searchRtuNameVal.length == 0) {
  383. let params = {};
  384. if (this.searchRtuCodeVal.length > 0) {
  385. params['rtuCode'] = this.searchRtuCodeVal;
  386. }
  387. this.getPage(params);
  388. }
  389. }
  390. },
  391. searchRtuCodeValClear(e) {
  392. if (e == null || e.length == 0) {
  393. this.searchRtuCodeVal = '';
  394. if (this.searchRtuCodeVal.length == 0) {
  395. let params = {};
  396. if (this.searchRtuNameVal.length > 0) {
  397. params['rtuName'] = this.searchRtuNameVal;
  398. }
  399. this.getPage(params);
  400. }
  401. }
  402. },
  403. getCountInfo(adCode) {
  404. let that = this;
  405. http.request({
  406. url: '/galaxy-business/equipment/inspection/count',
  407. method: 'GET',
  408. data: {
  409. adCode
  410. }
  411. }).then(res => {
  412. that.countInfo = res.data;
  413. })
  414. },
  415. getRegionTree() {
  416. var that = this;
  417. http.request({
  418. url: '/galaxy-business/baseinfo/region/tree',
  419. method: 'GET',
  420. }).then(res => {
  421. if (res.data != null) {
  422. that.regionTree = res.data;
  423. that.selectedTreeNode = that.regionTree[0].value;
  424. that.regionCode = that.regionTree[0].value;
  425. that.query = {};
  426. that.query['adCode'] = that.regionCode;
  427. //that.orgId = that.projectTree[0].orgId;
  428. //that.projectId = that.projectTree[0].projectId;
  429. that.getPage();
  430. that.getCountInfo(that.regionCode);
  431. }
  432. }).catch(err => {
  433. console.log(err)
  434. })
  435. },
  436. getSiteKind(val) {
  437. let htmltext = '';
  438. if (val.isRain === 1) {
  439. htmltext = htmltext + "雨量站";
  440. }
  441. if (val.isRiver == 1 || val.isRes == 1) {
  442. if (htmltext.length > 0) {
  443. htmltext = htmltext + ' / ';
  444. }
  445. htmltext = htmltext + '水位站';
  446. }
  447. if (val.isGround == 1) {
  448. if (htmltext.length > 0) {
  449. htmltext = htmltext + ' / ';
  450. }
  451. htmltext = htmltext + '墒情站';
  452. }
  453. if (val.isVideo == 1) {
  454. if (htmltext.length > 0) {
  455. htmltext = htmltext + ' / ';
  456. }
  457. htmltext = htmltext + '视频站';
  458. }
  459. return htmltext;
  460. },
  461. getAreaName(item) {
  462. let htmltext = '';
  463. if (item.adCity) {
  464. htmltext = htmltext + item.adCity;
  465. }
  466. if (item.adDist) {
  467. if (htmltext.length > 0) {
  468. htmltext = htmltext + ' / ';
  469. }
  470. htmltext = htmltext + item.adDist;
  471. }
  472. return htmltext;
  473. },
  474. getPage(params = {}) {
  475. let that = this;
  476. const current = this.pageCurrent;
  477. const size = this.pageSize;
  478. let postData = Object.assign(params, this.query);
  479. http.request({
  480. url: '/galaxy-business/equipment/inspection/rtu/page',
  481. method: 'GET',
  482. params: {
  483. current,
  484. size,
  485. },
  486. data: postData,
  487. }).then(res => {
  488. if (res.data != null) {
  489. //console.log(JSON.stringify(res.data))
  490. if (res.data.records != null) {
  491. that.list = res.data.records;
  492. }
  493. this.total = res.data.total;
  494. }
  495. }).catch(err => {
  496. console.log(err)
  497. })
  498. },
  499. }
  500. }
  501. </script>
  502. <style>
  503. /* page {
  504. background-color: rgb(240, 242, 244);
  505. } */
  506. </style>
  507. <style lang="scss" scoped>
  508. .line {
  509. display: flex;
  510. flex-direction: column;
  511. justify-content: flex-start;
  512. }
  513. .line .lineText {
  514. margin-left: 10px;
  515. margin-right: 0px;
  516. display: flex;
  517. flex-direction: row;
  518. justify-content: flex-start;
  519. }
  520. .line .lineText .inspectionCount {
  521. color: dodgerblue;
  522. font-size: 0.7rem;
  523. }
  524. .line .lineText .content {
  525. margin-left: 10px;
  526. color: gray;
  527. font-size: 0.7rem;
  528. }
  529. .line .lineText .beforeRainInspectionCount {
  530. color: darkorange;
  531. font-size: 0.7rem;
  532. }
  533. .line .lineText .rainFirstInspectionCount {
  534. color: lightcoral;
  535. font-size: 0.7rem;
  536. }
  537. .line .lineText .rainSencodInspectionCount {
  538. color: darkcyan;
  539. font-size: 0.7rem;
  540. }
  541. </style>