accessQualification.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <!-- 准入资格证书 -->
  2. <template>
  3. <view id="accessQualification">
  4. <view class="top-picker-max-box">
  5. <view class="top-picker-left-box">审核状态</view>
  6. <picker class="top-picker-right-box" @change="buttonChange"
  7. :range-key="'name'" :value="id" :range="buttonArray">
  8. <view>{{buttonArray[buttonArrayIndex].name}}</view>
  9. </picker>
  10. </view>
  11. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  12. <view class="for-big-box" v-for="(item,index) in dataList" :key="index">
  13. <view class="for-time-p">{{item.titleCreatTime}}</view>
  14. <img class="for-back-img" src="@/images/basicsModules/for_min_bg.png">
  15. <view class="for-list-box" @click="goPageInfo(minItem)"
  16. v-for="(minItem,indexTwo) in item.subList" :key="indexTwo">
  17. <view class="min-for-box-one">
  18. <view :class="minItem.auditStatus==1?'titleType1':(minItem.auditStatus==0?'titleType2':(minItem.auditStatus==2?'titleType3':''))">{{minItem.auditStatus==1?'未通过':(minItem.auditStatus==0?'待审核':(minItem.auditStatus==2?'已通过':''))}}</view>
  19. <view>{{minItem.subName}}</view>
  20. </view>
  21. <view class="min-for-box-two">
  22. <view></view>
  23. <view>申请人:{{minItem.userName}}</view>
  24. <view>{{minItem.creatTime}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="get-null-box" v-if="getData.nullDataType">暂无更多数据</view>
  29. </scroll-view>
  30. <view class="tip">请联系管理员开通<text>白名单</text>来获取实验室准入资格</view>
  31. </view>
  32. </template>
  33. <script>
  34. import { parseTime } from '@/component/public.js'
  35. import { laboratoryAppletAuditListByApply } from '@/api/manage/index.js'
  36. export default {
  37. data() {
  38. return {
  39. //选项
  40. buttonArray:[
  41. {name:"全部",id:""},
  42. {name:"待审核",id:"0"},
  43. {name:"已通过",id:"2"},
  44. {name:"未通过",id:"1"},
  45. ],
  46. buttonArrayIndex:0,
  47. auditStatus:"",
  48. //列表请求参数
  49. queryParams: {
  50. page: 1,
  51. pageSize: 20,
  52. },
  53. total:0,
  54. dataList:[],
  55. }
  56. },
  57. onLoad() {
  58. },
  59. onShow(){
  60. this.clearData();
  61. this.getList();
  62. },
  63. mounted() {
  64. },
  65. methods: {
  66. //清除
  67. clearData(){
  68. this.dataList = [];
  69. this.queryParams.page = 1;
  70. },
  71. //去详情页
  72. goPageInfo(item){
  73. uni.navigateTo({
  74. url:'/pages_manage/accessQualification/accessQualificationInfo?item='+encodeURIComponent(JSON.stringify(item))
  75. })
  76. },
  77. //滚动事件
  78. scrollGet(){
  79. let self=this;
  80. if(self.total/self.queryParams.pageSize<=self.queryParams.page){
  81. console.log('没有更多数据!')
  82. }else{
  83. setTimeout(function(){
  84. self.queryParams.page += 1;
  85. self.getList();
  86. },1000)
  87. }
  88. },
  89. //选择
  90. buttonChange(e){
  91. this.clearData()
  92. this.buttonArrayIndex = e.detail.value;
  93. this.$set(this,'auditStatus',this.buttonArray[this.buttonArrayIndex].id);
  94. this.getList();
  95. },
  96. //获取列表数据
  97. async getList(){
  98. let self = this;
  99. this.$set(this.queryParams,'auditStatus',this.auditStatus)
  100. const {data} = await laboratoryAppletAuditListByApply(this.queryParams);
  101. if(data.code==200){
  102. //定义一个空数组
  103. let newArr = [];
  104. //通过forEach循环数组
  105. data.data.records.forEach((item, i) => {
  106. item.creatTime=parseTime(item.creatTime,"{h}:{i}")
  107. let index = -1;
  108. //然后在跑到这里筛选 根据不同的时间放置不同的数组 some()用来查找数组中是否存在某个值 如果存在 就return true
  109. let isExists = newArr.some((newItem, j) => {
  110. if(item.titleCreatTime == newItem.titleCreatTime) {
  111. index = j;
  112. return true;
  113. }
  114. })
  115. //代码是先跑这里的if条件判读
  116. if(!isExists) {
  117. newArr.push({
  118. titleCreatTime: item.titleCreatTime,
  119. subList: [item]
  120. })
  121. } else {
  122. newArr[index].subList.push(item);
  123. }
  124. })
  125. this.dataList=[...this.dataList,...newArr]
  126. this.total=data.data.total;
  127. }
  128. },
  129. }
  130. }
  131. </script>
  132. <style lang="stylus" scoped>
  133. #accessQualification{
  134. height:100%;
  135. display flex
  136. flex-direction column
  137. .top-picker-max-box{
  138. height:100rpx;
  139. display flex;
  140. height:150rpx;
  141. background #fff;
  142. overflow hidden
  143. margin-bottom:15rpx;
  144. .top-picker-left-box{
  145. margin-top:34rpx;
  146. line-height:82rpx;
  147. width:145rpx;
  148. text-align center;
  149. }
  150. .top-picker-right-box{
  151. margin-top:34rpx;
  152. width:586rpx;
  153. height:82rpx;
  154. border:1rpx solid #A2A2A2;
  155. line-height:82rpx;
  156. border-radius:6rpx;
  157. view{
  158. padding:0 20rpx;
  159. color:#999999;
  160. }
  161. }
  162. }
  163. .top-max-box{
  164. height:100rpx;
  165. display flex
  166. background #fff
  167. margin-bottom:20rpx;
  168. .top-button-box{
  169. width:200rpx;
  170. padding-top:3rpx;
  171. view:nth-child(1){
  172. font-size:30rpx;
  173. text-align center;
  174. color:#333;
  175. line-height:95rpx;
  176. }
  177. view:nth-child(2){
  178. width:100rpx;
  179. height:5rpx;
  180. margin:0 auto;
  181. }
  182. .colorA{
  183. color:#0183FA!important;
  184. }
  185. .backA{
  186. background:#0183FA;
  187. }
  188. }
  189. }
  190. .info-max-box{
  191. flex:1;
  192. overflow: scroll
  193. .for-big-box:last-child{
  194. margin-bottom:180rpx;
  195. }
  196. .for-big-box{
  197. margin:0 20rpx 20rpx;
  198. overflow hidden
  199. border-radius:20rpx;
  200. // border-bottom-left-radius :20rpx;
  201. // border-bottom-right-radius :20rpx;
  202. background #fff;
  203. .for-time-p{
  204. background #fff
  205. line-height:57rpx;
  206. font-size:30rpx;
  207. padding:14rpx 22rpx 0;
  208. // border-top-left-radius:20rpx;
  209. // border-top-right-radius:20rpx;
  210. }
  211. .for-back-img{
  212. height:30rpx;
  213. width:710rpx;
  214. }
  215. .for-list-box:nth-child(3){
  216. border:none;
  217. }
  218. .for-list-box{
  219. border-top:1rpx solid #E0E0E0;
  220. margin:0 24rpx;
  221. padding:20rpx 0;
  222. .min-for-box-one{
  223. display:flex;
  224. view{
  225. height:36rpx;
  226. line-height:36rpx;
  227. margin:10rpx 0;
  228. }
  229. view:nth-child(1){
  230. width:100rpx;
  231. margin-right:20rpx;
  232. line-height:36rpx;
  233. text-align center;
  234. font-size:20rpx;
  235. }
  236. view:nth-child(2){
  237. flex:1;
  238. font-size:28rpx;
  239. }
  240. .titleType1{
  241. border-radius:6rpx;
  242. color:#FF5555;
  243. background rgba(255,85,85,0.2)
  244. }
  245. .titleType2{
  246. border-radius:6rpx;
  247. color:#F6A71D;
  248. background rgba(246,167,29,0.2)
  249. }
  250. .titleType3{
  251. border-radius:6rpx;
  252. color:#30A23D;
  253. background rgba(48,162,61,0.2)
  254. }
  255. }
  256. .min-for-box-two{
  257. display:flex;
  258. view{
  259. height:36rpx;
  260. line-height:36rpx;
  261. margin:10rpx 0;
  262. }
  263. view:nth-child(1){
  264. width:100rpx;
  265. margin-right:20rpx;
  266. line-height:36rpx;
  267. text-align center;
  268. font-size:20rpx;
  269. }
  270. view:nth-child(2){
  271. flex:1;
  272. font-size:26rpx;
  273. }
  274. view:nth-child(3){
  275. font-size:26rpx;
  276. }
  277. }
  278. }
  279. }
  280. .get-null-box{
  281. height:100rpx;
  282. line-height:100rpx;
  283. color:#999;
  284. text-align center
  285. }
  286. }
  287. .bottom-button-box{
  288. border-radius:20rpx;
  289. margin:20rpx 50rpx;
  290. width: 650rpx;
  291. height: 100rpx;
  292. line-height: 100rpx;
  293. background: #0183FA;
  294. font-size: 30rpx;
  295. color: #FFFFFF;
  296. text-align center;
  297. }
  298. .tip{
  299. width: 750rpx;
  300. height: 100rpx;
  301. line-height :100rpx;
  302. border-top: 1rpx solid #e0e0e0;
  303. background: #fff;
  304. font-size: 30rpx;
  305. color: #333;
  306. text-align center;
  307. >text{
  308. color:red;
  309. }
  310. }
  311. }
  312. </style>