선거문자 주소록 불러오기 기능 수정
@002869ec69cd78670360857477c0d81fd425153d
--- src/main/webapp/WEB-INF/jsp/web/msgcampain/MsgDataSMLView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/MsgDataSMLView.jsp
... | ... | @@ -124,13 +124,13 @@ |
| 124 | 124 |
cell.getRow().toggleSelect(); |
| 125 | 125 |
}}, |
| 126 | 126 |
{formatter: "rownum", align: "center", title: "No", hozAlign: "center", headerHozAlign: "center", width: 60},
|
| 127 |
- {title: "그룹명", hozAlign: "center", field: "addrGroupNm", editor: false, width: 100, validator: ["required", "minLength:2", "maxLength:40"]},
|
|
| 128 |
- {title: "이름", hozAlign: "center", field: "addrName", editor: false, width: 100, validator: ["maxLength:12"]},
|
|
| 129 |
- {title: "휴대폰번호", hozAlign: "center", field: "addrPhone", editor: false, width: 100, validator: ["required", "minLength:10", "maxLength:11"]},
|
|
| 130 |
- {title: "[*1*]", hozAlign: "center", field: "addrRep1", editor: false, width: 84, validator: ["maxLength:40"]},
|
|
| 131 |
- {title: "[*2*]", hozAlign: "center", field: "addrRep2", editor: false, width: 84, validator: ["maxLength:40"]},
|
|
| 132 |
- {title: "[*3*]", hozAlign: "center", field: "addrRep3", editor: false, width: 84, validator: ["maxLength:40"]},
|
|
| 133 |
- {title: "[*4*]", hozAlign: "center", field: "addrRep4", editor: false, width: 84, validator: ["maxLength:40"]},
|
|
| 127 |
+ {title: "그룹명", hozAlign: "center", field: "groupNm", editor: false, width: 100, validator: ["required", "minLength:2", "maxLength:40"]},
|
|
| 128 |
+ {title: "이름", hozAlign: "center", field: "name", editor: false, width: 100, validator: ["maxLength:12"]},
|
|
| 129 |
+ {title: "휴대폰번호", hozAlign: "center", field: "phone", editor: false, width: 100, validator: ["required", "minLength:10", "maxLength:11"]},
|
|
| 130 |
+ {title: "[*1*]", hozAlign: "center", field: "rep1", editor: false, width: 84, validator: ["maxLength:40"]},
|
|
| 131 |
+ {title: "[*2*]", hozAlign: "center", field: "rep2", editor: false, width: 84, validator: ["maxLength:40"]},
|
|
| 132 |
+ {title: "[*3*]", hozAlign: "center", field: "rep3", editor: false, width: 84, validator: ["maxLength:40"]},
|
|
| 133 |
+ {title: "[*4*]", hozAlign: "center", field: "rep4", editor: false, width: 84, validator: ["maxLength:40"]},
|
|
| 134 | 134 |
], |
| 135 | 135 |
validationFailed: function(cell, value, parameters) {
|
| 136 | 136 |
var valid = cell.isValid(); |
... | ... | @@ -1202,23 +1202,17 @@ |
| 1202 | 1202 |
|
| 1203 | 1203 |
//기존 받는사람 리스트를 배열에 미리 담아둔다. |
| 1204 | 1204 |
if(recTableData.length > 0){
|
| 1205 |
- |
|
| 1206 | 1205 |
for(var j=0; j < recTableData.length; j++){
|
| 1207 |
- |
|
| 1208 | 1206 |
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});
|
| 1209 |
- |
|
| 1210 | 1207 |
} |
| 1211 |
- |
|
| 1212 | 1208 |
} |
| 1213 | 1209 |
|
| 1214 | 1210 |
//받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다. |
| 1215 | 1211 |
for(var i=0; i < newData.length; i++){
|
| 1216 |
- |
|
| 1217 | 1212 |
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});
|
| 1218 |
- |
|
| 1219 | 1213 |
} |
| 1220 | 1214 |
|
| 1221 |
- var temp = tableData.length; |
|
| 1215 |
+ //var temp = tableData.length; |
|
| 1222 | 1216 |
|
| 1223 | 1217 |
//기존 수신 리스트를 지워준 후 신규 전체 리스트를 추가해준다. |
| 1224 | 1218 |
tableL.clearData(); //기존 받는사람 목록을 삭제. |
... | ... | @@ -1767,13 +1761,13 @@ |
| 1767 | 1761 |
//받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다. |
| 1768 | 1762 |
for(var i=0; i < addrList.length; i++){
|
| 1769 | 1763 |
tableData.push({
|
| 1770 |
- addrGroupNm: addrList[i].addrGrpNm |
|
| 1771 |
- , addrPhone: removeDash(addrList[i].addrPhoneNo) |
|
| 1772 |
- , addrName: addrList[i].addrNm |
|
| 1773 |
- , addrRep1: addrList[i].addrInfo1 |
|
| 1774 |
- , addrRep2: addrList[i].addrInfo2 |
|
| 1775 |
- , addrRep3: addrList[i].addrInfo3 |
|
| 1776 |
- , addrRep4: addrList[i].addrInfo4 |
|
| 1764 |
+ groupNm: addrList[i].addrGrpNm |
|
| 1765 |
+ , phone: removeDash(addrList[i].addrPhoneNo) |
|
| 1766 |
+ , name: addrList[i].addrNm |
|
| 1767 |
+ , rep1: addrList[i].addrInfo1 |
|
| 1768 |
+ , rep2: addrList[i].addrInfo2 |
|
| 1769 |
+ , rep3: addrList[i].addrInfo3 |
|
| 1770 |
+ , rep4: addrList[i].addrInfo4 |
|
| 1777 | 1771 |
}); |
| 1778 | 1772 |
} |
| 1779 | 1773 |
|
... | ... | @@ -1804,39 +1798,55 @@ |
| 1804 | 1798 |
} |
| 1805 | 1799 |
|
| 1806 | 1800 |
//주소록 불러오기에서 수신자 리스트 추가해 주기 |
| 1807 |
-function addrToList(){
|
|
| 1808 |
- |
|
| 1809 |
- var selectedData = tableAddr.getSelectedRows(); |
|
| 1801 |
+function addrToList_advc(type){
|
|
| 1802 |
+ var tableSize = tableAddr.getDataCount(); |
|
| 1810 | 1803 |
var tableData = []; |
| 1811 | 1804 |
|
| 1812 |
- if(selectedData == "" || selectedData == null){
|
|
| 1805 |
+ if(tableSize < 1){
|
|
| 1813 | 1806 |
|
| 1814 | 1807 |
alert("주소록을 선택해 주세요.");
|
| 1815 | 1808 |
return false; |
| 1816 | 1809 |
|
| 1817 | 1810 |
}else{ // 선택한 Row 데이터 저장해주기
|
| 1818 | 1811 |
|
| 1819 |
- for(var i=0; i < selectedData.length; i++){
|
|
| 1820 |
- |
|
| 1821 |
- //좌측 받는사람 리스트를 담아둔 배열에 데이터를 추가해 준다. |
|
| 1822 |
- tableData.push({phone: removeDash(selectedData[i].getData().addrPhone),
|
|
| 1823 |
- name: selectedData[i].getData().addrName, |
|
| 1824 |
- rep1: selectedData[i].getData().addrRep1, |
|
| 1825 |
- rep2: selectedData[i].getData().addrRep2, |
|
| 1826 |
- rep3: selectedData[i].getData().addrRep3, |
|
| 1827 |
- rep4: selectedData[i].getData().addrRep4} |
|
| 1828 |
- ); |
|
| 1829 |
- |
|
| 1812 |
+ // 기존 tableL의 데이터를 가져옵니다. |
|
| 1813 |
+ var existingData = tableL.getData(); |
|
| 1814 |
+ var addrData; |
|
| 1815 |
+ |
|
| 1816 |
+ if(type == 'all'){
|
|
| 1817 |
+ addrData = tableAddr.getData(); |
|
| 1818 |
+ }else{
|
|
| 1819 |
+ addrData = tableAddr.getSelectedData(); |
|
| 1830 | 1820 |
} |
| 1831 |
- |
|
| 1832 |
- //선택한 데이터 받는사람 리스트에 추가해 주기 |
|
| 1833 |
- addPhoneInfo(tableData); |
|
| 1834 |
- $(".closeAddr").trigger("click");
|
|
| 1835 | 1821 |
|
| 1822 |
+ // 기존 데이터와 새로운 데이터를 합칩니다. |
|
| 1823 |
+ var combinedData = existingData.concat(addrData); |
|
| 1824 |
+ |
|
| 1825 |
+ // 합쳐진 데이터를 tableL에 설정합니다. |
|
| 1826 |
+ tableL.setData(combinedData); |
|
| 1827 |
+ |
|
| 1828 |
+ //일괄변환 문구 결제금액 처리 |
|
| 1829 |
+ totRows = tableL.getRows().length; |
|
| 1830 |
+ updateTotCnt(totRows); //전체 데이터 갯수 구하기 |
|
| 1831 |
+ var smsTxtArea = $('#smsTxtArea').val();
|
|
| 1832 |
+ if(smsTxtArea.indexOf("[*이름*]") > -1
|
|
| 1833 |
+ || smsTxtArea.indexOf("[*1*]") > -1
|
|
| 1834 |
+ || smsTxtArea.indexOf("[*2*]") > -1
|
|
| 1835 |
+ || smsTxtArea.indexOf("[*3*]") > -1
|
|
| 1836 |
+ || smsTxtArea.indexOf("[*4*]") > -1){
|
|
| 1837 |
+ |
|
| 1838 |
+ fnReplCell(); |
|
| 1839 |
+ }else{
|
|
| 1840 |
+ //결제 금액 구하기 |
|
| 1841 |
+ totalPriceSum(totRows); |
|
| 1842 |
+ } |
|
| 1843 |
+ |
|
| 1844 |
+ $(".closeAddr").trigger("click");
|
|
| 1836 | 1845 |
//주소록 레이어 팝업의 Tabulator 데이터 지워주기 |
| 1837 | 1846 |
tableAddr.clearData(); |
| 1838 | 1847 |
} |
| 1839 | 1848 |
} |
| 1849 |
+ |
|
| 1840 | 1850 |
|
| 1841 | 1851 |
//주소록 팝업 닫기 기능 |
| 1842 | 1852 |
function addrClose(){
|
... | ... | @@ -2778,7 +2788,8 @@ |
| 2778 | 2788 |
<!--// table --> |
| 2779 | 2789 |
</div> |
| 2780 | 2790 |
<div class="popup_btn_wrap2"> |
| 2781 |
- <button type="button" onClick="javascript:addrToList(); return false;">추가</button> |
|
| 2791 |
+ <button type="button" onClick="javascript:addrToList_advc('all'); return false;">전체</button>
|
|
| 2792 |
+ <button type="button" onClick="javascript:addrToList_advc('select'); return false;">선택</button>
|
|
| 2782 | 2793 |
<button type="button" onClick="javascript:addrClose(); return false;">닫기</button> |
| 2783 | 2794 |
</div> |
| 2784 | 2795 |
<%-- 주소록 레이어 팝업 닫기 실행 코드 --%> |
--- src/main/webapp/WEB-INF/jsp/web/msgcampain/MyMsgListAjax.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/MyMsgListAjax.jsp
... | ... | @@ -105,7 +105,10 @@ |
| 105 | 105 |
</c:otherwise> |
| 106 | 106 |
</c:choose> |
| 107 | 107 |
<div class="myphoto_info"> |
| 108 |
- <p>일자 <fmt:formatDate pattern = "yyyy-MM-dd" value = "${myMsgList.regdate}" /></p>
|
|
| 108 |
+ <p>일자 |
|
| 109 |
+ <fmt:parseDate value="${myMsgList.regdate}" var="loginLastDateValue" pattern="yyyy-MM-dd"/>
|
|
| 110 |
+ <fmt:formatDate value="${loginLastDateValue}" pattern="yyyy-MM-dd"/>
|
|
| 111 |
+ </p> |
|
| 109 | 112 |
</div> |
| 110 | 113 |
</li> |
| 111 | 114 |
</c:forEach> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?