accessQualification.vue 9.7 KB

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