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