DownloadDetail.uvue 5.0 KB

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