labBinding.vue 2.5 KB

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