companyfinishedinspectionreportlist.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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 v-if="rainSeasonKind==0" style="margin-top: 2px;">
  30. <view class="items-line">
  31. <text v-if="item.beforeRainSeasonStatus ==1"
  32. class="item-text-content">汛前:{{item.beforeRainSeasonReportUserName}}/{{item.beforeRainSeasonReportTime}}</text>
  33. </view>
  34. <view class="items-line">
  35. <text v-if="item.rainSeasonFirstStatus ==1"
  36. class="item-text-content">汛中(一):{{item.rainSeasonFirstReportUserName}}/{{item.rainSeasonFirstReportTime}}</text>
  37. </view>
  38. <view class="items-line">
  39. <text v-if="item.rainSeasonSecondStatus ==1"
  40. class="item-text-content">汛中(二):{{item.rainSeasonSecondReportUserName}}/{{item.rainSeasonSecondReportTime}}</text>
  41. </view>
  42. </view>
  43. <view v-else>
  44. <view class="items-line" style="margin-top: 2px;">
  45. <uni-icons class="input-uni-icon" type="auth" size="18" color="lightblue" />
  46. <text class="item-text-lable">填报人:</text>
  47. <text v-if="rainSeasonKind ==1"
  48. class="item-text-content">{{item.beforeRainSeasonReportUserName}}</text>
  49. <text v-else-if="rainSeasonKind ==2"
  50. class="item-text-content">{{item.rainSeasonFirstReportUserName}}</text>
  51. <text v-else-if="rainSeasonKind ==3"
  52. class="item-text-content">{{item.rainSeasonSecondReportUserName}}</text>
  53. </view>
  54. <view class="items-line" style="margin-top: 2px;">
  55. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  56. <text class="item-text-lable">填报时间:</text>
  57. <text v-if="rainSeasonKind ==1"
  58. class="item-text-content">{{item.beforeRainSeasonReportTime}}</text>
  59. <text v-else-if="rainSeasonKind ==2"
  60. class="item-text-content">{{item.rainSeasonFirstReportTime}}</text>
  61. <text v-else-if="rainSeasonKind ==3"
  62. class="item-text-content">{{item.rainSeasonSecondReportTime}}</text>
  63. </view>
  64. </view>
  65. <view class="item-button-group">
  66. <view v-if="item.beforeRainSeasonStatus ==1" class="item-button"
  67. @click="onBeforeRainDetailViewClick(item.beforeRainSeasonReportId)">
  68. <view class="items-line">
  69. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  70. <text class="button-text">汛前详情</text>
  71. </view>
  72. </view>
  73. <view v-if="item.rainSeasonFirstStatus ==1" class="item-button"
  74. @click="onRainFirstDetailViewClick(item.rainSeasonFirstReportId)">
  75. <view class="items-line">
  76. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  77. <text class="button-text">汛中(一)详情</text>
  78. </view>
  79. </view>
  80. <view v-if="item.rainSeasonSecondStatus ==1" class="item-button"
  81. @click="onRainSencodDetailViewClick(item.rainSeasonSecondReportId)">
  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>
  88. </view>
  89. </template>
  90. </uni-list-item>
  91. </uni-list>
  92. <uni-group>
  93. <view class="pagination-block">
  94. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  95. @change="pageChange" />
  96. </view>
  97. </uni-group>
  98. </view>
  99. </view>
  100. </template>
  101. <script>
  102. import {
  103. role
  104. } from "@/api/role.js";
  105. import http from '@/http/api.js';
  106. export default {
  107. components: {},
  108. onLoad(option) {
  109. if (this.userInfo.role_name === role['admin']) {
  110. this.permission.admin = true;
  111. } else if (this.userInfo.role_name === role['orgAdmin']) {
  112. this.permission.orgAdmin = true;
  113. } else if (this.userInfo.role_name === role['companyAdmin']) {
  114. this.permission.companyAdmin = true;
  115. } else if (this.userInfo.role_name === role['companyServciePerson']) {
  116. this.permission.companyServciePerson = true;
  117. }
  118. this.rainSeasonKind = option.rainSeasonKind;
  119. this.query['deptId'] = option.deptId;
  120. if (this.rainSeasonKind == 0) {
  121. this.title = '年度已巡检设备信息';
  122. } else if (this.rainSeasonKind == 1) {
  123. this.title = '汛前已巡检设备信息';
  124. this.query['rainSeasonKind'] = option.rainSeasonKind;
  125. } else if (this.rainSeasonKind == 2) {
  126. this.title = '汛中(一)已巡检设备信息';
  127. this.query['rainSeasonKind'] = option.rainSeasonKind;
  128. } else if (this.rainSeasonKind == 3) {
  129. this.title = '汛中(二)已巡检设备信息';
  130. this.query['rainSeasonKind'] = option.rainSeasonKind;
  131. }
  132. console.log(JSON.stringify(this.query))
  133. this.getPage();
  134. },
  135. data() {
  136. return {
  137. rainSeasonKind: 0,
  138. title: '已巡检设备信息',
  139. permission: {
  140. 'admin': false,
  141. 'orgAdmin': false,
  142. 'companyAdmin': false,
  143. 'companyServciePerson': false,
  144. },
  145. list: [],
  146. pageSize: 10,
  147. // 当前页
  148. pageCurrent: 1,
  149. // 数据总量
  150. total: 0,
  151. query: {},
  152. inputStyles: {
  153. color: '#808080',
  154. borderColor: '#d3d3d3'
  155. }
  156. }
  157. },
  158. computed: {
  159. },
  160. onShow() {
  161. },
  162. methods: {
  163. toBack() {
  164. uni.navigateBack({
  165. delta: 1
  166. })
  167. },
  168. onBackPress() {
  169. // #ifdef APP-PLUS
  170. plus.key.hideSoftKeybord();
  171. // #endif
  172. },
  173. // 分页触发
  174. pageChange(e) {
  175. this.pageCurrent = e.current;
  176. this.getPage()
  177. },
  178. onBeforeRainDetailViewClick(id) {
  179. console.log("onDetailViewClick " + id)
  180. var url = '/pages/equipment-inspection/inspectionreportview?type=1&id=' + id;
  181. uni.navigateTo({
  182. url: url
  183. })
  184. },
  185. onRainFirstDetailViewClick(id) {
  186. console.log("onDetailViewClick " + id)
  187. var url = '/pages/equipment-inspection/inspectionreportview?type=2&id=' + id;
  188. uni.navigateTo({
  189. url: url
  190. })
  191. },
  192. onRainSencodDetailViewClick(id) {
  193. console.log("onDetailViewClick " + id)
  194. var url = '/pages/equipment-inspection/inspectionreportview?type=3&id=' + id;
  195. uni.navigateTo({
  196. url: url
  197. })
  198. },
  199. getPage(params = {}) {
  200. let that = this;
  201. const current = this.pageCurrent;
  202. const size = this.pageSize;
  203. let postData = Object.assign(this.query, params);
  204. http.request({
  205. url: '/galaxy-business/equipment/inspection/rain/page',
  206. method: 'GET',
  207. params: {
  208. current,
  209. size,
  210. },
  211. data: postData,
  212. }).then(res => {
  213. if (res.data != null) {
  214. if (res.data.records != null) {
  215. that.list = res.data.records;
  216. }
  217. this.total = res.data.total;
  218. }
  219. }).catch(err => {
  220. console.log(err)
  221. })
  222. },
  223. }
  224. }
  225. </script>
  226. <style>
  227. /* page {
  228. background-color: rgb(240, 242, 244);
  229. } */
  230. </style>
  231. <style lang="scss" scoped>
  232. </style>