accessQualification.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. <!-- 准入资格证书 -->
  2. <template>
  3. <view id="accessQualification">
  4. <view class="top-picker-max-box">
  5. <view class="top-picker-input-box">
  6. <input class="top-picker-input" type="text" clearable
  7. v-model="queryParams.searchValue" placeholder="申请人/实验室名称/房间号" maxlength="20">
  8. <img v-if="queryParams.searchValue" class="top-picker-del"
  9. :src="imagesUrl('student/icon_jlfgz_gb.png')" @click="delSearchValue()">
  10. </view>
  11. <picker class="top-picker-right-box" @change="buttonChange"
  12. :range-key="'name'" :value="'id'" :range="buttonArray">
  13. <view>{{buttonArray[buttonArrayIndex].name}}</view>
  14. </picker>
  15. <view class="top-picker-left-box" @click="getButton()">搜索</view>
  16. </view>
  17. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  18. <view class="for-big-box" v-for="(item,index) in dataList" :key="index">
  19. <view class="for-time-p">{{item.titleCreatTime}}</view>
  20. <img class="for-back-img" :src="imagesUrl('commonality/for_min_bg.png')">
  21. <view class="for-list-box" @click="goPageInfo(minItem)" v-for="(minItem,indexTwo) in item.subList"
  22. :key="indexTwo">
  23. <view class="min-for-box-one">
  24. <view
  25. :class="minItem.auditStatus==1?'titleType1':(minItem.auditStatus==0?'titleType2':(minItem.auditStatus==2?'titleType3':''))">
  26. {{minItem.auditStatus==1?'未通过':(minItem.auditStatus==0?'待审核':(minItem.auditStatus==2?'已通过':''))}}
  27. </view>
  28. <view>{{minItem.subName}}{{minItem.roomNum?'('+minItem.roomNum+')':''}}</view>
  29. </view>
  30. <view class="min-for-box-two">
  31. <view></view>
  32. <view>申请人:{{minItem.userName}}</view>
  33. <view>{{minItem.creatTime}}</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="get-null-box" v-if="getDataType">暂无更多数据</view>
  38. </scroll-view>
  39. <view class="bottom-button-max-box">
  40. <view @click="goPage(1)">我的准入</view>
  41. <view @click="goPage(2)">准入申请</view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. parseTime
  48. } from '@/component/public.js'
  49. import {
  50. laboratoryAppletAuditListByApply
  51. } from '@/pages_manage/api/index.js'
  52. export default {
  53. data() {
  54. return {
  55. //选项
  56. buttonArray: [{
  57. name: "全部",
  58. id: ""
  59. },
  60. {
  61. name: "待审核",
  62. id: "0"
  63. },
  64. {
  65. name: "已通过",
  66. id: "2"
  67. },
  68. {
  69. name: "未通过",
  70. id: "1"
  71. },
  72. ],
  73. buttonArrayIndex: 0,
  74. auditStatus: "",
  75. //列表请求参数
  76. queryParams: {
  77. searchValue:'',
  78. page: 1,
  79. pageSize: 20,
  80. },
  81. total: 0,
  82. dataList: [],
  83. getDataType: null,
  84. }
  85. },
  86. onLoad() {
  87. },
  88. onShow() {
  89. this.clearData();
  90. this.getList();
  91. },
  92. mounted() {
  93. },
  94. methods: {
  95. delSearchValue(){
  96. this.$set(this.queryParams,'searchValue','');
  97. },
  98. getButton(){
  99. this.clearData();
  100. this.getList();
  101. },
  102. //清除
  103. clearData() {
  104. this.dataList = [];
  105. this.queryParams.page = 1;
  106. },
  107. //去准入列表/申请
  108. goPage(type){
  109. if(type == 1){
  110. uni.navigateTo({
  111. url: '/pages_student/views/accessApplication/safeAccess'
  112. })
  113. }else if(type == 2){
  114. uni.navigateTo({
  115. url: '/pages_student/views/accessApplication/newApplication'
  116. })
  117. }
  118. },
  119. //去详情页
  120. goPageInfo(item) {
  121. uni.navigateTo({
  122. url: '/pages_manage/views/accessQualification/accessQualificationInfo?item=' + encodeURIComponent(
  123. JSON.stringify(item))
  124. })
  125. },
  126. //滚动事件
  127. scrollGet() {
  128. let self = this;
  129. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  130. this.$set(this, 'getDataType', true);
  131. } else {
  132. setTimeout(function() {
  133. self.queryParams.page += 1;
  134. self.getList();
  135. }, 1000)
  136. }
  137. },
  138. //选择
  139. buttonChange(e) {
  140. // this.clearData()
  141. this.buttonArrayIndex = e.detail.value;
  142. this.$set(this, 'auditStatus', this.buttonArray[this.buttonArrayIndex].id);
  143. // this.getList();
  144. },
  145. //获取列表数据
  146. async getList() {
  147. let self = this;
  148. this.$set(this.queryParams, 'auditStatus', this.auditStatus)
  149. const {
  150. data
  151. } = await laboratoryAppletAuditListByApply(this.queryParams);
  152. if (data.code == 200) {
  153. //定义一个空数组
  154. let newArr = [];
  155. if(data.data.records){
  156. //通过forEach循环数组
  157. data.data.records.forEach((item, i) => {
  158. item.creatTime = parseTime(item.creatTime, "{h}:{i}")
  159. let index = -1;
  160. //然后在跑到这里筛选 根据不同的时间放置不同的数组 some()用来查找数组中是否存在某个值 如果存在 就return true
  161. let isExists = newArr.some((newItem, j) => {
  162. if (item.titleCreatTime == newItem.titleCreatTime) {
  163. index = j;
  164. return true;
  165. }
  166. })
  167. //代码是先跑这里的if条件判读
  168. if (!isExists) {
  169. newArr.push({
  170. titleCreatTime: item.titleCreatTime,
  171. subList: [item]
  172. })
  173. } else {
  174. newArr[index].subList.push(item);
  175. }
  176. })
  177. }
  178. if (self.queryParams.page == 1) {
  179. this.dataList = newArr;
  180. this.total = data.data.total;
  181. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  182. this.$set(this, 'getDataType', true);
  183. }
  184. } else {
  185. this.dataList = [...this.dataList, ...newArr]
  186. this.total = data.data.total;
  187. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  188. this.$set(this, 'getDataType', true);
  189. }
  190. }
  191. }
  192. },
  193. }
  194. }
  195. </script>
  196. <style lang="stylus" scoped>
  197. #accessQualification {
  198. height: 100%;
  199. display flex;
  200. flex-direction column;
  201. .top-picker-max-box {
  202. height: 100rpx;
  203. display flex;
  204. height: 150rpx;
  205. background #fff;
  206. overflow hidden;
  207. margin-bottom: 15rpx;
  208. .top-picker-left-box {
  209. margin-top: 34rpx;
  210. line-height: 84rpx;
  211. height:84rpx;
  212. text-align: center;
  213. width: 120rpx;
  214. border-radius:6rpx;
  215. background-color: #0183fa;
  216. color:#fff;
  217. margin-left:20rpx;
  218. }
  219. .top-picker-input-box {
  220. margin-top: 34rpx;
  221. width: 350rpx;
  222. height: 82rpx;
  223. border: 1rpx solid #A2A2A2;
  224. line-height: 82rpx;
  225. border-radius: 6rpx;
  226. margin-left:30rpx;
  227. padding:0 20rpx;
  228. position:relative;
  229. view {
  230. padding: 0 20rpx;
  231. color: #999999;
  232. }
  233. .top-picker-input{
  234. width: 350rpx;
  235. height: 82rpx;
  236. line-height: 82rpx;
  237. border-radius: 6rpx;
  238. }
  239. .top-picker-del{
  240. position: absolute;
  241. top:20rpx;
  242. right:20rpx;
  243. width:40rpx;
  244. height:40rpx;
  245. z-index:10;
  246. }
  247. }
  248. .top-picker-right-box {
  249. margin-top: 34rpx;
  250. width: 140rpx;
  251. height: 82rpx;
  252. border: 1rpx solid #A2A2A2;
  253. line-height: 82rpx;
  254. border-radius: 6rpx;
  255. margin-left:20rpx;
  256. view {
  257. padding: 0 20rpx;
  258. color: #999999;
  259. }
  260. }
  261. }
  262. .top-max-box {
  263. height: 100rpx;
  264. display flex;
  265. background #fff;
  266. margin-bottom: 20rpx;
  267. .top-button-box {
  268. width: 200rpx;
  269. padding-top: 3rpx;
  270. view:nth-child(1) {
  271. font-size: 30rpx;
  272. text-align center;
  273. color: #333;
  274. line-height: 95rpx;
  275. }
  276. view:nth-child(2) {
  277. width: 100rpx;
  278. height: 5rpx;
  279. margin: 0 auto;
  280. }
  281. .colorA {
  282. color: #0183FA !important;
  283. }
  284. .backA {
  285. background: #0183FA;
  286. }
  287. }
  288. }
  289. .info-max-box {
  290. flex: 1;
  291. overflow: scroll;
  292. .for-big-box:last-child {
  293. margin-bottom: 180rpx;
  294. }
  295. .for-big-box {
  296. margin: 0 20rpx 20rpx;
  297. overflow hidden;
  298. border-radius: 20rpx;
  299. // border-bottom-left-radius :20rpx;
  300. // border-bottom-right-radius :20rpx;
  301. background #fff;
  302. .for-time-p {
  303. background #fff;
  304. line-height: 57rpx;
  305. font-size: 30rpx;
  306. padding: 14rpx 22rpx 0;
  307. // border-top-left-radius:20rpx;
  308. // border-top-right-radius:20rpx;
  309. }
  310. .for-back-img {
  311. height: 30rpx;
  312. width: 710rpx;
  313. }
  314. .for-list-box:nth-child(3) {
  315. border: none;
  316. }
  317. .for-list-box {
  318. border-top: 1rpx solid #E0E0E0;
  319. margin: 0 24rpx;
  320. padding: 20rpx 0;
  321. .min-for-box-one {
  322. display: flex;
  323. view {
  324. height: 36rpx;
  325. line-height: 36rpx;
  326. margin: 10rpx 0;
  327. }
  328. view:nth-child(1) {
  329. width: 100rpx;
  330. margin-right: 20rpx;
  331. line-height: 36rpx;
  332. text-align center;
  333. font-size: 20rpx;
  334. }
  335. view:nth-child(2) {
  336. flex: 1;
  337. font-size: 28rpx;
  338. }
  339. .titleType1 {
  340. border-radius: 6rpx;
  341. color: #FF5555;
  342. background rgba(255, 85, 85, 0.2)
  343. }
  344. .titleType2 {
  345. border-radius: 6rpx;
  346. color: #F6A71D;
  347. background rgba(246, 167, 29, 0.2)
  348. }
  349. .titleType3 {
  350. border-radius: 6rpx;
  351. color: #30A23D;
  352. background rgba(48, 162, 61, 0.2)
  353. }
  354. }
  355. .min-for-box-two {
  356. display: flex;
  357. view {
  358. height: 36rpx;
  359. line-height: 36rpx;
  360. margin: 10rpx 0;
  361. }
  362. view:nth-child(1) {
  363. width: 100rpx;
  364. margin-right: 20rpx;
  365. line-height: 36rpx;
  366. text-align center;
  367. font-size: 20rpx;
  368. }
  369. view:nth-child(2) {
  370. flex: 1;
  371. font-size: 26rpx;
  372. }
  373. view:nth-child(3) {
  374. font-size: 26rpx;
  375. }
  376. }
  377. }
  378. }
  379. .get-null-box {
  380. height: 100rpx;
  381. line-height: 100rpx;
  382. color: #999;
  383. text-align center;
  384. }
  385. }
  386. .bottom-button-box {
  387. border-radius: 20rpx;
  388. margin: 20rpx 50rpx;
  389. width: 650rpx;
  390. height: 100rpx;
  391. line-height: 100rpx;
  392. background: #0183FA;
  393. font-size: 30rpx;
  394. color: #FFFFFF;
  395. text-align center;
  396. }
  397. .tip {
  398. width: 750rpx;
  399. height: 100rpx;
  400. line-height: 100rpx;
  401. border-top: 1rpx solid #e0e0e0;
  402. background: #fff;
  403. font-size: 30rpx;
  404. color: #333;
  405. text-align center;
  406. >text {
  407. color: red;
  408. }
  409. }
  410. .bottom-button-max-box{
  411. padding-top: 30rpx;
  412. display: flex;
  413. view{
  414. text-align: center;
  415. line-height:80rpx;
  416. }
  417. view:nth-child(1){
  418. width:220rpx;
  419. margin:0 40rpx 40rpx 80rpx;
  420. border:1rpx solid #0183fa;
  421. color:#0183fa;
  422. border-radius:10rpx;
  423. }
  424. view:nth-child(2){
  425. flex:1;
  426. margin:0 80rpx 40rpx 0;
  427. border:1rpx solid #0183fa;
  428. background-color: #0183fa;
  429. color:#fff;
  430. border-radius:16rpx;
  431. }
  432. }
  433. }
  434. </style>