DownloadDetail.uvue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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 : RecordCalculate,index2 : number) in taskProcessList"
  24. :key="index2" @click="enterProcess(taskProcess.photoitem)">
  25. <uni-td class="grid-text">{{taskProcess.photoitem}}</uni-td>
  26. <uni-td class="grid-text">
  27. <text :class="{
  28. 'bg-green bg-text': taskProcess.status === 3,
  29. 'bg-yellow bg-text': taskProcess.status === 2,
  30. 'bg-black bg-text': taskProcess.status === 1,
  31. 'bg-red bg-text': taskProcess.status === 4
  32. }">
  33. {{taskProcess.step}}/{{taskProcess.total}}
  34. </text>
  35. </uni-td>
  36. <uni-td class="grid-text">
  37. <text :class="{
  38. 'ft-red': taskProcess.status === 4
  39. }">{{ statusDict[taskProcess.status.toString()] }}</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. import { getList, Download, TaskProcess, getRecordCalculate, RecordCalculate, statusDict } from '@/api/work';
  54. const titleList = [{
  55. title1: "部位", title2: "进度", title3: "状态"
  56. }];
  57. var taskProcessList = ref<RecordCalculate[]>([]);
  58. var initTasks = [] as RecordCalculate[]
  59. //const statusMap = ref(new Map<number, string>([[1,'未执行'],[2,'执行中'],[3,'执行完'],[4,'检验失败']]))
  60. const download = ref<Download>({
  61. pdid: 0,
  62. workorder: "",
  63. invname: "",
  64. productno: "",
  65. graphid: "",
  66. cardno: "",
  67. processno: "",
  68. ver: "",
  69. updatetime: "",
  70. progress: "",
  71. status: 1
  72. })
  73. // #ifdef H5
  74. download.value = {
  75. pdid: 1,
  76. workorder: "632-P-01",
  77. invname: "箱间段",
  78. productno: "1CFA1040-00#S",
  79. graphid: "HBJ0100-00",
  80. cardno: "LK20230707070012",
  81. processno: "Pb/XXX-E11",
  82. ver: "A.1",
  83. updatetime: "2025-06-23",
  84. progress: "1/3"
  85. }
  86. taskProcessList.value = [
  87. { id: 1, name: "前底-外侧", num: 5, step: 5, status: 3 },
  88. { id: 2, name: "后底-外侧", num: 3, step: 3, status: 4 },
  89. { id: 3, name: "简段-外侧", num: 12, step: 2, status: 2 },
  90. { id: 4, name: "前底-内侧", num: 5, step: 0, status: 1 },
  91. { id: 5, name: "后底-内侧", num: 6, step: 0, status: 1 },
  92. { id: 6, name: "简段-内侧", num: 3, step: 0, status: 1 },
  93. { id: 7, name: "隧道管", num: 5, step: 0, status: 1 },
  94. ];
  95. // #endif
  96. onLoad((options) => {
  97. const downloadId = options?.id ?? ""
  98. // 模拟数据加载,建议替换为后端接口请求
  99. // #ifdef APP-ANDROID
  100. //获取下载产品数据
  101. getList('app_product', 'pdid', downloadId,null, null, null).then((res:UTSJSONObject) => {
  102. console.log(res)
  103. let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
  104. if(dataList!=null && dataList.length>0){
  105. dataList.forEach(item =>{
  106. if(item!=null){
  107. let data = JSON.parse<Download>(item.toJSONString());
  108. if(data!=null){
  109. download.value = data
  110. }
  111. }
  112. });
  113. }
  114. })
  115. //获取下载产品任务数据
  116. getRecordCalculate('app_product_points', downloadId, null).then((res:UTSJSONObject) => {
  117. console.log(res)
  118. let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
  119. if(dataList!=null && dataList.length>0){
  120. dataList.forEach(item =>{
  121. if(item!=null){
  122. let task = JSON.parse<RecordCalculate>(item.toJSONString());
  123. if(task!=null){
  124. initTasks.push(task)
  125. }
  126. }
  127. });
  128. }
  129. console.log(initTasks)
  130. taskProcessList.value = initTasks
  131. })
  132. // #endif
  133. })
  134. const goBack = () => {
  135. uni.navigateBack()
  136. }
  137. const enterProcess = (photoitem : string) => {
  138. console.log(photoitem);
  139. uni.navigateTo({
  140. url: `/pages/work/record/RecordList?photoitem=${photoitem}`
  141. });
  142. }
  143. </script>
  144. <style scoped>
  145. .container {
  146. padding: 40rpx;
  147. background-color: #f5f7fa;
  148. flex: 1;
  149. box-sizing: border-box;
  150. }
  151. .banner {
  152. background: linear-gradient(135deg, #2193b0, #6dd5ed);
  153. border-radius: 24rpx;
  154. padding: 40rpx 30rpx;
  155. margin-bottom: 40rpx;
  156. box-shadow: 0 8rpx 16rpx rgba(33, 147, 176, 0.3);
  157. }
  158. .banner-title {
  159. color: white;
  160. font-size: 36rpx;
  161. font-weight: bold;
  162. text-align: center;
  163. }
  164. .section {
  165. background-color: #fff;
  166. border-radius: 20rpx;
  167. padding: 30rpx;
  168. margin-bottom: 30rpx;
  169. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
  170. }
  171. .section-title {
  172. display: flex;
  173. flex-direction: row;
  174. flex: 1;
  175. }
  176. .info-item {
  177. display: flex;
  178. justify-content: space-between;
  179. /* #ifdef APP-NVUE */
  180. font-size: 28rpx;
  181. color: #666;
  182. /* #endif */
  183. margin-bottom: 18rpx;
  184. flex-direction: row;
  185. }
  186. .section-content {
  187. font-size: 28rpx;
  188. color: #444;
  189. line-height: 1.8;
  190. white-space: normal;
  191. }
  192. .grid-text {
  193. /* #ifdef APP-NVUE */
  194. font-size: 24rpx;
  195. color: #000;
  196. /* #endif */
  197. padding: 10rpx 0 10rpx 0rpx;
  198. box-sizing: border-box;
  199. margin: 10rpx 10rpx;
  200. min-width: 180rpx;
  201. }
  202. .footer-btn {
  203. margin-top: 40rpx;
  204. display: flex;
  205. justify-content: center;
  206. }
  207. .main-btn {
  208. width: 80%;
  209. padding: 28rpx 0;
  210. font-size: 30rpx;
  211. color: #fff;
  212. border: none;
  213. border-radius: 100rpx;
  214. background: linear-gradient(to right, #36d1dc, #5b86e5);
  215. box-shadow: 0 10rpx 24rpx rgba(91, 134, 229, 0.3);
  216. }
  217. .label {
  218. font-weight: bold;
  219. color: #102a43;
  220. min-width: 150rpx;
  221. margin-right: 30rpx;
  222. }
  223. .value {
  224. flex: 1;
  225. /* #ifdef APP-NVUE */
  226. white-space: nowrap;
  227. text-overflow: ellipsis;
  228. /* #endif */
  229. overflow: hidden;
  230. margin-left: 30rpx;
  231. }
  232. .my-radius {
  233. border-radius: 10rpx;
  234. }
  235. .bg-text {
  236. width: 100rpx;
  237. min-width: 80rpx;
  238. border-radius: 10rpx;
  239. text-align: center;
  240. }
  241. .bg-green {
  242. background-color: seagreen;
  243. color: #fff;
  244. }
  245. .bg-yellow {
  246. background-color: yellow;
  247. }
  248. .bg-black {
  249. background-color: #102a43;
  250. color: #fff;
  251. }
  252. .bg-red {
  253. background-color: red;
  254. color: #fff;
  255. }
  256. .ft-red {
  257. color: red;
  258. }
  259. </style>