inspectionreportview.vue 3.4 KB

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