safeAccess.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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 infoList" :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.subjectName}}准入申请</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 { listapply } from '@/api/index.js'
  22. export default {
  23. data() {
  24. return {
  25. //数据列表
  26. infoList:[],
  27. //列表请求参数
  28. getData:{
  29. page:1,
  30. pageSize:20,
  31. getType:true,
  32. nullDataType:true,
  33. }
  34. }
  35. },
  36. onLoad() {
  37. },
  38. onShow(){
  39. this.clearData();
  40. this.getList();
  41. },
  42. methods: {
  43. //清除
  44. clearData(){
  45. this.infoList = [];
  46. this.getData.page = 1;
  47. this.getData.getType = true;
  48. this.getData.nullDataType = true;
  49. },
  50. //去准入详情
  51. goInfoPage(item){
  52. item.infoId = item.id;
  53. uni.navigateTo({
  54. url:'/pages_student/workbench/safeAccess/applicationDetails?item='+encodeURIComponent(JSON.stringify(item))
  55. })
  56. },
  57. //去选择实验室
  58. goChooseALaboratory(){
  59. uni.navigateTo({
  60. url:'/pages_student/workbench/safeAccess/newApplication'
  61. })
  62. },
  63. //滚动事件
  64. scrollGet(){
  65. if(this.getData.getType){
  66. this.getData.page += 1;
  67. this.getList();
  68. }
  69. },
  70. //获取列表数据
  71. async getList(){
  72. let self = this;
  73. let obj = {
  74. pageNum:this.getData.page,
  75. pageSize:this.getData.pageSize,
  76. // recordContent:"-1",
  77. // userId:uni.getStorageSync('userId'),
  78. }
  79. const {data} = await listapply(obj)
  80. if(data.code==200){
  81. for(let i=0;i<data.rows.length;i++){
  82. // item.auditTime + ' 至 ' + item.validEndTime
  83. if(data.rows[i].auditTime){
  84. let leftTiem = data.rows[i].auditTime.split(' ');
  85. data.rows[i].auditTime = leftTiem[0];
  86. }
  87. if(data.rows[i].validEndTime){
  88. let rightTuem = data.rows[i].validEndTime.split(' ');
  89. data.rows[i].validEndTime = rightTuem[0];
  90. }
  91. }
  92. if(self.page==1){
  93. if(data.rows.length > 0 && data.rows.length == self.getData.pageSize){
  94. self.infoList = data.rows;
  95. }else if(data.rows.length > 0 && data.rows.length != self.getData.pageSize){
  96. self.infoList = data.rows;
  97. self.getData.getType = false;
  98. self.getData.nullDataType = true;
  99. }else{
  100. self.getData.getType = false;
  101. self.getData.nullDataType = true;
  102. }
  103. }else{
  104. if(data.rows.length > 0 && data.rows.length == self.getData.pageSize){
  105. self.infoList = self.infoList.concat(data.rows)
  106. }else if(data.rows.length > 0 && data.rows.length != self.getData.pageSize){
  107. self.infoList = self.infoList.concat(data.rows);
  108. self.getData.getType = false;
  109. self.getData.nullDataType = true;
  110. }else{
  111. self.getData.getType = false;
  112. self.getData.nullDataType = true;
  113. }
  114. }
  115. }
  116. },
  117. }
  118. }
  119. </script>
  120. <style lang="stylus" scoped>
  121. #safeAccess{
  122. height:100%;
  123. width:100%;
  124. display flex
  125. flex-direction column
  126. .info-max-box{
  127. flex:1;
  128. overflow: scroll
  129. .for-box:nth-child(1){
  130. border:none;
  131. }
  132. .for-box{
  133. background #fff
  134. border-radius:20rpx;
  135. margin:20rpx;
  136. overflow hidden
  137. .name-box{
  138. display flex;
  139. margin:20rpx 0;
  140. view:nth-child(1){
  141. height:36rpx;
  142. text-align center;
  143. width:100rpx;
  144. line-height:36rpx;
  145. font-size:20rpx;
  146. margin:0 18rpx 0 23rpx;
  147. }
  148. view:nth-child(2){
  149. flex:1;
  150. font-size:28rpx;
  151. margin-right:20rpx;
  152. }
  153. .typeColor1{
  154. border-radius:6rpx;
  155. color:#F6A71D;
  156. background rgba(246,167,29,0.2)
  157. }
  158. .typeColor2{
  159. border-radius:6rpx;
  160. color:#FF5555;
  161. background rgba(255,85,85,0.2)
  162. }
  163. .typeColor3{
  164. border-radius:6rpx;
  165. color:#30A23D;
  166. background rgba(48,162,61,0.2)
  167. }
  168. .typeColor4{
  169. border-radius:6rpx;
  170. color:#F6A71D;
  171. background rgba(246,167,29,0.2)
  172. }
  173. }
  174. .time-box{
  175. display flex;
  176. height:36rpx;
  177. margin:20rpx 0;
  178. view:nth-child(1){
  179. width:100rpx;
  180. line-height:36rpx;
  181. font-size:20rpx;
  182. margin:0 18rpx 0 23rpx;
  183. }
  184. view:nth-child(2){
  185. flex:1;
  186. font-size:28rpx;
  187. }
  188. }
  189. }
  190. .get-null-box{
  191. height:100rpx;
  192. line-height:100rpx;
  193. color:#999;
  194. text-align center
  195. }
  196. }
  197. .bottom-button-box{
  198. border-radius:20rpx;
  199. margin:20rpx 50rpx;
  200. width: 650rpx;
  201. height: 100rpx;
  202. line-height: 100rpx;
  203. background: #0183FA;
  204. font-size: 30rpx;
  205. color: #FFFFFF;
  206. text-align center;
  207. }
  208. }
  209. </style>