rosewiper 2023-12-15
선거문자 20건 분할발송 기능 추가 - 전체선택/해제 기능 추가 - 초기화 버튼 위치 변경 - 문자 발송 완료 메세지 토스트 메세지 방식으로 변경
 - 전체선택/해제 기능 추가
 - 초기화 버튼 위치 변경
 - 문자 발송 완료 메세지 토스트 메세지 방식으로 변경
@16c2f518d8189313682c01dc547c6f78355b8895
src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataCallToListView.jsp
--- src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataCallToListView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataCallToListView.jsp
@@ -79,7 +79,6 @@
 	</c:choose>
 	<div class="list_bottom_right">
 		<button type="button" class="btnType btn_gray fill" id="checkAll" name="receipt_number_check" value="N">전체선택</button>
-		<!-- <button type="button" class="btnType btn_gray fill" onclick="fnCallToListReset();">초기화</button> -->
 		<div class="btn_popup_wrap">
 			<button type="button" class="btnType btn_yellow fill btn_check_one">1명씩 선택<i class="qmMark"></i></button>
 			<div class="error_hover_cont send_hover_cont">
src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataSMLView.jsp
--- src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataSMLView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataSMLView.jsp
@@ -283,37 +283,62 @@
 		
 		$(document).ready(function () {
 			$(".receipt_number_table_wrap .tbody_ul").selectable({
-				selecting: function (event, ui) {
-					console.log("selecting");
-					$(ui.selecting).find("input[type='checkbox']").attr("checked", "checked");
-				},
-				selected: function (event, ui) {
-					if ($(ui.selected).find("input[type='checkbox']").attr("checked") == true) {
-						console.log("selected remove");
-						$(ui.selected).find("input[type='checkbox']").removeAttr("checked");
-					} else {
-						console.log("selected checed");
-						$(ui.selected).find("input[type='checkbox']").attr("checked", "checked");
-					}
+				filter: "li",
+				stop: function () {
+					$(".ui-selected input",this).each(function () {
+						this.checked = !this.checked;
+						if ($(this).is(':checked')) {
+							$(this).closest(".ui-widget-content").addClass("ui-selected");
+						} else {
+							$(this).closest(".ui-widget-content").removeClass("ui-selected");
+						}
+						publishCommon.clickCheckPrice();
+					});
+				}
+			});
+
+			$(".receipt_number_table_wrap .tbody_ul input[type='checkbox']",".receipt_number_table_wrap .tbody_ul input[type='checkbox']+label").click(function () {
+				if ($(this).is(':checked')) {
+					$(this).closest(".ui-widget-content").addClass("ui-selected");
+				} else {
+					$(this).closest(".ui-widget-content").removeClass("ui-selected");
+				}
+			});
+
+			$("#checkAll").click(function(){
+				
+				var checkbox = $('[name=chkCallTo]');
+				var btnAllVal = $("#checkAll").val();
+
+				if($(this).is(":checked") == true){
+					checkbox.prop("checked",false);
+				}else{
 					
+					//전체선택 체크해주기
+					if(btnAllVal == 'N'){
+						
+						//publishCommon.longMousePressCheck(checkbox, 20);
+						publishCommon.clickCheckAll();
+						
+					}else{//전체선택 해제해주기
+						
+						$("input:checkbox[name='chkCallTo']").each(function () {
+							$(this).prop("checked",false);
+						});
+					
+						$("#checkAll").val("N");
+				    	$("#checkAll").text("전체선택");
+						
+					}
+				}
 					publishCommon.clickCheckPrice();
-				},
-				unselecting: function (event, ui) {
-					console.log("unselecting");
-					$(ui.unselecting).find("input[type='checkbox']").removeAttr("checked");
-				},
-				unselected: function (event, ui) {
-					$(ui.unselected).find("input[type='checkbox']").removeAttr("checked");
-					publishCommon.clickCheckPrice();
-				},
-				filter: "li"
+				
 			});
 
 			onlongclick(".btn_check_one", 1000, function () {
 				var checkbox = $('[name=chkCallTo]');
 				publishCommon.longMousePressCheck(checkbox, 10, $(".btn_check_one"));
 				publishCommon.clickCheckPrice();
-				
 			});
 
 			$(".btn_check_one").click(function(){
@@ -322,16 +347,7 @@
 				publishCommon.clickCheckPrice();
 			});
 			
-			$("#checkAll").click(function(){
-				
-				publishCommon.clickCheckAll();
-				publishCommon.clickCheckPrice();
-				
-			});
-
 		});
-		//수신자 목록 추가된 건수 및 발송 금액 변경해주기
-		fnChkCallToChange();
 		
 	});
 	
@@ -342,7 +358,6 @@
 	};
 	
 }
