accessQualification.vue 9.0 KB

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