This commit is contained in:
hehihoho3@gmail.com 2024-10-15 14:51:34 +09:00
commit a64c8bc69b
2 changed files with 56 additions and 42 deletions

View File

@ -124,13 +124,13 @@ $(document).ready(function (){
cell.getRow().toggleSelect(); cell.getRow().toggleSelect();
}}, }},
{formatter: "rownum", align: "center", title: "No", hozAlign: "center", headerHozAlign: "center", width: 60}, {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: "groupNm", 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: "name", editor: false, width: 100, validator: ["maxLength:12"]},
{title: "휴대폰번호", hozAlign: "center", field: "addrPhone", editor: false, width: 100, validator: ["required", "minLength:10", "maxLength:11"]}, {title: "휴대폰번호", hozAlign: "center", field: "phone", editor: false, width: 100, validator: ["required", "minLength:10", "maxLength:11"]},
{title: "[*1*]", hozAlign: "center", field: "addrRep1", editor: false, width: 84, validator: ["maxLength:40"]}, {title: "[*1*]", hozAlign: "center", field: "rep1", editor: false, width: 84, validator: ["maxLength:40"]},
{title: "[*2*]", hozAlign: "center", field: "addrRep2", 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: "addrRep3", 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: "addrRep4", 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) { validationFailed: function(cell, value, parameters) {
var valid = cell.isValid(); var valid = cell.isValid();
@ -1202,23 +1202,17 @@ function addPhoneInfo(data){
//기존 받는사람 리스트를 배열에 미리 담아둔다. //기존 받는사람 리스트를 배열에 미리 담아둔다.
if(recTableData.length > 0){ if(recTableData.length > 0){
for(var j=0; j < recTableData.length; j++){ 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}); 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++){ 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}); 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(); //기존 받는사람 목록을 삭제. tableL.clearData(); //기존 받는사람 목록을 삭제.
@ -1767,13 +1761,13 @@ function loadAddrList(){
//받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다. //받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다.
for(var i=0; i < addrList.length; i++){ for(var i=0; i < addrList.length; i++){
tableData.push({ tableData.push({
addrGroupNm: addrList[i].addrGrpNm groupNm: addrList[i].addrGrpNm
, addrPhone: removeDash(addrList[i].addrPhoneNo) , phone: removeDash(addrList[i].addrPhoneNo)
, addrName: addrList[i].addrNm , name: addrList[i].addrNm
, addrRep1: addrList[i].addrInfo1 , rep1: addrList[i].addrInfo1
, addrRep2: addrList[i].addrInfo2 , rep2: addrList[i].addrInfo2
, addrRep3: addrList[i].addrInfo3 , rep3: addrList[i].addrInfo3
, addrRep4: addrList[i].addrInfo4 , rep4: addrList[i].addrInfo4
}); });
} }
@ -1804,40 +1798,56 @@ function loadAddrList(){
} }
//주소록 불러오기에서 수신자 리스트 추가해 주기 //주소록 불러오기에서 수신자 리스트 추가해 주기
function addrToList(){ function addrToList_advc(type){
var tableSize = tableAddr.getDataCount();
var selectedData = tableAddr.getSelectedRows();
var tableData = []; var tableData = [];
if(selectedData == "" || selectedData == null){ if(tableSize < 1){
alert("주소록을 선택해 주세요."); alert("주소록을 선택해 주세요.");
return false; return false;
}else{ // 선택한 Row 데이터 저장해주기 }else{ // 선택한 Row 데이터 저장해주기
for(var i=0; i < selectedData.length; i++){ // 기존 tableL의 데이터를 가져옵니다.
var existingData = tableL.getData();
//좌측 받는사람 리스트를 담아둔 배열에 데이터를 추가해 준다. var addrData;
tableData.push({phone: removeDash(selectedData[i].getData().addrPhone),
name: selectedData[i].getData().addrName, if(type == 'all'){
rep1: selectedData[i].getData().addrRep1, addrData = tableAddr.getData();
rep2: selectedData[i].getData().addrRep2, }else{
rep3: selectedData[i].getData().addrRep3, addrData = tableAddr.getSelectedData();
rep4: selectedData[i].getData().addrRep4}
);
} }
//선택한 데이터 받는사람 리스트에 추가해 주기
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 데이터 지워주기 //주소록 레이어 팝업의 Tabulator 데이터 지워주기
tableAddr.clearData(); tableAddr.clearData();
} }
} }
//주소록 팝업 닫기 기능 //주소록 팝업 닫기 기능
function addrClose(){ function addrClose(){
$(".closeAddr").trigger("click"); $(".closeAddr").trigger("click");
@ -2778,7 +2788,8 @@ $(document).on('click', '#hdnLink', function() {
<!--// table --> <!--// table -->
</div> </div>
<div class="popup_btn_wrap2"> <div class="popup_btn_wrap2">
<button type="button" onClick="javascript:addrToList(); return false;">추가</button> <button type="button" onClick="javascript:addrToList_advc('all'); return false;">전체</button>
<button type="button" onClick="javascript:addrToList_advc('select'); return false;">선택</button>
<button type="button" onClick="javascript:addrClose(); return false;">닫기</button> <button type="button" onClick="javascript:addrClose(); return false;">닫기</button>
</div> </div>
<%-- 주소록 레이어 팝업 닫기 실행 코드 --%> <%-- 주소록 레이어 팝업 닫기 실행 코드 --%>

View File

@ -105,7 +105,10 @@ function fnCheckAll(){
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
<div class="myphoto_info"> <div class="myphoto_info">
<p>일자 <fmt:formatDate pattern = "yyyy-MM-dd" value = "${myMsgList.regdate}" /></p> <p>일자
<fmt:parseDate value="${myMsgList.regdate}" var="loginLastDateValue" pattern="yyyy-MM-dd"/>
<fmt:formatDate value="${loginLastDateValue}" pattern="yyyy-MM-dd"/>
</p>
</div> </div>
</li> </li>
</c:forEach> </c:forEach>