safeAccess.vue 4.9 KB

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