浏览代码

检验任务详情页数据获取修改

ZhangLeo 1 周之前
父节点
当前提交
1e9e0bf4a8
共有 2 个文件被更改,包括 61 次插入40 次删除
  1. 18 0
      api/work.uts
  2. 43 40
      pages/work/download/DownloadDetail.uvue

+ 18 - 0
api/work.uts

@@ -83,6 +83,24 @@ export type TaskInfo = {
 }
 
 
+export type TaskDownload = {
+	pdid : number,
+	gxpk : string,
+	cardno : string,
+	productcode : string,
+	model : string,
+	workorder : string,
+	invname : string,
+	graphid : string,
+	processno : string,
+	gxno : string,
+	ver : string,
+	lastupdatetime ?: string,
+	updateuser ?: string,
+	progress ?: string,
+	uploadflag : number
+}
+
 export function offlineData(data : UTSJSONObject) : Promise<UTSJSONObject> {
 	return new Promise((resolve, reject) => {
 		let result = JSON.parseObject(JSON.stringify(data)) as UTSJSONObject

+ 43 - 40
pages/work/download/DownloadDetail.uvue

@@ -9,7 +9,7 @@
 				<text class="value">{{ download.workorder}}</text>
 			</view>
 			<view class="info-item">
-				<text class="label">{{ download.productno }}</text>
+				<text class="label">{{ download.productcode }}</text>
 				<text class="value">{{ download.invname }}</text>
 			</view>
 		</view>
@@ -47,7 +47,7 @@
 		ref,
 		onMounted
 	} from 'vue'
-	import { getList, Download, TaskProcess, getRecordCalculate, RecordCalculate, statusDict, TaskInfo } from '@/api/work';
+	import { getList, TaskDownload, TaskProcess, getRecordCalculate, RecordCalculate, statusDict, TaskInfo } from '@/api/work';
 
 	const titleList = [{
 		title1: "部位", title2: "进度", title3: "状态"
@@ -112,18 +112,22 @@
 		} as TaskInfo
 	]
 	
-	const download = ref<Download>({
-		pdid: 0,
-		workorder: "",
-		invname: "",
-		productno: "",
-		graphid: "",
-		cardno: "",
-		processno: "",
-		ver: "",
-		updatetime: "",
-		progress: "",
-		status: 1
+	const download = ref<TaskDownload>({
+		pdid : 0,
+		gxpk : '',
+		cardno : '',
+		productcode : '',
+		model : '',
+		workorder : '',
+		invname : '',
+		graphid : '',
+		processno : '',
+		gxno : '',
+		ver : '',
+		lastupdatetime : '',
+		updateuser: '',
+		uploadflag : 0,
+		progress : ''
 	})
 
 	onLoad((options) => {
@@ -131,38 +135,37 @@
 		// 模拟数据加载,建议替换为后端接口请求
         // #ifdef APP-ANDROID
 		    //获取下载产品数据
-         	getList('app_task_info', 'pdid', downloadId,null, null, null).then((res:UTSJSONObject) => {
+         	getList('app_task_info', 'pdid', downloadId, null, null, null).then((res:UTSJSONObject) => {
          	 		console.log(res)
          				let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
          				if(dataList!=null && dataList.length>0){							
-         					dataList.forEach(item =>{
-         						if(item!=null){
-         							let data = JSON.parse<Download>(item.toJSONString());
-         							if(data!=null){
-         								download.value = data
-         							}
-         						}
-         					});
+         					let obj = dataList[0]
+							if (obj != null) {
+								let data = JSON.parse<TaskDownload>(obj.toJSONString());
+								if (data != null) {
+									download.value = data
+								}
+							}
          				} 
          	 })
 			 
-			 //获取下载产品任务数据
-			 getRecordCalculate('app_product_points', downloadId, null).then((res:UTSJSONObject) => {
-			  		console.log(res)
-			 			let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
-			 			if(dataList!=null && dataList.length>0){							
-			 				dataList.forEach(item =>{
-			 					if(item!=null){
-			 						let task = JSON.parse<RecordCalculate>(item.toJSONString());
-			 						if(task!=null){
-			 							initTasks.push(task)
-			 						}
-			 					}
-			 				});
-			 			} 
-				   console.log(initTasks)
-				   taskProcessList.value = initTasks
-			  })
+			 // //获取下载产品任务数据
+			 // getRecordCalculate('app_product_points', downloadId, null).then((res:UTSJSONObject) => {
+			 //  		console.log(res)
+			 // 			let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
+			 // 			if(dataList!=null && dataList.length>0){							
+			 // 				dataList.forEach(item =>{
+			 // 					if(item!=null){
+			 // 						let task = JSON.parse<RecordCalculate>(item.toJSONString());
+			 // 						if(task!=null){
+			 // 							initTasks.push(task)
+			 // 						}
+			 // 					}
+			 // 				});
+			 // 			} 
+				//    console.log(initTasks)
+				//    taskProcessList.value = initTasks
+			 //  })
 			 
         // #endif
 	})