친구톡 발송 엑셀 불러오기 대량으로 수정
This commit is contained in:
parent
995aef6f4b
commit
f22a5850e1
129
src/main/java/itn/com/cmm/MjonFTSendVO.java
Normal file
129
src/main/java/itn/com/cmm/MjonFTSendVO.java
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
package itn.com.cmm;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
public class MjonFTSendVO{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 수신자번호
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : [*이름*] - 치환문자
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : [*1*] - 치환문자
|
||||||
|
*/
|
||||||
|
private String rep1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : [*2*] - 치환문자
|
||||||
|
*/
|
||||||
|
private String rep2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : [*3*] - 치환문자
|
||||||
|
*/
|
||||||
|
private String rep3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : [*4*] - 치환문자
|
||||||
|
*/
|
||||||
|
private String rep4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 문자ID
|
||||||
|
*/
|
||||||
|
private String msgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 전송그룹ID (대량문자의 경우 하나의 그룹으로 세팅)
|
||||||
|
*/
|
||||||
|
private String msgGroupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 문자온 일반회원ID
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 발신번호 (하이픈 등의 문자를 제외한 12byte이하의 숫자로 입력한다.)
|
||||||
|
*/
|
||||||
|
private String callFrom;
|
||||||
|
/**
|
||||||
|
* @description : 수신번호 (하이픈 등의 문자를 제외한 12byte이하의 숫자로 입력한다.)
|
||||||
|
*/
|
||||||
|
private String callTo;
|
||||||
|
/**
|
||||||
|
* @description : 예약 발송일시
|
||||||
|
*/
|
||||||
|
private String reqDate;
|
||||||
|
/**
|
||||||
|
* @description :전송사(04:다우, 05:JJ, 07:IVT, 01:아이하트 , 02:현대퓨처넷, 03:아이엠오)
|
||||||
|
*/
|
||||||
|
private String agentCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : MMS용 메시지제목
|
||||||
|
*/
|
||||||
|
private String subject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : SMS용 메시지본문
|
||||||
|
*/
|
||||||
|
private String smsTxt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 메세지타입(4: SMS 전송, 5: URL 전송, 6: MMS전송, 7: BARCODE전송, 8: 카카오 알림톡 전송)
|
||||||
|
*/
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 첨부파일 갯수
|
||||||
|
*/
|
||||||
|
private String fileCnt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 파일이름1
|
||||||
|
*/
|
||||||
|
private String filePath1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 파일이름2
|
||||||
|
*/
|
||||||
|
private String filePath2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 파일이름3
|
||||||
|
*/
|
||||||
|
private String filePath3;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : event 여부 / group tb에 넣는 용도 / 기본값 N
|
||||||
|
*/
|
||||||
|
private String eventYn="N";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : 개별단가
|
||||||
|
*/
|
||||||
|
private String eachPrice;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import itn.com.cmm.MjonFTSendVO;
|
||||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@ -262,6 +263,8 @@ public class KakaoVO extends MjonMsgVO{
|
|||||||
|
|
||||||
private List<Map<String, String>> varListMap;
|
private List<Map<String, String>> varListMap;
|
||||||
|
|
||||||
|
private List<MjonFTSendVO> mjonFTSendVOList = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String varListMapString = "[";
|
String varListMapString = "[";
|
||||||
@ -286,6 +289,18 @@ public class KakaoVO extends MjonMsgVO{
|
|||||||
}
|
}
|
||||||
varListMapString += "]";
|
varListMapString += "]";
|
||||||
|
|
||||||
|
|
||||||
|
StringBuilder mjonFTListSb = new StringBuilder("[");
|
||||||
|
if (mjonFTSendVOList != null && !mjonFTSendVOList.isEmpty()) {
|
||||||
|
String prefix = "";
|
||||||
|
for (MjonFTSendVO vo : mjonFTSendVOList) {
|
||||||
|
mjonFTListSb.append(prefix).append(vo == null ? "null" : vo.toString());
|
||||||
|
prefix = ", ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mjonFTListSb.append("]");
|
||||||
|
|
||||||
|
|
||||||
return "KakaoSendAdvcVO[" +
|
return "KakaoSendAdvcVO[" +
|
||||||
"\n senderKey=[" + senderKey + "]" +
|
"\n senderKey=[" + senderKey + "]" +
|
||||||
"\n , subMsgTxtReplYn=[" + subMsgTxtReplYn + "]" +
|
"\n , subMsgTxtReplYn=[" + subMsgTxtReplYn + "]" +
|
||||||
@ -312,6 +327,7 @@ public class KakaoVO extends MjonMsgVO{
|
|||||||
"\n , varListMap=[" + varListMapString + "]" +
|
"\n , varListMap=[" + varListMapString + "]" +
|
||||||
"\n , befCash=[" + getBefCash() + "]" +
|
"\n , befCash=[" + getBefCash() + "]" +
|
||||||
"\n , befPoint=[" + getBefPoint() + "]" +
|
"\n , befPoint=[" + getBefPoint() + "]" +
|
||||||
|
"\n , mjonFTSendVOList=" + mjonFTListSb.toString() +
|
||||||
"\n ]";
|
"\n ]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,8 +11,10 @@ import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
|||||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||||
import itn.let.kakao.user.kakaoFt.service.KakaoFriendsTalkService;
|
import itn.let.kakao.user.kakaoFt.service.KakaoFriendsTalkService;
|
||||||
import itn.let.mail.service.StatusResponse;
|
import itn.let.mail.service.StatusResponse;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Service("kakaoFriendsTalkTemplateService")
|
@Slf4j
|
||||||
|
@Service("KakaoFriendsTalkService")
|
||||||
public class KakaoFriendsTalkServiceImpl extends EgovAbstractServiceImpl implements KakaoFriendsTalkService{
|
public class KakaoFriendsTalkServiceImpl extends EgovAbstractServiceImpl implements KakaoFriendsTalkService{
|
||||||
|
|
||||||
@Resource(name = "egovFriendstalkTemplateIdService")
|
@Resource(name = "egovFriendstalkTemplateIdService")
|
||||||
@ -25,10 +27,16 @@ public class KakaoFriendsTalkServiceImpl extends EgovAbstractServiceImpl implem
|
|||||||
public StatusResponse insertKakaoFtSandAjax_advc(KakaoVO kakaoVO, HttpServletRequest request) {
|
public StatusResponse insertKakaoFtSandAjax_advc(KakaoVO kakaoVO, HttpServletRequest request) {
|
||||||
StatusResponse statusResponse = new StatusResponse();
|
StatusResponse statusResponse = new StatusResponse();
|
||||||
|
|
||||||
|
log.info(" + kakaoVO.toString() :: [{}]", kakaoVO.toString());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// KakaoSendAdvcVO 발송 VO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
statusResponse.setStatus(HttpStatus.OK);
|
statusResponse.setStatus(HttpStatus.OK);
|
||||||
// statusResponse.setObject(returnMap);
|
// statusResponse.setObject(returnMap);
|
||||||
return statusResponse;
|
return statusResponse;
|
||||||
|
|||||||
@ -72,7 +72,7 @@ public class KakaoFriendsTalkSendController {
|
|||||||
@Resource(name = "kakaoFriendsTalkTemplateService")
|
@Resource(name = "kakaoFriendsTalkTemplateService")
|
||||||
private KakaoFriendsTalkTemplateService kakaoFtTemplateService;
|
private KakaoFriendsTalkTemplateService kakaoFtTemplateService;
|
||||||
|
|
||||||
@Resource(name = "kakaoFriendsTalkService")
|
@Resource(name = "KakaoFriendsTalkService")
|
||||||
private KakaoFriendsTalkService kakaoFriendsTalkService;
|
private KakaoFriendsTalkService kakaoFriendsTalkService;
|
||||||
|
|
||||||
/** userManageService */
|
/** userManageService */
|
||||||
|
|||||||
@ -14,6 +14,8 @@
|
|||||||
<script type="text/javascript" src="<c:out value='/js/kakao/at/addr.js' />"></script>
|
<script type="text/javascript" src="<c:out value='/js/kakao/at/addr.js' />"></script>
|
||||||
<script type="text/javascript" src="<c:out value='/js/common/popup.js' />"></script>
|
<script type="text/javascript" src="<c:out value='/js/common/popup.js' />"></script>
|
||||||
<script type="text/javascript" src="<c:out value='/js/kakao/ft/friendstalkExcel.js' />"></script>
|
<script type="text/javascript" src="<c:out value='/js/kakao/ft/friendstalkExcel.js' />"></script>
|
||||||
|
<!-- 주소록 유효성 체크 공통유틸로 인해 추가 -->
|
||||||
|
<script type="text/javascript" src="<c:url value='/js/web/addr/cmn.js?date=202409021440'/>"></script>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -25,8 +27,9 @@ var _fileForm2 = new Array();
|
|||||||
var fileExt = ""; // 첨부파일 확장자
|
var fileExt = ""; // 첨부파일 확장자
|
||||||
var excelAddr = []; //엑셀 불러오기에서 내용 저장하는 배열 변수
|
var excelAddr = []; //엑셀 불러오기에서 내용 저장하는 배열 변수
|
||||||
|
|
||||||
|
var KAKAO_FT_PRICE = $('#kakaoFtPrice').val();
|
||||||
$(document).ready(function (){
|
$(document).ready(function (){
|
||||||
|
KAKAO_FT_PRICE = $('#kakaoFtPrice').val();
|
||||||
//화면 초기 로딩시 화면 처리해주기 - 템플릿 불러오기 했을 경우를 위함
|
//화면 초기 로딩시 화면 처리해주기 - 템플릿 불러오기 했을 경우를 위함
|
||||||
initFormChk();
|
initFormChk();
|
||||||
|
|
||||||
@ -159,6 +162,26 @@ $(document).ready(function (){
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//치환문자 있는 엑섹불러오기 버튼 클릭시 파일 첨부 실행
|
||||||
|
$('.c3').click(function(){ // 엑셀파일 불러오기 선택 시
|
||||||
|
|
||||||
|
$("#excelFile").click();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#excelFile").on("change", function(event) {
|
||||||
|
var fileInfo = event.target.files;
|
||||||
|
if(fileInfo.length > 0){
|
||||||
|
excelFileChange(fileInfo[0]);
|
||||||
|
} else {
|
||||||
|
fn_loadRemoveActive(); // 파일이 선택되지 않은 경우 로딩 상태 제거
|
||||||
|
setTimeout(() => { $(this).val(''); }, 0); // 파일 선택 초기화
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function initFormChk(){
|
function initFormChk(){
|
||||||
@ -1205,7 +1228,7 @@ function fn_sendMsgData(){
|
|||||||
// 빈 값 제거
|
// 빈 값 제거
|
||||||
removeEmptyValues(formData);
|
removeEmptyValues(formData);
|
||||||
// 선택된 데이터 추가
|
// 선택된 데이터 추가
|
||||||
formData["mjonFtSendVOList"] = $selectedData;
|
formData["mjonFTSendVOList"] = $selectedData;
|
||||||
// JSON 데이터 확인
|
// JSON 데이터 확인
|
||||||
console.log("최종 formData:", JSON.stringify(formData));
|
console.log("최종 formData:", JSON.stringify(formData));
|
||||||
|
|
||||||
@ -1221,7 +1244,12 @@ function fn_sendMsgData(){
|
|||||||
, processData: false
|
, processData: false
|
||||||
, contentType: false
|
, contentType: false
|
||||||
, cache: false
|
, cache: false
|
||||||
, success: function (returnData, status) {
|
, success: function (returnData) {
|
||||||
|
|
||||||
|
console.log('returnData : ', returnData);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
if(status == 'success'){
|
if(status == 'success'){
|
||||||
if("loginFail" == returnData.result){
|
if("loginFail" == returnData.result){
|
||||||
|
|
||||||
@ -1253,7 +1281,7 @@ function fn_sendMsgData(){
|
|||||||
|
|
||||||
$('.mask').addClass('on');
|
$('.mask').addClass('on');
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
}
|
}
|
||||||
,beforeSend : function(xmlHttpRequest) {
|
,beforeSend : function(xmlHttpRequest) {
|
||||||
//로딩창 show
|
//로딩창 show
|
||||||
@ -1716,6 +1744,10 @@ function msgResultLink(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateButtons(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- 로딩바 -->
|
<!-- 로딩바 -->
|
||||||
@ -2214,7 +2246,7 @@ function msgResultLink(){
|
|||||||
<button type="button" data-tooltip="popup06" class="btnType btnType7 popupAddr">주소록 불러오기</button>
|
<button type="button" data-tooltip="popup06" class="btnType btnType7 popupAddr">주소록 불러오기</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn_popup_wrap">
|
<div class="btn_popup_wrap">
|
||||||
<button type="button" data-tooltip="popup02" class="btnType btnType7">엑셀 불러오기</button>
|
<button type="button" data-tooltip="popup07" class="btnType btnType7">엑셀 불러오기</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn_popup_wrap">
|
<div class="btn_popup_wrap">
|
||||||
<button type="button" data-tooltip="popup03" class="btnType btnType7 tab1">최근 전송내역</button>
|
<button type="button" data-tooltip="popup03" class="btnType btnType7 tab1">최근 전송내역</button>
|
||||||
@ -2539,22 +2571,25 @@ function msgResultLink(){
|
|||||||
<!--// 주소록 불러오기 -->
|
<!--// 주소록 불러오기 -->
|
||||||
|
|
||||||
<!-- 엑셀 불러오기 -->
|
<!-- 엑셀 불러오기 -->
|
||||||
<form id="excelToolTipForm" name="excelToolTipForm" method="post">
|
<form id="excelForm" name="excelForm" method="post">
|
||||||
<div class="tooltip-wrap">
|
<div class="tooltip-wrap">
|
||||||
<div class="popup-com import_layer popup02" tabindex="0" data-tooltip-con="popup02" data-focus="popup02" data-focus-prev="popup02-close">
|
<!-- <div class="popup-com import_layer popup07" tabindex="0" data-tooltip-con="popup07" data-focus="popup07" data-focus-prev="popup07-close"> -->
|
||||||
<div class="popup_heading">
|
<div class="popup-com adr_layer popup07" tabindex="0" data-tooltip-con="popup07" data-focus="popup07" data-focus-prev="popup07-close" style="width: 1000px;">
|
||||||
|
<%@include file="/WEB-INF/jsp/web/kakao/msgdata/include/ftDataIncludeExcel.jsp" %>
|
||||||
|
<%-- <%@include file="/WEB-INF/jsp/web/msgdata/include/msgDataIncludeExcel.jsp" %> --%>
|
||||||
|
<!-- <div class="popup_heading">
|
||||||
<p><span>엑셀</span> 불러오기</p>
|
<p><span>엑셀</span> 불러오기</p>
|
||||||
<button type="button" class="tooltip-close" data-focus="popup02-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
|
<button type="button" class="tooltip-close" data-focus="popup07-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="layer_in">
|
<div class="layer_in">
|
||||||
<!-- 엑셀파일 불러오기 -->
|
엑셀파일 불러오기
|
||||||
<div class="hascont">
|
<div class="hascont">
|
||||||
<div class="titBox">
|
<div class="titBox">
|
||||||
<p>- 최대 2만 건까지 등록할 수 있습니다.</p>
|
<p>- 최대 2만 건까지 등록할 수 있습니다.</p>
|
||||||
<p>- [엑셀 불러오기]시 문서의 A, B열을 불러옵니다.(지원하는 파일 형식 : xls, xlsx)</p>
|
<p>- [엑셀 불러오기]시 문서의 A, B열을 불러옵니다.(지원하는 파일 형식 : xls, xlsx)</p>
|
||||||
<p>- 휴대폰 항목은 숫자, 하이픈(-)만 인식하며, 번호 앞에 0이 생략되어도 정상 등록됩니다.
|
<p>- 휴대폰 항목은 숫자, 하이픈(-)만 인식하며, 번호 앞에 0이 생략되어도 정상 등록됩니다.
|
||||||
</p>
|
</p>
|
||||||
<!-- <button type="button" class="excel_btn" onclick="location.href='/cmm/fms/FileDown.do?atchFileId=FILE_000000000011651&fileSn=1'"><i></i>샘플파일 다운로드</button> -->
|
<button type="button" class="excel_btn" onclick="location.href='/cmm/fms/FileDown.do?atchFileId=FILE_000000000011651&fileSn=1'"><i></i>샘플파일 다운로드</button>
|
||||||
<button type="button" class="excel_btn" onclick="location.href='/download/msg/엑셀주소록_등록양식.xlsx'"><i class="downroad"></i>샘플파일 다운로드</button>
|
<button type="button" class="excel_btn" onclick="location.href='/download/msg/엑셀주소록_등록양식.xlsx'"><i class="downroad"></i>샘플파일 다운로드</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="attachedFile">
|
<div class="attachedFile">
|
||||||
@ -2562,15 +2597,15 @@ function msgResultLink(){
|
|||||||
<input type="text" id="excelNm" value="" readonly>
|
<input type="text" id="excelNm" value="" readonly>
|
||||||
<input type="file" id="excelFile" accept=".xls, .xlsx" onchange="excelExport(event); return false;" style="display:none"/>
|
<input type="file" id="excelFile" accept=".xls, .xlsx" onchange="excelExport(event); return false;" style="display:none"/>
|
||||||
<button type="button" class="btnType btnType6 c1">찾아보기</button>
|
<button type="button" class="btnType btnType6 c1">찾아보기</button>
|
||||||
<!-- <p><span class="vMiddle">*</span> 첨부된 파일은 <span class="c_e40000">[추가]버튼을 클릭</span>하셔야 받는 사람에 등록됩니다.</p> -->
|
<p><span class="vMiddle">*</span> 첨부된 파일은 <span class="c_e40000">[추가]버튼을 클릭</span>하셔야 받는 사람에 등록됩니다.</p>
|
||||||
<p><span class="vMiddle">*</span> 첨부된 파일은 <span class="c_e40000">[추가]버튼을 클릭</span>하셔야 받는 사람에 등록됩니다.</p>
|
<p><span class="vMiddle">*</span> 첨부된 파일은 <span class="c_e40000">[추가]버튼을 클릭</span>하셔야 받는 사람에 등록됩니다.</p>
|
||||||
</div>
|
</div>
|
||||||
</div><!--// 엑셀파일 불러오기 -->
|
</div>// 엑셀파일 불러오기
|
||||||
<div class="popup_btn_wrap2">
|
<div class="popup_btn_wrap2">
|
||||||
<button type="button" class="tooltip-close" data-focus="popup02-close" data-focus-next="popup02" id="excelAdd">추가</button>
|
<button type="button" class="tooltip-close" data-focus="popup07-close" data-focus-next="popup07" id="excelAdd">추가</button>
|
||||||
<button type="button" class="tooltip-close" data-focus="popup02-close" data-focus-next="popup02">닫기</button>
|
<button type="button" class="tooltip-close" data-focus="popup07-close" data-focus-next="popup07">닫기</button>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div><!--// 엑셀 불러오기 -->
|
</div><!--// 엑셀 불러오기 -->
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -0,0 +1,957 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||||
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="<c:url value='/publish/js/content.js'/>"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
var $tableExcel = null; //엑셀입력 탭
|
||||||
|
var $tableError = null; //엑셀입력 탭
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
//Tabulator AJAX Data Loading
|
||||||
|
$tableError = new Tabulator("#tabulator_error", {
|
||||||
|
height:"255px",
|
||||||
|
width:"100%",
|
||||||
|
layout:"fitColumns",
|
||||||
|
autoColumns:false,
|
||||||
|
headerHozAlign:"center",
|
||||||
|
validationMode:"highlight",
|
||||||
|
clipboard:false,
|
||||||
|
clipboardCopySelector:"table",
|
||||||
|
clipboardPasteAction:"insert", // insert, update, replace
|
||||||
|
placeholder:"등록 팝업에서 휴대폰을 선택 후 확인해주세요.", //fit columns to width of table (optional)
|
||||||
|
columns:[ //Define Table Columns
|
||||||
|
{title:"이름", field:"name", hozAlign:"center", headerHozAlign: "center", width:125},
|
||||||
|
{title:"휴대폰", field:"phone", hozAlign:"center", headerHozAlign: "center"},
|
||||||
|
{title:"미등록 결과", field:"result", hozAlign:"center", headerHozAlign: "center"}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//Tabulator AJAX Data Loading
|
||||||
|
$tableExcel = new Tabulator("#tabulator_excel", {
|
||||||
|
height:"255px",
|
||||||
|
width:"100%",
|
||||||
|
layout:"fitColumns",
|
||||||
|
autoColumns:false,
|
||||||
|
headerHozAlign:"center",
|
||||||
|
validationMode:"highlight",
|
||||||
|
clipboard:false,
|
||||||
|
clipboardCopySelector:"table",
|
||||||
|
clipboardPasteAction:"insert", // insert, update, replace
|
||||||
|
placeholder:"Excel 파일을 업로드 해주세요.", //fit columns to width of table (optional)
|
||||||
|
columns:[ //Define Table Columns
|
||||||
|
{formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, headerHozAlign:"center", hozAlign:"center", headerSort:false, cellClick:function(e, cell){
|
||||||
|
cell.getRow().toggleSelect();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{formatter:"rownum", align:"center" ,title:"No", hozAlign:"center", headerHozAlign:"center", width:50},
|
||||||
|
{title:"A", field:"A", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
||||||
|
{title:"B", field:"B", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
||||||
|
{title:"C", field:"C", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
||||||
|
{title:"D", field:"D", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
||||||
|
{title:"E", field:"E", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
||||||
|
{title:"F", field:"F", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]}
|
||||||
|
],
|
||||||
|
validationFailed:function(cell, value, parameters){ // 유효성 체크 함수
|
||||||
|
var valid = cell.isValid();
|
||||||
|
if(!valid){
|
||||||
|
alert("양식에 맞지 않는 정보가 입력되었습니다.");
|
||||||
|
|
||||||
|
//해당 셀 데이터 삭제
|
||||||
|
cell.setValue("");
|
||||||
|
}
|
||||||
|
return value % parameters.phone;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 타뷸레이터 width값 변경 시 위에 select width 값 변경
|
||||||
|
var titleArray = ["No","A","B","C","D","E","F"];
|
||||||
|
|
||||||
|
$tableExcel.on("columnWidth",function(column){
|
||||||
|
var titleIndex = titleArray.indexOf(column._column.definition.title);
|
||||||
|
titleIndex += 1;
|
||||||
|
|
||||||
|
if(titleIndex != 0){
|
||||||
|
$('.select_adr_hd>div').eq(titleIndex).css('width', column._column.width);
|
||||||
|
}else{
|
||||||
|
$('.select_adr_hd>div').eq(0).css('width', column._column.width);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$tableExcel.on("scrollHorizontal",function(left){
|
||||||
|
$(".adr_excel").scrollLeft(left);
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
$(".adr_excel").on("scroll",function(){
|
||||||
|
$(".tabulator-tableholder").scrollLeft($(this).scrollLeft());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$("#excelFileC4").on("change", function(event) {
|
||||||
|
var fileInfo = event.target.files;
|
||||||
|
if(fileInfo.length > 0){
|
||||||
|
excelFileChange(fileInfo[0]);
|
||||||
|
} else {
|
||||||
|
fn_loadRemoveActive(); // 파일이 선택되지 않은 경우 로딩 상태 제거
|
||||||
|
setTimeout(() => { $(this).val(''); }, 0); // 파일 선택 초기화
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on('click', '#btnAddrMassClose', function() {
|
||||||
|
|
||||||
|
$('.field-selector').each(function() { $(this).val(''); });
|
||||||
|
setAddrMassClose();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on('click', '#closeBtn', function() {
|
||||||
|
// 대량등록 닫기
|
||||||
|
setAddrMassClose();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀등록 닫기
|
||||||
|
function setAddrMassClose() {
|
||||||
|
$tableExcel.clearData();
|
||||||
|
$("#excelRowTotCnt").text(0); //총건수 수정
|
||||||
|
$("#excelRowDupCnt").text(0); //중복건수 수정
|
||||||
|
$("#excelRowErrorCnt").text(0); //중복건수 수정
|
||||||
|
// dupliPhoneDataRealList.length = 0; // 중복 휴대폰번호 초기화
|
||||||
|
|
||||||
|
|
||||||
|
// 중복 카운트
|
||||||
|
$("#errorPopDupCnt").text(0);
|
||||||
|
// 에러 카운트
|
||||||
|
$("#errorPopErrorCnt").text(0);
|
||||||
|
//
|
||||||
|
$("#errorPopTotCnt").text(0);
|
||||||
|
|
||||||
|
// popup 영역
|
||||||
|
$tableError.clearData();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//#############################################################################################
|
||||||
|
//파일업로드 드래그앤 드롭
|
||||||
|
//#############################################################################################
|
||||||
|
var objDragAndDrop = $(".upload_area");
|
||||||
|
$(document).on("dragenter",".upload_area",function(e){
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
//$(this).css('border', '2px solid #0B85A1');
|
||||||
|
});
|
||||||
|
$(document).on("dragover",".upload_area",function(e){
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
$(document).on("drop",".upload_area",function(e){
|
||||||
|
fn_loadAddActive();
|
||||||
|
e.preventDefault();
|
||||||
|
var files = e.originalEvent.dataTransfer.files;
|
||||||
|
excelFileChange(files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('dragenter', function (e){
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
$(document).on('dragover', function (e){
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
//objDragAndDrop.css('border', '2px dotted #0B85A1');
|
||||||
|
});
|
||||||
|
$(document).on('drop', function (e){
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
//파일 드래그앤드롭 종료
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 받는사람 선택삭제 버튼 처리해주기
|
||||||
|
$('#in_select_del').click(function(){
|
||||||
|
|
||||||
|
if($tableExcel == null || $tableExcel == ""){
|
||||||
|
|
||||||
|
alert("받는사람을 추가해 주세요.");
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var selectedData = $tableExcel.getSelectedRows();
|
||||||
|
|
||||||
|
if(selectedData == "" || selectedData == null){
|
||||||
|
|
||||||
|
alert("삭제할 연락처를 선택해주세요.");
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}else{ // 선택한 Row 데이터 삭제하기
|
||||||
|
|
||||||
|
if(confirm("선택하신 받는 사람을 삭제하시겠습니까?")){
|
||||||
|
|
||||||
|
// 선택 데이터 삭제
|
||||||
|
selectedData.forEach(row => row.delete());
|
||||||
|
|
||||||
|
|
||||||
|
totRows = $tableExcel.getRows().length;
|
||||||
|
$("#excelRowTotCnt").text(totRows);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 추가버튼
|
||||||
|
$('#btnAddrMassReg').click(function(){
|
||||||
|
|
||||||
|
if($tableExcel.getData().length < 1){
|
||||||
|
alert("한 개 이상의 연락처를 입력하세요");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// else if (selectedData.length > 20000) {
|
||||||
|
// alert("2만줄 이상의 업로드는 데이터 부하로 업로드 할수 없습니다.");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// tableExcel 그룹의 select 요소들을 확인
|
||||||
|
var columns = $tableExcel.getColumns();
|
||||||
|
var isAddrPhoneNoSelected = columns.some(column => column.getField() === 'addrPhoneNo');
|
||||||
|
|
||||||
|
if (!isAddrPhoneNoSelected) {
|
||||||
|
alert('휴대폰이 선택되지 않았습니다.');
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var addrData = $tableExcel.getData().map((row, index) => ({
|
||||||
|
name: row.addrNm,
|
||||||
|
phone: removeDash(row.addrPhoneNo),
|
||||||
|
rep1: row.addrInfo1,
|
||||||
|
rep2: row.addrInfo2,
|
||||||
|
rep3: row.addrInfo3,
|
||||||
|
rep4: row.addrInfo4,
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 기존 tableL의 데이터를 가져옵니다.
|
||||||
|
var existingData = tableL.getData();
|
||||||
|
// 기존 데이터와 새로운 데이터를 합칩니다.
|
||||||
|
var combinedData = existingData.concat(addrData);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ phone을 기준으로 중복 제거 및 갯수 계산
|
||||||
|
* @ 결과 반환
|
||||||
|
* return {
|
||||||
|
* uniqueArray, // 중복 제거된 배열
|
||||||
|
* uniqueCount, // 중복 제거된 데이터 개수
|
||||||
|
* duplicateArray, // 중복된 데이터 배열
|
||||||
|
* duplicateCount: duplicateArray.length // 중복된 데이터 개수
|
||||||
|
* };
|
||||||
|
*/
|
||||||
|
const result = removeDuplicatesAndCount(combinedData, 'phone');
|
||||||
|
|
||||||
|
|
||||||
|
// 총 30만건이 넘으면 false
|
||||||
|
if (!validateRowLimit(result.uniqueCount)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 6. 수량/가격 계산
|
||||||
|
setAllCntData(result);
|
||||||
|
fn_priceClclt(result.uniqueCount);
|
||||||
|
|
||||||
|
|
||||||
|
$('#closeBtn').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//받는사람 전체삭제 버튼 처리
|
||||||
|
$('#allDel').click(function(){
|
||||||
|
var data = $tableExcel.getRows();
|
||||||
|
$tableExcel.clearData();
|
||||||
|
$("#excelRowTotCnt").text(0); //총건수 수정
|
||||||
|
$("#excelRowDupCnt").text(0); //중복건수 수정
|
||||||
|
$("#excelRowErrorCnt").text(0); //중복건수 수정
|
||||||
|
dupliPhoneDataRealList.length = 0; // 중복 휴대폰번호 초기화
|
||||||
|
$tableError.clearData();
|
||||||
|
|
||||||
|
// select box 초기화
|
||||||
|
$('.field-selector').each(function() { $(this).val(''); });
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//치환문자 있는 엑섹불러오기 버튼 클릭시 파일 첨부 실행
|
||||||
|
$('.c3').click(function(){ // 엑셀파일 불러오기 선택 시
|
||||||
|
|
||||||
|
$("#excelFileC4").click();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//타이틀 select 선택 이벤트
|
||||||
|
$('.field-selector').on('change', function() {
|
||||||
|
fn_loadAddActive();
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
var selectedFields = [];
|
||||||
|
var isDuplicate = false;
|
||||||
|
|
||||||
|
if($tableExcel.getData().length < 1){
|
||||||
|
alert('데이터 입력 후 선택해 주세요.');
|
||||||
|
$(this).val("");
|
||||||
|
fn_loadRemoveActive();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 중복체크
|
||||||
|
$('.field-selector').each(function() {
|
||||||
|
var selectedField = $(this).val();
|
||||||
|
if (selectedField) {
|
||||||
|
if (selectedFields.includes(selectedField)) {
|
||||||
|
alert("중복된 필드를 선택할 수 없습니다.");
|
||||||
|
$(this).val(""); // 중복 필드를 선택한 경우 빈 값으로 초기화
|
||||||
|
isDuplicate = true;
|
||||||
|
return false; // 반복문 종료
|
||||||
|
}
|
||||||
|
selectedFields.push(selectedField);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
updateTableFields($tableExcel);
|
||||||
|
|
||||||
|
// 필드가 휴대폰이면 열 중복체크
|
||||||
|
if($(this).val() == 'addrPhoneNo'){
|
||||||
|
fn_phoneDupl($tableExcel);
|
||||||
|
}
|
||||||
|
fn_loadRemoveActive();
|
||||||
|
|
||||||
|
}, 0); // 지연 없이 즉시 실행되도록 0ms 지연을 설정
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function excelFileChange(file) {
|
||||||
|
if (file) {
|
||||||
|
|
||||||
|
// 파일 크기 체크 (20MB)
|
||||||
|
const maxSize = 20 * 1024 * 1024; // 20MB in bytes
|
||||||
|
if (file.size > maxSize) {
|
||||||
|
alert('파일 크기는 20MB를 초과할 수 없습니다.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn_loadAddActive();
|
||||||
|
var reader = new FileReader();
|
||||||
|
var extension = file.name.split('.').pop().toLowerCase();
|
||||||
|
reader.onload = function(e) {
|
||||||
|
setTimeout(() => { // 파일 읽기 완료 후 실행되도록 함
|
||||||
|
if (extension === 'xlsx') {
|
||||||
|
var data = new Uint8Array(e.target.result);
|
||||||
|
var workbook = XLSX.read(data, {type: 'array'});
|
||||||
|
var firstSheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||||
|
var jsonData = XLSX.utils.sheet_to_json(firstSheet, {header: 1});
|
||||||
|
// 문제 데이터를 확인하는 함수 호출
|
||||||
|
findInvalidDBCharacters(jsonData);
|
||||||
|
processExcelData(jsonData);
|
||||||
|
} else if (extension === 'xls') {
|
||||||
|
var data = e.target.result;
|
||||||
|
var workbook = XLSX.read(data, { type: 'binary' });
|
||||||
|
var firstSheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||||
|
var jsonData = XLSX.utils.sheet_to_json(firstSheet, { header: 1 });
|
||||||
|
|
||||||
|
// 문제 데이터를 확인하는 함수 호출
|
||||||
|
findInvalidDBCharacters(jsonData);
|
||||||
|
|
||||||
|
|
||||||
|
processExcelData(jsonData);
|
||||||
|
} else if (extension === 'txt') {
|
||||||
|
var textData = e.target.result;
|
||||||
|
processTextData(textData);
|
||||||
|
} else {
|
||||||
|
alert('지원되지 않는 파일 형식입니다.');
|
||||||
|
}
|
||||||
|
fn_loadRemoveActive();
|
||||||
|
}, 0); // 지연 없이 즉시 실행되도록 0ms 지연을 설정
|
||||||
|
};
|
||||||
|
if (extension === 'xlsx') {
|
||||||
|
reader.readAsArrayBuffer(file);
|
||||||
|
} else if (extension === 'xls') {
|
||||||
|
reader.readAsBinaryString(file); // xls 파일에 적절한 read 메서드 호출
|
||||||
|
} else if (extension === 'txt') {
|
||||||
|
reader.readAsText(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//문제 데이터를 확인하는 함수
|
||||||
|
function findInvalidDBCharacters(jsonData) {
|
||||||
|
console.log('DB 입력 값 검사 중...');
|
||||||
|
const invalidCharPattern = /[\uD800-\uDBFF][\uDC00-\uDFFF]/; // 4바이트 유니코드 문자 (이모지 등)
|
||||||
|
for (let rowIndex = 0; rowIndex < jsonData.length; rowIndex++) {
|
||||||
|
const row = jsonData[rowIndex];
|
||||||
|
if (Array.isArray(row)) {
|
||||||
|
for (let colIndex = 0; colIndex < row.length; colIndex++) {
|
||||||
|
const cell = row[colIndex];
|
||||||
|
if (typeof cell === 'string' && invalidCharPattern.test(cell)) {
|
||||||
|
console.warn('허용되지 않는 문자: row', rowIndex + 1,', col ', colIndex + 1, ', value:', cell);
|
||||||
|
// 허용되지 않는 문자를 제거 (선택 사항)
|
||||||
|
row[colIndex] = cell.replace(invalidCharPattern, '');
|
||||||
|
console.log('수정된 값:', row[colIndex]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//엑셀 데이터 처리 함수
|
||||||
|
function processExcelData(data) {
|
||||||
|
var keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G'];
|
||||||
|
var tableData = [];
|
||||||
|
var totalRows = data.length - 2; // 전체 데이터 수 (1, 2행 제외)
|
||||||
|
|
||||||
|
|
||||||
|
// 3번째 행부터 입력
|
||||||
|
data.slice(0).forEach((row, index) => {
|
||||||
|
var rowData = {};
|
||||||
|
keys.forEach((key, idx) => { // index 변수명 변경 (내부와 외부에서 사용되므로 충돌 방지)
|
||||||
|
// console.log('row[idx] : ', row[idx]);
|
||||||
|
// rowData[key] = row[idx] ? row[idx].trim() : ""; // 각 컬럼에 대해 기본값을 설정
|
||||||
|
rowData[key] = (typeof row[idx] === 'string') ? row[idx].trim() : row[idx];
|
||||||
|
});
|
||||||
|
tableData.push(rowData);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
updateTable(tableData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* function processExcelData(data) {
|
||||||
|
console.log('data : ', data);
|
||||||
|
var keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G'];
|
||||||
|
var tableData = [];
|
||||||
|
var totalRows = data.length - 2; // 전체 데이터 수 (1, 2행 제외)
|
||||||
|
console.log('data: ', data);
|
||||||
|
|
||||||
|
// 3번째 행부터 입력
|
||||||
|
data.slice(0).forEach((row, index) => {
|
||||||
|
var rowData = {};
|
||||||
|
keys.forEach((key, idx) => { // index 변수명 변경 (내부와 외부에서 사용되므로 충돌 방지)
|
||||||
|
// console.log('row[idx] : ', row[idx]);
|
||||||
|
rowData[key] = row[idx] ? row[idx].trim() : ""; // 각 컬럼에 대해 기본값을 설정
|
||||||
|
rowData[key] = (typeof row[idx] === 'string') ? row[idx].trim() : row[idx];
|
||||||
|
});
|
||||||
|
tableData.push(rowData);
|
||||||
|
|
||||||
|
});
|
||||||
|
console.log('tableData :: ', tableData);
|
||||||
|
updateTable(tableData);
|
||||||
|
} */
|
||||||
|
|
||||||
|
|
||||||
|
// 텍스트 데이터 처리 함수
|
||||||
|
function processTextData(text) {
|
||||||
|
var lines = text.split('\n'); // 각 줄을 배열로 분리
|
||||||
|
var keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G'];
|
||||||
|
var tableData = [];
|
||||||
|
|
||||||
|
lines.forEach(line => {
|
||||||
|
var rowData = {};
|
||||||
|
var row = line.split(','); // 쉼표로 분리
|
||||||
|
keys.forEach((key, index) => {
|
||||||
|
rowData[key] = row[index] ? row[index].trim() : ""; // 각 컬럼에 대해 기본값을 설정
|
||||||
|
});
|
||||||
|
tableData.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
updateTable(tableData);
|
||||||
|
}
|
||||||
|
|
||||||
|
//공통 테이블 업데이트 함수
|
||||||
|
function updateTable(tableData) {
|
||||||
|
$tableExcel.setColumns([ //Define Table Columns
|
||||||
|
{formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, headerHozAlign:"center", hozAlign:"center", headerSort:false, cellClick:function(e, cell){
|
||||||
|
cell.getRow().toggleSelect();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{formatter:"rownum", align:"center" ,title:"No", hozAlign:"center", headerHozAlign:"center", width:10},
|
||||||
|
{title:"A", field:"A", hozAlign:"center", headerHozAlign: "center", width:150, validator:["maxLength:100", "string"]},
|
||||||
|
{title:"B", field:"B", hozAlign:"center", headerHozAlign: "center", width:150, validator:["maxLength:100", "string"]},
|
||||||
|
{title:"C", field:"C", hozAlign:"center", headerHozAlign: "center", width:150, validator:["maxLength:100", "string"]},
|
||||||
|
{title:"D", field:"D", hozAlign:"center", headerHozAlign: "center", width:150, validator:["maxLength:100", "string"]},
|
||||||
|
{title:"E", field:"E", hozAlign:"center", headerHozAlign: "center", width:150, validator:["maxLength:100", "string"]},
|
||||||
|
{title:"F", field:"F", hozAlign:"center", headerHozAlign: "center", width:150, validator:["maxLength:100", "string"]}
|
||||||
|
]);
|
||||||
|
|
||||||
|
$tableExcel.setData(tableData).then(() => {
|
||||||
|
// excelRowTotCnt 업데이트
|
||||||
|
document.getElementById("excelRowTotCnt").innerText = tableData.length;
|
||||||
|
});
|
||||||
|
|
||||||
|
fn_loadRemoveActive();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 타이틀 select 선택할때마다 실행해서
|
||||||
|
* 데이터테이블 필드값 수정
|
||||||
|
*/
|
||||||
|
function updateTableFields($objTabul) {
|
||||||
|
var currentData = $objTabul.getData();
|
||||||
|
var columns = [
|
||||||
|
{formatter: "rowSelection", titleFormatter: "rowSelection", clipboard: false, hozAlign: "center", headerHozAlign: "center", headerSort: false, cellClick: function(e, cell) {
|
||||||
|
cell.getRow().toggleSelect();
|
||||||
|
}}
|
||||||
|
,{formatter:"rownum", align:"center", title:"No", hozAlign:"center", headerHozAlign:"center", width:60}
|
||||||
|
];
|
||||||
|
|
||||||
|
var fieldMapping = [];
|
||||||
|
$('.field-selector').each(function(index) {
|
||||||
|
var selectedField = $(this).val();
|
||||||
|
// ASCII 문자 코드 사용 - 65=A, 66=B ...
|
||||||
|
var field = String.fromCharCode(65 + index);
|
||||||
|
if (selectedField) {
|
||||||
|
columns.push({
|
||||||
|
title: field
|
||||||
|
, field: selectedField
|
||||||
|
, hozAlign: "center"
|
||||||
|
, headerHozAlign: "center"
|
||||||
|
// , editor: "input"
|
||||||
|
, editor: false
|
||||||
|
, width: 140
|
||||||
|
, validator: ["maxLength:100", "string"]
|
||||||
|
});
|
||||||
|
fieldMapping.push(selectedField);
|
||||||
|
} else {
|
||||||
|
columns.push({
|
||||||
|
title: field
|
||||||
|
, field: field
|
||||||
|
, hozAlign: "center"
|
||||||
|
, headerHozAlign: "center"
|
||||||
|
, editor: false
|
||||||
|
// , editor: "input"
|
||||||
|
, width: 140
|
||||||
|
, validator: ["maxLength:100", "string"]
|
||||||
|
});
|
||||||
|
fieldMapping.push(field);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var updatedData = currentData.map(row => {
|
||||||
|
console.log('row : ', row);
|
||||||
|
var newRow = {};
|
||||||
|
fieldMapping.forEach((field, index) => {
|
||||||
|
newRow[field] = row[Object.keys(row)[index]] ?? "";
|
||||||
|
});
|
||||||
|
return newRow;
|
||||||
|
});
|
||||||
|
|
||||||
|
$objTabul.setColumns(columns);
|
||||||
|
$objTabul.setData(updatedData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ 핸드폰 중복 데이터
|
||||||
|
* */
|
||||||
|
function fn_phoneDupl($objTabul) {
|
||||||
|
|
||||||
|
$tableError.clearData();
|
||||||
|
|
||||||
|
var data = $objTabul.getData();
|
||||||
|
var phoneNumberChk = false;
|
||||||
|
var existingNumbers = new Set(); // 배열에서 Set으로 변경
|
||||||
|
|
||||||
|
let errorCount = 0; // 중복 번호 개수를 저장할 변수
|
||||||
|
let duplicateCount = 0; // 중복 번호 개수를 저장할 변수
|
||||||
|
|
||||||
|
const errors = []; // 오류 데이터를 저장할 배열
|
||||||
|
const newData = []; // 유효한 데이터만 저장할 새로운 배열
|
||||||
|
|
||||||
|
data.forEach((row, index) => {
|
||||||
|
|
||||||
|
const number = row.addrPhoneNo;
|
||||||
|
|
||||||
|
// number가 null, undefined, 빈 문자열이거나 숫자인 경우 처리
|
||||||
|
if (!number || (typeof number === 'string' && !number.trim())){
|
||||||
|
console.log("number : ", number);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const formattedNumber = formatPhoneNumber(number); // 번호 표준화
|
||||||
|
const cleanedNumber = formattedNumber.replace(/[^0-9]/g, ''); // 숫자만 남김
|
||||||
|
|
||||||
|
if (!existingNumbers.has(cleanedNumber)) { // 중복 번호 체크
|
||||||
|
if (isValidPhoneNumber(formattedNumber)) { // 유효성 검사
|
||||||
|
row.addrPhoneNo = formattedNumber;
|
||||||
|
existingNumbers.add(cleanedNumber); // 추가된 번호를 기존 목록에 추가
|
||||||
|
newData.push(row); // 유효한 데이터만 새로운 배열에 추가
|
||||||
|
} else {
|
||||||
|
// 오류: 유효성 통과 못함
|
||||||
|
errorCount++;
|
||||||
|
|
||||||
|
errors.push({
|
||||||
|
name: row.addrNm, // 이름
|
||||||
|
phone: row.addrPhoneNo, // 폰번호
|
||||||
|
result: "오류" // 결과 메시지 추가
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 중복
|
||||||
|
duplicateCount++;
|
||||||
|
|
||||||
|
errors.push({
|
||||||
|
name: row.addrNm, // 이름
|
||||||
|
phone: row.addrPhoneNo, // 폰번호
|
||||||
|
result: "중복" // 결과 메시지 추가
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// data 배열을 newData 배열로 대체
|
||||||
|
data = newData;
|
||||||
|
|
||||||
|
|
||||||
|
// 수정된 데이터로 테이블 업데이트
|
||||||
|
$objTabul.setData(data);
|
||||||
|
// 오류 총 카운트
|
||||||
|
$("#excelRowTotCnt").text($objTabul.getDataCount());
|
||||||
|
// 중복 카운트
|
||||||
|
$("#excelRowDupCnt").text(duplicateCount);
|
||||||
|
// 에러 카운트
|
||||||
|
$("#excelRowErrorCnt").text(errorCount);
|
||||||
|
|
||||||
|
// popup 영역
|
||||||
|
$("#errorPopTotCnt").text($objTabul.getDataCount());
|
||||||
|
// 중복 카운트
|
||||||
|
$("#errorPopDupCnt").text(duplicateCount);
|
||||||
|
// 에러 카운트
|
||||||
|
$("#errorPopErrorCnt").text(errorCount);
|
||||||
|
|
||||||
|
|
||||||
|
$tableError.setData(errors);
|
||||||
|
|
||||||
|
if(errorCount > 0){
|
||||||
|
alert('휴대폰 형식에 맞지 않는 데이터는 삭제 후 업로드 됩니다.\nex) 발송불가 특수문자, 자릿수 오류 등');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_dupliPopupShow(){
|
||||||
|
|
||||||
|
$("#tableExcelDupliBtn").show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 상단 설명 더보기
|
||||||
|
function popMore(e){
|
||||||
|
$(e).closest(".pop_more_cont").toggleClass("pop_more_click");
|
||||||
|
|
||||||
|
if($(e).closest(".pop_more_cont").is(".pop_more_click")){
|
||||||
|
$(e).html('숨기기');
|
||||||
|
$(e).append('<i></i>');
|
||||||
|
}else {
|
||||||
|
$(e).html('더보기');
|
||||||
|
$(e).append('<i></i>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// excel 오류정보 테스트
|
||||||
|
$(document).on('click', '#errorExcelBtn', function() {
|
||||||
|
if($tableError.getDataCount()<1){
|
||||||
|
alert('오류 정보가 없습니다.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$tableError.download("xlsx", "error_data.xlsx");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- 중복전화번호 data-tooltip:addrMassDupli_layer -->
|
||||||
|
<div class="tooltip-wrap">
|
||||||
|
<div class="popup-com addrMassDupli_layer" tabindex="0" data-tooltip-con="addrMassDupli_layer" data-focus="addrMassDupli_layer" data-focus-prev="addrMassDupli_layer-close" style="width: 270px; height: 500px;">
|
||||||
|
<div class="popup_heading">
|
||||||
|
<p>중복 휴대폰번호</p>
|
||||||
|
<button type="button" class="tooltip-close" data-focus="addrMassDupli_layer-close" onclick="setAddrDupliClose();"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
|
||||||
|
</div>
|
||||||
|
<div class="layer_in" style="padding:20px 0px;" id="addrMassDupli_layer">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="popup_btn_wrap2" style="margin-top: 0px;">
|
||||||
|
<button type="button" class="tooltip-close" data-focus="addrMassDupli_layer-close" data-focus-next="addrMassDupli_layer">닫기</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 주소록 상세 결과 팝업 data-tooltip:adr_popup14 -->
|
||||||
|
<div class="tooltip-wrap">
|
||||||
|
<div class="popup-com adr_layer adr_detail_result adr_popup14" tabindex="0" data-tooltip-con="adr_popup14" data-focus="adr_popup14" data-focus-prev="adr_popu14-close" style="width: 525px;z-index:125;">
|
||||||
|
<div class="popup_heading">
|
||||||
|
<p>주소록 상세 결과</p>
|
||||||
|
<button type="button" class="tooltip-close" data-focus="adr_popup14-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
|
||||||
|
</div>
|
||||||
|
<div class="layer_in" style="padding:30px 20px;">
|
||||||
|
<div class="table_top">
|
||||||
|
<p>
|
||||||
|
총 <span class="c_e40000" id="errorPopTotCnt">0</span>건
|
||||||
|
/ 중복 <span class="c_002c9a" id="errorPopDupCnt">0</span>건
|
||||||
|
/ 오류 <span class="c_002c9a" id="errorPopErrorCnt">0</span>건</p>
|
||||||
|
<button type="button" class="excel_btn btnType" id="errorExcelBtn"><i class="downroad"></i>엑셀 다운로드</button>
|
||||||
|
</div>
|
||||||
|
<div class="tb_wrap adr_list" id="tabulator_error">
|
||||||
|
<!-- $tableError 참고 -->
|
||||||
|
</div>
|
||||||
|
<ul class="cf_text_ul">
|
||||||
|
<li>*중복번호는 하나의 번호만 등록됩니다.</li>
|
||||||
|
<li>*휴대폰 형식에 맞지 않는 데이터는 삭제 후 업로드 됩니다.</li>
|
||||||
|
<li>ex) 발송불가 특수문자, 자릿수 오류 등</li>
|
||||||
|
</ul>
|
||||||
|
<div class="popup_btn_wrap2">
|
||||||
|
<!-- <button type="button">저장</button> -->
|
||||||
|
<button type="button" class="tooltip-close" data-focus="adr_popup14-close" data-focus-next="adr_popup14">닫기</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--// 중복전화번호 팝업 -->
|
||||||
|
<div class="popup_heading">
|
||||||
|
<p>엑셀 불러오기</p>
|
||||||
|
<button type="button" class="tooltip-close" id="closeBtn" data-focus="popup07-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
|
||||||
|
</div>
|
||||||
|
<div class="layer_in execl_upload_layer" style="padding: 25px 30px;">
|
||||||
|
<!-- <div class="list_tab_wrap2"> -->
|
||||||
|
<!-- tab button -->
|
||||||
|
<!-- <ul class="list_tab" id="tbTabl"> -->
|
||||||
|
<!-- <li class="tab active" data-tabul="tableExcel"><button type="button" onclick="popupTab(this,'1'); fn_tabToggle('1');">엑셀입력</button></li> -->
|
||||||
|
<!-- <li class="tab" data-tabul="tableClip"><button type="button" onclick="popupTab(this,'2'); fn_tabToggle('2');">붙여넣기</button></li> -->
|
||||||
|
<!-- <li class="tab" data-tabul="tableSelf"><button type="button" onclick="popupTab(this,'3'); fn_tabToggle('3');">직접입력</button></li> -->
|
||||||
|
<!-- </ul>// tab button -->
|
||||||
|
<!-- </div> -->
|
||||||
|
<!-- 엑셀입력 -->
|
||||||
|
<div class="popCont current pop_more_cont" id="popCont_1">
|
||||||
|
<div class="titBox">
|
||||||
|
<p>- 주소록은 한 번에 최대 30만건까지 등록(EXCEL파일, 최대용량 20MB) 가능합니다. </p>
|
||||||
|
<p>- 엑셀 파일에 비밀번호 설정, 제한된 보기, 수식 등이 설정되어 있는 경우 업로드가 불가합니다.</p>
|
||||||
|
<p>- 구분선(|), 역슬래시(\, ₩), 큰따옴표("), 이모지(이모티콘) 등 발송불가 특수문자는 저장되지 않습니다.</p>
|
||||||
|
<p>- 이름 200byte, [*1*]~[*4*] 200byte, 메모 250byte까지 입력 가능합니다.</p>
|
||||||
|
<p>- 주소록 등록이 어려우신 경우에는 <a href="<c:url value='/web/mjon/addragency/selectAddrAgencyList.do'/>" style="font-weight: bold; color: blue;">주소록 입력대행</a> 메뉴를 이용하실 수 있습니다. </p>
|
||||||
|
</div>
|
||||||
|
<div class="pop_more_wrap">
|
||||||
|
<button type="button" class="pop_more" onclick="popMore(this);">더보기<i></i></button>
|
||||||
|
</div>
|
||||||
|
</div><!--// 엑셀입력 -->
|
||||||
|
|
||||||
|
<!-- 공통 -->
|
||||||
|
<div>
|
||||||
|
<table class="layer_tType1">
|
||||||
|
<caption>엑셀입력 표</caption>
|
||||||
|
<colgroup>
|
||||||
|
<col style="width: 95px">
|
||||||
|
<col style="width: auto">
|
||||||
|
</colgroup>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<!-- <th>그룹 선택</th>
|
||||||
|
<td>
|
||||||
|
<label for="" class="label">그룹 선택</label>
|
||||||
|
<select id="addrGrpIdInfo" name="addrGrpIdInfo">
|
||||||
|
</select>
|
||||||
|
<label for="" class="label">그룹명 입력</label>
|
||||||
|
<input type="text" id="addrGrpNm" name="addrGrpNm" placeholder="새 그룹명을 입력해주세요." onfocus="this.placeholder=''" onblur="this.placeholder='새 그룹명을 입력해주세요.'"class="inputLight" style="width: 300px;">
|
||||||
|
<input type="file" id="excelFile" accept=".xls, .xlsx, .txt" style="display:none"/>
|
||||||
|
<button type="button" class="excel_btn2 btnType c3"><i class="uproad"></i>엑셀, TXT파일 업로드</button>
|
||||||
|
</td> -->
|
||||||
|
<td colspan="2" style="padding:10px 0;">
|
||||||
|
<div class="file_upload_wrap" style="width:100%;display:flex;">
|
||||||
|
<div class="file_add upload_area">
|
||||||
|
<p><img src="/publish/images/content/file_add.png" alt="파일 붙여넣기">마우스로 엑셀파일을 여기에 끌어다 놓으세요</p>
|
||||||
|
</div>
|
||||||
|
<input type="file" id="excelFileC4" accept=".xls, .xlsx, .txt" style="display:none"/>
|
||||||
|
<button type="button" class="excel_btn2 btnType c3"><i class="uproad"></i>엑셀파일 업로드</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="excel_middle2">
|
||||||
|
<p>
|
||||||
|
총 <span class="c_e40000 fwBold" id="excelRowTotCnt">0</span>건
|
||||||
|
/ 중복 <span class="c_002c9a fwBold" id="excelRowDupCnt">0</span>건
|
||||||
|
/ 오류 <span class="c_002c9a fwBold" id="excelRowErrorCnt">0</span>건
|
||||||
|
<button type="button" class="btn_list_detail" data-tooltip="adr_popup14"><img src="/publish/images/search.png"></button>
|
||||||
|
</p>
|
||||||
|
<!-- -->
|
||||||
|
<!-- <button type="button" class="btnType btnType6" data-tooltip="addrMassDupli_layer" id="tableExcelDupliBtn">중복번호</button> -->
|
||||||
|
<!-- -->
|
||||||
|
<!-- <button type="button" class="btnType btnType6" data-tooltip="addrMassSaveDupli_layer" onclick="GetAddrMassSaveDupli()" id="btnAddrMassSaveDupli">중복번호</button> -->
|
||||||
|
</p>
|
||||||
|
<!-- <button type="button" class="btnType btnType6 addCallToF">번호추가</button> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="adr_excel" style="margin-top: 13px; overflow-x:auto;">
|
||||||
|
<!-- <div class="adr_excel" style="margin-top: 13px;"> -->
|
||||||
|
<!-- thead -->
|
||||||
|
<div class="adr_hd select_adr_hd msg" data-group="tableExcel">
|
||||||
|
<div style="width: 100px;"></div>
|
||||||
|
<div style="width: 100px;"></div>
|
||||||
|
<div style="width: 140px;">
|
||||||
|
<label for="" class="label"></label>
|
||||||
|
<select class="field-selector">
|
||||||
|
<option value="">선택하기</option>
|
||||||
|
<option value="addrNm">이름</option>
|
||||||
|
<option value="addrPhoneNo">휴대폰</option>
|
||||||
|
<option value="addrInfo1">[*1*]</option>
|
||||||
|
<option value="addrInfo2">[*2*]</option>
|
||||||
|
<option value="addrInfo3">[*3*]</option>
|
||||||
|
<option value="addrInfo4">[*4*]</option>
|
||||||
|
<!-- <option value="addrComment">메모</option> -->
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div style="width: 140px;">
|
||||||
|
<label for="" class="label"></label>
|
||||||
|
<select class="field-selector">
|
||||||
|
<option value="">선택하기</option>
|
||||||
|
<option value="addrNm">이름</option>
|
||||||
|
<option value="addrPhoneNo">휴대폰</option>
|
||||||
|
<option value="addrInfo1">[*1*]</option>
|
||||||
|
<option value="addrInfo2">[*2*]</option>
|
||||||
|
<option value="addrInfo3">[*3*]</option>
|
||||||
|
<option value="addrInfo4">[*4*]</option>
|
||||||
|
<!-- <option value="addrComment">메모</option> -->
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div style="width: 140px;">
|
||||||
|
<label for="" class="label"></label>
|
||||||
|
<select class="field-selector">
|
||||||
|
<option value="">선택하기</option>
|
||||||
|
<option value="addrNm">이름</option>
|
||||||
|
<option value="addrPhoneNo">휴대폰</option>
|
||||||
|
<option value="addrInfo1">[*1*]</option>
|
||||||
|
<option value="addrInfo2">[*2*]</option>
|
||||||
|
<option value="addrInfo3">[*3*]</option>
|
||||||
|
<option value="addrInfo4">[*4*]</option>
|
||||||
|
<!-- <option value="addrComment">메모</option> -->
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div style="width: 140px;">
|
||||||
|
<label for="" class="label"></label>
|
||||||
|
<select class="field-selector">
|
||||||
|
<option value="">선택하기</option>
|
||||||
|
<option value="addrNm">이름</option>
|
||||||
|
<option value="addrPhoneNo">휴대폰</option>
|
||||||
|
<option value="addrInfo1">[*1*]</option>
|
||||||
|
<option value="addrInfo2">[*2*]</option>
|
||||||
|
<option value="addrInfo3">[*3*]</option>
|
||||||
|
<option value="addrInfo4">[*4*]</option>
|
||||||
|
<!-- <option value="addrComment">메모</option> -->
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div style="width: 140px;">
|
||||||
|
<label for="" class="label"></label>
|
||||||
|
<select class="field-selector">
|
||||||
|
<option value="">선택하기</option>
|
||||||
|
<option value="addrNm">이름</option>
|
||||||
|
<option value="addrPhoneNo">휴대폰</option>
|
||||||
|
<option value="addrInfo1">[*1*]</option>
|
||||||
|
<option value="addrInfo2">[*2*]</option>
|
||||||
|
<option value="addrInfo3">[*3*]</option>
|
||||||
|
<option value="addrInfo4">[*4*]</option>
|
||||||
|
<!-- <option value="addrComment">메모</option> -->
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div style="width: 140px;">
|
||||||
|
<label for="" class="label"></label>
|
||||||
|
<select class="field-selector">
|
||||||
|
<option value="">선택하기</option>
|
||||||
|
<option value="addrNm">이름</option>
|
||||||
|
<option value="addrPhoneNo">휴대폰</option>
|
||||||
|
<option value="addrInfo1">[*1*]</option>
|
||||||
|
<option value="addrInfo2">[*2*]</option>
|
||||||
|
<option value="addrInfo3">[*3*]</option>
|
||||||
|
<option value="addrInfo4">[*4*]</option>
|
||||||
|
<!-- <option value="addrComment">메모</option> -->
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="drag_drop_wrap callList_includ_box" id="tabulator_excel">
|
||||||
|
<!-- <img src="/publish/images/content/excel.jpg" style="width: 100%;"> -->
|
||||||
|
</div>
|
||||||
|
<div class="excel_middle">
|
||||||
|
<div class="select_btnWrap clearfix">
|
||||||
|
<div>
|
||||||
|
<button type="button" id="allDel"><i class="remove_img"></i>전체삭제</button>
|
||||||
|
<button type="button" id="in_select_del"><i class="remove_img"></i>선택삭제</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div><!--// 공통 -->
|
||||||
|
|
||||||
|
<!-- 붙여놓기 설명 -->
|
||||||
|
<!-- <div class="req_area"> -->
|
||||||
|
<!-- <div class="text_box"> -->
|
||||||
|
<!-- - 휴대폰 번호가 입력된 txt 파일을 열어 복사(Ctrl+c) + 붙여넣기(Ctrl+v)로도 입력하실 수 있습니다.<br> -->
|
||||||
|
<!-- - 휴대폰 번호는 필수입력 항목입니다.<br> -->
|
||||||
|
<!-- - 이름,휴대폰 번호,[*1*],[*2*],[*3*],[*4*],메모 순서대로 입력해주세요.(예 : 010-1234-5678,홍길동,변수1…메모)<br> -->
|
||||||
|
<!-- - 이름은 24byte, [*1*]~[*4*] 40byte, 메모는 250byte까지 입력 가능합니다.<br> -->
|
||||||
|
<!-- - '오류 검사'를 통해 등록된 데이터에 전화번호 입력 오류를 확인하실 수 있습니다. -->
|
||||||
|
<!-- </div> -->
|
||||||
|
<!-- </div> -->
|
||||||
|
<div class="popup_btn_wrap2" style="margin: 0 auto 30px auto;">
|
||||||
|
<button type="button" id="btnAddrMassReg">추가</button>
|
||||||
|
<button type="button" id="btnAddrMassClose" class="tooltip-close" data-focus="adr_popup07-close" data-focus-next="popup07">닫기</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
@ -943,19 +943,6 @@ $(document).on('click', '#errorExcelBtn', function() {
|
|||||||
<!-- <option value="addrComment">메모</option> -->
|
<!-- <option value="addrComment">메모</option> -->
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="width: 125px;">
|
|
||||||
<label for="" class="label"></label>
|
|
||||||
<select class="field-selector">
|
|
||||||
<option value="">선택하기</option>
|
|
||||||
<option value="addrNm">이름</option>
|
|
||||||
<option value="addrPhoneNo">휴대폰</option>
|
|
||||||
<option value="addrInfo1">[*1*]</option>
|
|
||||||
<option value="addrInfo2">[*2*]</option>
|
|
||||||
<option value="addrInfo3">[*3*]</option>
|
|
||||||
<option value="addrInfo4">[*4*]</option>
|
|
||||||
<option value="addrComment">메모</option>
|
|
||||||
</select>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -93,6 +93,9 @@ function totalFtPriceSum(totRows){
|
|||||||
var KAKAO_FT_PRICE = '';
|
var KAKAO_FT_PRICE = '';
|
||||||
var SHORT_PRICE = '';
|
var SHORT_PRICE = '';
|
||||||
var LONG_PRICE = '';
|
var LONG_PRICE = '';
|
||||||
|
KAKAO_FT_PRICE = $('#kakaoFtPrice').val();
|
||||||
|
SHORT_PRICE = $('#shortPrice').val();
|
||||||
|
LONG_PRICE = $('#longPrice').val();
|
||||||
|
|
||||||
/*$(document).ready(function(){
|
/*$(document).ready(function(){
|
||||||
|
|
||||||
@ -153,14 +156,16 @@ var LONG_PRICE = '';
|
|||||||
/**
|
/**
|
||||||
* @description 금액 계산 function
|
* @description 금액 계산 function
|
||||||
*/
|
*/
|
||||||
function fn_priceClclt(){
|
function fn_priceClclt(phoneSu = 0){
|
||||||
|
|
||||||
// 미리보기 텍스트
|
// 미리보기 텍스트
|
||||||
var templateHtml = $('#smsTxtArea').val();
|
var templateHtml = $('#smsTxtArea').val();
|
||||||
// var templateHtml = $('.template_text').html();
|
// var templateHtml = $('.template_text').html();
|
||||||
|
|
||||||
// 수신 번호 개수
|
// 수신 번호 개수
|
||||||
var phoneSu = $('.phoneArea').length;
|
if(phoneSu == 0){
|
||||||
|
phoneSu = $('.phoneArea').length;
|
||||||
|
}
|
||||||
// 대체문자 있는지 확인
|
// 대체문자 있는지 확인
|
||||||
var isSendFailChecked = $("#send_fail_check").is(":checked");
|
var isSendFailChecked = $("#send_fail_check").is(":checked");
|
||||||
// 치환문자 여부 확인
|
// 치환문자 여부 확인
|
||||||
@ -183,6 +188,7 @@ function fn_priceClclt(){
|
|||||||
* 카카오 금액 * 수신자 수 계산
|
* 카카오 금액 * 수신자 수 계산
|
||||||
*/
|
*/
|
||||||
function fn_sendFailUnChecked(phoneSu){
|
function fn_sendFailUnChecked(phoneSu){
|
||||||
|
console.log('phoneSu; ', phoneSu);
|
||||||
|
|
||||||
// 카카오 금액 * 수신자 수
|
// 카카오 금액 * 수신자 수
|
||||||
// fn_writePriceText() 첫 파라미터가 null이면 카카오 전송으로 인식
|
// fn_writePriceText() 첫 파라미터가 null이면 카카오 전송으로 인식
|
||||||
@ -279,9 +285,9 @@ function fn_writePriceText(msgTypeText, phoneSu){
|
|||||||
msgTypeText = msgTypeText.trim();
|
msgTypeText = msgTypeText.trim();
|
||||||
if(msgTypeText == '단문') price = SHORT_PRICE * phoneSu;
|
if(msgTypeText == '단문') price = SHORT_PRICE * phoneSu;
|
||||||
else if(msgTypeText == '장문') price = LONG_PRICE * phoneSu;
|
else if(msgTypeText == '장문') price = LONG_PRICE * phoneSu;
|
||||||
else price = KAKAO_AT_PRICE * phoneSu; // 카카오
|
else price = KAKAO_FT_PRICE * phoneSu; // 카카오
|
||||||
|
|
||||||
$('#totalPriceTxt').text((price).toFixed(1));
|
$('#totalPriceTxt').text(numberWithCommas((price).toFixed(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -29,8 +29,14 @@ $(document).ready(function (){
|
|||||||
//clipboardPasteAction:"insert", // insert, update, replace
|
//clipboardPasteAction:"insert", // insert, update, replace
|
||||||
placeholder:"복사(Ctrl+C)한 내용을 여기에 붙여넣기(Ctrl+V) 해주세요.", //fit columns to width of table (optional)
|
placeholder:"복사(Ctrl+C)한 내용을 여기에 붙여넣기(Ctrl+V) 해주세요.", //fit columns to width of table (optional)
|
||||||
resizableColumns:false,
|
resizableColumns:false,
|
||||||
|
columnDefaults:{ // 공통설정
|
||||||
|
hozAlign: "center",
|
||||||
|
headerHozAlign: "center",
|
||||||
|
editor: "input",
|
||||||
|
editor: false
|
||||||
|
},
|
||||||
columns:[ //Define Table Columns
|
columns:[ //Define Table Columns
|
||||||
{formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, hozAlign:"center", headerSort:false, cellClick:function(e, cell){
|
{formatter:"rowSelection", headerHozAlign:"center", titleFormatter:"rowSelection",clipboard:false, hozAlign:"center", width:5, headerSort:false, cellClick:function(e, cell){
|
||||||
cell.getRow().toggleSelect();
|
cell.getRow().toggleSelect();
|
||||||
}},
|
}},
|
||||||
{title:"이름", hozAlign:"center", field:"name", editor:"input", validator:["maxLength:12"], cellEdited:function(cell){
|
{title:"이름", hozAlign:"center", field:"name", editor:"input", validator:["maxLength:12"], cellEdited:function(cell){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user