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