DownloadDetail.uvue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <!-- #ifdef APP -->
  3. <scroll-view style="flex:1">
  4. <!-- #endif -->
  5. <!-- 报告基础信息 -->
  6. <view class="section">
  7. <view class="info-item">
  8. <text class="label">声像记录任务</text>
  9. <text class="value">{{ download.workorder}}</text>
  10. </view>
  11. <view class="info-item">
  12. <text class="label">{{ download.productno }}</text>
  13. <text class="value">{{ download.invname }}</text>
  14. </view>
  15. </view>
  16. <view class="section">
  17. <uni-table>
  18. <uni-tr class="section-title" v-for="(item,index) in titleList" :key="index">
  19. <uni-td class="grid-text">{{item.title1}}</uni-td>
  20. <uni-td class="grid-text">{{item.title2}}</uni-td>
  21. <uni-td class="grid-text">{{item.title3}}</uni-td>
  22. </uni-tr>
  23. <uni-tr class="section-title" v-for="(taskProcess : TaskProcess,index2 : number) in taskProcessList"
  24. :key="index2" @click="enterProcess(taskProcess.id)">
  25. <uni-td class="grid-text">{{taskProcess.name}}</uni-td>
  26. <uni-td class="grid-text my-radius"
  27. :class="{
  28. 'bg-green': taskProcess.state === 'done',
  29. 'bg-yellow': taskProcess.state === 'doing',
  30. 'bg-black': taskProcess.state === 'waiting',
  31. 'bg-red': taskProcess.state === 'error'
  32. }">{{taskProcess.step}}/{{taskProcess.num}}</uni-td>
  33. <uni-td class="grid-text">
  34. <text :class="{
  35. 'ft-red': taskProcess.state === 'error'
  36. }">{{ taskProcess.state === 'error' ? "检验失败" : "" }}</text>
  37. </uni-td>
  38. </uni-tr>
  39. </uni-table>
  40. </view>
  41. <!-- #ifdef APP -->
  42. </scroll-view>
  43. <!-- #endif -->
  44. </template>
  45. <script setup>
  46. import {
  47. ref,
  48. onMounted
  49. } from 'vue'
  50. const titleList = [{
  51. title1: "部位", title2: "进度", title3: "状态"
  52. }];
  53. const download = {
  54. pdid: 1,
  55. workorder: "632-P-01",
  56. invname: "箱间段",
  57. productno: "1CFA1040-00#S",
  58. graphid: "HBJ0100-00",
  59. cardno: "LK20230707070012",
  60. processno: "Pb/XXX-E11",
  61. ver: "A.1",
  62. updatetime: "2025-06-23",
  63. progress: "1/3"
  64. }
  65. type TaskProcess = {
  66. id : number
  67. name : string
  68. num : number
  69. step : number
  70. state : string
  71. }
  72. const taskProcessList : Array<TaskProcess> = [
  73. { id: 1, name: "前底-外侧", num: 5, step: 5, state: "done" },
  74. { id: 2, name: "后底-外侧", num: 3, step: 3, state: "error" },
  75. { id: 3, name: "简段-外侧", num: 5, step: 2, state: "doing" }
  76. ];
  77. onLoad((options) => {
  78. //const downloadId = options?.id ?? ""
  79. // 模拟数据加载,建议替换为后端接口请求
  80. })
  81. const goBack = () => {
  82. uni.navigateBack()
  83. }
  84. const enterProcess = (id : number) => {
  85. console.log(id);
  86. uni.navigateTo({
  87. url: `/pages/work/record/RecordList?id=${id}`
  88. });
  89. }
  90. </script>
  91. <style scoped>
  92. .container {
  93. padding: 40rpx;
  94. background-color: #f5f7fa;
  95. flex: 1;
  96. box-sizing: border-box;
  97. }
  98. .banner {
  99. background: linear-gradient(135deg, #2193b0, #6dd5ed);
  100. border-radius: 24rpx;
  101. padding: 40rpx 30rpx;
  102. margin-bottom: 40rpx;
  103. box-shadow: 0 8rpx 16rpx rgba(33, 147, 176, 0.3);
  104. }
  105. .banner-title {
  106. color: white;
  107. font-size: 36rpx;
  108. font-weight: bold;
  109. text-align: center;
  110. }
  111. .section {
  112. background-color: #fff;
  113. border-radius: 20rpx;
  114. padding: 30rpx;
  115. margin-bottom: 30rpx;
  116. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
  117. }
  118. .section-title {
  119. display: flex;
  120. flex-direction: row;
  121. flex: 1;
  122. }
  123. .info-item {
  124. display: flex;
  125. justify-content: space-between;
  126. /* #ifdef APP-NVUE */
  127. font-size: 28rpx;
  128. color: #666;
  129. /* #endif */
  130. margin-bottom: 18rpx;
  131. flex-direction: row;
  132. }
  133. .section-content {
  134. font-size: 28rpx;
  135. color: #444;
  136. line-height: 1.8;
  137. white-space: normal;
  138. }
  139. .grid-text {
  140. /* #ifdef APP-NVUE */
  141. font-size: 24rpx;
  142. color: #000;
  143. /* #endif */
  144. padding: 10rpx 0 20rpx 0rpx;
  145. box-sizing: border-box;
  146. margin: 10rpx 20rpx;
  147. min-width: 150rpx;
  148. }
  149. .footer-btn {
  150. margin-top: 40rpx;
  151. display: flex;
  152. justify-content: center;
  153. }
  154. .main-btn {
  155. width: 80%;
  156. padding: 28rpx 0;
  157. font-size: 30rpx;
  158. color: #fff;
  159. border: none;
  160. border-radius: 100rpx;
  161. background: linear-gradient(to right, #36d1dc, #5b86e5);
  162. box-shadow: 0 10rpx 24rpx rgba(91, 134, 229, 0.3);
  163. }
  164. .label {
  165. font-weight: bold;
  166. color: #102a43;
  167. min-width: 150rpx;
  168. margin-right: 30rpx;
  169. }
  170. .value {
  171. flex: 1;
  172. /* #ifdef APP-NVUE */
  173. white-space: nowrap;
  174. text-overflow: ellipsis;
  175. /* #endif */
  176. overflow: hidden;
  177. margin-left: 30rpx;
  178. }
  179. .my-radius {
  180. border-radius: 10rpx;
  181. }
  182. .bg-green {
  183. background-color: seagreen;
  184. }
  185. .bg-yellow {
  186. background-color: yellow;
  187. }
  188. .bg-black {
  189. background-color: #102a43;
  190. }
  191. .bg-red {
  192. background-color: red;
  193. }
  194. .ft-red {
  195. color: red;
  196. }
  197. </style>