InspectionList.uvue 6.5 KB

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