accessQualification.vue 9.0 KB

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