InspectionList.uvue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <scroll-view scroll-y class="container">
  3. <!-- Banner -->
  4. <view class="banner">
  5. <text class="banner-title">检验记录</text>
  6. </view>
  7. <view class="card-list">
  8. <u-sticky bgColor="#fff">
  9. <u-tabs :list="tabsList"
  10. lineWidth="30"
  11. lineColor="#f56c6c"
  12. :activeStyle="{
  13. color: '#303133',
  14. fontWeight: 'bold',
  15. transform: 'scale(1.05)'
  16. }"
  17. :inactiveStyle="{
  18. color: '#606266',
  19. transform: 'scale(1)'
  20. }"
  21. itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"
  22. @click="tabsClick"
  23. ></u-tabs>
  24. </u-sticky>
  25. </view>
  26. <!-- 检查报告卡片列表 -->
  27. <view v-if="reportList.length" class="card-list">
  28. <view class="card" v-for="item in reportList" :key="item.id">
  29. <view class="divider"></view>
  30. <view class="info-row">
  31. <text class="label">序号</text>
  32. <text class="value">
  33. <u-number-box v-model="item.id" disabled></u-number-box>
  34. </text>
  35. </view>
  36. <view class="info-row">
  37. <text class="label">产品码</text>
  38. <text class="value">
  39. <u-input
  40. v-model="item.productcode"
  41. border="surround"
  42. disabled
  43. ></u-input>
  44. </text>
  45. </view>
  46. <view class="info-row">
  47. <text class="label">检测项目</text>
  48. <text class="value">
  49. <u-input
  50. v-model="item.invname"
  51. border="surround"
  52. disabled
  53. ></u-input>
  54. </text>
  55. </view>
  56. <view class="info-row">
  57. <text class="label">性质</text>
  58. <text class="value">
  59. <u-input
  60. v-model="item.model"
  61. border="surround"
  62. disabled
  63. ></u-input>
  64. </text>
  65. </view>
  66. <view class="info-row">
  67. <text class="label">上限要求</text>
  68. <text class="value">
  69. <u-number-box v-model="item.upperlimit" step="0.1" :min="0.5" decimal-length="1" disabled></u-number-box>
  70. </text>
  71. </view>
  72. <view class="info-row">
  73. <text class="label">下限要求</text>
  74. <text class="value">
  75. <u-number-box v-model="item.lowerlimit" :min="0" disabled></u-number-box>
  76. </text>
  77. </view>
  78. <!--
  79. <view class="btn-group">
  80. <button class="main-btn" @click="viewReport(item)">查看报告</button>
  81. </view>-->
  82. <view class="divider"></view>
  83. <view class="info-row">
  84. <text class="label">实测值小</text>
  85. <text class="value">
  86. <u-number-box v-model="item.minactval" :min="0" ></u-number-box>
  87. </text>
  88. </view>
  89. <view class="info-row">
  90. <text class="label">实测值大</text>
  91. <text class="value">
  92. <u-number-box v-model="item.maxactval" :min="0" ></u-number-box>
  93. </text>
  94. </view>
  95. <view class="info-row">
  96. <text class="label">结论</text>
  97. <text class="value">
  98. <u-input
  99. v-model="item.conclusion"
  100. border="surround"
  101. ></u-input>
  102. </text>
  103. </view>
  104. </view>
  105. </view>
  106. <!-- 空状态 -->
  107. <view v-else class="empty-card">
  108. <image src="/static/image/empty.png" class="empty-img" />
  109. <text class="empty-text">暂无检查检验记录</text>
  110. </view>
  111. </scroll-view>
  112. </template>
  113. <script setup>
  114. import {
  115. ref
  116. } from 'vue'
  117. var current = ref(1)
  118. var reportList = ref([])
  119. const tabsList = ref([{name:1},{name:2},{name:3},{name:4},{name:5},{name:6}]);
  120. const initReportList = ref([{
  121. id: 1,
  122. productcode:"YH0001",
  123. invname: '装配间隙',
  124. model: '定量',
  125. upperlimit:0.5,
  126. lowerlimit:0,
  127. minactval:0,
  128. maxactval:0,
  129. conclusion:'',
  130. applyDate: '2025-08-20 09:15',
  131. reportDate: '2025-08-20 17:30'
  132. },
  133. {
  134. id: 2,
  135. productcode:"YH0001",
  136. invname: '装配间隙',
  137. model: '定量',
  138. upperlimit:0.5,
  139. lowerlimit:0,
  140. minactval:0,
  141. maxactval:0,
  142. conclusion:'',
  143. applyDate: '2025-08-28 10:00',
  144. reportDate: '2025-08-28 13:40'
  145. }
  146. ])
  147. reportList.value = initReportList.value.filter(item=>item.id == current.value)
  148. const tabsClick = (obj) =>{
  149. current = obj.name
  150. reportList.value = initReportList.value.filter(item=>item.id == current)
  151. }
  152. const viewReport = (item) => {
  153. uni.navigateTo({
  154. url: `/pages/work/report/InspectionDetail?id=${item.id}`
  155. })
  156. }
  157. </script>
  158. <style scoped>
  159. .container {
  160. padding: 40rpx;
  161. background-color: #f5f7fa;
  162. min-height: 100vh;
  163. box-sizing: border-box;
  164. }
  165. .banner {
  166. background: linear-gradient(135deg, #6dd5ed, #2193b0);
  167. border-radius: 24rpx;
  168. padding: 40rpx 30rpx;
  169. margin-bottom: 40rpx;
  170. box-shadow: 0 8rpx 16rpx rgba(33, 147, 176, 0.3);
  171. }
  172. .banner-title {
  173. color: white;
  174. font-size: 36rpx;
  175. font-weight: bold;
  176. text-align: center;
  177. }
  178. .box{
  179. width: 40rpx;
  180. background-color: #909193;
  181. border-radius: 15rpx;
  182. }
  183. .card-list {
  184. display: flex;
  185. flex-direction: column;
  186. gap: 30rpx;
  187. }
  188. .card {
  189. background-color: white;
  190. border-radius: 20rpx;
  191. padding: 30rpx;
  192. box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.05);
  193. display: flex;
  194. flex-direction: column;
  195. }
  196. .card-header {
  197. display: flex;
  198. align-items: center;
  199. margin-bottom: 20rpx;
  200. }
  201. .card-icon {
  202. width: 64rpx;
  203. height: 64rpx;
  204. margin-right: 20rpx;
  205. border-radius: 12rpx;
  206. background-color: #eef5ff;
  207. padding: 10rpx;
  208. }
  209. .info-row {
  210. display: flex;
  211. flex-direction: row;
  212. gap: 10rpx;
  213. font-size: 28rpx;
  214. color: #33475b;
  215. align-items: center;
  216. padding: 20rpx;
  217. }
  218. .label {
  219. font-weight: 600;
  220. color: #102a43;
  221. min-width: 150rpx;
  222. }
  223. .value {
  224. flex: 1;
  225. white-space: nowrap;
  226. overflow: hidden;
  227. text-overflow: ellipsis;
  228. }
  229. .divider {
  230. height: 1px;
  231. background-color: #eee;
  232. margin: 20rpx 0;
  233. }
  234. .card-info {
  235. font-size: 28rpx;
  236. color: #666;
  237. line-height: 1.6;
  238. display: flex;
  239. flex-direction: column;
  240. gap: 10rpx;
  241. }
  242. .btn-group {
  243. display: flex;
  244. justify-content: flex-end;
  245. margin-top: 20rpx;
  246. }
  247. .main-btn {
  248. font-size: 28rpx;
  249. color: white;
  250. border: none;
  251. border-radius: 100rpx;
  252. background: linear-gradient(to right, #36d1dc, #5b86e5);
  253. box-shadow: 0 6rpx 16rpx rgba(91, 134, 229, 0.3);
  254. transition: all 0.2s ease-in-out;
  255. }
  256. .main-btn:active {
  257. opacity: 0.9;
  258. transform: scale(0.98);
  259. }
  260. .empty-card {
  261. background-color: white;
  262. border-radius: 20rpx;
  263. padding: 60rpx 30rpx;
  264. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
  265. text-align: center;
  266. margin-top: 100rpx;
  267. }
  268. .empty-img {
  269. width: 180rpx;
  270. height: 180rpx;
  271. margin-bottom: 30rpx;
  272. opacity: 0.8;
  273. }
  274. .empty-text {
  275. font-size: 30rpx;
  276. color: #999;
  277. }
  278. </style>