finishedinspectionreportlist.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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-list>
  19. <uni-list-item v-for="item in list" :key="item.id">
  20. <template v-slot:body>
  21. <view class="list-item-block">
  22. <view class="items-line">
  23. <image class="item-title-run-status-icon" style="box-shadow:0 0 2px 2px lightblue"
  24. src="/static/images/list/inspection_item.png" mode="widthFix">
  25. </image>
  26. <text class="item-title-rtu-name">{{item.rtuName}}</text>
  27. <text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
  28. </view>
  29. <view class="items-line">
  30. <uni-icons class="input-uni-icon" type="auth" size="18" color="lightblue" />
  31. <text class="item-text-lable">填报人:</text>
  32. <text v-if="rainSeasonKind ==1"
  33. class="item-text-content">{{item.beforeRainSeasonReportUserName}}</text>
  34. <text v-else-if="rainSeasonKind ==2"
  35. class="item-text-content">{{item.rainSeasonFirstReportUserName}}</text>
  36. <text v-else-if="rainSeasonKind ==3"
  37. class="item-text-content">{{item.rainSeasonSecondReportUserName}}</text>
  38. </view>
  39. <view class="items-line">
  40. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  41. <text class="item-text-lable">填报时间:</text>
  42. <text v-if="rainSeasonKind ==1"
  43. class="item-text-content">{{item.beforeRainSeasonReportTime}}</text>
  44. <text v-else-if="rainSeasonKind ==2"
  45. class="item-text-content">{{item.rainSeasonFirstReportTime}}</text>
  46. <text v-else-if="rainSeasonKind ==3"
  47. class="item-text-content">{{item.rainSeasonSecondReportTime}}</text>
  48. </view>
  49. <view class="item-button-group">
  50. <view v-if="rainSeasonKind ==1" class="item-button" style="width: 120px;"
  51. @click="onBeforeRainDetailViewClick(item.beforeRainSeasonReportId)">
  52. <view class="items-line">
  53. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  54. <text class="button-text">巡检填报详情</text>
  55. </view>
  56. </view>
  57. <view v-if="rainSeasonKind ==2" class="item-button" style="width: 120px;"
  58. @click="onRainFirstDetailViewClick(item.rainSeasonFirstReportId)">
  59. <view class="items-line">
  60. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  61. <text class="button-text">巡检填报详情</text>
  62. </view>
  63. </view>
  64. <view v-if="rainSeasonKind ==3" class="item-button" style="width: 120px;"
  65. @click="onRainSencodDetailViewClick(item.rainSeasonSecondReportId)">
  66. <view class="items-line">
  67. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  68. <text class="button-text">巡检填报详情</text>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. </uni-list-item>
  75. </uni-list>
  76. <uni-group>
  77. <view class="pagination-block">
  78. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  79. @change="pageChange" />
  80. </view>
  81. </uni-group>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. import {
  87. role
  88. } from "@/api/role.js";
  89. import http from '@/http/api.js';
  90. export default {
  91. components: {
  92. },
  93. onLoad(option) {
  94. if (this.userInfo.role_name === role['admin']) {
  95. this.permission.admin = true;
  96. } else if (this.userInfo.role_name === role['orgAdmin']) {
  97. this.permission.orgAdmin = true;
  98. } else if (this.userInfo.role_name === role['companyAdmin']) {
  99. this.permission.companyAdmin = true;
  100. } else if (this.userInfo.role_name === role['companyServciePerson']) {
  101. this.permission.companyServciePerson = true;
  102. }
  103. this.rainSeasonKind = option.rainSeasonKind;
  104. if (this.rainSeasonKind == 1) {
  105. this.title = '汛前已巡检设备信息';
  106. } else if (this.rainSeasonKind == 2) {
  107. this.title = '汛中(一)已巡检设备信息';
  108. } else if (this.rainSeasonKind == 3) {
  109. this.title = '汛中(二)已巡检设备信息';
  110. }
  111. this.getPage();
  112. },
  113. data() {
  114. return {
  115. rainSeasonKind: 0,
  116. title: '汛前已巡检设备信息',
  117. permission: {
  118. 'admin': false,
  119. 'orgAdmin': false,
  120. 'companyAdmin': false,
  121. 'companyServciePerson': false,
  122. },
  123. countInfo: {
  124. rainKind: 0,
  125. },
  126. list: [],
  127. pageSize: 10,
  128. // 当前页
  129. pageCurrent: 1,
  130. // 数据总量
  131. total: 0,
  132. regionTree: [],
  133. regionCode: '',
  134. selectedTreeNode: '',
  135. searchRtuNameVal: '',
  136. searchRtuCodeVal: '',
  137. query: {},
  138. inputStyles: {
  139. color: '#808080',
  140. borderColor: '#d3d3d3'
  141. }
  142. }
  143. },
  144. computed: {
  145. },
  146. onShow() {
  147. },
  148. methods: {
  149. toBack() {
  150. uni.navigateBack({
  151. delta: 1
  152. })
  153. },
  154. onBackPress() {
  155. // #ifdef APP-PLUS
  156. plus.key.hideSoftKeybord();
  157. // #endif
  158. },
  159. // 分页触发
  160. pageChange(e) {
  161. this.pageCurrent = e.current;
  162. this.getPage()
  163. },
  164. onTreeNodeClick(node) {
  165. console.log(JSON.stringify(node))
  166. },
  167. onTreePopupOpened(e) {
  168. console.log(JSON.stringify(e))
  169. },
  170. onTreePopupClosed(e) {
  171. console.log(JSON.stringify(e))
  172. },
  173. onTreeChange(e) {
  174. console.log(JSON.stringify(e))
  175. let nodes = e.detail.value;
  176. if (nodes.length > 0) {
  177. let node = nodes[nodes.length - 1];
  178. this.regionCode = node.value;
  179. this.query = {};
  180. this.query['adCode'] = this.regionCode;
  181. this.searchRtuNameVal = '';
  182. this.searchRtuCodeVal = '';
  183. this.pageCurrent = 1;
  184. this.getPage();
  185. this.getCountInfo(this.regionCode);
  186. } else {
  187. this.regionCode = '';
  188. this.query = {};
  189. this.searchRtuNameVal = '';
  190. this.searchRtuCodeVal = '';
  191. this.pageCurrent = 1;
  192. this.getPage();
  193. this.getCountInfo(this.regionCode);
  194. }
  195. },
  196. onBeforeRainDetailViewClick(id) {
  197. console.log("onDetailViewClick " + id)
  198. var url = '/pages/equipment-inspection/inspectionreportview?type=1&id=' + id;
  199. uni.navigateTo({
  200. url: url
  201. })
  202. },
  203. onRainFirstDetailViewClick(id) {
  204. console.log("onDetailViewClick " + id)
  205. var url = '/pages/equipment-inspection/inspectionreportview?type=2&id=' + id;
  206. uni.navigateTo({
  207. url: url
  208. })
  209. },
  210. onRainSencodDetailViewClick(id) {
  211. console.log("onDetailViewClick " + id)
  212. var url = '/pages/equipment-inspection/inspectionreportview?type=3&id=' + id;
  213. uni.navigateTo({
  214. url: url
  215. })
  216. },
  217. //录入查询
  218. search() {
  219. this.pageCurrent = 1;
  220. // console.log(JSON.stringify(res))
  221. let params = {};
  222. if (this.searchRtuCodeVal.length > 0) {
  223. params['rtuCode'] = this.searchRtuCodeVal;
  224. }
  225. if (this.searchRtuNameVal.length > 0) {
  226. params['rtuName'] = this.searchRtuNameVal;
  227. }
  228. this.getPage(params);
  229. },
  230. searchRtuNameValClear(e) {
  231. if (e == null || e.length == 0) {
  232. this.searchRtuNameVal = '';
  233. if (this.searchRtuNameVal.length == 0) {
  234. let params = {};
  235. if (this.searchRtuCodeVal.length > 0) {
  236. params['rtuCode'] = this.searchRtuCodeVal;
  237. }
  238. this.getPage(params);
  239. }
  240. }
  241. },
  242. searchRtuCodeValClear(e) {
  243. if (e == null || e.length == 0) {
  244. this.searchRtuCodeVal = '';
  245. if (this.searchRtuCodeVal.length == 0) {
  246. let params = {};
  247. if (this.searchRtuNameVal.length > 0) {
  248. params['rtuName'] = this.searchRtuNameVal;
  249. }
  250. this.getPage(params);
  251. }
  252. }
  253. },
  254. getCountInfo(adCode) {
  255. let that = this;
  256. http.request({
  257. url: '/galaxy-business/equipment/inspection/count',
  258. method: 'GET',
  259. data: {
  260. adCode
  261. }
  262. }).then(res => {
  263. that.countInfo = res.data;
  264. })
  265. },
  266. getRegionTree() {
  267. var that = this;
  268. http.request({
  269. url: '/galaxy-business/baseinfo/region/tree',
  270. method: 'GET',
  271. }).then(res => {
  272. if (res.data != null) {
  273. that.regionTree = res.data;
  274. that.selectedTreeNode = that.regionTree[0].value;
  275. that.regionCode = that.regionTree[0].value;
  276. that.query = {};
  277. that.query['adCode'] = that.regionCode;
  278. //that.orgId = that.projectTree[0].orgId;
  279. //that.projectId = that.projectTree[0].projectId;
  280. that.getPage();
  281. that.getCountInfo(that.regionCode);
  282. }
  283. }).catch(err => {
  284. console.log(err)
  285. })
  286. },
  287. getPage(params = {}) {
  288. let that = this;
  289. const current = this.pageCurrent;
  290. const size = this.pageSize;
  291. params['rainSeasonKind'] = this.rainSeasonKind;
  292. let postData = Object.assign(params, this.query);
  293. http.request({
  294. url: '/galaxy-business/equipment/inspection/rain/page',
  295. method: 'GET',
  296. params: {
  297. current,
  298. size,
  299. },
  300. data: postData,
  301. }).then(res => {
  302. if (res.data != null) {
  303. if (res.data.records != null) {
  304. that.list = res.data.records;
  305. }
  306. this.total = res.data.total;
  307. }
  308. }).catch(err => {
  309. console.log(err)
  310. })
  311. },
  312. }
  313. }
  314. </script>
  315. <style>
  316. /* page {
  317. background-color: rgb(240, 242, 244);
  318. } */
  319. </style>
  320. <style lang="scss" scoped>
  321. </style>