merge master into develop - CscListRForm.jsp FAQ 아코디언 버그 수정
This commit is contained in:
163
build/resources/main/static/js/puri.js
Normal file
163
build/resources/main/static/js/puri.js
Normal file
@@ -0,0 +1,163 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
//datepicker 초기화
|
||||
let visitDe = $('input[name="visitDe"]').val();
|
||||
$('#visitDe').datepicker({
|
||||
dateFormat: 'yy-mm-dd'
|
||||
}).datepicker('setDate',visitDe);
|
||||
|
||||
$('#installDe').datepicker({
|
||||
dateFormat: 'yy-mm-dd'
|
||||
})
|
||||
|
||||
// 라디오 버튼 초기화
|
||||
let statusValue = $('input[name="status"]').val();
|
||||
let allimStatusValue = $('input[name="allimStatus"]').val();
|
||||
let visitTrgterAtValue = $('input[name="visitTrgterAt"]').val();
|
||||
let puriAllimSeq = $('input[name="puriAllimSeq"]').val();
|
||||
|
||||
if (statusValue == 'regist') {
|
||||
$('#s-1').prop('checked', true);
|
||||
} else if(statusValue == 'cancel') {
|
||||
$('#s-2').prop('checked', true);
|
||||
}
|
||||
|
||||
if (allimStatusValue == '대기') {
|
||||
$('#at-1').prop('checked', true);
|
||||
} else if (allimStatusValue == '발송') {
|
||||
$('#at-2').prop('checked', true);
|
||||
} else if (allimStatusValue == '중지') {
|
||||
$('#at-3').prop('checked', true);
|
||||
}
|
||||
|
||||
if (visitTrgterAtValue == 'Y') {
|
||||
$('#v-1').prop('checked', true);
|
||||
} else if (visitTrgterAtValue == 'N') {
|
||||
$('#v-2').prop('checked', true);
|
||||
}
|
||||
|
||||
// 알림 테이블 전화번호 input 넣기
|
||||
let noMasktelnbOne = $('input[name="noMasktelnb"]').val().substring(0,3);
|
||||
let noMasktelnbTwo = $('input[name="noMasktelnb"]').val().substring(4,8);
|
||||
let noMasktelnbThree = $('input[name="noMasktelnb"]').val().slice(-4);
|
||||
|
||||
$('#telnbOne').val(noMasktelnbOne);
|
||||
$('#telnbTwo').val(noMasktelnbTwo);
|
||||
$('#telnbThree').val(noMasktelnbThree);
|
||||
|
||||
|
||||
|
||||
// 팝업 문자 전송내역
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/mngr/puri/selectPuriAllimList',
|
||||
data: { puriAllimSeq: puriAllimSeq },
|
||||
success: function (data) {
|
||||
let html = '';
|
||||
if(data != null && data.list) {
|
||||
$.each(data.list,function(index,list){
|
||||
let dateStr = list.sndngDe;
|
||||
let dateObj = new Date(dateStr);
|
||||
let formattedDate = dateObj.toISOString().split('T')[0];
|
||||
let formattedTime = dateObj.toTimeString().split(' ')[0];
|
||||
const sanitizedText = $('<div>').text(list.sndngCn).html().replace(/\r\n/g, '<br>');
|
||||
|
||||
html += '<tr>' +
|
||||
'<td>' + list.rnum + '</td>' +
|
||||
'<td>' + formattedDate + ' ' + formattedTime + '</td>' +
|
||||
'<td>' + list.telnb + '</td>' +
|
||||
'<td>' + sanitizedText + '</td>' +
|
||||
' </tr>' ;
|
||||
})
|
||||
|
||||
|
||||
$('.allim-zone').html(html);
|
||||
} else {
|
||||
$('.allim-zone').html('<tr><td>** 발송내역이 없습니다 **</td> </tr>');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#orderBtn').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
url: '/mngr/puri/updatePuriOrder',
|
||||
method: 'POST',
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
data: $('#puriOrderForm').serialize(),
|
||||
success: function(data) {
|
||||
if(data.resBody && data.resBody.result) {
|
||||
|
||||
let parseResult = JSON.parse(data.resBody.result);
|
||||
|
||||
let status = parseResult.status;
|
||||
if (status == 'success') {
|
||||
alert(parseResult.message);
|
||||
$('#puriOrderListDetailStatsPopup').hide();
|
||||
$('.blocker').remove();
|
||||
$('body').css('overflow', 'auto');
|
||||
window.location.reload();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, error: function(xhr,status,error) {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#allimBtn').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
let telOnevalue = $('#telnbOne').val();
|
||||
let telTwovalue = $('#telnbTwo').val();
|
||||
let telThreevalue = $('#telnbThree').val();
|
||||
let regex = /^(010|011)$/;
|
||||
|
||||
if (!regex.test(telOnevalue)) {
|
||||
alert('전화번호는 010 또는 011으로 시작해야 합니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (telOnevalue === '' || telTwovalue === '' || telThreevalue === '') {
|
||||
alert('전화번호가 공백입니다. 다시 입력해 주세요.');
|
||||
return;
|
||||
}
|
||||
|
||||
if($('#cstmrNm').val() === '' ) {
|
||||
alert('이름이 공백입니다. 다시 입력해 주세요.');
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '/mngr/puri/updatePuriAllim',
|
||||
method: 'POST',
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
data: $('#puriAllimForm').serialize(),
|
||||
success: function(data) {
|
||||
if (data.resBody && data.resBody.result) {
|
||||
let parseResult = JSON.parse(data.resBody.result);
|
||||
let status = parseResult.status;
|
||||
|
||||
if (status === 'success') {
|
||||
alert(parseResult.message);
|
||||
$('#puriOrderListDetailStatsPopup').hide();
|
||||
$('.blocker').remove();
|
||||
$('body').css('overflow', 'auto');
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user