DownloadDetail.uvue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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 v-for="(item,index) in demoData" :key="index">
  18. <uni-tr>
  19. <uni-td class="grid-text">{{item.itemTitle}}</uni-td>
  20. </uni-tr>
  21. <uni-tr class="section-title" @click="enterItem(item.gxid, 0)">
  22. <uni-td class="grid-text">拍照点</uni-td>
  23. <uni-td class="grid-text">{{item.photoitemStep}} / {{item.photoitemTotal}}</uni-td>
  24. <uni-td class="grid-text">{{item.photoitemStatus}}</uni-td>
  25. </uni-tr>
  26. <uni-tr class="section-title" @click="enterItem(item.gxid, 1)">
  27. <uni-td class="grid-text">检验记录</uni-td>
  28. <uni-td class="grid-text">{{item.recordStep}} / {{item.recordTotal}}</uni-td>
  29. <uni-td class="grid-text">{{item.recordStatus}}</uni-td>
  30. </uni-tr>
  31. <uni-tr class="section-title" @click="enterItem(item.gxid, 2)">
  32. <uni-td class="grid-text">关键工序记录</uni-td>
  33. <uni-td class="grid-text">{{item.keypointStep}} / {{item.keypointTotal}}</uni-td>
  34. <uni-td class="grid-text">{{item.keypointStatus}}</uni-td>
  35. </uni-tr>
  36. </uni-table>
  37. </view>
  38. <!-- #ifdef APP -->
  39. </scroll-view>
  40. <!-- #endif -->
  41. </template>
  42. <script setup>
  43. import {
  44. ref,
  45. onMounted
  46. } from 'vue'
  47. import { getList, Download, TaskProcess, getRecordCalculate, RecordCalculate, statusDict, TaskInfo } from '@/api/work';
  48. const titleList = [{
  49. title1: "部位", title2: "进度", title3: "状态"
  50. }];
  51. var taskProcessList = ref<RecordCalculate[]>([]);
  52. var initTasks = [] as RecordCalculate[]
  53. //const statusMap = ref(new Map<number, string>([[1,'未执行'],[2,'执行中'],[3,'执行完'],[4,'检验失败']]))
  54. var demoData = ref<TaskInfo[]>([]);
  55. demoData.value = [
  56. {
  57. gxid: '1',
  58. itemTitle : '20-检验',
  59. photoitemStep : 10,
  60. photoitemTotal: 10,
  61. photoitemStatus : '',
  62. recordStep : 5,
  63. recordTotal : 5,
  64. recordStatus : '不合格',
  65. keypointStep : 4,
  66. keypointTotal : 4,
  67. keypointStatus : ''
  68. } as TaskInfo,
  69. {
  70. gxid: '2',
  71. itemTitle : '50-检验',
  72. photoitemStep : 2,
  73. photoitemTotal: 5,
  74. photoitemStatus : '',
  75. recordStep : 2,
  76. recordTotal : 11,
  77. recordStatus : '',
  78. keypointStep : 3,
  79. keypointTotal : 4,
  80. keypointStatus : ''
  81. } as TaskInfo,
  82. {
  83. gxid: '3',
  84. itemTitle : '80-检验',
  85. photoitemStep : 2,
  86. photoitemTotal: 5,
  87. photoitemStatus : '',
  88. recordStep : 2,
  89. recordTotal : 11,
  90. recordStatus : '',
  91. keypointStep : 3,
  92. keypointTotal : 4,
  93. keypointStatus : ''
  94. } as TaskInfo,
  95. {
  96. gxid: '4',
  97. itemTitle: '100-总检',
  98. photoitemStep: 0,
  99. photoitemTotal: 5,
  100. photoitemStatus: '',
  101. recordStep: 0,
  102. recordTotal: 13,
  103. recordStatus: '',
  104. keypointStep: 0,
  105. keypointTotal: 4,
  106. keypointStatus: ''
  107. } as TaskInfo
  108. ]
  109. const download = ref<Download>({
  110. pdid: 0,
  111. workorder: "",
  112. invname: "",
  113. productno: "",
  114. graphid: "",
  115. cardno: "",
  116. processno: "",
  117. ver: "",
  118. updatetime: "",
  119. progress: "",
  120. status: 1
  121. })
  122. onLoad((options) => {
  123. const downloadId = options?.id ?? ""
  124. // 模拟数据加载,建议替换为后端接口请求
  125. // #ifdef APP-ANDROID
  126. //获取下载产品数据
  127. getList('app_task_info', 'pdid', downloadId,null, null, null).then((res:UTSJSONObject) => {
  128. console.log(res)
  129. let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
  130. if(dataList!=null && dataList.length>0){
  131. dataList.forEach(item =>{
  132. if(item!=null){
  133. let data = JSON.parse<Download>(item.toJSONString());
  134. if(data!=null){
  135. download.value = data
  136. }
  137. }
  138. });
  139. }
  140. })
  141. //获取下载产品任务数据
  142. getRecordCalculate('app_product_points', downloadId, null).then((res:UTSJSONObject) => {
  143. console.log(res)
  144. let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
  145. if(dataList!=null && dataList.length>0){
  146. dataList.forEach(item =>{
  147. if(item!=null){
  148. let task = JSON.parse<RecordCalculate>(item.toJSONString());
  149. if(task!=null){
  150. initTasks.push(task)
  151. }
  152. }
  153. });
  154. }
  155. console.log(initTasks)
  156. taskProcessList.value = initTasks
  157. })
  158. // #endif
  159. })
  160. const goBack = () => {5
  161. uni.navigateBack()
  162. }
  163. const enterItem = (id : string, type : number) => {
  164. let url = ''
  165. if (type == 0) {
  166. url = `/pages/work/download/PhotoRecord`
  167. } else if (type == 1) {
  168. url = `/pages/work/report/InspectionList`
  169. } else if (type == 2) {
  170. url = `/pages/work/process/ProcessList`
  171. }
  172. uni.navigateTo({
  173. url
  174. });
  175. }
  176. </script>
  177. <style scoped>
  178. .container {
  179. padding: 40rpx;
  180. background-color: #f5f7fa;
  181. flex: 1;
  182. box-sizing: border-box;
  183. }
  184. .banner {
  185. background: linear-gradient(135deg, #2193b0, #6dd5ed);
  186. border-radius: 24rpx;
  187. padding: 40rpx 30rpx;
  188. margin-bottom: 40rpx;
  189. box-shadow: 0 8rpx 16rpx rgba(33, 147, 176, 0.3);
  190. }
  191. .banner-title {
  192. color: white;
  193. font-size: 36rpx;
  194. font-weight: bold;
  195. text-align: center;
  196. }
  197. .section {
  198. background-color: #fff;
  199. border-radius: 20rpx;
  200. padding: 30rpx;
  201. margin-bottom: 30rpx;
  202. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
  203. }
  204. .section-title {
  205. display: flex;
  206. flex-direction: row;
  207. flex: 1;
  208. }
  209. .info-item {
  210. display: flex;
  211. justify-content: space-between;
  212. /* #ifdef APP-NVUE */
  213. font-size: 28rpx;
  214. color: #666;
  215. /* #endif */
  216. margin-bottom: 18rpx;
  217. flex-direction: row;
  218. }
  219. .section-content {
  220. font-size: 28rpx;
  221. color: #444;
  222. line-height: 1.8;
  223. white-space: normal;
  224. }
  225. /* 表格容器样式 */
  226. uni-table {
  227. width: 100%;
  228. background-color: #fff; /* 设置表格背景色 */
  229. border-radius: 8rpx;
  230. overflow: hidden;
  231. /* 去除列表样式,解决第一列前的小短横 */
  232. list-style-type: none;
  233. }
  234. /* 表格行样式 */
  235. uni-tr {
  236. width: 100%;
  237. /* #ifdef APP-ANDROID */
  238. border-bottom: 1rpx solid #f0f0f0; /* Android设备添加底边框 */
  239. /* #endif */
  240. }
  241. /* 表格单元格样式 */
  242. uni-td {
  243. /* #ifdef APP-ANDROID */
  244. border-right: 1rpx solid #f0f0f0; /* Android设备添加右边框 */
  245. /* #endif */
  246. }
  247. /* 最后一列去除右边框 */
  248. uni-tr uni-td:last-child {
  249. /* #ifdef APP-ANDROID */
  250. border-right: none;
  251. /* #endif */
  252. }
  253. /* 最后一行去除底边框 */
  254. uni-table uni-tr:last-child {
  255. /* #ifdef APP-ANDROID */
  256. border-bottom: none;
  257. /* #endif */
  258. }
  259. .grid-text {
  260. /* #ifdef APP-NVUE */
  261. font-size: 24rpx;
  262. color: #000;
  263. /* #endif */
  264. /* #ifdef APP-ANDROID */
  265. font-size: 28rpx; /* Android设备上字体稍大一些 */
  266. /* #endif */
  267. padding: 20rpx 16rpx; /* 增加内边距 */
  268. box-sizing: border-box;
  269. margin: 0;
  270. min-width: 180rpx;
  271. background-color: #fff; /* 确保单元格背景色 */
  272. /* 去除列表样式标记 */
  273. list-style-type: none;
  274. list-style-position: inside;
  275. }
  276. .footer-btn {
  277. margin-top: 40rpx;
  278. display: flex;
  279. justify-content: center;
  280. }
  281. .main-btn {
  282. width: 80%;
  283. padding: 28rpx 0;
  284. font-size: 30rpx;
  285. color: #fff;
  286. border: none;
  287. border-radius: 100rpx;
  288. background: linear-gradient(to right, #36d1dc, #5b86e5);
  289. box-shadow: 0 10rpx 24rpx rgba(91, 134, 229, 0.3);
  290. }
  291. .label {
  292. font-weight: bold;
  293. color: #102a43;
  294. min-width: 150rpx;
  295. margin-right: 30rpx;
  296. }
  297. .value {
  298. flex: 1;
  299. /* #ifdef APP-NVUE */
  300. white-space: nowrap;
  301. text-overflow: ellipsis;
  302. /* #endif */
  303. overflow: hidden;
  304. margin-left: 30rpx;
  305. }
  306. .my-radius {
  307. border-radius: 10rpx;
  308. }
  309. .bg-text {
  310. width: 100rpx;
  311. min-width: 80rpx;
  312. border-radius: 10rpx;
  313. text-align: center;
  314. }
  315. .bg-green {
  316. background-color: seagreen;
  317. color: #fff;
  318. }
  319. .bg-yellow {
  320. background-color: yellow;
  321. }
  322. .bg-black {
  323. background-color: #102a43;
  324. color: #fff;
  325. }
  326. .bg-red {
  327. background-color: red;
  328. color: #fff;
  329. }
  330. .ft-red {
  331. color: red;
  332. }
  333. </style>