rtuinspectionreportview.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text"
  19. activeColor="#585b61"></uni-segmented-control>
  20. <view class="content">
  21. <view v-show="current === 0">
  22. <inspectionreportdetail :inspectionId="inspectionReportStatus.beforeRainSeasonReportId"
  23. v-if="inspectionReportStatus.beforeRainSeasonStatus==1">
  24. </inspectionreportdetail>
  25. <view v-else style="display: flex;flex-direction: row;justify-content: center;">
  26. <text style="color: red;font-size: 0.7rem;margin-top: 20px;">汛前巡检暂未填报</text>
  27. </view>
  28. </view>
  29. <view v-show="current === 1">
  30. <inspectionreportdetail :inspectionId="inspectionReportStatus.rainSeasonFirstReportId"
  31. v-if="inspectionReportStatus.rainSeasonFirstStatus==1">
  32. </inspectionreportdetail>
  33. <view v-else style="display: flex;flex-direction: row;justify-content: center;">
  34. <text style="color: red;font-size: 0.7rem;margin-top: 20px;">汛中第一次巡检暂未填报</text>
  35. </view>
  36. </view>
  37. <view v-show="current === 2">
  38. <inspectionreportdetail :inspectionId="inspectionReportStatus.rainSeasonSecondReportId"
  39. v-if="inspectionReportStatus.rainSeasonSecondStatus==1">
  40. </inspectionreportdetail>
  41. <view v-else style="display: flex;flex-direction: row;justify-content: center;">
  42. <text style="color: red;font-size: 0.7rem;margin-top: 20px;">汛中第二次巡检暂未填报</text>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import http from '@/http/api.js';
  51. import inspectionreportdetail from '@/pages/equipment-inspection/inspectionreportdetail.vue'
  52. export default {
  53. components: {
  54. inspectionreportdetail
  55. },
  56. onLoad(options) {
  57. this.rtuCode = options.rtuCode;
  58. this.query['rtuCode'] = this.rtuCode;
  59. console.log("onLoad")
  60. this.getInspectionReportStatus();
  61. },
  62. data() {
  63. return {
  64. rtuCode: '',
  65. items: ['汛前巡检', '汛中(一)巡检', '汛中(二)巡检'],
  66. current: -1,
  67. inspectionReportStatus: {
  68. beforeRainSeasonReportId: 0,
  69. rainSeasonFirstReportId: 0,
  70. rainSeasonSecondReportId: 0,
  71. beforeRainSeasonStatus: 0,
  72. rainSeasonFirstStatus: 0,
  73. rainSeasonSecondStatus: 0,
  74. },
  75. query: {},
  76. title: '测站巡检填报详情',
  77. }
  78. },
  79. computed: {
  80. },
  81. onShow() {
  82. console.log("onShow")
  83. },
  84. methods: {
  85. toBack() {
  86. uni.navigateBack({
  87. delta: 1
  88. })
  89. },
  90. getInspectionReportStatus(params = {}) {
  91. let that = this;
  92. let postData = Object.assign(params, this.query);
  93. console.log(JSON.stringify(postData))
  94. http.request({
  95. url: '/galaxy-business/equipment/inspection/rtu/reportStatus',
  96. method: 'GET',
  97. data: postData
  98. }).then(res => {
  99. //console.log(JSON.stringify(res))
  100. if (res != null && res.success) {
  101. if (res.data != null) {
  102. that.inspectionReportStatus = res.data;
  103. if (that.inspectionReportStatus.rainSeasonSecondStatus == 1) {
  104. that.current = 2;
  105. } else if (that.inspectionReportStatus.rainSeasonFirstStatus == 1) {
  106. that.current = 1;
  107. } else if (that.inspectionReportStatus.beforeRainSeasonStatus == 1) {
  108. that.current = 0;
  109. }
  110. }
  111. }
  112. }).catch(err => {
  113. console.log(err)
  114. })
  115. },
  116. onClickItem(e) {
  117. if (this.current != e.currentIndex) {
  118. this.current = e.currentIndex;
  119. }
  120. },
  121. }
  122. }
  123. </script>
  124. <style>
  125. </style>
  126. <style lang="scss" scoped>
  127. .nav-title {
  128. width: 100%;
  129. display: flex;
  130. flex-direction: row;
  131. justify-content: center;
  132. align-items: center;
  133. text {
  134. color: white;
  135. font-size: 1rem;
  136. }
  137. }
  138. .container {
  139. padding: 0 0 50rpx;
  140. width: 100%;
  141. }
  142. .content {
  143. /* #ifndef APP-NVUE */
  144. display: flex;
  145. /* #endif */
  146. justify-content: flex-start;
  147. flex-direction: column;
  148. width: 100%;
  149. }
  150. </style>