accessQualification.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  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="@/images/basicsModules/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 '@/api/manage/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/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. //通过forEach循环数组
  126. data.data.records.forEach((item, i) => {
  127. item.creatTime = parseTime(item.creatTime, "{h}:{i}")
  128. let index = -1;
  129. //然后在跑到这里筛选 根据不同的时间放置不同的数组 some()用来查找数组中是否存在某个值 如果存在 就return true
  130. let isExists = newArr.some((newItem, j) => {
  131. if (item.titleCreatTime == newItem.titleCreatTime) {
  132. index = j;
  133. return true;
  134. }
  135. })
  136. //代码是先跑这里的if条件判读
  137. if (!isExists) {
  138. newArr.push({
  139. titleCreatTime: item.titleCreatTime,
  140. subList: [item]
  141. })
  142. } else {
  143. newArr[index].subList.push(item);
  144. }
  145. })
  146. this.dataList = [...this.dataList, ...newArr]
  147. this.total = data.data.total;
  148. }
  149. },
  150. }
  151. }
  152. </script>
  153. <style lang="stylus" scoped>
  154. #accessQualification {
  155. height: 100%;
  156. display flex;
  157. flex-direction column;
  158. .top-picker-max-box {
  159. height: 100rpx;
  160. display flex;
  161. height: 150rpx;
  162. background #fff;
  163. overflow hidden;
  164. margin-bottom: 15rpx;
  165. .top-picker-left-box {
  166. margin-top: 34rpx;
  167. line-height: 82rpx;
  168. width: 145rpx;
  169. text-align center;
  170. }
  171. .top-picker-right-box {
  172. margin-top: 34rpx;
  173. width: 586rpx;
  174. height: 82rpx;
  175. border: 1rpx solid #A2A2A2;
  176. line-height: 82rpx;
  177. border-radius: 6rpx;
  178. view {
  179. padding: 0 20rpx;
  180. color: #999999;
  181. }
  182. }
  183. }
  184. .top-max-box {
  185. height: 100rpx;
  186. display flex;
  187. background #fff;
  188. margin-bottom: 20rpx;
  189. .top-button-box {
  190. width: 200rpx;
  191. padding-top: 3rpx;
  192. view:nth-child(1) {
  193. font-size: 30rpx;
  194. text-align center;
  195. color: #333;
  196. line-height: 95rpx;
  197. }
  198. view:nth-child(2) {
  199. width: 100rpx;
  200. height: 5rpx;
  201. margin: 0 auto;
  202. }
  203. .colorA {
  204. color: #0183FA !important;
  205. }
  206. .backA {
  207. background: #0183FA;
  208. }
  209. }
  210. }
  211. .info-max-box {
  212. flex: 1;
  213. overflow: scroll;
  214. .for-big-box:last-child {
  215. margin-bottom: 180rpx;
  216. }
  217. .for-big-box {
  218. margin: 0 20rpx 20rpx;
  219. overflow hidden;
  220. border-radius: 20rpx;
  221. // border-bottom-left-radius :20rpx;
  222. // border-bottom-right-radius :20rpx;
  223. background #fff;
  224. .for-time-p {
  225. background #fff;
  226. line-height: 57rpx;
  227. font-size: 30rpx;
  228. padding: 14rpx 22rpx 0;
  229. // border-top-left-radius:20rpx;
  230. // border-top-right-radius:20rpx;
  231. }
  232. .for-back-img {
  233. height: 30rpx;
  234. width: 710rpx;
  235. }
  236. .for-list-box:nth-child(3) {
  237. border: none;
  238. }
  239. .for-list-box {
  240. border-top: 1rpx solid #E0E0E0;
  241. margin: 0 24rpx;
  242. padding: 20rpx 0;
  243. .min-for-box-one {
  244. display: flex;
  245. view {
  246. height: 36rpx;
  247. line-height: 36rpx;
  248. margin: 10rpx 0;
  249. }
  250. view:nth-child(1) {
  251. width: 100rpx;
  252. margin-right: 20rpx;
  253. line-height: 36rpx;
  254. text-align center;
  255. font-size: 20rpx;
  256. }
  257. view:nth-child(2) {
  258. flex: 1;
  259. font-size: 28rpx;
  260. }
  261. .titleType1 {
  262. border-radius: 6rpx;
  263. color: #FF5555;
  264. background rgba(255, 85, 85, 0.2)
  265. }
  266. .titleType2 {
  267. border-radius: 6rpx;
  268. color: #F6A71D;
  269. background rgba(246, 167, 29, 0.2)
  270. }
  271. .titleType3 {
  272. border-radius: 6rpx;
  273. color: #30A23D;
  274. background rgba(48, 162, 61, 0.2)
  275. }
  276. }
  277. .min-for-box-two {
  278. display: flex;
  279. view {
  280. height: 36rpx;
  281. line-height: 36rpx;
  282. margin: 10rpx 0;
  283. }
  284. view:nth-child(1) {
  285. width: 100rpx;
  286. margin-right: 20rpx;
  287. line-height: 36rpx;
  288. text-align center;
  289. font-size: 20rpx;
  290. }
  291. view:nth-child(2) {
  292. flex: 1;
  293. font-size: 26rpx;
  294. }
  295. view:nth-child(3) {
  296. font-size: 26rpx;
  297. }
  298. }
  299. }
  300. }
  301. .get-null-box {
  302. height: 100rpx;
  303. line-height: 100rpx;
  304. color: #999;
  305. text-align center;
  306. }
  307. }
  308. .bottom-button-box {
  309. border-radius: 20rpx;
  310. margin: 20rpx 50rpx;
  311. width: 650rpx;
  312. height: 100rpx;
  313. line-height: 100rpx;
  314. background: #0183FA;
  315. font-size: 30rpx;
  316. color: #FFFFFF;
  317. text-align center;
  318. }
  319. .tip {
  320. width: 750rpx;
  321. height: 100rpx;
  322. line-height: 100rpx;
  323. border-top: 1rpx solid #e0e0e0;
  324. background: #fff;
  325. font-size: 30rpx;
  326. color: #333;
  327. text-align center;
  328. >text {
  329. color: red;
  330. }
  331. }
  332. }
  333. </style>