inspection-manage.vue 14 KB

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