safeAccess.vue 4.8 KB

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