diff --git a/src/main/webapp/WEB-INF/jsp/web/msgcampain/MsgDataSMLView.jsp b/src/main/webapp/WEB-INF/jsp/web/msgcampain/MsgDataSMLView.jsp index d75dc9a7..c3c3c1ad 100644 --- a/src/main/webapp/WEB-INF/jsp/web/msgcampain/MsgDataSMLView.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/msgcampain/MsgDataSMLView.jsp @@ -124,13 +124,13 @@ $(document).ready(function (){ cell.getRow().toggleSelect(); }}, {formatter: "rownum", align: "center", title: "No", hozAlign: "center", headerHozAlign: "center", width: 60}, - {title: "그룹명", hozAlign: "center", field: "addrGroupNm", editor: false, width: 100, validator: ["required", "minLength:2", "maxLength:40"]}, - {title: "이름", hozAlign: "center", field: "addrName", editor: false, width: 100, validator: ["maxLength:12"]}, - {title: "휴대폰번호", hozAlign: "center", field: "addrPhone", editor: false, width: 100, validator: ["required", "minLength:10", "maxLength:11"]}, - {title: "[*1*]", hozAlign: "center", field: "addrRep1", editor: false, width: 84, validator: ["maxLength:40"]}, - {title: "[*2*]", hozAlign: "center", field: "addrRep2", editor: false, width: 84, validator: ["maxLength:40"]}, - {title: "[*3*]", hozAlign: "center", field: "addrRep3", editor: false, width: 84, validator: ["maxLength:40"]}, - {title: "[*4*]", hozAlign: "center", field: "addrRep4", editor: false, width: 84, validator: ["maxLength:40"]}, + {title: "그룹명", hozAlign: "center", field: "groupNm", editor: false, width: 100, validator: ["required", "minLength:2", "maxLength:40"]}, + {title: "이름", hozAlign: "center", field: "name", editor: false, width: 100, validator: ["maxLength:12"]}, + {title: "휴대폰번호", hozAlign: "center", field: "phone", editor: false, width: 100, validator: ["required", "minLength:10", "maxLength:11"]}, + {title: "[*1*]", hozAlign: "center", field: "rep1", editor: false, width: 84, validator: ["maxLength:40"]}, + {title: "[*2*]", hozAlign: "center", field: "rep2", editor: false, width: 84, validator: ["maxLength:40"]}, + {title: "[*3*]", hozAlign: "center", field: "rep3", editor: false, width: 84, validator: ["maxLength:40"]}, + {title: "[*4*]", hozAlign: "center", field: "rep4", editor: false, width: 84, validator: ["maxLength:40"]}, ], validationFailed: function(cell, value, parameters) { var valid = cell.isValid(); @@ -1202,23 +1202,17 @@ function addPhoneInfo(data){ //기존 받는사람 리스트를 배열에 미리 담아둔다. if(recTableData.length > 0){ - for(var j=0; j < recTableData.length; j++){ - tableData.push({phone: removeDash(recTableData[j].getData().phone) , name: recTableData[j].getData().name, rep1: recTableData[j].getData().rep1, rep2: recTableData[j].getData().rep2, rep3: recTableData[j].getData().rep3, rep4: recTableData[j].getData().rep4}); - } - } //받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다. for(var i=0; i < newData.length; i++){ - tableData.push({phone: removeDash(newData[i].phone) , name: newData[i].name, rep1: newData[i].rep1, rep2: newData[i].rep2, rep3: newData[i].rep3, rep4: newData[i].rep4}); - } - var temp = tableData.length; + //var temp = tableData.length; //기존 수신 리스트를 지워준 후 신규 전체 리스트를 추가해준다. tableL.clearData(); //기존 받는사람 목록을 삭제. @@ -1767,13 +1761,13 @@ function loadAddrList(){ //받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다. for(var i=0; i < addrList.length; i++){ tableData.push({ - addrGroupNm: addrList[i].addrGrpNm - , addrPhone: removeDash(addrList[i].addrPhoneNo) - , addrName: addrList[i].addrNm - , addrRep1: addrList[i].addrInfo1 - , addrRep2: addrList[i].addrInfo2 - , addrRep3: addrList[i].addrInfo3 - , addrRep4: addrList[i].addrInfo4 + groupNm: addrList[i].addrGrpNm + , phone: removeDash(addrList[i].addrPhoneNo) + , name: addrList[i].addrNm + , rep1: addrList[i].addrInfo1 + , rep2: addrList[i].addrInfo2 + , rep3: addrList[i].addrInfo3 + , rep4: addrList[i].addrInfo4 }); } @@ -1804,40 +1798,56 @@ function loadAddrList(){ } //주소록 불러오기에서 수신자 리스트 추가해 주기 -function addrToList(){ - - var selectedData = tableAddr.getSelectedRows(); +function addrToList_advc(type){ + var tableSize = tableAddr.getDataCount(); var tableData = []; - if(selectedData == "" || selectedData == null){ + if(tableSize < 1){ alert("주소록을 선택해 주세요."); return false; }else{ // 선택한 Row 데이터 저장해주기 - for(var i=0; i < selectedData.length; i++){ - - //좌측 받는사람 리스트를 담아둔 배열에 데이터를 추가해 준다. - tableData.push({phone: removeDash(selectedData[i].getData().addrPhone), - name: selectedData[i].getData().addrName, - rep1: selectedData[i].getData().addrRep1, - rep2: selectedData[i].getData().addrRep2, - rep3: selectedData[i].getData().addrRep3, - rep4: selectedData[i].getData().addrRep4} - ); - + // 기존 tableL의 데이터를 가져옵니다. + var existingData = tableL.getData(); + var addrData; + + if(type == 'all'){ + addrData = tableAddr.getData(); + }else{ + addrData = tableAddr.getSelectedData(); } - - //선택한 데이터 받는사람 리스트에 추가해 주기 - addPhoneInfo(tableData); - $(".closeAddr").trigger("click"); + // 기존 데이터와 새로운 데이터를 합칩니다. + var combinedData = existingData.concat(addrData); + + // 합쳐진 데이터를 tableL에 설정합니다. + tableL.setData(combinedData); + + //일괄변환 문구 결제금액 처리 + totRows = tableL.getRows().length; + updateTotCnt(totRows); //전체 데이터 갯수 구하기 + var smsTxtArea = $('#smsTxtArea').val(); + if(smsTxtArea.indexOf("[*이름*]") > -1 + || smsTxtArea.indexOf("[*1*]") > -1 + || smsTxtArea.indexOf("[*2*]") > -1 + || smsTxtArea.indexOf("[*3*]") > -1 + || smsTxtArea.indexOf("[*4*]") > -1){ + + fnReplCell(); + }else{ + //결제 금액 구하기 + totalPriceSum(totRows); + } + + $(".closeAddr").trigger("click"); //주소록 레이어 팝업의 Tabulator 데이터 지워주기 tableAddr.clearData(); } } + //주소록 팝업 닫기 기능 function addrClose(){ $(".closeAddr").trigger("click"); @@ -2778,7 +2788,8 @@ $(document).on('click', '#hdnLink', function() {
일자
일자
+