DownloadDetail.uvue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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: 12, step: 2, state: "doing" },
  76. { id: 4, name: "前底-内侧", num: 5, step: 0, state: "waiting" },
  77. { id: 5, name: "后底-内侧", num: 6, step: 0, state: "waiting" },
  78. { id: 6, name: "简段-内侧", num: 3, step: 0, state: "waiting" },
  79. { id: 7, name: "隧道管", num: 5, step: 0, state: "waiting" },
  80. ];
  81. onLoad((options) => {
  82. //const downloadId = options?.id ?? ""
  83. // 模拟数据加载,建议替换为后端接口请求
  84. })
  85. const goBack = () => {
  86. uni.navigateBack()
  87. }
  88. const enterProcess = (id : number) => {
  89. console.log(id);
  90. uni.navigateTo({
  91. url: `/pages/work/record/RecordList?id=${id}`
  92. });
  93. }
  94. </script>
  95. <style scoped>
  96. .container {
  97. padding: 40rpx;
  98. background-color: #f5f7fa;
  99. flex: 1;
  100. box-sizing: border-box;
  101. }
  102. .banner {
  103. background: linear-gradient(135deg, #2193b0, #6dd5ed);
  104. border-radius: 24rpx;
  105. padding: 40rpx 30rpx;
  106. margin-bottom: 40rpx;
  107. box-shadow: 0 8rpx 16rpx rgba(33, 147, 176, 0.3);
  108. }
  109. .banner-title {
  110. color: white;
  111. font-size: 36rpx;
  112. font-weight: bold;
  113. text-align: center;
  114. }
  115. .section {
  116. background-color: #fff;
  117. border-radius: 20rpx;
  118. padding: 30rpx;
  119. margin-bottom: 30rpx;
  120. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
  121. }
  122. .section-title {
  123. display: flex;
  124. flex-direction: row;
  125. flex: 1;
  126. }
  127. .info-item {
  128. display: flex;
  129. justify-content: space-between;
  130. /* #ifdef APP-NVUE */
  131. font-size: 28rpx;
  132. color: #666;
  133. /* #endif */
  134. margin-bottom: 18rpx;
  135. flex-direction: row;
  136. }
  137. .section-content {
  138. font-size: 28rpx;
  139. color: #444;
  140. line-height: 1.8;
  141. white-space: normal;
  142. }
  143. .grid-text {
  144. /* #ifdef APP-NVUE */
  145. font-size: 24rpx;
  146. color: #000;
  147. /* #endif */
  148. padding: 10rpx 0 10rpx 0rpx;
  149. box-sizing: border-box;
  150. margin: 10rpx 10rpx;
  151. min-width: 180rpx;
  152. }
  153. .footer-btn {
  154. margin-top: 40rpx;
  155. display: flex;
  156. justify-content: center;
  157. }
  158. .main-btn {
  159. width: 80%;
  160. padding: 28rpx 0;
  161. font-size: 30rpx;
  162. color: #fff;
  163. border: none;
  164. border-radius: 100rpx;
  165. background: linear-gradient(to right, #36d1dc, #5b86e5);
  166. box-shadow: 0 10rpx 24rpx rgba(91, 134, 229, 0.3);
  167. }
  168. .label {
  169. font-weight: bold;
  170. color: #102a43;
  171. min-width: 150rpx;
  172. margin-right: 30rpx;
  173. }
  174. .value {
  175. flex: 1;
  176. /* #ifdef APP-NVUE */
  177. white-space: nowrap;
  178. text-overflow: ellipsis;
  179. /* #endif */
  180. overflow: hidden;
  181. margin-left: 30rpx;
  182. }
  183. .my-radius {
  184. border-radius: 10rpx;
  185. }
  186. .bg-green {
  187. background-color: seagreen;
  188. color: #fff;
  189. }
  190. .bg-yellow {
  191. background-color: yellow;
  192. }
  193. .bg-black {
  194. background-color: #102a43;
  195. color: #fff;
  196. }
  197. .bg-red {
  198. background-color: red;
  199. color: #fff;
  200. }
  201. .ft-red {
  202. color: red;
  203. }
  204. </style>