labBinding.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!-- 实验室绑定申请 -->
  2. <template>
  3. <view class="labBinding-component">
  4. <!-- <view class="card mob-admin-only" @click="goToApproval" hover-class="card-hover" hover-stay-time="100"> -->
  5. <view class="card mob-admin-only" @click="goToApproval">
  6. <view class="card-content">
  7. <view class="icon-box">🏛️</view>
  8. <view class="info-box">
  9. <view class="title">实验室绑定申请</view>
  10. <view class="subtitle">待审批申请需及时处理</view>
  11. </view>
  12. <view class="right-box">
  13. <text class="badge" v-if="pendingCount>0">{{ pendingCount }}</text>
  14. <text class="arrow">›</text>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import {
  22. examElLabEduRelationAuditList
  23. } from '@/pages_safetyEducationExamination/api/index.js'
  24. export default {
  25. data() {
  26. return {
  27. pendingCount: 0,
  28. }
  29. },
  30. mounted() {
  31. this.loadPendingCount();
  32. },
  33. methods: {
  34. async loadPendingCount() {
  35. try {
  36. const { data } = await examElLabEduRelationAuditList({
  37. page: 1,
  38. pageSize: 1,
  39. statusCode:0,
  40. });
  41. if (data.code === 200) {
  42. this.pendingCount = data.data.total || 0;
  43. }
  44. } catch (e) {
  45. console.error('获取待审批数量失败', e);
  46. }
  47. },
  48. goToApproval() {
  49. uni.navigateTo({
  50. url: '/pages_safetyEducationExamination/views/approval/index'
  51. });
  52. },
  53. },
  54. }
  55. </script>
  56. <style lang="stylus" scoped>
  57. .labBinding-component {
  58. margin: 0 32rpx 24rpx;
  59. .card {
  60. background-color: #fff;
  61. border-radius: 24rpx;
  62. padding: 0;
  63. overflow: hidden;
  64. position: relative;
  65. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.03);
  66. border: 1px solid #dde3ed;
  67. }
  68. .card-hover {
  69. background-color: #f5f5f5;
  70. }
  71. .card-content {
  72. display: flex;
  73. align-items: center;
  74. padding: 28rpx 32rpx;
  75. cursor: pointer;
  76. }
  77. .icon-box {
  78. width: 80rpx;
  79. height: 80rpx;
  80. border-radius: 20rpx;
  81. background: #e6f4ff;
  82. display: flex;
  83. align-items: center;
  84. justify-content: center;
  85. font-size: 40rpx;
  86. flex-shrink: 0;
  87. margin-right: 24rpx;
  88. }
  89. .info-box {
  90. flex: 1;
  91. .title {
  92. font-size: 28rpx;
  93. font-weight: 600;
  94. color: #333;
  95. }
  96. .subtitle {
  97. font-size: 24rpx;
  98. color: #999;
  99. margin-top: 4rpx;
  100. }
  101. }
  102. .right-box {
  103. display: flex;
  104. align-items: center;
  105. .badge {
  106. background: #ff4d4f;
  107. color: #fff;
  108. font-size: 22rpx;
  109. font-weight: 600;
  110. border-radius: 20rpx;
  111. min-width: 40rpx;
  112. text-align: center;
  113. margin-right: 12rpx;
  114. }
  115. .arrow {
  116. font-size: 32rpx;
  117. color: #999;
  118. }
  119. }
  120. }
  121. </style>