safeAccess.vue 5.2 KB

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