-
 
 //받는사람 하단 페이징 처리
 function fnCallToListPaging(pageIndex){
@@ -3419,6 +3434,14 @@
 		<input type="hidden" name="searchSortOrd" value="" />		
 	</form>
 	
+	<!-- 문자 전송 완료 후 toast(시작) -->
+	<div class="toast_popup success">
+		<i class="icon check"></i>
+		<p class="title">처리가 완료되었습니다.</p>
+		<button type="button" class="btn_close" onclick="publishCommon.toastsUtil('','active','success')"><i></i></button>
+	</div>
+	<!-- 문자 전송 완료 후 toast(끝) -->
+	
 	<!-- 2023 10 16 재전송 : 상세내용 팝업 -->
 	<div class="tooltip-wrap" style="z-index:110;">
 		<div class="popup-com adr_layer rev_popup01" tabindex="0" data-tooltip-con="rev_popup01"
@@ -4295,7 +4318,6 @@
 												</ul>
 												<div class="list_bottom_right">
 													<button type="button" class="btnType btn_gray fill" id="checkAll" name="receipt_number_check" value="N">전체선택</button>
-													<!-- <button type="button" class="btnType btn_gray fill" onclick="fnCallToListReset();">초기화</button> -->
 													<div class="btn_popup_wrap">
 														<button type="button" class="btnType btn_yellow fill btn_check_one">1명씩 선택<i class="qmMark"></i></button>
 														<div class="error_hover_cont send_hover_cont">
src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataView.jsp
--- src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataView.jsp
@@ -1663,7 +1663,7 @@
 						
 					}else{
 						
-						$('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
+						/* $('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
 						
 						//예약발송 건의 경우 결과 팝업 문구 변경
 						if(reserYn == 'Y'){
@@ -1672,7 +1672,17 @@
 							$('.pop_msg_success .msg_text').html("발송 성공 : <strong>"+ smsCnt + "</strong>건,수신거부 : <span>" + blockCnt + "</span>건의<br>문자가 발송 되었습니다.");
 						}
 						
-						$('.mask').addClass('on');
+						$('.mask').addClass('on'); */
+						
+						//문자 예약 및 발송이 완료되면 토스트 메세지 띄워 주기
+						if(reserYn == 'Y'){
+							publishCommon.toastsUtil('문자 예약이 완료되었습니다.','active','success');
+						}else{
+							publishCommon.toastsUtil('문자 발송이 완료되었습니다.','active','success');
+						}
+						
+						//받는사람 리스트 새로 갱신해주기
+						addTWCallToInfo();
 						
 					}
 					
src/main/webapp/js/MJUtill.js
--- src/main/webapp/js/MJUtill.js
+++ src/main/webapp/js/MJUtill.js
@@ -883,6 +883,36 @@
 	txtArea.focus();
 }
 
+//받는사람 목록의 체크박스가 20개가 모두 체크 되었는지 확인
+function fnCallToChkAllCnt(){
+	
+	var chkCnt = 0;
+	var totChkCnt = $("input:checkbox[name='chkCallTo']").length;
+	var btnAllVal = $("#checkAll").val();
+	
+	//체크박스 체크된 갯수 구하기
+	$("input:checkbox[name='chkCallTo']").each(function () {
+		if($(this).is(':checked')){
+			chkCnt++;
+		};
+	});
+	
+	//전체선택 체크 여부 값 변경해 주기
+	//현재 체크된 체크박스 갯수와 전체 체크박스 갯수 비교하기
+	if(totChkCnt > 0 && totChkCnt == chkCnt){
+
+		if(btnAllVal == 'N'){
+	    	$("#checkAll").val("Y");
+	    	$("#checkAll").text("선택해제");
+	    }else{
+	    	$("#checkAll").val("N");
+	    	$("#checkAll").text("전체선택");
+	    }
+	    
+	}
+	
+}
+
 //선거문자 20건 수신자 목록 추가된 건수 및 발송 금액 변경해주기
 function fnChkCallToChange(){
 	
@@ -895,6 +925,9 @@
 		}
 	});
 	
+	//체크박스가 모두 체크 되어있는지 확인 하기
+	fnCallToChkAllCnt();
+	
 	updateTotCnt(callToCnt); //전체 데이터 갯수 구하기
 	totalPriceSum(callToCnt);
 	
src/main/webapp/publish/js/publish.js
--- src/main/webapp/publish/js/publish.js
+++ src/main/webapp/publish/js/publish.js
@@ -19,8 +19,8 @@
       if (this.count == 0) {} else if (cnt >= checkLength) {
         clearInterval(checkEvent); // 자동체크 끝.
       }
-      //$(checkTarget[cnt]).prop('checked', true); // 체크박스 체크.
-      $(checkTarget[cnt]).attr("checked", "checked"); // 체크박스 체크.
+      $(checkTarget[cnt]).prop('checked', true); // 체크박스 체크.
+      //$(checkTarget[cnt]).attr("checked", "checked"); // 체크박스 체크.
       $($target).on("mouseup", function () {
         //마우스떼면 멈춤
         clearInterval(checkEvent);
@@ -37,8 +37,8 @@
       var chkSts = $(this).is(":checked");
 
       if (!chkSts) {
-        $(this).attr("checked", "checked");
-        //$(this).prop("checked","true");
+        //$(this).attr("checked", "checked");
+        $(this).prop("checked",true);
         return false;
       }
 
@@ -61,22 +61,16 @@
     $("input:checkbox[name='chkCallTo']").each(function () {
 
       if (btnAllVal == 'N') {
-        $(this).attr("checked", "checked");
-        //$(this).prop("checked",true);
+        //$(this).attr("checked", "checked");
+        $(this).prop("checked",true);
         
       } else {
-        $(this).removeAttr("checked");
-        //$(this).prop("checked",false);
+        //$(this).removeAttr("checked");
+        $(this).prop("checked",false);
       }
 
     });
 
-    //전체선택 체크 여부 값 변경해 주기
-    if(btnAllVal == 'N'){
-    	$("#checkAll").val("Y");
-    }else{
-    	$("#checkAll").val("N");
-    }
   },
   clickCheckPrice: function () {
 
Add a comment
List