ProcessList.uvue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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
  19. v-for="(tag,index) in 6" :key="index"
  20. :text="tag +''"
  21. size="medium"
  22. type="primary"
  23. circle
  24. @click="tabsClick(tag)"
  25. style="width:40rpx;margin: 0 10rpx;"
  26. ></uni-tag>
  27. </view> -->
  28. <!-- 检查报告卡片列表 -->
  29. <view v-if="processList.length" class="card-list">
  30. <view class="card card-view" v-for="item in processList" :key="item.id" v-show="current == item.id">
  31. <view class="info-row">
  32. <text class="label info-text">序号</text>
  33. <view class="value info-text">
  34. <uni-number-box v-model="item.id" disabled></uni-number-box>
  35. </view>
  36. </view>
  37. <view class="info-row">
  38. <text class="label info-text">产品码</text>
  39. <view class="value info-text">
  40. <input v-model="item.productcode" class="surround" disabled></input>
  41. </view>
  42. </view>
  43. <view class="info-row">
  44. <text class="label info-text">检测项目</text>
  45. <view class="value info-text">
  46. <input v-model="item.invname" class="surround" disabled></input>
  47. </view>
  48. </view>
  49. <view class="info-row">
  50. <text class="label info-text">分类</text>
  51. <view class="value info-text">
  52. <input v-model="item.model" class="surround" disabled></input>
  53. </view>
  54. </view>
  55. <view class="info-row">
  56. <text class="label info-text">上限要求</text>
  57. <view class="value info-text">
  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 info-text">下限要求</text>
  63. <view class="value info-text">
  64. <uni-number-box v-model="item.lowerlimit" :min="0" disabled></uni-number-box>
  65. </view>
  66. </view>
  67. <view class="divider"></view>
  68. <view class="info-row">
  69. <text class="label info-text">实测值小</text>
  70. <view class="value info-text">
  71. <uni-number-box v-model="item.minactval" :min="0"></uni-number-box>
  72. </view>
  73. </view>
  74. <view class="info-row">
  75. <text class="label info-text">实测值大</text>
  76. <view class="value info-text">
  77. <uni-number-box v-model="item.maxactval" :min="0"></uni-number-box>
  78. </view>
  79. </view>
  80. <view class="info-row">
  81. <text class="label info-text">结论</text>
  82. <view class="value info-text">
  83. <input v-model="item.conclusion" class="surround"></input>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- 空状态 -->
  89. <view v-else class="empty-card">
  90. <image src="/static/image/empty.png" class="empty-img" />
  91. <text class="empty-text">暂无检查检验记录</text>
  92. </view>
  93. <view class="info-row btn-panel">
  94. <button class="btn btn-first" @click="tabsClick(current-1)" v-if="current > 1">
  95. 前一项
  96. </button>
  97. <button class="btn btn-second" @click="tabsClick(current+1)" v-if="current < maxcount">
  98. 下一项
  99. </button>
  100. </view>
  101. <!-- #ifdef APP -->
  102. </scroll-view>
  103. <!-- #endif -->
  104. </template>
  105. <script setup>
  106. import {
  107. ref
  108. } from 'vue'
  109. type Process = {
  110. id : number,
  111. productcode : string,
  112. invname : string,
  113. model : string,
  114. upperlimit : number,
  115. lowerlimit : number,
  116. minactval : number,
  117. maxactval : number,
  118. conclusion : string,
  119. applyDate : string,
  120. reportDate : string
  121. }
  122. //检查项目最大数量
  123. var maxcount = 5
  124. var current = ref(1)
  125. var processList = ref<Process[]>([])
  126. const initProcessList = [{
  127. id: 1,
  128. productcode: "YH0001",
  129. invname: '对称度',
  130. model: '重要尺寸',
  131. upperlimit: 0.5,
  132. lowerlimit: 0,
  133. minactval: 0,
  134. maxactval: 0,
  135. conclusion: '',
  136. applyDate: '2025-08-20 09:15',
  137. reportDate: '2025-08-20 17:30'
  138. },
  139. {
  140. id: 2,
  141. productcode: "YH0001",
  142. invname: '对称度',
  143. model: '重要尺寸',
  144. upperlimit: 0.5,
  145. lowerlimit: 0,
  146. minactval: 0,
  147. maxactval: 0,
  148. conclusion: '',
  149. applyDate: '2025-08-28 10:00',
  150. reportDate: '2025-08-28 13:40'
  151. }
  152. ] as Process[];
  153. processList.value = initProcessList.filter(item => item.id == current.value);
  154. const tabsClick = (obj : number) => {
  155. current.value = obj
  156. processList.value = initProcessList.filter(item => item.id == current.value)
  157. }
  158. </script>
  159. <style scoped>
  160. .container {
  161. padding: 40rpx;
  162. background-color: #f5f7fa;
  163. height: 100%;
  164. box-sizing: border-box;
  165. }
  166. .banner {
  167. background: linear-gradient(135deg, #6dd5ed, #2193b0);
  168. border-radius: 24rpx;
  169. padding: 40rpx 30rpx;
  170. margin-bottom: 40rpx;
  171. box-shadow: 0 8rpx 16rpx rgba(33, 147, 176, 0.3);
  172. }
  173. .banner-title {
  174. color: white;
  175. font-size: 36rpx;
  176. font-weight: bold;
  177. text-align: center;
  178. }
  179. .box {
  180. width: 40rpx;
  181. background-color: #909193;
  182. border-radius: 15rpx;
  183. }
  184. .card-list {
  185. display: flex;
  186. flex-direction: column;
  187. }
  188. .card-list .card-view {
  189. margin-bottom: 30rpx;
  190. }
  191. .card {
  192. background-color: white;
  193. border-radius: 20rpx;
  194. padding: 30rpx;
  195. box-shadow: 0 6rpx 20rpx 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. /* #ifdef APP-NVUE */
  216. font-size: 28rpx;
  217. color: #33475b;
  218. /* #endif */
  219. align-items: center;
  220. padding: 20rpx;
  221. }
  222. .info-row .info-text {
  223. margin-right: 10rpx;
  224. }
  225. .label {
  226. font-weight: bold;
  227. color: #102a43;
  228. min-width: 150rpx;
  229. }
  230. .value {
  231. flex: 1;
  232. /* #ifdef APP-NVUE */
  233. white-space: nowrap;
  234. text-overflow: ellipsis;
  235. /* #endif */
  236. overflow: hidden;
  237. }
  238. .divider {
  239. height: 1px;
  240. background-color: #eee;
  241. margin: 20rpx 0;
  242. }
  243. .card-info {
  244. font-size: 28rpx;
  245. color: #666;
  246. line-height: 1.6;
  247. display: flex;
  248. flex-direction: column;
  249. }
  250. .card-info .card-info-view {
  251. margin-bottom: 10rpx;
  252. }
  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>