inspection-manage.vue 12 KB

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