liuhairui 1 year ago
parent
commit
d4c1b93bd0
1 changed files with 37 additions and 9 deletions
  1. 37 9
      src/view/performance/chejianbaogong.vue

+ 37 - 9
src/view/performance/chejianbaogong.vue

@@ -3696,9 +3696,13 @@ const ReportInfo = async () => {
 	const getTimelistss = await getTimelist();
 	console.log(getTimelistss)
 	console.log("获取下机时间")
+	console.log(formData)
 	
-	// console.log(formData)
-	// 获取当前日期
+	//4.1获取报工单其他信息接口
+	const response = await reportInfo({ machine: JTMC.split("#")[0] });
+	// console.log(response)
+	// console.log("reportInfo_01")
+	 
 	// const today = new Date();
 	// const year = today.getFullYear();
 	// const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
@@ -3706,14 +3710,38 @@ const ReportInfo = async () => {
 	// const hours = String(today.getHours()).padStart(2, '0');
 	// const minutes = String(today.getMinutes()).padStart(2, '0');
 	// const seconds = String(today.getSeconds()).padStart(2, '0');
-	// const currentDate = `${year}-${month}-${day}`;
-	// const currentTime = `${year}-${month}-${day} ${hours}:${minutes}`;
-	// const currenttimes = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+	// const currentHour = today.getHours(); // 获取当前的小时
+	// let currentDate = `${year}-${month}-${day}`;
+	// if (!JTMC.endsWith('#')) {
+	//   JTMC += '#';
+	// }
 	
-	//4.1获取报工单其他信息接口
-	const response = await reportInfo({ machine: JTMC.split("#")[0] });
-	// console.log(response)
-	// console.log("reportInfo_01")
+	// console.log("machine--->"+JTMC)
+	// console.log("Gd_gdbh--->"+formData.value.工单编号)
+	// console.log("team--->"+BZMC.value)
+	
+	// const facilityDetailresponse = await facilityDetail({ machine: JTMC, Gd_gdbh: formData.value.工单编号, team:BZMC.value });
+	// console.log(facilityDetailresponse)
+	// console.log("↑↑↑↑facilityDetail_01 ↑↑↑↑↑↑")
+	
+	// // 日产量上报上机时间
+	// // if (facilityDetailresponse.code === 0) {
+	// if(facilityDetailresponse.data === null || facilityDetailresponse.data.length === 0){
+	// 	 if (currentHour < 8 || (currentHour === 8 && minutes < 30)) {
+	// 			// 如果当前时间早于08:30, 则设置为前一天的晚班时间20:30
+	// 			// 需要将日期减一天
+	// 			const yesterDay = new Date(today.getTime() - 86400000); // 减去一天的毫秒数
+	// 			const yearYesterday = yesterDay.getFullYear();
+	// 			const monthYesterday = String(yesterDay.getMonth() + 1).padStart(2, '0');
+	// 			const dayYesterday = String(yesterDay.getDate()).padStart(2, '0');
+	// 			formData.value.上机时间 = `${yearYesterday}-${monthYesterday}-${dayYesterday} 20:30:00`;
+	// 		} else {
+	// 			// 如果当前时间晚于或等于08:30, 则设置为当天的白班时间08:30
+	// 			formData.value.上机时间 = `${currentDate} 08:30:00`;
+	// 		}
+	// }
+	// // }
+	// console.log(formData.value.上机时间)
 	
 	// 日产量上报上机时间
 	if (response.code === 0) {