Sfoglia il codice sorgente

출석체크 개발

sowon4187 5 anni fa
parent
commit
f2c3eecc07

+ 26 - 19
src/main/webapp/WEB-INF/views/web/planning/PlanningEventAttendFormWeb.html

@@ -207,9 +207,12 @@ let calendar = [[${month}]];
 let planInfo = [[${planInfo}]];
 var custAttendList = [[${custAttendList}]];
 var appendHtml = function () {
+	
+	
 	$("#monthTbody").html('');
 	$.each(calendar, function(idx, item)  { 
-		
+
+				
 		html = '<tr>\n';
 		
 		if (item.sun!=null && item.sun!='') {
@@ -233,7 +236,7 @@ var appendHtml = function () {
 		}
 		if (item.tue!=null && item.tue!='') {
 			html += '	<td id="td_'+item.tue+'">\n';
-			html += '		<div class="date"  id="'+item.tue+'">'+item.tue+'</div>\n';
+			html += '		<div class="date" id="'+item.tue+'">'+item.tue+'</div>\n';
 			html += '	</td>\n	';
 		}else{
 			html += '	<td>\n';
@@ -250,7 +253,6 @@ var appendHtml = function () {
 			html += '	</td>\n	';
 		}
 		if (item.thu!=null && item.thu!='') {
-			if (item.thu == item1.entryDt) {
 			html += '	<td id="td_'+item.thu+'">\n';
 			html += '		<div class="date" id="'+item.thu+'">'+item.thu+'</div>\n';
 			html += '	</td>\n	';
@@ -278,8 +280,16 @@ var appendHtml = function () {
 			html += '	</td>\n	';
 		}
 		
-		html += '</tr>\n'
+		html += '</tr>\n';
+
 		$("#monthTbody").append(html);
+		
+		$.each(custAttendList, function(idx1, item1) {
+			if(item1.entryDt == item.sun || item1.entryDt == item.mon || item1.entryDt == item.tue|| item1.entryDt == item.wed
+					|| item1.entryDt == item.thu || item1.entryDt == item.fri || item1.entryDt == item.sat){
+				$("#td_"+item.tue).attr("class","complete");
+			}
+		})
 	
 	})    
 } 
@@ -299,33 +309,30 @@ var fnAttendEntry = function () {
 
 var fnInfoConfirmCallBack = function(result) {
 	mcxDialog.alert(result.msg);
-	custAttendList = result.custAttendList; 
-	
-	$.each(custAttendList, function(idx, item)  {
-		if(item.entryDt == date){
-			$("#td_"+date).attr("class","complete");
-		}else{
-			
-		}
-	}) 
-	
 	appendHtml();
+	$("#td_"+date).attr("class","complete");
+	
 };
 
 $(document).ready(function() {
 	if (!cfCheckLogin()) {
 		$(".day").html("<span>0</span>일");
 	}
-	 
+	
 	appendHtml();
-	$("#td_"+date).attr("class","today");
-	$.each(custAttendList, function(idx, item)  {
+	
+	$.each(custAttendList, function(idx, item) {
 		if(item.entryDt == date){
 			$("#td_"+date).attr("class","complete");
 		}else{
-			
+			$("#td_"+date).attr("class","today"); 
 		}
-	}) 
+	})
+	
+	
+	
+	
+	
 	
 	$(".title").html("<strong>"+month+"월</strong> 출석체크");