InspectionList.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <scroll-view scroll-y class="container">
  3. <!-- Banner -->
  4. <view class="banner">
  5. <text class="banner-title">🧪 检验记录</text>
  6. </view>
  7. <!-- 检查报告卡片列表 -->
  8. <view v-if="reportList.length" class="card-list">
  9. <view class="card" v-for="item in reportList" :key="item.id">
  10. <view class="card-header">
  11. <!--<image :src="item.icon" class="card-icon" />-->
  12. <view class="header-info">
  13. <text class="item-title">{{ item.name }}</text>
  14. <text class="item-status">{{ item.status }}</text>
  15. </view>
  16. </view>
  17. <view class="divider"></view>
  18. <view class="card-info">
  19. <text class="item-text">📅 开单时间:{{ item.applyDate }}</text>
  20. <text class="item-text">📝 报告时间:{{ item.reportDate }}</text>
  21. </view>
  22. <view class="btn-group">
  23. <button class="main-btn" @click="viewReport(item)">查看报告</button>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 空状态 -->
  28. <view v-else class="empty-card">
  29. <image src="/static/image/empty.png" class="empty-img" />
  30. <text class="empty-text">暂无检查检验记录</text>
  31. </view>
  32. </scroll-view>
  33. </template>
  34. <script setup>
  35. import {
  36. ref
  37. } from 'vue'
  38. const reportList = ref([{
  39. id: 1,
  40. name: '装配间隙',
  41. icon: '/static/icons/ct.png',
  42. status: '✅ 已出报告',
  43. applyDate: '2025-08-20 09:15',
  44. reportDate: '2025-08-20 17:30'
  45. },
  46. {
  47. id: 2,
  48. name: '装配间隙',
  49. icon: '/static/icons/blood.png',
  50. status: '✅ 已出报告',
  51. applyDate: '2025-08-28 10:00',
  52. reportDate: '2025-08-28 13:40'
  53. }
  54. ])
  55. const viewReport = (item) => {
  56. uni.navigateTo({
  57. url: `/pages/work/report/ReportDetail?id=${item.id}`
  58. })
  59. }
  60. </script>
  61. <style scoped>
  62. .container {
  63. padding: 40rpx;
  64. background-color: #f5f7fa;
  65. min-height: 100vh;
  66. box-sizing: border-box;
  67. }
  68. .banner {
  69. background: linear-gradient(135deg, #6dd5ed, #2193b0);
  70. border-radius: 24rpx;
  71. padding: 40rpx 30rpx;
  72. margin-bottom: 40rpx;
  73. box-shadow: 0 8rpx 16rpx rgba(33, 147, 176, 0.3);
  74. }
  75. .banner-title {
  76. color: white;
  77. font-size: 36rpx;
  78. font-weight: bold;
  79. text-align: center;
  80. }
  81. .card-list {
  82. display: flex;
  83. flex-direction: column;
  84. gap: 30rpx;
  85. }
  86. .card {
  87. background-color: white;
  88. border-radius: 20rpx;
  89. padding: 30rpx;
  90. box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.05);
  91. display: flex;
  92. flex-direction: column;
  93. }
  94. .card-header {
  95. display: flex;
  96. align-items: center;
  97. margin-bottom: 20rpx;
  98. }
  99. .card-icon {
  100. width: 64rpx;
  101. height: 64rpx;
  102. margin-right: 20rpx;
  103. border-radius: 12rpx;
  104. background-color: #eef5ff;
  105. padding: 10rpx;
  106. }
  107. .header-info {
  108. flex: 1;
  109. display: flex;
  110. flex-direction: column;
  111. }
  112. .item-title {
  113. font-size: 32rpx;
  114. color: #222;
  115. font-weight: bold;
  116. }
  117. .item-status {
  118. font-size: 28rpx;
  119. color: #43cea2;
  120. margin-top: 8rpx;
  121. }
  122. .divider {
  123. height: 1px;
  124. background-color: #eee;
  125. margin: 20rpx 0;
  126. }
  127. .card-info {
  128. font-size: 28rpx;
  129. color: #666;
  130. line-height: 1.6;
  131. display: flex;
  132. flex-direction: column;
  133. gap: 10rpx;
  134. }
  135. .btn-group {
  136. display: flex;
  137. justify-content: flex-end;
  138. margin-top: 20rpx;
  139. }
  140. .main-btn {
  141. font-size: 28rpx;
  142. color: white;
  143. border: none;
  144. border-radius: 100rpx;
  145. background: linear-gradient(to right, #36d1dc, #5b86e5);
  146. box-shadow: 0 6rpx 16rpx rgba(91, 134, 229, 0.3);
  147. transition: all 0.2s ease-in-out;
  148. }
  149. .main-btn:active {
  150. opacity: 0.9;
  151. transform: scale(0.98);
  152. }
  153. .empty-card {
  154. background-color: white;
  155. border-radius: 20rpx;
  156. padding: 60rpx 30rpx;
  157. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
  158. text-align: center;
  159. margin-top: 100rpx;
  160. }
  161. .empty-img {
  162. width: 180rpx;
  163. height: 180rpx;
  164. margin-bottom: 30rpx;
  165. opacity: 0.8;
  166. }
  167. .empty-text {
  168. font-size: 30rpx;
  169. color: #999;
  170. }
  171. </style>