InspectionList.uvue 8.4 KB

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