inspectionreportlist.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  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 style="margin-top: 5px;padding-left: 10px;padding-right: 10px;margin-bottom: 5px;">
  42. <view class="line">
  43. <view class="lineText">
  44. <text class="inspectionCount">当前汛期: </text>
  45. <text v-if="countInfo.rainKind==1" class="content">汛前巡检</text>
  46. <text v-else-if="countInfo.rainKind==2" class="content">汛中(一)巡检</text>
  47. <text v-else-if="countInfo.rainKind==3" class="content">汛中(二)巡检</text>
  48. <text v-else class="content">--</text>
  49. </view>
  50. <view class="lineText">
  51. <text class="beforeRainInspectionCount">巡检设备总数量: </text>
  52. <text class="content">{{ countInfo.rtus }}</text>
  53. </view>
  54. <view class="lineText">
  55. <text class="rainSencodInspectionCount">汛前已巡检数量: </text>
  56. <text class="content">{{ countInfo.beforeRainInspectionCount }}</text>
  57. </view>
  58. <view class="lineText">
  59. <text class="rainSencodInspectionCount">汛中(一)已巡检数量: </text>
  60. <text class="content">{{ countInfo.firstRainInspectionCount }}</text>
  61. </view>
  62. <view class="lineText">
  63. <text class="rainSencodInspectionCount">汛中(二)已巡检数量: </text>
  64. <text class="content">{{ countInfo.sencodRainInspectionCount }}</text>
  65. </view>
  66. <view style="margin-top: 5px;">
  67. <uni-data-checkbox v-model="countOption" :localdata="countItems" @change="countOptionChange">
  68. </uni-data-checkbox>
  69. </view>
  70. </view>
  71. </view>
  72. <uni-list>
  73. <uni-list-item v-for="item in list" :key="item.id">
  74. <template v-slot:body>
  75. <view class="list-item-block">
  76. <view class="items-line">
  77. <image class="item-title-run-status-icon" style="box-shadow:0 0 2px 2px lightblue"
  78. src="/static/images/list/inspection_item.png" mode="widthFix">
  79. </image>
  80. <text class="item-title-rtu-name">{{item.rtuName}}</text>
  81. <text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
  82. </view>
  83. <view class="items-line">
  84. <uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
  85. <text class="item-text-lable">汛前填报:</text>
  86. <view v-if="item.beforeRainSeasonStatus ==1">
  87. <text class="item-text-content" style="color:dodgerblue;">已填报</text>
  88. <text class="item-text-content" style="color:gray;">/</text>
  89. <text class="item-text-content"
  90. style="color:gray;">{{item.beforeRainSeasonReportTime}}</text>
  91. </view>
  92. <text v-else class="item-text-content" style="color:darkorange;">未填报</text>
  93. </view>
  94. <view class="items-line">
  95. <uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
  96. <text class="item-text-lable">汛中(一)填报:</text>
  97. <view v-if="item.rainSeasonFirstStatus ==1">
  98. <text class="item-text-content" style="color:dodgerblue;">已填报</text>
  99. <text class="item-text-content" style="color:gray;">/</text>
  100. <text class="item-text-content"
  101. style="color:gray;">{{item.rainSeasonFirstReportTime}}</text>
  102. </view>
  103. <text v-else class="item-text-content" style="color:darkorange;">未填报</text>
  104. </view>
  105. <view class="items-line">
  106. <uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
  107. <text class="item-text-lable">汛中(二)填报:</text>
  108. <view v-if="item.rainSeasonSecondStatus ==1">
  109. <text class="item-text-content" style="color:dodgerblue;">已填报</text>
  110. <text class="item-text-content" style="color:gray;">/</text>
  111. <text class="item-text-content"
  112. style="color:gray;">{{item.rainSeasonSecondReportTime}}</text>
  113. </view>
  114. <text v-else class="item-text-content" style="color:darkorange;">未填报</text>
  115. </view>
  116. <view class="item-button-group">
  117. <view v-if="item.beforeRainSeasonStatus ==1" class="item-button" style="width: 120px;"
  118. @click="onBeforeRainDetailViewClick(item.beforeRainSeasonReportId)">
  119. <view class="items-line">
  120. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  121. <text class="button-text">汛前详情</text>
  122. </view>
  123. </view>
  124. <view v-else class="item-button-disabled" style="width: 120px;">
  125. <view class="items-line">
  126. <uni-icons class="input-uni-icon" type="info" size="18" color="gray" />
  127. <text class="button-text">汛前详情</text>
  128. </view>
  129. </view>
  130. <view v-if="item.rainSeasonFirstStatus ==1" class="item-button" style="width: 120px;"
  131. @click="onRainFirstDetailViewClick(item.rainSeasonFirstReportId)">
  132. <view class="items-line">
  133. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  134. <text class="button-text">汛中(一)详情</text>
  135. </view>
  136. </view>
  137. <view v-else class="item-button-disabled" style="width: 120px;">
  138. <view class="items-line">
  139. <uni-icons class="input-uni-icon" type="info" size="18" color="gray" />
  140. <text class="button-text">汛中(一)详情</text>
  141. </view>
  142. </view>
  143. <view v-if="item.rainSeasonSecondStatus ==1" class="item-button" style="width: 120px;"
  144. @click="onRainSencodDetailViewClick(item.rainSeasonSecondReportId)">
  145. <view class="items-line">
  146. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  147. <text class="button-text">汛中(二)详情</text>
  148. </view>
  149. </view>
  150. <view v-else class="item-button-disabled" style="width: 120px;">
  151. <view class="items-line">
  152. <uni-icons class="input-uni-icon" type="info" size="18" color="gray" />
  153. <text class="button-text">汛中(二)详情</text>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. </template>
  159. </uni-list-item>
  160. </uni-list>
  161. <uni-group>
  162. <view class="pagination-block">
  163. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  164. @change="pageChange" />
  165. </view>
  166. </uni-group>
  167. </view>
  168. </view>
  169. </template>
  170. <script>
  171. import {
  172. role
  173. } from "@/api/role.js";
  174. import http from '@/http/api.js';
  175. export default {
  176. components: {
  177. },
  178. onLoad(option) {
  179. if (this.userInfo.role_name === role['admin']) {
  180. this.permission.admin = true;
  181. } else if (this.userInfo.role_name === role['orgAdmin']) {
  182. this.permission.orgAdmin = true;
  183. } else if (this.userInfo.role_name === role['companyAdmin']) {
  184. this.permission.companyAdmin = true;
  185. } else if (this.userInfo.role_name === role['companyServciePerson']) {
  186. this.permission.companyServciePerson = true;
  187. }
  188. this.getRegionTree();
  189. },
  190. data() {
  191. return {
  192. title: '设备巡检填报信息',
  193. permission: {
  194. 'admin': false,
  195. 'orgAdmin': false,
  196. 'companyAdmin': false,
  197. 'companyServciePerson': false,
  198. },
  199. countItems: [{
  200. 'value': 0,
  201. 'text': '全部'
  202. }, {
  203. 'value': 1,
  204. 'text': '汛前巡检'
  205. }, {
  206. 'value': 2,
  207. 'text': '汛中(一)巡检'
  208. }, {
  209. 'value': 3,
  210. 'text': '汛中(二)巡检'
  211. }],
  212. countOption: 0,
  213. countInfo: {
  214. rainKind: 0,
  215. },
  216. list: [],
  217. pageSize: 10,
  218. // 当前页
  219. pageCurrent: 1,
  220. // 数据总量
  221. total: 0,
  222. regionTree: [],
  223. regionCode: '',
  224. selectedTreeNode: '',
  225. searchRtuNameVal: '',
  226. searchRtuCodeVal: '',
  227. query: {},
  228. inputStyles: {
  229. color: '#808080',
  230. borderColor: '#d3d3d3'
  231. }
  232. }
  233. },
  234. computed: {},
  235. onShow() {},
  236. methods: {
  237. toBack() {
  238. uni.navigateBack({
  239. delta: 1
  240. })
  241. },
  242. onBackPress() {
  243. // #ifdef APP-PLUS
  244. plus.key.hideSoftKeybord();
  245. // #endif
  246. },
  247. // 分页触发
  248. pageChange(e) {
  249. this.pageCurrent = e.current;
  250. this.getPage()
  251. },
  252. onTreeNodeClick(node) {
  253. console.log(JSON.stringify(node))
  254. },
  255. onTreePopupOpened(e) {
  256. console.log(JSON.stringify(e))
  257. },
  258. onTreePopupClosed(e) {
  259. console.log(JSON.stringify(e))
  260. },
  261. onTreeChange(e) {
  262. console.log(JSON.stringify(e))
  263. let nodes = e.detail.value;
  264. if (nodes.length > 0) {
  265. let node = nodes[nodes.length - 1];
  266. this.regionCode = node.value;
  267. this.query = {};
  268. this.query['adCode'] = this.regionCode;
  269. this.searchRtuNameVal = '';
  270. this.searchRtuCodeVal = '';
  271. this.pageCurrent = 1;
  272. this.getPage();
  273. this.getCountInfo(this.regionCode);
  274. } else {
  275. this.regionCode = '';
  276. this.query = {};
  277. this.searchRtuNameVal = '';
  278. this.searchRtuCodeVal = '';
  279. this.pageCurrent = 1;
  280. this.getPage();
  281. this.getCountInfo(this.regionCode);
  282. }
  283. },
  284. onBeforeRainDetailViewClick(id) {
  285. console.log("onDetailViewClick " + id)
  286. var url = '/pages/equipment-inspection/inspectionreportview?type=1&id=' + id;
  287. uni.navigateTo({
  288. url: url
  289. })
  290. },
  291. onRainFirstDetailViewClick(id) {
  292. console.log("onDetailViewClick " + id)
  293. var url = '/pages/equipment-inspection/inspectionreportview?type=2&id=' + id;
  294. uni.navigateTo({
  295. url: url
  296. })
  297. },
  298. onRainSencodDetailViewClick(id) {
  299. console.log("onDetailViewClick " + id)
  300. var url = '/pages/equipment-inspection/inspectionreportview?type=3&id=' + id;
  301. uni.navigateTo({
  302. url: url
  303. })
  304. },
  305. //录入查询
  306. search() {
  307. this.pageCurrent = 1;
  308. let params = {};
  309. if (this.searchRtuCodeVal.length > 0) {
  310. params['rtuCode'] = this.searchRtuCodeVal;
  311. }
  312. if (this.searchRtuNameVal.length > 0) {
  313. params['rtuName'] = this.searchRtuNameVal;
  314. }
  315. this.getPage(params);
  316. },
  317. searchRtuNameValClear(e) {
  318. if (e == null || e.length == 0) {
  319. this.searchRtuNameVal = '';
  320. if (this.searchRtuNameVal.length == 0) {
  321. let params = {};
  322. if (this.searchRtuCodeVal.length > 0) {
  323. params['rtuCode'] = this.searchRtuCodeVal;
  324. }
  325. this.getPage(params);
  326. }
  327. }
  328. },
  329. searchRtuCodeValClear(e) {
  330. if (e == null || e.length == 0) {
  331. this.searchRtuCodeVal = '';
  332. if (this.searchRtuCodeVal.length == 0) {
  333. let params = {};
  334. if (this.searchRtuNameVal.length > 0) {
  335. params['rtuName'] = this.searchRtuNameVal;
  336. }
  337. this.getPage(params);
  338. }
  339. }
  340. },
  341. countOptionChange: function(evt) {
  342. //console.log("sensor" + JSON.stringify(evt))
  343. let params = {};
  344. // if (this.countOption == 0) {
  345. // } else if (this.countOption == 1) {
  346. // params['rainSeasonKind'] = 1;
  347. // } else if (this.countOption == 2) {
  348. // params['rainSeasonKind'] = 2;
  349. // } else if (this.countOption == 3) {
  350. // params['rainSeasonKind'] = 3;
  351. // }
  352. this.pageCurrent=1;
  353. this.getPage(params);
  354. },
  355. getCountInfo(adCode) {
  356. let that = this;
  357. http.request({
  358. url: '/galaxy-business/equipment/inspection/count',
  359. method: 'GET',
  360. data: {
  361. adCode
  362. }
  363. }).then(res => {
  364. that.countInfo = res.data;
  365. })
  366. },
  367. getRegionTree() {
  368. var that = this;
  369. http.request({
  370. url: '/galaxy-business/baseinfo/region/tree',
  371. method: 'GET',
  372. }).then(res => {
  373. if (res.data != null) {
  374. that.regionTree = res.data;
  375. that.selectedTreeNode = that.regionTree[0].value;
  376. that.regionCode = that.regionTree[0].value;
  377. that.query = {};
  378. that.query['adCode'] = that.regionCode;
  379. //that.orgId = that.projectTree[0].orgId;
  380. //that.projectId = that.projectTree[0].projectId;
  381. that.getPage();
  382. that.getCountInfo(that.regionCode);
  383. }
  384. }).catch(err => {
  385. console.log(err)
  386. })
  387. },
  388. getPage(params = {}) {
  389. let that = this;
  390. const current = this.pageCurrent;
  391. const size = this.pageSize;
  392. if (this.countOption == 0) {
  393. } else if (this.countOption == 1) {
  394. params['rainSeasonKind'] = 1;
  395. } else if (this.countOption == 2) {
  396. params['rainSeasonKind'] = 2;
  397. } else if (this.countOption == 3) {
  398. params['rainSeasonKind'] = 3;
  399. }
  400. let postData = Object.assign(params, this.query);
  401. http.request({
  402. url: '/galaxy-business/equipment/inspection/rain/page',
  403. method: 'GET',
  404. params: {
  405. current,
  406. size,
  407. },
  408. data: postData,
  409. }).then(res => {
  410. if (res.data != null) {
  411. if (res.data.records != null) {
  412. that.list = res.data.records;
  413. }
  414. this.total = res.data.total;
  415. }
  416. }).catch(err => {
  417. console.log(err)
  418. })
  419. },
  420. }
  421. }
  422. </script>
  423. <style>
  424. /* page {
  425. background-color: rgb(240, 242, 244);
  426. } */
  427. </style>
  428. <style lang="scss" scoped>
  429. .line {
  430. display: flex;
  431. flex-direction: column;
  432. justify-content: flex-start;
  433. }
  434. .line .lineText {
  435. margin-left: 10px;
  436. margin-right: 0px;
  437. display: flex;
  438. flex-direction: row;
  439. justify-content: flex-start;
  440. }
  441. .line .lineText .inspectionCount {
  442. color: dodgerblue;
  443. font-size: 0.7rem;
  444. }
  445. .line .lineText .content {
  446. margin-left: 10px;
  447. color: gray;
  448. font-size: 0.7rem;
  449. }
  450. .line .lineText .beforeRainInspectionCount {
  451. color: dodgerblue;
  452. font-size: 0.7rem;
  453. }
  454. .line .lineText .rainFirstInspectionCount {
  455. color: dodgerblue;
  456. font-size: 0.7rem;
  457. }
  458. .line .lineText .rainSencodInspectionCount {
  459. color: dodgerblue;
  460. font-size: 0.7rem;
  461. }
  462. </style>