InspectionList.uvue 8.1 KB

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