inspection-report-list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  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.inspectionTitle}}</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;">{{item.inspectionDate}}</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. this.planId = option.planId;
  180. // if (this.userInfo.role_name === role['admin']) {
  181. // this.permission.admin = true;
  182. // } else if (this.userInfo.role_name === role['orgAdmin']) {
  183. // this.permission.orgAdmin = true;
  184. // } else if (this.userInfo.role_name === role['companyAdmin']) {
  185. // this.permission.companyAdmin = true;
  186. // } else if (this.userInfo.role_name === role['companyServciePerson']) {
  187. // this.permission.companyServciePerson = true;
  188. // }
  189. // this.getRegionTree();
  190. this.getPage();
  191. },
  192. data() {
  193. return {
  194. title: '巡检填报信息',
  195. planId:'',
  196. permission: {
  197. 'admin': false,
  198. 'orgAdmin': false,
  199. 'companyAdmin': false,
  200. 'companyServciePerson': false,
  201. },
  202. countItems: [{
  203. 'value': 0,
  204. 'text': '全部'
  205. }, {
  206. 'value': 1,
  207. 'text': '汛前巡检'
  208. }, {
  209. 'value': 2,
  210. 'text': '汛中(一)巡检'
  211. }, {
  212. 'value': 3,
  213. 'text': '汛中(二)巡检'
  214. }],
  215. countOption: 0,
  216. countInfo: {
  217. rainKind: 0,
  218. },
  219. list: [],
  220. pageSize: 10,
  221. // 当前页
  222. pageCurrent: 1,
  223. // 数据总量
  224. total: 0,
  225. regionTree: [],
  226. regionCode: '',
  227. selectedTreeNode: '',
  228. searchRtuNameVal: '',
  229. searchRtuCodeVal: '',
  230. query: {},
  231. inputStyles: {
  232. color: '#808080',
  233. borderColor: '#d3d3d3'
  234. }
  235. }
  236. },
  237. computed: {},
  238. onShow() {},
  239. methods: {
  240. toBack() {
  241. uni.navigateBack({
  242. delta: 1
  243. })
  244. },
  245. onBackPress() {
  246. // #ifdef APP-PLUS
  247. plus.key.hideSoftKeybord();
  248. // #endif
  249. },
  250. // 分页触发
  251. pageChange(e) {
  252. this.pageCurrent = e.current;
  253. this.getPage()
  254. },
  255. onTreeNodeClick(node) {
  256. console.log(JSON.stringify(node))
  257. },
  258. onTreePopupOpened(e) {
  259. console.log(JSON.stringify(e))
  260. },
  261. onTreePopupClosed(e) {
  262. console.log(JSON.stringify(e))
  263. },
  264. onTreeChange(e) {
  265. console.log(JSON.stringify(e))
  266. let nodes = e.detail.value;
  267. if (nodes.length > 0) {
  268. let node = nodes[nodes.length - 1];
  269. this.regionCode = node.value;
  270. this.query = {};
  271. this.query['adCode'] = this.regionCode;
  272. this.searchRtuNameVal = '';
  273. this.searchRtuCodeVal = '';
  274. this.pageCurrent = 1;
  275. this.getPage();
  276. this.getCountInfo(this.regionCode);
  277. } else {
  278. this.regionCode = '';
  279. this.query = {};
  280. this.searchRtuNameVal = '';
  281. this.searchRtuCodeVal = '';
  282. this.pageCurrent = 1;
  283. this.getPage();
  284. this.getCountInfo(this.regionCode);
  285. }
  286. },
  287. onBeforeRainDetailViewClick(id) {
  288. console.log("onDetailViewClick " + id)
  289. var url = '/pages/equipment-inspection/inspectionreportview?type=1&id=' + id;
  290. uni.navigateTo({
  291. url: url
  292. })
  293. },
  294. onRainFirstDetailViewClick(id) {
  295. console.log("onDetailViewClick " + id)
  296. var url = '/pages/equipment-inspection/inspectionreportview?type=2&id=' + id;
  297. uni.navigateTo({
  298. url: url
  299. })
  300. },
  301. onRainSencodDetailViewClick(id) {
  302. console.log("onDetailViewClick " + id)
  303. var url = '/pages/equipment-inspection/inspectionreportview?type=3&id=' + id;
  304. uni.navigateTo({
  305. url: url
  306. })
  307. },
  308. //录入查询
  309. search() {
  310. this.pageCurrent = 1;
  311. let params = {};
  312. if (this.searchRtuCodeVal.length > 0) {
  313. params['rtuCode'] = this.searchRtuCodeVal;
  314. }
  315. if (this.searchRtuNameVal.length > 0) {
  316. params['rtuName'] = this.searchRtuNameVal;
  317. }
  318. this.getPage(params);
  319. },
  320. searchRtuNameValClear(e) {
  321. if (e == null || e.length == 0) {
  322. this.searchRtuNameVal = '';
  323. if (this.searchRtuNameVal.length == 0) {
  324. let params = {};
  325. if (this.searchRtuCodeVal.length > 0) {
  326. params['rtuCode'] = this.searchRtuCodeVal;
  327. }
  328. this.getPage(params);
  329. }
  330. }
  331. },
  332. searchRtuCodeValClear(e) {
  333. if (e == null || e.length == 0) {
  334. this.searchRtuCodeVal = '';
  335. if (this.searchRtuCodeVal.length == 0) {
  336. let params = {};
  337. if (this.searchRtuNameVal.length > 0) {
  338. params['rtuName'] = this.searchRtuNameVal;
  339. }
  340. this.getPage(params);
  341. }
  342. }
  343. },
  344. countOptionChange: function(evt) {
  345. //console.log("sensor" + JSON.stringify(evt))
  346. let params = {};
  347. // if (this.countOption == 0) {
  348. // } else if (this.countOption == 1) {
  349. // params['rainSeasonKind'] = 1;
  350. // } else if (this.countOption == 2) {
  351. // params['rainSeasonKind'] = 2;
  352. // } else if (this.countOption == 3) {
  353. // params['rainSeasonKind'] = 3;
  354. // }
  355. this.pageCurrent=1;
  356. this.getPage(params);
  357. },
  358. getCountInfo(adCode) {
  359. let that = this;
  360. http.request({
  361. url: '/galaxy-business/equipment/inspection/count',
  362. method: 'GET',
  363. data: {
  364. adCode
  365. }
  366. }).then(res => {
  367. that.countInfo = res.data;
  368. })
  369. },
  370. getRegionTree() {
  371. var that = this;
  372. http.request({
  373. url: '/galaxy-business/baseinfo/region/tree',
  374. method: 'GET',
  375. }).then(res => {
  376. if (res.data != null) {
  377. that.regionTree = res.data;
  378. that.selectedTreeNode = that.regionTree[0].value;
  379. that.regionCode = that.regionTree[0].value;
  380. that.query = {};
  381. that.query['adCode'] = that.regionCode;
  382. //that.orgId = that.projectTree[0].orgId;
  383. //that.projectId = that.projectTree[0].projectId;
  384. that.getPage();
  385. that.getCountInfo(that.regionCode);
  386. }
  387. }).catch(err => {
  388. console.log(err)
  389. })
  390. },
  391. getPage(params = {}) {
  392. let that = this;
  393. const current = this.pageCurrent;
  394. const size = this.pageSize;
  395. // if (this.countOption == 0) {
  396. // } else if (this.countOption == 1) {
  397. params['inspectionPlanId'] = this.planId;
  398. // } else if (this.countOption == 2) {
  399. // params['rainSeasonKind'] = 2;
  400. // } else if (this.countOption == 3) {
  401. // params['rainSeasonKind'] = 3;
  402. // }
  403. let postData = Object.assign(params, this.query);
  404. http.request({
  405. url: '/galaxy-business/equipment/inspection/page',
  406. method: 'GET',
  407. params: {
  408. current,
  409. size,
  410. },
  411. data: postData,
  412. }).then(res => {
  413. if (res.data != null) {
  414. if (res.data.records != null) {
  415. that.list = res.data.records;
  416. }
  417. this.total = res.data.total;
  418. }
  419. }).catch(err => {
  420. console.log(err)
  421. })
  422. },
  423. }
  424. }
  425. </script>
  426. <style>
  427. /* page {
  428. background-color: rgb(240, 242, 244);
  429. } */
  430. </style>
  431. <style lang="scss" scoped>
  432. .line {
  433. display: flex;
  434. flex-direction: column;
  435. justify-content: flex-start;
  436. }
  437. .line .lineText {
  438. margin-left: 10px;
  439. margin-right: 0px;
  440. display: flex;
  441. flex-direction: row;
  442. justify-content: flex-start;
  443. }
  444. .line .lineText .inspectionCount {
  445. color: dodgerblue;
  446. font-size: 0.7rem;
  447. }
  448. .line .lineText .content {
  449. margin-left: 10px;
  450. color: gray;
  451. font-size: 0.7rem;
  452. }
  453. .line .lineText .beforeRainInspectionCount {
  454. color: dodgerblue;
  455. font-size: 0.7rem;
  456. }
  457. .line .lineText .rainFirstInspectionCount {
  458. color: dodgerblue;
  459. font-size: 0.7rem;
  460. }
  461. .line .lineText .rainSencodInspectionCount {
  462. color: dodgerblue;
  463. font-size: 0.7rem;
  464. }
  465. </style>