accessQualification.vue 7.7 KB

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