safeAccess.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <!-- 安全准入 -->
  2. <template>
  3. <view id="safeAccess">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="for-box" v-for="(item,index) in dataList" :key="index" @click="goInfoPage(item)">
  6. <view class="name-box">
  7. <view
  8. :class="item.auditStatus==0?'typeColor1':(item.auditStatus==1?'typeColor2':(item.auditStatus==2?'typeColor3':''))">
  9. {{item.auditStatus==0?'待审核':(item.auditStatus==1?'未通过':(item.auditStatus==2?'已通过':''))}}
  10. </view>
  11. <view>{{item.subName}}准入申请</view>
  12. </view>
  13. <view class="time-box">
  14. <view></view>
  15. <view>
  16. {{item.auditStatus==0?'申请时间:' + item.creatTime:(item.auditStatus==1?'审核未通过时间:' + item.rejectTime:(item.auditStatus==2?'有效期:' + item.auditTime + ' 至 ' + item.validEndTime:''))}}
  17. </view>
  18. </view>
  19. </view>
  20. <view class="get-null-box" v-if="getData.nullDataType">暂无更多数据</view>
  21. </scroll-view>
  22. <view class="bottom-button-box" @click="goChooseALaboratory">准入申请</view>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. parseTime
  28. } from '@/component/public.js'
  29. import {
  30. laboratoryAppletListApply
  31. } from '@/pages_student/api/index.js'
  32. export default {
  33. data() {
  34. return {
  35. //列表请求参数
  36. queryParams: {
  37. page: 1,
  38. pageSize: 20,
  39. },
  40. total: 0,
  41. dataList: [],
  42. }
  43. },
  44. onLoad() {
  45. },
  46. onShow() {
  47. this.clearData();
  48. this.getList();
  49. },
  50. methods: {
  51. //清除
  52. clearData() {
  53. this.dataList = [];
  54. this.queryParams.page = 1;
  55. },
  56. //去准入详情
  57. goInfoPage(item) {
  58. item.infoId = item.id;
  59. uni.navigateTo({
  60. url: '/pages_student/views/accessApplication/applicationDetails?item=' + encodeURIComponent(JSON.stringify(
  61. item))
  62. })
  63. },
  64. //去选择实验室
  65. goChooseALaboratory() {
  66. uni.navigateTo({
  67. url: '/pages_student/views/accessApplication/newApplication'
  68. })
  69. },
  70. //滚动事件
  71. scrollGet() {
  72. let self = this;
  73. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  74. console.log('没有更多数据!')
  75. } else {
  76. setTimeout(function() {
  77. self.queryParams.page += 1;
  78. self.getList();
  79. }, 1000)
  80. }
  81. },
  82. //获取列表数据
  83. async getList() {
  84. let self = this;
  85. this.$set(this.queryParams, 'auditStatus', this.auditStatus)
  86. const {
  87. data
  88. } = await laboratoryAppletListApply(this.queryParams);
  89. if (data.code == 200) {
  90. //通过forEach循环数组
  91. data.data.records.forEach((item, i) => {
  92. item.auditTime = parseTime(item.auditTime, "{y}-{m}-{d}")
  93. item.validEndTime = parseTime(item.validEndTime, "{y}-{m}-{d}")
  94. item.rejectTime = parseTime(item.rejectTime, "{y}-{m}-{d}")
  95. })
  96. this.dataList = [...this.dataList, ...data.data.records]
  97. this.total = data.data.total;
  98. }
  99. },
  100. }
  101. }
  102. </script>
  103. <style lang="stylus" scoped>
  104. #safeAccess {
  105. height: 100%;
  106. width: 100%;
  107. display flex;
  108. flex-direction column;
  109. .info-max-box {
  110. flex: 1;
  111. overflow: scroll;
  112. .for-box:nth-child(1) {
  113. border: none;
  114. }
  115. .for-box {
  116. background #fff;
  117. border-radius: 20rpx;
  118. margin: 20rpx;
  119. overflow hidden;
  120. .name-box {
  121. display flex;
  122. margin: 20rpx 0;
  123. view:nth-child(1) {
  124. height: 36rpx;
  125. text-align center;
  126. width: 100rpx;
  127. line-height: 36rpx;
  128. font-size: 20rpx;
  129. margin: 0 18rpx 0 23rpx;
  130. }
  131. view:nth-child(2) {
  132. flex: 1;
  133. font-size: 28rpx;
  134. margin-right: 20rpx;
  135. }
  136. .typeColor1 {
  137. border-radius: 6rpx;
  138. color: #F6A71D;
  139. background rgba(246, 167, 29, 0.2)
  140. }
  141. .typeColor2 {
  142. border-radius: 6rpx;
  143. color: #FF5555;
  144. background rgba(255, 85, 85, 0.2)
  145. }
  146. .typeColor3 {
  147. border-radius: 6rpx;
  148. color: #30A23D;
  149. background rgba(48, 162, 61, 0.2)
  150. }
  151. .typeColor4 {
  152. border-radius: 6rpx;
  153. color: #F6A71D;
  154. background rgba(246, 167, 29, 0.2)
  155. }
  156. }
  157. .time-box {
  158. display flex;
  159. height: 36rpx;
  160. margin: 20rpx 0;
  161. view:nth-child(1) {
  162. width: 100rpx;
  163. line-height: 36rpx;
  164. font-size: 20rpx;
  165. margin: 0 18rpx 0 23rpx;
  166. }
  167. view:nth-child(2) {
  168. flex: 1;
  169. font-size: 28rpx;
  170. }
  171. }
  172. }
  173. .get-null-box {
  174. height: 100rpx;
  175. line-height: 100rpx;
  176. color: #999;
  177. text-align center
  178. }
  179. }
  180. .bottom-button-box {
  181. border-radius: 20rpx;
  182. margin: 20rpx 50rpx;
  183. width: 650rpx;
  184. height: 100rpx;
  185. line-height: 100rpx;
  186. background: #0183FA;
  187. font-size: 30rpx;
  188. color: #FFFFFF;
  189. text-align center;
  190. }
  191. }
  192. </style>