ProcessList.uvue 8.5 KB

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