selfCheck.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="self-check-container">
  3. <view class="self-check-header">
  4. <text class="header-title">定/自检</text>
  5. <text class="view-all" @click="goToSelfCheckPage('all')">查看全部</text>
  6. </view>
  7. <view class="self-check-content">
  8. <!-- 已过期定检提醒 -->
  9. <view class="check-section">
  10. <view class="section-header">
  11. <text class="section-title">已过期定检提醒</text>
  12. <text class="view-more" @click="goToSelfCheckPage('expired')">查看更多</text>
  13. </view>
  14. <view class="check-item" v-for="(item, index) in expiredItems" :key="index">
  15. <view class="item-indicator expired"></view>
  16. <view class="item-content">
  17. <view class="item-row">
  18. <text class="item-label">{{ item.name }}</text>
  19. <text class="item-label">{{ item.serialNumber }}</text>
  20. <text class="item-date">{{ item.date }}</text>
  21. </view>
  22. <view class="item-row">
  23. <text class="item-label">{{ item.location }}</text>
  24. <text class="item-role">{{ item.role }}</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 两周内到期提醒 -->
  30. <view class="check-section">
  31. <view class="section-header">
  32. <text class="section-title">两周内到期提醒</text>
  33. <text class="view-more" @click="goToSelfCheckPage('twoWeeks')">查看更多</text>
  34. </view>
  35. <view class="check-item" v-for="(item, index) in twoWeeksItems" :key="index">
  36. <view class="item-indicator urgent"></view>
  37. <view class="item-content">
  38. <view class="item-row">
  39. <text class="item-label">{{ item.name }}</text>
  40. <text class="item-label">{{ item.serialNumber }}</text>
  41. <text class="item-date">{{ item.date }}</text>
  42. </view>
  43. <view class="item-row">
  44. <text class="item-label">{{ item.location }}</text>
  45. <text class="item-role">{{ item.role }}</text>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 一月内检到期提醒 -->
  51. <view class="check-section">
  52. <view class="section-header">
  53. <text class="section-title">一月内检到期提醒</text>
  54. <text class="view-more" @click="goToSelfCheckPage('oneMonth')">查看更多</text>
  55. </view>
  56. <view class="check-item" v-for="(item, index) in oneMonthItems" :key="index">
  57. <view class="item-indicator normal"></view>
  58. <view class="item-content">
  59. <view class="item-row">
  60. <text class="item-label">{{ item.name }}</text>
  61. <text class="item-label">{{ item.serialNumber }}</text>
  62. <text class="item-date">{{ item.date }}</text>
  63. </view>
  64. <view class="item-row">
  65. <text class="item-label">{{ item.location }}</text>
  66. <text class="item-role">{{ item.role }}</text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. export default {
  76. name: 'SelfCheck',
  77. data() {
  78. return {
  79. // 已过期定检数据
  80. expiredItems: [
  81. { name: '设备名称', serialNumber: '设备序列号', location: '设备位置', role: '组长、组员、组员', date: '2026-06-10' },
  82. { name: '设备名称', serialNumber: '设备序列号', location: '设备位置', role: '组长、组员、组员', date: '2026-06-10' }
  83. ],
  84. // 两周内到期数据
  85. twoWeeksItems: [
  86. { name: '设备名称', serialNumber: '设备序列号', location: '设备位置', role: '组长、组员、组员', date: '2026-06-10' },
  87. { name: '设备型号', serialNumber: '设备序列号', location: '设备位置', role: '组长、组员、组员', date: '2026-06-10' }
  88. ],
  89. // 一月内到期数据
  90. oneMonthItems: [
  91. { name: '设备型号', serialNumber: '设备序列号', location: '设备位置', role: '组长、组员、组员', date: '2026-06-10' },
  92. { name: '设备型号', serialNumber: '设备序列号', location: '设备位置', role: '组长、组员、组员', date: '2026-06-10' }
  93. ]
  94. }
  95. },
  96. methods: {
  97. goToSelfCheckPage(tab) {
  98. uni.navigateTo({
  99. url: `/pages/selfCheck/index?tab=${tab}`
  100. });
  101. }
  102. }
  103. }
  104. </script>
  105. <style scoped>
  106. .self-check-container {
  107. width: 100%;
  108. padding: 12px;
  109. background-color: #f5f7fa;
  110. }
  111. .self-check-header {
  112. display: flex;
  113. justify-content: space-between;
  114. align-items: center;
  115. margin-bottom: 12px;
  116. }
  117. .header-title {
  118. font-size: 20px;
  119. font-weight: bold;
  120. color: #333;
  121. }
  122. .view-all {
  123. font-size: 14px;
  124. color: #409eff;
  125. }
  126. .self-check-content {
  127. background-color: #fff;
  128. border-radius: 12px;
  129. padding: 12px;
  130. }
  131. .check-section {
  132. margin-bottom: 16px;
  133. }
  134. .check-section:last-child {
  135. margin-bottom: 0;
  136. }
  137. .section-header {
  138. display: flex;
  139. justify-content: space-between;
  140. align-items: center;
  141. margin-bottom: 10px;
  142. }
  143. .section-title {
  144. font-size: 16px;
  145. font-weight: bold;
  146. color: #333;
  147. }
  148. .view-more {
  149. font-size: 14px;
  150. color: #409eff;
  151. }
  152. .check-item {
  153. display: flex;
  154. align-items: flex-start;
  155. padding: 10px 0;
  156. border-bottom: 1px solid #f0f0f0;
  157. }
  158. .check-item:last-child {
  159. border-bottom: none;
  160. }
  161. .item-indicator {
  162. width: 6px;
  163. border-radius: 3px;
  164. margin-right: 10px;
  165. flex-shrink: 0;
  166. }
  167. .item-indicator.expired {
  168. background-color: #8c3c34;
  169. height: 60px;
  170. }
  171. .item-indicator.urgent {
  172. background-color: #ff291f;
  173. height: 60px;
  174. }
  175. .item-indicator.normal {
  176. background-color: #b97c45;
  177. height: 60px;
  178. }
  179. .item-content {
  180. flex: 1;
  181. display: flex;
  182. flex-direction: column;
  183. gap: 6px;
  184. }
  185. .item-row {
  186. display: flex;
  187. justify-content: space-between;
  188. align-items: center;
  189. }
  190. .item-label {
  191. font-size: 14px;
  192. color: #333;
  193. }
  194. .item-date {
  195. font-size: 14px;
  196. color: #333;
  197. }
  198. .item-role {
  199. font-size: 14px;
  200. color: #333;
  201. }
  202. </style>