safeAccess.vue 5.1 KB

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