servicepersonfinishedinspectionreportlist.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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"
  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"
  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"
  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. this.query['servicePersonId'] = option.userId;
  105. this.query['rainSeasonKind'] = option.rainSeasonKind;
  106. console.log(JSON.stringify(this.query))
  107. if (this.rainSeasonKind == 1) {
  108. this.title = '汛前已巡检设备信息';
  109. } else if (this.rainSeasonKind == 2) {
  110. this.title = '汛中(一)已巡检设备信息';
  111. } else if (this.rainSeasonKind == 3) {
  112. this.title = '汛中(二)已巡检设备信息';
  113. }
  114. this.getPage();
  115. },
  116. data() {
  117. return {
  118. rainSeasonKind: 0,
  119. title: '已巡检设备信息',
  120. permission: {
  121. 'admin': false,
  122. 'orgAdmin': false,
  123. 'companyAdmin': false,
  124. 'companyServciePerson': false,
  125. },
  126. list: [],
  127. pageSize: 10,
  128. // 当前页
  129. pageCurrent: 1,
  130. // 数据总量
  131. total: 0,
  132. query: {},
  133. inputStyles: {
  134. color: '#808080',
  135. borderColor: '#d3d3d3'
  136. }
  137. }
  138. },
  139. computed: {
  140. },
  141. onShow() {
  142. },
  143. methods: {
  144. toBack() {
  145. uni.navigateBack({
  146. delta: 1
  147. })
  148. },
  149. onBackPress() {
  150. // #ifdef APP-PLUS
  151. plus.key.hideSoftKeybord();
  152. // #endif
  153. },
  154. // 分页触发
  155. pageChange(e) {
  156. this.pageCurrent = e.current;
  157. this.getPage()
  158. },
  159. onBeforeRainDetailViewClick(id) {
  160. console.log("onDetailViewClick " + id)
  161. var url = '/pages/equipment-inspection/inspectionreportview?type=1&id=' + id;
  162. uni.navigateTo({
  163. url: url
  164. })
  165. },
  166. onRainFirstDetailViewClick(id) {
  167. console.log("onDetailViewClick " + id)
  168. var url = '/pages/equipment-inspection/inspectionreportview?type=2&id=' + id;
  169. uni.navigateTo({
  170. url: url
  171. })
  172. },
  173. onRainSencodDetailViewClick(id) {
  174. console.log("onDetailViewClick " + id)
  175. var url = '/pages/equipment-inspection/inspectionreportview?type=3&id=' + id;
  176. uni.navigateTo({
  177. url: url
  178. })
  179. },
  180. getPage(params = {}) {
  181. let that = this;
  182. const current = this.pageCurrent;
  183. const size = this.pageSize;
  184. let postData = Object.assign(this.query, params);
  185. http.request({
  186. url: '/galaxy-business/equipment/inspection/rain/page',
  187. method: 'GET',
  188. params: {
  189. current,
  190. size,
  191. },
  192. data: postData,
  193. }).then(res => {
  194. if (res.data != null) {
  195. if (res.data.records != null) {
  196. that.list = res.data.records;
  197. }
  198. this.total = res.data.total;
  199. }
  200. }).catch(err => {
  201. console.log(err)
  202. })
  203. },
  204. }
  205. }
  206. </script>
  207. <style>
  208. /* page {
  209. background-color: rgb(240, 242, 244);
  210. } */
  211. </style>
  212. <style lang="scss" scoped>
  213. </style>