초기소스
61
src/main/resources/static/js/mngr/alarmCount.js
Normal file
@@ -0,0 +1,61 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
const authSopmalCd = getCookie("authSopmalCd");
|
||||
|
||||
$.ajax({
|
||||
url: '/mngr/alarm/select/selectAlarmCount',
|
||||
method: 'GET',
|
||||
contentType: 'application/json; charset=UTF-8',
|
||||
data: {"sopmalCd" : authSopmalCd},
|
||||
success: function(data) {
|
||||
if (data.resBody && data.resBody.result) {
|
||||
let parseResult = JSON.parse(data.resBody.result);
|
||||
let status = parseResult.status;
|
||||
|
||||
if (status === 'success') {
|
||||
console.log(parseResult.refundList);
|
||||
console.log(parseResult.answerList);
|
||||
|
||||
show_top_menu_req_cnt(parseResult.refundList);
|
||||
show_top_menu_req_cnt(parseResult.answerList);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function show_top_menu_req_cnt(list) {
|
||||
if(list.length < 1) return;
|
||||
let menu = list[0].menuName;
|
||||
|
||||
$("div.header-nav__right a").each(function () {
|
||||
if ($(this).text() == menu) {
|
||||
if ($(this).text() == '게시판') {
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
let bbsId = list[i].bbsId;
|
||||
let cnt = list[i].cnt;
|
||||
|
||||
if (bbsId == 'goods_qna') {
|
||||
$(this).parent().append("<div class='top_menu_req_cnt'>" + cnt + "</div>");
|
||||
} else {
|
||||
$(this).parent().append("<div class='top_menu_req_cnt2'>" + cnt + "</div>");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (list[0].cnt != 0) {
|
||||
$(this).parent().append("<div class='top_menu_req_cnt'>" + list[0].cnt + "</div>");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getCookie(name) {
|
||||
const value = `; ${document.cookie}`;
|
||||
const parts = value.split(`; ${name}=`);
|
||||
if (parts.length === 2) return parts.pop().split(';').shift();
|
||||
}
|
||||
249
src/main/resources/static/js/mngr/css/bnft/style.css
Normal file
@@ -0,0 +1,249 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
/*event add 2024-05*/
|
||||
.wd60 {width:60px !important;max-width:120px !important;}
|
||||
.wd70 {width:70px !important;max-width:120px !important;}
|
||||
.wd80 {width:80px !important;max-width:120px !important;}
|
||||
|
||||
.wd90 {width:90px !important;max-width:120px !important;}
|
||||
.wd100 {width:100px !important;max-width:100px !important;}
|
||||
.wd150 {width:150px !important;max-width:150px !important;}
|
||||
.wd200 {width:200px !important;max-width:200px !important;}
|
||||
.wd250 {width:250px !important;max-width:250px !important;}
|
||||
.wd300 {width:300px !important;max-width:300px !important;}
|
||||
.wd400 {width:400px !important;max-width:400px !important;}
|
||||
.wd500 {width:500px !important;max-width:500px !important;}
|
||||
.wd540 {width:540px !important;max-width:580px !important;}
|
||||
.wd580 {width:580px !important;max-width:580px !important;}
|
||||
.wd600 {width:600px !important;max-width:600px !important;}
|
||||
.wd50p {width:50% !important;}
|
||||
.wd100p {width:100% !important;}
|
||||
|
||||
.alignL {text-align:left !important;}
|
||||
.alignR {text-align:right !important;}
|
||||
.alignC {text-align:center !important;}
|
||||
.center {margin:0 auto;}
|
||||
|
||||
.mt0 {margin-top:0 !important;}
|
||||
.mb5 {margin-bottom:5px !important;}
|
||||
|
||||
.pdt0 {padding-top:0 !important;}
|
||||
|
||||
.bar_right {border-right:1px solid #ccc; margin:0 10px 0 0; padding-right:10px; line-height:1;}
|
||||
.table td .td-inner.right {flex-direction: row-reverse;}
|
||||
.table td .td-inner.nowrap {flex-wrap: nowrap;align-items: flex-start;}
|
||||
.table td .ft-12{font-size: 12px;}
|
||||
.table td .cl-{font-size: 12px;}
|
||||
.side-nav {overflow-y: auto;}
|
||||
.textarea_form {
|
||||
width:100%;
|
||||
border:1px solid #dee2e6;
|
||||
padding: 15px;
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
.textarea_form textarea{width:100%; height:150px;}
|
||||
/*출석체크_기간별내역*/
|
||||
.count-wrapper {display: flex;}
|
||||
.count_box {width:25%;text-align:center;border:1px solid #ccc;border-radius: 10px;margin: 10px 10px 30px;position: relative;}
|
||||
.count_box:hover {border-color:#1c7ed6;}
|
||||
.count_box a {display:block;padding:20px 10px;}
|
||||
.count_box .cnt_top {font-size:16px;font-weight: 600;}
|
||||
.count_box .cnt_bm {font-size:24px;font-weight: 600;color:#1864ab;margin-top:10px;}
|
||||
.count_box .cnt_txt {font-size:14px;font-weight: 500;color: #696969;/* margin-top: 15px; */position: absolute;left: 0;bottom: -33px;width: 100%;text-align: center;}
|
||||
|
||||
.count_box.last {background: #f7f7f7;border-color:#3CAB50;}
|
||||
.count_box.last .cnt_bm {color:#3CAB50;}
|
||||
.count_box.last:hover {background: #fff;}
|
||||
|
||||
.count_box.st-01 {background: #edecf9;border-color: #865fdf;}
|
||||
.count_box.st-01 .cnt_bm {color: #797c81;font-size: 18px;/* font-weight: 400; */}
|
||||
.count_box.st-01 .cnt_bm .cc{color: #865fdf;font-size: 24px;font-weight: 600;margin-right: 5px;}
|
||||
.count_box.st-01:hover {background: #fff;}
|
||||
|
||||
.ic_today{background: #228be6;color:#fff;border-radius: 5px;font-size: 0.8em;padding: 1px 9px 5px 9px;vertical-align: 2px;}
|
||||
|
||||
.count-wrapper.cw-01{display: flex;flex-wrap: wrap;}
|
||||
.count-wrapper.cw-01 .count_box{width: 18.7%;}
|
||||
.dropzone-wrapper .dropzone.w200 {min-width: 200px;}
|
||||
|
||||
.ck.ck-content:not(.ck-style-grid__button__preview) {min-height: 200px !important;}
|
||||
|
||||
/*사진작은사이즈*/
|
||||
.dropzone-wrapper.sm {padding:0;}
|
||||
.dropzone-wrapper.sm .dropzone {min-width: 100px; min-height: 100px;}
|
||||
.dropzone-wrapper.sm .dropzone .dz-message {/*display: flex; gap: 20px; */margin: 0;}
|
||||
.dropzone-wrapper.sm .dropzone .dz-message::before {
|
||||
width:60px; height:60px;
|
||||
}
|
||||
th.left-line{border-left: solid 1px #dee2e6;}
|
||||
td.left-line{border-left: solid 1px #f1f3f5;}
|
||||
tr.hr td,
|
||||
tr.hr th{border-top:1px solid #6e6e6e;}
|
||||
.btn.outline.delete {
|
||||
border-color:red
|
||||
}
|
||||
.btn.delete {
|
||||
background-color: #ca0000;
|
||||
color: #ffffff;
|
||||
}
|
||||
.btn.delete:hover {
|
||||
background-color: #ca0000;
|
||||
}
|
||||
.btn.delete.outline {
|
||||
border-color: #ca0000;
|
||||
color: #ca0000;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
/*관심분야설정 차트*/
|
||||
.content-chart {display: flex; width: 100%;justify-content: space-between;}
|
||||
.content-chart .left_area{width: 52%;}
|
||||
.content-chart .right_area{width: 44%;}
|
||||
|
||||
.chart-wrapper{min-width: 200px; min-height: 200px;}
|
||||
|
||||
.tf-bg tfoot th,
|
||||
.tf-bg tfoot td{background: #f5fbff;font-weight: 600;color: #416ec3;}
|
||||
.tf-bg tfoot th{/* background: #e8eef3; */color: #50514f;font-weight: 500;}
|
||||
|
||||
.select-box.xs .nice-select {min-width: 128px;height: 36px;line-height: 34px;border: 1px solid #dee2e6;border-radius: 4px;padding-left: 12px;max-width: 200px;}
|
||||
.grp-wrap {
|
||||
display:flex;
|
||||
gap: 20px;
|
||||
height:350px;
|
||||
}
|
||||
.grp-inbox {
|
||||
width:100%;
|
||||
height:100%;
|
||||
background-color:#fafafa;
|
||||
padding:20px;
|
||||
}
|
||||
.grp-tit {
|
||||
font-size: 18px;
|
||||
margin-bottom: 10px;
|
||||
color: #262675;
|
||||
font-weight: 500;
|
||||
}
|
||||
.btn.delete.outline {
|
||||
border-color: #ce1818;
|
||||
color: #ce1818;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.bar_chart {
|
||||
margin:40px 0;
|
||||
}
|
||||
.barWrap {
|
||||
display: flex;
|
||||
position: relative;
|
||||
margin: 0 0 24px;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
.bar {
|
||||
position: relative;
|
||||
width: 80%;
|
||||
height: 15px;
|
||||
background-color: #f7f7f7;
|
||||
border-radius: 25px;
|
||||
border-radius: 25px;
|
||||
}
|
||||
.bar > span {
|
||||
display: block;
|
||||
width: 50%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 15px;
|
||||
background: #4CAF50;
|
||||
border-radius: 999px;
|
||||
font-size: 0;
|
||||
}
|
||||
.bar.blue-8 span {background-color: #1971c2;}
|
||||
.barWrap span.tit {
|
||||
display: block;
|
||||
width: 5%;
|
||||
font-size:16px;
|
||||
font-weight:600;
|
||||
}
|
||||
.barWrap span.per {
|
||||
display: block;
|
||||
width: 15%;
|
||||
text-align: right;
|
||||
font-size: 16px;
|
||||
font-weight: 600
|
||||
}
|
||||
.barWrapSum {
|
||||
margin:30px 0;
|
||||
text-align:right;
|
||||
font-size:18px;
|
||||
font-weight:600;
|
||||
background:#f7f7f7;
|
||||
border-radius: 10px;
|
||||
padding:30px;
|
||||
}
|
||||
.barWrapSum b {
|
||||
font-size:24px;
|
||||
}
|
||||
.tb-top-date {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap:5px;
|
||||
}
|
||||
.btn.outline.green-8 {
|
||||
border-color:#2f9e44 !important
|
||||
}
|
||||
/*테스트발송*/
|
||||
.messege-check-listWrap {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
overflow-y: auto;
|
||||
margin: 10px 0;
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #dedede;
|
||||
}
|
||||
.messege-check-list {
|
||||
|
||||
}
|
||||
.messege-check-list li {
|
||||
padding: 12px;
|
||||
border-bottom: 1px dashed #eee;
|
||||
}
|
||||
.messege-check-list li:hover {
|
||||
background-color: #fff;
|
||||
}
|
||||
/*탭*/
|
||||
.tab_area {
|
||||
display: flex;
|
||||
border-bottom: 2px solid #ddd;
|
||||
}
|
||||
|
||||
.tab_area a {
|
||||
font-size: 20px;
|
||||
padding: 10px 30px;
|
||||
display: block;
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
border-bottom: 2px solid transparent;
|
||||
transition: border-color 0.3s, color 0.3s;
|
||||
margin-bottom: -2px;
|
||||
}
|
||||
|
||||
.tab_area a.active {
|
||||
font-weight: 600;
|
||||
color: #228be6;
|
||||
border-bottom: 2px solid #228be6;
|
||||
}
|
||||
|
||||
|
||||
.tab-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-content.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
31
src/main/resources/static/js/mngr/css/imgFileupload.css
Normal file
@@ -0,0 +1,31 @@
|
||||
@charset "UTF-8";
|
||||
.preview-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
.preview-item {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
.preview-item img {
|
||||
max-width: 150px;
|
||||
max-height: 150px;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.preview-item .delete-btn {
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
right: -5px;
|
||||
background: red;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
}
|
||||
7
src/main/resources/static/js/mngr/css/jquery-ui.min.css
vendored
Normal file
7900
src/main/resources/static/js/mngr/css/style.css
Normal file
275
src/main/resources/static/js/mngr/fileupload_comm.js
Normal file
@@ -0,0 +1,275 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
//$("#fileUpload").on("change", addFiles);
|
||||
});
|
||||
|
||||
var filesTempArr = [];
|
||||
|
||||
//파일추가
|
||||
function addFiles(event, mode){
|
||||
addFilesObj(event, mode,"fileList");
|
||||
}
|
||||
|
||||
function addFilesObj(event, mode, objId, represntAt){
|
||||
if(!($(event.target).is('[multiple]'))) filesTempArr.splice(0, filesTempArr.length);
|
||||
|
||||
var files = event.target.files; //선택한 파일들
|
||||
var filesArr = Array.prototype.slice.call(files); //file객체 array추가
|
||||
var filesArrLen = filesArr.length;
|
||||
var filesTempArrSize = filesTempArr.length*1;
|
||||
|
||||
let obj = $('#'+objId);
|
||||
if((mode === 1 && filesArrLen>1) || (mode === 1 && obj.find('li').length>0)){
|
||||
alert("파일은 한개만 첨부할 수 있습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
var templist = '';
|
||||
for(var i=0; i<filesArrLen; i++){
|
||||
if(i === filesArrLen-1){ //게시판 대표이미지 배열 첫번째로 이동
|
||||
if(represntAt === 'Y'){
|
||||
filesTempArr.unshift(filesArr[i]); //임시배열에 저장
|
||||
}else{
|
||||
filesTempArr.push(filesArr[i]); //임시배열에 저장
|
||||
}
|
||||
}else{
|
||||
filesTempArr.push(filesArr[i]); //임시배열에 저장
|
||||
}
|
||||
if($(event.target).is('[multiple]')){
|
||||
//templist = "<div id='temp"+(i+filesTempArrSize)+"'><a href='#' onclick='downloadFile(this, "+(i+filesTempArrSize)+");'>"+ filesArr[i].name + "</a><span style='color:red;' onclick='deleteFile(this, event, "+(i+filesTempArrSize)+");'> [X]</span></div>";
|
||||
let fileSize = (filesArr[i].size / 1024).toFixed(2);
|
||||
if(objId=='fileList'){
|
||||
templist ="<li id='temp"+(i+filesTempArrSize)+"'>"
|
||||
+"<a href='#' onclick='downloadFile(this, "+(i+filesTempArrSize)+");'>"
|
||||
+ "<i class='icon icon_file-list mr-2'></i>"
|
||||
+ "<span class='file-list__item-title'>"+ filesArr[i].name + "</span>"
|
||||
+"</a>"
|
||||
+"<button type='button' class='file-list__delete' onclick='deleteFile(this,0,0, "+(i+filesTempArrSize)+");'/>"
|
||||
+"</li>";
|
||||
}else {
|
||||
templist = "<li class = 'uploadList__item' id='temp" + (i + filesTempArrSize) + "'>"
|
||||
+ "<p class = 'uploadList__itemText'>"
|
||||
+ "<span class = 'uploadList__itemName'/> "+ filesArr[i].name + "</span>"
|
||||
+ "<span class ='uploadList__itemSize'>("+ fileSize + " KB)</span>"
|
||||
+ "</p>"
|
||||
+ "<input type = 'hidden' value = '"+ fileSize + "' class = 'filsSize'/>"
|
||||
+ "<button class='uploadList__removeBtn' type='button' onclick='deleteFile(this,0,0," + (i+filesTempArrSize) + ",\"" + objId + "\"); fn_sum_file_size();'/>"
|
||||
+ "<span class ='visually-hidden'>삭제</span>"
|
||||
+ "</button>"
|
||||
+ "</li>"
|
||||
}
|
||||
obj.append(templist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//파일삭제
|
||||
//callbackNm ajax 파일 처리 성공시 실행 할 콜백함수
|
||||
function deleteFile(obj, shopCd, menuGb, orderParam,callbackNm,callbackParam) {
|
||||
deleteFiles(obj, shopCd, menuGb, orderParam, 'fileUpload',callbackNm,callbackParam);
|
||||
}
|
||||
|
||||
//파일삭제
|
||||
function deleteFiles(obj, shopCd, menuGb, orderParam, objId, callbackNm,callbackParam) {
|
||||
filesTempArr.splice(orderParam, 1);
|
||||
var $div = $(obj).closest('li');
|
||||
var $id = $div.attr('id');
|
||||
var obj = "#" + objId;
|
||||
if ($id.indexOf('temp') == 0) { //임시등록파일은 화면에서 삭제
|
||||
$div.remove();
|
||||
$(obj).val('');
|
||||
} else { //업로드된 파일은 서버삭제
|
||||
if (confirm("파일을 삭제하시겠습니까?")) {
|
||||
ajaxFileDelete($div, $id, shopCd, menuGb, orderParam,callbackNm,callbackParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//파일삭제(html 요소 조작 없이 단순 파일 삭제)
|
||||
function dropzoneDeleteFiles(fileId, shopCd, menuGb, orderParam,callbackNm,callbackParam) {
|
||||
if (fileId.indexOf('temp') != 0) { //임시등록파일은 화면에서 삭제
|
||||
if (confirm("파일을 삭제하시겠습니까?")) {
|
||||
ajaxFileDelete('', fileId, shopCd, menuGb, orderParam, callbackNm,callbackParam);
|
||||
return "Y";
|
||||
}else{
|
||||
return "N";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var ajaxFileDelete = function (obj, fileId, shopCd, menuGb, orderParam, callbackNm,callbackParam) {
|
||||
|
||||
$.ajax({
|
||||
//url: '/file/deleteUploadedFile/'+shopCd+'/'+menuGb+'/'+fileId+'/ajax',
|
||||
url: '/mngr/file/deleteUploadedFile?sopCd=' + shopCd + '&menuGb=' + menuGb + '&fileKey=' + fileId,
|
||||
data: fileId,
|
||||
type: 'get',
|
||||
success: function (data) {
|
||||
if (obj !== '') {
|
||||
obj.remove();
|
||||
}
|
||||
if (callbackNm != null) {
|
||||
callbackNm(callbackParam);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
alert("삭제에 실패하였습니다.");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//다운로드
|
||||
var downloadFile = function(obj,shopCd, menuGb,orderParam){
|
||||
filesTempArr.splice(orderParam, 1);
|
||||
var $div = $(obj).closest('li');
|
||||
var fileId = $div.attr('id'); // <li>태그id - 파일글번호
|
||||
var orgFileId = obj.id; //선택된 파일명. 즉 <a>태그id - 원본파일명
|
||||
|
||||
if(fileId.indexOf('temp') == 0){
|
||||
alert("등록된 파일만 다운로드 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
//$(location).attr('href','/file/download/'+shopCd+'/'+menuGb+'/'+fileId+'/'+orgFileId+'/ajax');
|
||||
//$(location).attr('href','/file/download/'+shopCd+'/'+menuGb+'/'+fileId+'/ajax');
|
||||
$(location).attr('href','/mngr/file/fileDownload?sopCd='+shopCd+'&menuGb='+menuGb+'&fileKey='+fileId);
|
||||
}
|
||||
|
||||
|
||||
//다운로드
|
||||
var linkDownloadFile = function(key,shopCd, menuGb,orderParam){ //파일글번호, 원본파일명
|
||||
filesTempArr.splice(orderParam, 1);
|
||||
|
||||
if(key.indexOf('temp') == 0){
|
||||
alert("등록된 파일만 다운로드 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
$(location).attr('href','/mngr/file/fileDownload?sopCd='+shopCd+'&menuGb='+menuGb+'&fileKey='+key);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// 이미지 업로드 시 이미지 미리보기 , 삭제버튼(배열에서 제거함) 기능
|
||||
//-----------------------------------------------------------
|
||||
|
||||
// let selectedFiles = []; // 선택된 파일을 저장하는 배열
|
||||
function addImgFilesView(event,objId){
|
||||
const previewContainer = document.getElementById(objId);
|
||||
const files = event.target.files; // 선택된 파일들 가져오기
|
||||
// previewContainer.innerHTML = ''; // 기존 미리보기 초기화
|
||||
// filesTempArr = []; // 기존 배열 초기화
|
||||
|
||||
// 파일 개수 제한 확인
|
||||
// const maxFiles = 3; // 최대 파일 개수 제한
|
||||
/*if (filesTempArr.length + files.length > maxFiles) {
|
||||
alert(`최대 ${maxFiles}개의 파일만 업로드할 수 있습니다.`);
|
||||
return;
|
||||
}
|
||||
Array.from(files).forEach((file) => {
|
||||
if (filesTempArr.length < maxFiles) {
|
||||
filesTempArr.push(file); // 파일 추가
|
||||
displayPreview(file, previewContainer);
|
||||
}
|
||||
});*/
|
||||
Array.from(files).forEach((file) => {
|
||||
filesTempArr.push(file); // 파일 추가
|
||||
displayPreview(file, previewContainer);
|
||||
});
|
||||
|
||||
// input 초기화 (같은 파일 재선택 가능)
|
||||
event.target.value = '';
|
||||
}
|
||||
|
||||
function displayPreview(file,obj) {
|
||||
const reader = new FileReader();
|
||||
|
||||
reader.onload = function (e) {
|
||||
// 미리보기 항목 생성
|
||||
const previewItem = document.createElement('div');
|
||||
previewItem.classList.add('preview-item');
|
||||
|
||||
// 이미지 태그 생성
|
||||
const img = document.createElement('img');
|
||||
img.src = e.target.result;
|
||||
|
||||
// 삭제 버튼 생성
|
||||
const deleteBtn = document.createElement('button');
|
||||
deleteBtn.classList.add('delete-btn');
|
||||
deleteBtn.textContent = '×';
|
||||
deleteBtn.onclick = function () {
|
||||
removeImgFile(file, previewItem);
|
||||
};
|
||||
|
||||
// 미리보기 항목에 이미지와 버튼 추가
|
||||
previewItem.appendChild(img);
|
||||
previewItem.appendChild(deleteBtn);
|
||||
obj.appendChild(previewItem);
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
|
||||
function removeImgFile(file, previewItem) {
|
||||
// 선택된 파일 배열에서 제거
|
||||
filesTempArr = filesTempArr.filter((f) => f !== file);
|
||||
|
||||
// 미리보기 항목 제거
|
||||
previewItem.remove();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
var initFileList = function($files){
|
||||
if(Array.isArray($files)){
|
||||
$.each($files, function(index, item){
|
||||
filesTempArr.push(item);
|
||||
filesTempArr[index].upload = 'disable';
|
||||
});
|
||||
}else{
|
||||
filesTempArr.push(new File([$files], $files+".txt", {
|
||||
type: "text/plain",
|
||||
}));
|
||||
filesTempArr[0].upload = 'disable';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//파일삭제(단건)
|
||||
function deleteSingleFile (obj, eventParam, orderParam){
|
||||
if(confirm('삭제하시겠습니까?')){
|
||||
filesTempArr.splice(orderParam, 1);
|
||||
var $div = $(obj).closest('div')
|
||||
var $id = $div.attr('id');
|
||||
if($id.indexOf('temp') == 0) {
|
||||
$div.remove();
|
||||
}else{
|
||||
$div.remove();
|
||||
|
||||
$('#updateFileDiv').show();
|
||||
filesTempArr = [];
|
||||
$('#imgSavedYn').val("N");
|
||||
//ajaxSingleFileDelete($id);
|
||||
}
|
||||
}
|
||||
}
|
||||
//파일삭제(단건) 후처리
|
||||
var ajaxSingleFileDelete = function(fileId){
|
||||
$.ajax({
|
||||
url: '/mngr/file/deleteUploadedFile/'+fileId+"/ajax",
|
||||
data: fileId,
|
||||
type: 'post',
|
||||
success : function(data){
|
||||
//찾아보기 div구역 id = updateFileDiv
|
||||
$('#updateFileDiv').show();
|
||||
filesTempArr = [];
|
||||
},
|
||||
error: function(xhr, status, error){
|
||||
alert("삭제에 실패하였습니다.");
|
||||
}
|
||||
});
|
||||
}
|
||||
BIN
src/main/resources/static/js/mngr/fonts/NotoSansKR-Black.otf
Normal file
BIN
src/main/resources/static/js/mngr/fonts/NotoSansKR-Bold.otf
Normal file
BIN
src/main/resources/static/js/mngr/fonts/NotoSansKR-Light.otf
Normal file
BIN
src/main/resources/static/js/mngr/fonts/NotoSansKR-Medium.otf
Normal file
BIN
src/main/resources/static/js/mngr/fonts/NotoSansKR-Regular.otf
Normal file
BIN
src/main/resources/static/js/mngr/fonts/NotoSansKR-Thin.otf
Normal file
1916
src/main/resources/static/js/mngr/gcone.js
Normal file
BIN
src/main/resources/static/js/mngr/images/icon_calendar.png
Normal file
|
After Width: | Height: | Size: 656 B |
BIN
src/main/resources/static/js/mngr/images/icon_check-white.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/main/resources/static/js/mngr/images/icon_chevron.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
src/main/resources/static/js/mngr/images/icon_chevron2.png
Normal file
|
After Width: | Height: | Size: 733 B |
BIN
src/main/resources/static/js/mngr/images/icon_clock.png
Normal file
|
After Width: | Height: | Size: 1019 B |
BIN
src/main/resources/static/js/mngr/images/icon_comment-user.png
Normal file
|
After Width: | Height: | Size: 601 B |
BIN
src/main/resources/static/js/mngr/images/icon_draggable.png
Normal file
|
After Width: | Height: | Size: 319 B |
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/main/resources/static/js/mngr/images/icon_emoji.png
Normal file
|
After Width: | Height: | Size: 711 B |
BIN
src/main/resources/static/js/mngr/images/icon_excel.png
Normal file
|
After Width: | Height: | Size: 934 B |
BIN
src/main/resources/static/js/mngr/images/icon_file-delete.png
Normal file
|
After Width: | Height: | Size: 706 B |
BIN
src/main/resources/static/js/mngr/images/icon_file-list.png
Normal file
|
After Width: | Height: | Size: 832 B |
BIN
src/main/resources/static/js/mngr/images/icon_gift-badge.png
Normal file
|
After Width: | Height: | Size: 572 B |
BIN
src/main/resources/static/js/mngr/images/icon_headerCart.png
Normal file
|
After Width: | Height: | Size: 756 B |
BIN
src/main/resources/static/js/mngr/images/icon_headerLaptop.png
Normal file
|
After Width: | Height: | Size: 410 B |
BIN
src/main/resources/static/js/mngr/images/icon_headerSetting.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/main/resources/static/js/mngr/images/icon_hot-badge.png
Normal file
|
After Width: | Height: | Size: 369 B |
BIN
src/main/resources/static/js/mngr/images/icon_image-badge.png
Normal file
|
After Width: | Height: | Size: 481 B |
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/main/resources/static/js/mngr/images/icon_info.png
Normal file
|
After Width: | Height: | Size: 903 B |
BIN
src/main/resources/static/js/mngr/images/icon_kakao-id.png
Normal file
|
After Width: | Height: | Size: 699 B |
BIN
src/main/resources/static/js/mngr/images/icon_link.png
Normal file
|
After Width: | Height: | Size: 521 B |
BIN
src/main/resources/static/js/mngr/images/icon_lock.png
Normal file
|
After Width: | Height: | Size: 680 B |
BIN
src/main/resources/static/js/mngr/images/icon_logout.png
Normal file
|
After Width: | Height: | Size: 504 B |
|
After Width: | Height: | Size: 1004 B |
BIN
src/main/resources/static/js/mngr/images/icon_modal-close.png
Normal file
|
After Width: | Height: | Size: 377 B |
BIN
src/main/resources/static/js/mngr/images/icon_new-badge.png
Normal file
|
After Width: | Height: | Size: 531 B |
BIN
src/main/resources/static/js/mngr/images/icon_notification.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 401 B |
|
After Width: | Height: | Size: 364 B |
BIN
src/main/resources/static/js/mngr/images/icon_pencil.png
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
src/main/resources/static/js/mngr/images/icon_print.png
Normal file
|
After Width: | Height: | Size: 579 B |
BIN
src/main/resources/static/js/mngr/images/icon_question.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/main/resources/static/js/mngr/images/icon_rating-star.png
Normal file
|
After Width: | Height: | Size: 614 B |
BIN
src/main/resources/static/js/mngr/images/icon_reset.png
Normal file
|
After Width: | Height: | Size: 846 B |
BIN
src/main/resources/static/js/mngr/images/icon_search-blue.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/main/resources/static/js/mngr/images/icon_search.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/main/resources/static/js/mngr/images/icon_setting.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/main/resources/static/js/mngr/images/icon_stats.png
Normal file
|
After Width: | Height: | Size: 234 B |
BIN
src/main/resources/static/js/mngr/images/icon_unfold.png
Normal file
|
After Width: | Height: | Size: 827 B |
BIN
src/main/resources/static/js/mngr/images/icon_user-info-big.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/main/resources/static/js/mngr/images/icon_user-info.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src/main/resources/static/js/mngr/images/icon_window.png
Normal file
|
After Width: | Height: | Size: 214 B |
|
After Width: | Height: | Size: 648 B |
|
After Width: | Height: | Size: 518 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge01.png
Normal file
|
After Width: | Height: | Size: 672 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge02.png
Normal file
|
After Width: | Height: | Size: 642 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge03.png
Normal file
|
After Width: | Height: | Size: 437 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge04.png
Normal file
|
After Width: | Height: | Size: 599 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge05.png
Normal file
|
After Width: | Height: | Size: 634 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge06.png
Normal file
|
After Width: | Height: | Size: 558 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge07.png
Normal file
|
After Width: | Height: | Size: 640 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge08.png
Normal file
|
After Width: | Height: | Size: 535 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge09.png
Normal file
|
After Width: | Height: | Size: 586 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge10.png
Normal file
|
After Width: | Height: | Size: 826 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge11.png
Normal file
|
After Width: | Height: | Size: 568 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge12.png
Normal file
|
After Width: | Height: | Size: 441 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge13.png
Normal file
|
After Width: | Height: | Size: 605 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge14.png
Normal file
|
After Width: | Height: | Size: 507 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge15.png
Normal file
|
After Width: | Height: | Size: 842 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge16.png
Normal file
|
After Width: | Height: | Size: 771 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 772 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge_kcp.png
Normal file
|
After Width: | Height: | Size: 483 B |
|
After Width: | Height: | Size: 479 B |
BIN
src/main/resources/static/js/mngr/images/icon_word-badge_pos.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 450 B |
BIN
src/main/resources/static/js/mngr/images/image_placeholder.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/main/resources/static/js/mngr/images/image_talk.jpg
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
src/main/resources/static/js/mngr/images/loding.gif
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
src/main/resources/static/js/mngr/images/logo_chamdahan.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
src/main/resources/static/js/mngr/images/logo_default.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
src/main/resources/static/js/mngr/images/logo_nutricore.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
src/main/resources/static/js/mngr/images/logo_white.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/main/resources/static/js/mngr/images/로고이미지.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
src/main/resources/static/js/mngr/images/상품이미지01.png
Normal file
|
After Width: | Height: | Size: 278 KiB |
74
src/main/resources/static/js/mngr/js/bnft/script.js
Normal file
@@ -0,0 +1,74 @@
|
||||
|
||||
//Dropzone 파일업로드 - 다중선택 /*add 2024-05*/
|
||||
if ($(".dropzone").length > 0) {
|
||||
Dropzone.autoDiscover = false;
|
||||
$(".dropzone").each(function(index) {
|
||||
var dropzoneID = "my-dropzone" + (index + 1);
|
||||
var myDropzone = new Dropzone("#" + dropzoneID, {
|
||||
url: "/file-upload",
|
||||
maxFilesize: 5,
|
||||
maxFiles: 1, // 한 번에 하나의 파일만 업로드 가능
|
||||
autoProcessQueue: false,
|
||||
addRemoveLinks: true,
|
||||
dictDefaultMessage: "클릭하거나 파일을 여기로 드래그하세요",
|
||||
dictRemoveFile: "삭제",
|
||||
dictCancelUpload: "취소",
|
||||
dictCancelUploadConfirmation: "업로드를 취소하시겠습니까?",
|
||||
dictInvalidFileType: "이 파일은 업로드할 수 없습니다.",
|
||||
dictFileTooBig: "파일이 너무 큽니다. ({{filesize}}MB). 최대 파일 크기: {{maxFilesize}}MB.",
|
||||
dictMaxFilesExceeded: "파일을 더 이상 추가할 수 없습니다.",
|
||||
dictResponseError: "서버에서 응답을 받지 못했습니다.",
|
||||
init: function() {
|
||||
this.on("maxfilesexceeded", function(file) {
|
||||
this.removeAllFiles();
|
||||
this.addFile(file);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function fn_init_dropzone(dropzoneID) {
|
||||
Dropzone.autoDiscover = false;
|
||||
var myDropzone = new Dropzone("#" + dropzoneID, {
|
||||
url: "/file-upload",
|
||||
maxFilesize: 5,
|
||||
maxFiles: 1, // 한 번에 하나의 파일만 업로드 가능
|
||||
autoProcessQueue: false,
|
||||
addRemoveLinks: true,
|
||||
dictDefaultMessage: "클릭하거나 파일을 여기로 드래그하세요",
|
||||
dictRemoveFile: "삭제",
|
||||
dictCancelUpload: "취소",
|
||||
dictCancelUploadConfirmation: "업로드를 취소하시겠습니까?",
|
||||
dictInvalidFileType: "이 파일은 업로드할 수 없습니다.",
|
||||
dictFileTooBig: "파일이 너무 큽니다. ({{filesize}}MB). 최대 파일 크기: {{maxFilesize}}MB.",
|
||||
dictMaxFilesExceeded: "파일을 더 이상 추가할 수 없습니다.",
|
||||
dictResponseError: "서버에서 응답을 받지 못했습니다.",
|
||||
init: function() {
|
||||
this.on("maxfilesexceeded", function(file) {
|
||||
this.removeAllFiles();
|
||||
this.addFile(file);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//출석체크 라디오 선택에따른 DISPLAY 변경
|
||||
$(document).ready(function() {
|
||||
// 페이지 로드 시 초기 설정
|
||||
if ($('#rb-1').is(':checked')) {
|
||||
$('.td-inner.display').hide();
|
||||
} else if ($('#rb-2').is(':checked')) {
|
||||
$('.td-inner.display').show();
|
||||
}
|
||||
|
||||
// 라디오 버튼 변경 시 이벤트 처리
|
||||
$('input[type=radio][name=r-group02]').change(function() {
|
||||
if (this.id === 'rb-1') {
|
||||
$('.td-inner.display').hide();
|
||||
} else if (this.id === 'rb-2') {
|
||||
$('.td-inner.display').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
325
src/main/resources/static/js/mngr/js/crm/dlvylc/dlvylc_2.js
Normal file
@@ -0,0 +1,325 @@
|
||||
/**********************************************
|
||||
자주쓰는 배송지 조회 페이징
|
||||
***********************************************/
|
||||
const fn_select_rpuseDlvylcList = function (pageIndex) {
|
||||
let pageUnit = $("#rpuseSelect").val();
|
||||
if (pageUnit === 'undefined') {
|
||||
pageUnit = 10;
|
||||
}
|
||||
if (pageIndex === 'undefined') {
|
||||
pageIndex = $("#rpusePageIndex").val();
|
||||
}
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/crm/dlvylc/selectRpuseDlvylcListInqire',
|
||||
data: {
|
||||
mbrInnb: $("#leftMbrInnb").val(),
|
||||
mbrDvCd: $("#leftMbrDvCd").val(),
|
||||
pageIndex: pageIndex,
|
||||
pageUnit: pageUnit
|
||||
},
|
||||
success: function (data) {
|
||||
$('#rpuseDlvylcContent').html(data);
|
||||
$('#resentDlvylcContent').empty();
|
||||
$("#rpuseDlvylcBtn").addClass("current");
|
||||
$("#rpuseDlvylcContent").addClass("current");
|
||||
$("#rpuseSelect").niceSelect()
|
||||
$(".mbtlnb").each(function () {
|
||||
let mbtlnb = $(this).text().replace(/\s+/g, '');
|
||||
mbtlnb = fn_format_mbtlnb(mbtlnb);
|
||||
$(this).text(mbtlnb);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
/**********************************************
|
||||
최근 배송지 조회 페이징
|
||||
***********************************************/
|
||||
const fn_select_recentDlvylcList = function (pageIndex, ordering) {
|
||||
if (ordering == undefined) {
|
||||
ordering = 'recentRegist';
|
||||
}
|
||||
let pageUnit = $("#recentId").val();
|
||||
if (pageUnit === 'undefined') {
|
||||
pageUnit = 10;
|
||||
}
|
||||
if (pageIndex === 'undefined') {
|
||||
pageIndex = $("#recentPageIndex").val();
|
||||
}
|
||||
const selectForm = $("#resentDlvylcForm").serialize();
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/crm/dlvylc/selectRecentDlvylcListInqire',
|
||||
data: {
|
||||
selectForm,
|
||||
pageIndex: pageIndex,
|
||||
ordering: ordering,
|
||||
pageUnit: pageUnit,
|
||||
mbrInnb: $("#leftMbrInnb").val(),
|
||||
mbrDvCd: $("#leftMbrDvCd").val()
|
||||
},
|
||||
success: function (data) {
|
||||
$('#resentDlvylcContent').html(data);
|
||||
$('#rpuseDlvylcContent').empty();
|
||||
$("#resentDlvylcBtn").addClass("current");
|
||||
$("#resentDlvylcContent").addClass("current");
|
||||
if ($(".select-box > select").length > 0) {
|
||||
$(".select-box > select").niceSelect();
|
||||
}
|
||||
$(".recentMbtlnb").each(function () {
|
||||
$(this).text(fn_format_mbtlnb($(this).text()));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
/**********************************************
|
||||
배송지 관리 팝업 (처음 호출 할 때)
|
||||
***********************************************/
|
||||
const fn_move_dlvylc_manage_pop = function (pageIndex, mbrInnb, mbrDvCd, callback, formId = '') {
|
||||
if (mbrInnb == undefined) {
|
||||
mbrInnb = $("#dlvyLcMbr").val();
|
||||
}
|
||||
if (callback == undefined) {
|
||||
callback = fn_set_dlvylc;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/crm/dlvylc/selectRpuseDlvylcListInqire',
|
||||
data: {
|
||||
isPop: 'Y',
|
||||
pageIndex: pageIndex,
|
||||
mbrInnb: mbrInnb,
|
||||
mbrDvCd: mbrDvCd,
|
||||
callbackNm: callback,
|
||||
formId: formId
|
||||
},
|
||||
success: function (data) {
|
||||
fn_close_modal('dlvylcManage');
|
||||
$('#modalDiv').html(data);
|
||||
$('#dlvylcManage').modal();
|
||||
$(".mbtlnb").each(function () {
|
||||
let mbtlnb = $(this).text().replace(/\s+/g, '');
|
||||
mbtlnb = fn_format_mbtlnb(mbtlnb);
|
||||
$(this).text(mbtlnb);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const fn_move_dlvylc_manage_pop_wrapper = function (pageIndex) {
|
||||
const form = $('#mbrDlvylcList');
|
||||
let mbrInnb = $(form).find('#dlvyLcMbr').val();
|
||||
let mbrDvCd = $(form).find('#mbrDvCd').val();
|
||||
let callback = 'fn_set_dlvylc';
|
||||
let formId = $(form).find('#formId').val();
|
||||
|
||||
fn_move_dlvylc_manage_pop(pageIndex, mbrInnb, mbrDvCd, callback, formId);
|
||||
}
|
||||
/**********************************************
|
||||
배송지 등록 팝업 호출 ok
|
||||
***********************************************/
|
||||
const fn_move_dlvylc_regpage_pop = function (isPop, mbrInnb, mbrDvCd, dftDlvylcAt) {
|
||||
if (!mbrInnb) {
|
||||
mbrInnb = $("#leftMbrInnb").val();
|
||||
}
|
||||
if (!mbrDvCd) {
|
||||
mbrDvCd = $("#leftMbrDvCd").val();
|
||||
}
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/crm/dlvylc/selectDlvylcRegistForm',
|
||||
data: {
|
||||
mbrInnb: mbrInnb,
|
||||
mbrDvCd: mbrDvCd
|
||||
},
|
||||
success: function (data) {
|
||||
$('#dlvylcUpdate').remove();
|
||||
$('#dlvylcRegist').remove();
|
||||
$('#modalDiv').html(data);
|
||||
$('#isPop').val(isPop);
|
||||
$('#dlvylcRegist').modal();
|
||||
if (dftDlvylcAt == 'Y') {
|
||||
$('#dftDlvylcAt').prop("checked", true);
|
||||
}
|
||||
fn_set_event('.telno', 'keyup', fn_fmt_telno);
|
||||
}
|
||||
});
|
||||
}
|
||||
/**********************************************
|
||||
배송지 등록 ok
|
||||
***********************************************/
|
||||
const fn_insert_dlvylc = function (mbrInnb, mbrDvCd, msg, data) {
|
||||
$("#dlvylcUpdate").remove();
|
||||
let paramData = null;
|
||||
const registForm = $("#dlvylcRegistForm").serialize();
|
||||
if (data != null) {
|
||||
paramData = data;
|
||||
} else {
|
||||
paramData = registForm;
|
||||
}
|
||||
if (confirm('자주쓰는 배송지를 등록하시겠습니까?')) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/crm/dlvylc/insertDlvylcRegist',
|
||||
data: paramData,
|
||||
success: function () {
|
||||
alert(msg);
|
||||
fn_close_modal('dlvylcRegist');
|
||||
if ($("#isPop").val() == 'Y') {
|
||||
fn_move_dlvylc_manage_pop(1, mbrInnb, mbrDvCd, 'fn_set_dlvylc');
|
||||
} else {
|
||||
fn_select_rpuseDlvylcList(1);
|
||||
//최근 배송지 form, 버튼 활성화 삭제
|
||||
$('#resentDlvylcForm').remove();
|
||||
$("#resentDlvylcBtn").removeClass("active");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/**********************************************
|
||||
최근 배송지 자주쓰는 배송지로 등록
|
||||
***********************************************/
|
||||
const fn_move_repuseDlvylc = function (msg,target) {
|
||||
const trTarget = $(target).closest("tr");
|
||||
const data = {
|
||||
recpntNm: trTarget.find('input[name=recpntNm]').val(),
|
||||
mbrInnb: trTarget.find('input[name=recentMbrInnb]').val(),
|
||||
mbrDvCd: trTarget.find('input[name=recentMbrDvCd]').val(),
|
||||
zip: trTarget.find('input[name=dlvylcZip]').val(),
|
||||
adres: trTarget.find('input[name=adres]').val(),
|
||||
dtlAdres: trTarget.find('input[name=dlvylcAdresDtl]').val(),
|
||||
mbtlnb: trTarget.find('input[name=recpntMbtlnb]').val(),
|
||||
adresDv: trTarget.find('input[name=dlvylcAdresDvCd]').val(),
|
||||
dlvylcDcCn: trTarget.find('input[name=dlvylcDcCn]').val(),
|
||||
recentDlvylcAt: trTarget.find('input[name=recentDlvylcAt]').val()
|
||||
};
|
||||
fn_insert_dlvylc( trTarget.find('input[name=recentMbrInnb]').val(),trTarget.find('input[name=recentMbrDvCd]').val(), msg, data);
|
||||
}
|
||||
/**********************************************
|
||||
배송지 삭제 OK
|
||||
***********************************************/
|
||||
const fn_delete_dlvylc = function (msg, adbkInnb, isPop, mbrInnb, mbrDvCd) {
|
||||
if (confirm('자주쓰는 배송지를 삭제하시겠습니까?')) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/crm/dlvylc/deleteDlvylcDel',
|
||||
data: {
|
||||
adbkInnb: adbkInnb
|
||||
, mbrInnb: mbrInnb
|
||||
, mbrDvCd: mbrDvCd
|
||||
},
|
||||
success: function (data) {
|
||||
alert(msg);
|
||||
if (isPop == 'Y') {
|
||||
fn_move_dlvylc_manage_pop(1, mbrInnb, mbrDvCd, fn_set_dlvylc);
|
||||
} else {
|
||||
fn_select_rpuseDlvylcList(1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/**********************************************
|
||||
배송지 수정 팝업 이동 ok
|
||||
***********************************************/
|
||||
const fn_move_dlvylc_uptpage_pop = function (pageIndex, adbkInnb, isPop, mbrInnb, mbrDvCd) {
|
||||
$("#dlvylcRegist").remove();
|
||||
if (!mbrInnb) {
|
||||
mbrInnb = $("#leftMbrInnb").val();
|
||||
}
|
||||
if (!mbrDvCd) {
|
||||
mbrDvCd = $("#leftMbrDvCd").val();
|
||||
}
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/crm/dlvylc/selectDlvylcUpdtPopupForm',
|
||||
data: {
|
||||
adbkInnb: adbkInnb,
|
||||
pageIndex: pageIndex,
|
||||
mbrInnb: mbrInnb,
|
||||
mbrDvCd: mbrDvCd
|
||||
},
|
||||
success: function (data) {
|
||||
$('#dlvylcRegist').remove();
|
||||
$('#dlvylcUpdate').remove();
|
||||
$('#modalDiv').html(data);
|
||||
$('#isPop').val(isPop);
|
||||
$('#dlvylcUpdate').modal();
|
||||
fn_set_event('.telno', 'keyup', fn_fmt_telno);
|
||||
$(".telno").val(fn_format_mbtlnb($(".telno").val()))
|
||||
}
|
||||
});
|
||||
}
|
||||
/**********************************************
|
||||
배송지 수정 ok
|
||||
***********************************************/
|
||||
const fn_update_dlvylc = function (pageIndex, msg, mbrInnb, mbrDvCd) {
|
||||
const updateForm = $("#dlvylcUpdtForm").serialize();
|
||||
if (confirm('자주쓰는 배송지를 수정하시겠습니까?')) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/crm/dlvylc/updateDlvylcUpdt',
|
||||
data: updateForm,
|
||||
success: function (data) {
|
||||
alert(msg);
|
||||
fn_close_modal('dlvylcUpdate');
|
||||
if ($("#isPop").val() == 'Y') {
|
||||
fn_move_dlvylc_manage_pop(1, mbrInnb, mbrDvCd, 'fn_set_dlvylc');
|
||||
} else {
|
||||
fn_select_rpuseDlvylcList(1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
팝업 배송지 등록 시 도로명, 지번 주소 구분 value값 넣기 ok
|
||||
***********************************************/
|
||||
const fn_select_dlvylc_postcode = function (data) {
|
||||
$('#zip').val(data.postcode);
|
||||
$('#adresDv').val(data.addressType);
|
||||
if (data.addressType == '01') {
|
||||
$('#adres').val(data.roadAddress + data.extraAddress);
|
||||
} else {
|
||||
$('#adres').val(data.jibunAddress + data.extraAddress);
|
||||
}
|
||||
}
|
||||
/**********************************************
|
||||
배송지 등록 시 도로명, 지번 주소 구분 value값 넣기 ok
|
||||
***********************************************/
|
||||
const fn_set_mngrOrdrDlvylc_postcode = function (data) {
|
||||
$("#ordrRecpntNm").val(data.recpntNm);
|
||||
$("#ordrDtlAdres").val(data.dtlAdres);
|
||||
$("#ordrRecpntMbtlnb").val(data.mbtlnb);
|
||||
$('#ordrDlvylcZip').val(data.postcode);
|
||||
$('#ordrAdresDvCd').val(data.addressType);
|
||||
if (data.addressType == '01') {
|
||||
$('#ordrAdres').val(data.roadAddress + data.extraAddress);
|
||||
} else {
|
||||
$('#ordrAdres').val(data.jibunAddress + data.extraAddress);
|
||||
}
|
||||
if (data.recpntNm == null) {
|
||||
$("#newDlvyLc").prop("checked", true);
|
||||
} else {
|
||||
$("#defaultDlvyLc").prop("checked", true);
|
||||
}
|
||||
}
|
||||
/**********************************************
|
||||
배송지 관리 팝업에서 배송 정보 가져오기
|
||||
***********************************************/
|
||||
const fn_select_mngrOrdr_postcode = function (callback, index, formId = '') {
|
||||
let extraAddress = "";
|
||||
callback({
|
||||
postcode: $(".zip").eq(index).val(),
|
||||
addressType: $(".adresDv").eq(index).val(),
|
||||
roadAddress: $(".rnmAdres").eq(index).val(),
|
||||
jibunAddress: $(".lnbAdres").eq(index).val(),
|
||||
recpntNm: $(".recpntNmR").eq(index).val(),
|
||||
dtlAdres: $(".dtlAdres").eq(index).val(),
|
||||
mbtlnb: $(".dlvylcMbtlnb").eq(index).val(),
|
||||
extraAddress: extraAddress
|
||||
}, formId);
|
||||
fn_close_modal("dlvylcManage");
|
||||
}
|
||||
6
src/main/resources/static/js/mngr/js/jquery-ui.min.js
vendored
Normal file
925
src/main/resources/static/js/mngr/js/script.js
Normal file
@@ -0,0 +1,925 @@
|
||||
// 좌측 사이드 메뉴 접기/펴기
|
||||
//
|
||||
var sideBtn = $(".side-nav__fold");
|
||||
var header = $(".header");
|
||||
var content = $(".content");
|
||||
var sideNav = $(".side-nav");
|
||||
var pageTitle = $(".page-title");
|
||||
sideBtn.click(function () {
|
||||
$(this).toggleClass("closed");
|
||||
header.toggleClass("closed");
|
||||
content.toggleClass("closed");
|
||||
sideNav.toggleClass("closed");
|
||||
pageTitle.toggleClass("closed");
|
||||
});
|
||||
|
||||
var media = window.matchMedia("(max-width: 1450px)");
|
||||
|
||||
function handleTabletChange(e) {
|
||||
if (e.matches) {
|
||||
$(".side-nav__fold").addClass("closed");
|
||||
$(".header").addClass("closed");
|
||||
$(".content").addClass("closed");
|
||||
$(".side-nav").addClass("closed");
|
||||
} else {
|
||||
$(".side-nav__fold").removeClass("closed");
|
||||
$(".header").removeClass("closed");
|
||||
$(".content").removeClass("closed");
|
||||
$(".side-nav").removeClass("closed");
|
||||
}
|
||||
}
|
||||
|
||||
media.addEventListener("change", handleTabletChange);
|
||||
handleTabletChange(media);
|
||||
|
||||
// 좌측 사이드메뉴 내부 메뉴 접기/펴기
|
||||
//
|
||||
var depth2Btn = $(".depth2 > .has-sub");
|
||||
var depth3 = $(".depth3");
|
||||
|
||||
depth2Btn.each(function () {
|
||||
$(this).find(".depth3").hide();
|
||||
if ($(this).hasClass("opened")) {
|
||||
$(this).find(".depth3").show();
|
||||
}
|
||||
});
|
||||
|
||||
depth2Btn.click(function () {
|
||||
// find depth2Btn but not this
|
||||
var otherBtn = depth2Btn.not(this);
|
||||
otherBtn.removeClass("opened");
|
||||
otherBtn.find(".depth3").slideUp(300);
|
||||
$(this).toggleClass("opened");
|
||||
$(this).find(".depth3").slideToggle(300);
|
||||
});
|
||||
|
||||
// 커스텀 셀렉트박스
|
||||
//
|
||||
if ($(".select-box > select").length > 0) {
|
||||
$(".select-box > select").niceSelect();
|
||||
}
|
||||
|
||||
// 데이트 피커
|
||||
//
|
||||
$(".datepicker").each(function () {
|
||||
$(this).datepicker({
|
||||
dateFormat: "yy-mm-dd",
|
||||
prevText: "이전 달",
|
||||
nextText: "다음 달",
|
||||
changeMonth: "true",
|
||||
changeYear: "true",
|
||||
dayNames: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"],
|
||||
dayNamesMin: ["일", "월", "화", "수", "목", "금", "토"],
|
||||
monthNames: [
|
||||
"1월",
|
||||
"2월",
|
||||
"3월",
|
||||
"4월",
|
||||
"5월",
|
||||
"6월",
|
||||
"7월",
|
||||
"8월",
|
||||
"9월",
|
||||
"10월",
|
||||
"11월",
|
||||
"12월",
|
||||
],
|
||||
monthNamesShort: [
|
||||
"1월",
|
||||
"2월",
|
||||
"3월",
|
||||
"4월",
|
||||
"5월",
|
||||
"6월",
|
||||
"7월",
|
||||
"8월",
|
||||
"9월",
|
||||
"10월",
|
||||
"11월",
|
||||
"12월",
|
||||
],
|
||||
showMonthAfterYear: true,
|
||||
yearSuffix: "년",
|
||||
firstDay: 0/*,
|
||||
maxDate: 0, // 오늘로부터 1년 전까지의 날짜까지 선택 가능
|
||||
beforeShowDay: function (date) {
|
||||
// 오늘로부터 1년 전까지의 날짜를 비활성화
|
||||
let currentDate = new Date();
|
||||
currentDate.setDate(currentDate.getDate() - 366);
|
||||
return [date.getTime() > currentDate.getTime() - 1, ""];
|
||||
},*/
|
||||
});
|
||||
});
|
||||
|
||||
// 기간 선택 탭버튼
|
||||
// 240123 Enter키 입력 시, 버그 수정
|
||||
//
|
||||
var dateRangeBtn = $(".dateRange-btn");
|
||||
dateRangeBtn.click(function (e) {
|
||||
if (e.detail === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
var otherBtn = $(this).siblings();
|
||||
otherBtn.removeClass("selected");
|
||||
$(this).addClass("selected");
|
||||
});
|
||||
|
||||
// 숫자 텍스트 인풋 클릭 시 기본값 0 없어짐
|
||||
//
|
||||
var numberInput = $(".input-text.number");
|
||||
numberInput.click(function () {
|
||||
if ($(this).val() == 0) {
|
||||
$(this).val("");
|
||||
}
|
||||
});
|
||||
|
||||
numberInput.blur(function () {
|
||||
if ($(this).val() == "") {
|
||||
$(this).val(0);
|
||||
}
|
||||
});
|
||||
|
||||
// "상세검색" 버튼 클릭 시 "search-hide" 보이기/숨기기
|
||||
//
|
||||
var searchHide = $(".search-hide");
|
||||
var searchBtn = $(".btn.search-detail");
|
||||
|
||||
searchBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
if (searchHide.css("display") == "none") {
|
||||
searchHide.css("display", "");
|
||||
} else {
|
||||
searchHide.css("display", "none");
|
||||
}
|
||||
searchBtn.toggleClass("opened");
|
||||
});
|
||||
|
||||
// "search-hide" 가 숨겨지있지 않을때 "상세검색" 버튼에 "opened" 클래스 추가
|
||||
//
|
||||
if (!searchHide.eq(0).attr("style")) {
|
||||
searchBtn.addClass("opened");
|
||||
}
|
||||
|
||||
// 스크롤 시 헤더, 사이드메뉴 고정
|
||||
// 231204 탭메뉴 고정 추가
|
||||
|
||||
var headerHeight = 110;
|
||||
var headerGap = headerHeight - 18;
|
||||
|
||||
$(window).scroll(function () {
|
||||
var scrollTop = $(window).scrollTop();
|
||||
var firstElement = $(".page-title").next();
|
||||
if (firstElement.hasClass("content-tab__fixed")) {
|
||||
firstElement = firstElement.next();
|
||||
headerGap = headerHeight;
|
||||
}
|
||||
if (scrollTop > headerHeight) {
|
||||
firstElement.css("margin-top", headerGap + "px");
|
||||
$(".page-title").addClass("fixed");
|
||||
$(".side-nav").addClass("fixed");
|
||||
$(".content-tab__fixed").addClass("fixed");
|
||||
} else {
|
||||
firstElement.css("margin-top", "");
|
||||
$(".page-title").removeClass("fixed");
|
||||
$(".side-nav").removeClass("fixed");
|
||||
$(".content-tab__fixed").removeClass("fixed");
|
||||
}
|
||||
});
|
||||
|
||||
// 체크시 테이블 행 배경색 변경
|
||||
//
|
||||
var trColorCheck = $(".tr-color-check > input");
|
||||
trColorCheck.click(function () {
|
||||
var tr = $(this).closest("tr");
|
||||
if ($(this).prop("checked")) {
|
||||
tr.addClass("checked");
|
||||
} else {
|
||||
tr.removeClass("checked");
|
||||
}
|
||||
});
|
||||
|
||||
// 쿠폰 할인금액/할인율 선택
|
||||
//
|
||||
var couponDiscountSelect = $(".coupon-discount-select");
|
||||
var couponDiscountWon = $(".coupon-discount-won");
|
||||
var couponDiscountPercent = $(".coupon-discount-percent");
|
||||
|
||||
$(document).ready(function () {
|
||||
couponDiscountSelectChange();
|
||||
});
|
||||
|
||||
couponDiscountSelect.change(function () {
|
||||
couponDiscountSelectChange();
|
||||
});
|
||||
|
||||
function couponDiscountSelectChange() {
|
||||
if (couponDiscountSelect.val() == "won") {
|
||||
couponDiscountWon.show();
|
||||
couponDiscountPercent.hide();
|
||||
} else {
|
||||
couponDiscountWon.hide();
|
||||
couponDiscountPercent.show();
|
||||
}
|
||||
}
|
||||
|
||||
// 탭 버튼
|
||||
//
|
||||
var contentTabBtn = $(".content-tab__btn");
|
||||
var contentTabContent = $(".content-tab__content");
|
||||
|
||||
contentTabBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
var index = $(this).index();
|
||||
contentTabBtn.removeClass("active");
|
||||
contentTabContent.removeClass("active");
|
||||
$(this).addClass("active");
|
||||
contentTabContent.eq(index).addClass("active");
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
// $(".content-tab__btn").eq(0).trigger("click");
|
||||
});
|
||||
|
||||
// 툴팁(호버시 툴팁 노출)
|
||||
var tooltipElem;
|
||||
document.onmouseover = function (event) {
|
||||
var evt = event || window.event;
|
||||
var target = evt.target || evt.srcElement;
|
||||
|
||||
var tooltipHtml = target.getAttribute("data-tooltip");
|
||||
if (!tooltipHtml) return;
|
||||
|
||||
tooltipElem = document.createElement("div");
|
||||
tooltipElem.className = "tooltip";
|
||||
tooltipElem.innerHTML = tooltipHtml;
|
||||
document.body.appendChild(tooltipElem);
|
||||
|
||||
var coords = target.getBoundingClientRect();
|
||||
|
||||
var left = coords.left + (target.offsetWidth - tooltipElem.offsetWidth) / 2;
|
||||
if (left <= 14) left = 14;
|
||||
|
||||
var top = coords.top - tooltipElem.offsetHeight - 5;
|
||||
if (top < 0) {
|
||||
top = coords.top + target.offsetHeight + 5;
|
||||
}
|
||||
|
||||
tooltipElem.style.left = left + "px";
|
||||
tooltipElem.style.top = top + "px";
|
||||
};
|
||||
|
||||
document.onmouseout = function (event) {
|
||||
if (tooltipElem) {
|
||||
tooltipElem.parentNode.removeChild(tooltipElem);
|
||||
tooltipElem = null;
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
var sumAreaContent = $(".sum-area__content");
|
||||
var sumAreaBtn = $(".sum-area__title > button");
|
||||
|
||||
sumAreaBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).closest(".sum-area__item").find(sumAreaContent).toggleClass("opened");
|
||||
$(this).toggleClass("opened");
|
||||
});
|
||||
|
||||
// 위로가기 버튼
|
||||
var scrollToTop = $(".scroll-to-top");
|
||||
|
||||
var handleScroll = function () {
|
||||
var scrollTop = $(window).scrollTop();
|
||||
if (scrollTop > 100) {
|
||||
scrollToTop.addClass("show");
|
||||
} else {
|
||||
scrollToTop.removeClass("show");
|
||||
}
|
||||
};
|
||||
|
||||
var debounce = function (func, delay) {
|
||||
var timer;
|
||||
return function () {
|
||||
var context = this,
|
||||
args = arguments;
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function () {
|
||||
func.apply(context, args);
|
||||
}, delay);
|
||||
};
|
||||
};
|
||||
|
||||
$(window).scroll(debounce(handleScroll, 50));
|
||||
|
||||
scrollToTop.click(function () {
|
||||
$("html, body").animate({ scrollTop: 0 }, 400);
|
||||
});
|
||||
|
||||
// 컨텐츠 접기/펴기
|
||||
//
|
||||
var foldBtn = $(".content-fold__btn");
|
||||
var contentFold = $(".content-section.content-fold");
|
||||
|
||||
foldBtn.click(function (e) {
|
||||
var innerContent = $(this).closest(contentFold).find(".content-fold__content");
|
||||
e.preventDefault();
|
||||
if (innerContent.css("display") == "none") {
|
||||
innerContent.show();
|
||||
} else {
|
||||
innerContent.hide();
|
||||
}
|
||||
$(this).toggleClass("opened");
|
||||
});
|
||||
|
||||
// 스크롤 탭 버튼(상품 등록 페이지)
|
||||
//
|
||||
var contentTabScrollBtn = $(".content-tab__scroll-btn");
|
||||
var contentTabScrollContent = $(".content-scroll-detect");
|
||||
|
||||
$(document).ready(function () {
|
||||
contentTabScrollBtn.eq(0).addClass("active");
|
||||
});
|
||||
|
||||
contentTabScrollBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
var index = $(this).index();
|
||||
contentTabScrollBtn.removeClass("active");
|
||||
$(this).addClass("active");
|
||||
$("html, body").animate(
|
||||
{
|
||||
scrollTop: contentTabScrollContent.eq(index).offset().top - 128,
|
||||
},
|
||||
0
|
||||
);
|
||||
});
|
||||
|
||||
function handleTabScroll() {
|
||||
var scrollTop = $(window).scrollTop();
|
||||
contentTabScrollContent.each(function () {
|
||||
var index = contentTabScrollContent.index(this);
|
||||
if (scrollTop >= $(this).offset().top - 260) {
|
||||
contentTabScrollBtn.removeClass("active");
|
||||
contentTabScrollBtn.eq(index).addClass("active");
|
||||
}
|
||||
if (scrollTop < 100) {
|
||||
contentTabScrollBtn.removeClass("active");
|
||||
contentTabScrollBtn.eq(0).addClass("active");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(window).scroll(debounce(handleTabScroll, 20));
|
||||
|
||||
// 타임 피커
|
||||
//
|
||||
if ($(".bs-timepicker").length > 0) {
|
||||
$(".bs-timepicker").timepicker();
|
||||
}
|
||||
|
||||
// 셀렉트 선택 시 링크 이동
|
||||
//
|
||||
$(".select-link").on("change", function () {
|
||||
var url = $(this).val();
|
||||
if (url) {
|
||||
window.open(url, "_blank");
|
||||
$(".nice-select li").removeClass("selected");
|
||||
$(".nice-select .current").text("주요 게시판");
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//인풋 텍스트 글자수 제한
|
||||
//
|
||||
var wordLimitInput = $(".word-limit-input > input");
|
||||
var wordLimitNumbers = $(".word-limit-input__data");
|
||||
var wordLimitMax = $(".word-limit-input__data .max-words");
|
||||
var wordLimitCurrent = $(".word-limit-input__data .current-words");
|
||||
|
||||
wordLimitMax.each(function () {
|
||||
$(this).text($(this).closest(".word-limit-input").find("input").attr("maxlength"));
|
||||
});
|
||||
wordLimitCurrent.each(function () {
|
||||
$(this).text($(this).closest(".word-limit-input").find("input").val().length);
|
||||
});
|
||||
|
||||
wordLimitInput.keyup(function () {
|
||||
var current = $(this).val().length;
|
||||
$(this).closest(".word-limit-input").find(wordLimitCurrent).text(current);
|
||||
});
|
||||
|
||||
// 테이블 열 순서 바꾸기
|
||||
//
|
||||
$(document).ready(function () {
|
||||
if ($(".table.draggable").length > 0) {
|
||||
$(".table.draggable").tableDnD({
|
||||
onDragClass: "dragging",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 인풋 텍스트 숫자만 입력, 3자리마다 콤마
|
||||
//
|
||||
$(".input-text.number").on("input", function () {
|
||||
var input = $(this).val();
|
||||
$(this).val(input.replace(/[^0-9]/g, "").replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));
|
||||
});
|
||||
|
||||
// 미니 인포 버튼
|
||||
var miniInfoBtn = $(".mini-info-btn");
|
||||
var miniInfoContent = $(".mini-info-content");
|
||||
var miniInfoCloseBtn = $(".mini-info-content__close");
|
||||
|
||||
miniInfoContent.hide();
|
||||
|
||||
miniInfoBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// data-info 속성값 가져오기
|
||||
var info = $(this).attr("data-info");
|
||||
|
||||
// id가 info인 요소에 miniInfoBtn의 위치를 기준으로 miniInfoContent를 노출
|
||||
$("#" + info).css({
|
||||
top: $(this).offset().top,
|
||||
left: $(this).offset().left,
|
||||
});
|
||||
|
||||
if ($(this).offset().left > 1000) {
|
||||
$("#" + info).css({
|
||||
left: $(this).offset().left - $("#" + info).width() - 10,
|
||||
});
|
||||
}
|
||||
$("#" + info).show();
|
||||
});
|
||||
|
||||
miniInfoCloseBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).closest(".mini-info-content").hide();
|
||||
});
|
||||
|
||||
// 상품 검색 - 상품선택
|
||||
// var leftProductLists = $(".product-search-box > .table-wrapper.left tbody tr");
|
||||
// leftProductLists.click(function () {
|
||||
// leftProductLists.removeClass("checked");
|
||||
// $(this).addClass("checked");
|
||||
// });
|
||||
|
||||
// 체크박스 전체 선택
|
||||
//
|
||||
function checkAllCheckBoxes(checkAll, checkbox) {
|
||||
if (checkAll.prop("checked")) {
|
||||
checkbox.prop("checked", true);
|
||||
checkIfColorCheck(checkbox);
|
||||
} else {
|
||||
checkbox.prop("checked", false);
|
||||
checkIfColorCheck(checkbox);
|
||||
}
|
||||
}
|
||||
|
||||
function checkIfColorCheck(checkbox) {
|
||||
checkbox.each(function () {
|
||||
if (!$(this).closest(".b-checkbox").hasClass("tr-color-check")) return;
|
||||
|
||||
if ($(this).prop("checked")) {
|
||||
$(this).closest("tr").addClass("checked");
|
||||
} else {
|
||||
$(this).closest("tr").removeClass("checked");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 테이블 체크박스 전체 선택
|
||||
var tableCheckAll = $(".table .check-all > input[type=checkbox]");
|
||||
tableCheckAll.click(function () {
|
||||
var colIndex = $(this).closest("th").index();
|
||||
var checkbox = $(this)
|
||||
.closest(".table")
|
||||
.find("tbody tr td:nth-child(" + (colIndex + 1) + ") input[type=checkbox]");
|
||||
checkAllCheckBoxes($(this), checkbox);
|
||||
});
|
||||
|
||||
// multi-select 체크박스 전체 선택
|
||||
var multiCheckAll = $(".multi-select .check-all > input[type=checkbox]");
|
||||
multiCheckAll.click(function () {
|
||||
var checkbox = $(this).closest(".multi-select").find("input[type=checkbox]");
|
||||
checkAllCheckBoxes($(this), checkbox);
|
||||
});
|
||||
|
||||
// 같은 컨테이너 안의 체크박스 전체 선택
|
||||
var containerCheckAll = $(".b-checkbox-container .check-all > input[type=checkbox]");
|
||||
containerCheckAll.click(function () {
|
||||
var checkbox = $(this).closest(".b-checkbox-container").find("input[type=checkbox]");
|
||||
checkAllCheckBoxes($(this), checkbox);
|
||||
});
|
||||
|
||||
// Dropzone 파일업로드
|
||||
if ($("#my-dropzone").length > 0) {
|
||||
Dropzone.autoDiscover = false;
|
||||
var myDropzone = new Dropzone("#my-dropzone", {
|
||||
url: "/file-upload",
|
||||
maxFilesize: 20,
|
||||
autoProcessQueue: false,
|
||||
addRemoveLinks: true,
|
||||
dictDefaultMessage: "클릭하거나 파일을 여기로 드래그하세요",
|
||||
dictRemoveFile: "삭제",
|
||||
dictCancelUpload: "취소",
|
||||
dictCancelUploadConfirmation: "업로드를 취소하시겠습니까?",
|
||||
dictInvalidFileType: "이 파일은 업로드할 수 없습니다.",
|
||||
dictFileTooBig: "파일이 너무 큽니다. ({{filesize}}MB). 최대 파일 크기: {{maxFilesize}}MB.",
|
||||
dictMaxFilesExceeded: "파일을 더 이상 추가할 수 없습니다.",
|
||||
dictResponseError: "서버에서 응답을 받지 못했습니다.",
|
||||
});
|
||||
}
|
||||
|
||||
//주요 게시판 보기 설정
|
||||
//
|
||||
|
||||
// 전체게시판 <-> 노출게시판 이동
|
||||
var boardLeftSelect = $(".board-setting__left .board-setting__select");
|
||||
var boardRightSelect = $(".board-setting__right .board-setting__select");
|
||||
var boardToRightBtn = $(".board-setting__move-btn.right");
|
||||
var boardToLeftBtn = $(".board-setting__move-btn.left");
|
||||
|
||||
boardToRightBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
moveSelectedOptions(boardLeftSelect, boardRightSelect);
|
||||
});
|
||||
|
||||
boardToLeftBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
moveSelectedOptions(boardRightSelect, boardLeftSelect);
|
||||
});
|
||||
|
||||
function moveSelectedOptions(from, to) {
|
||||
from.find("option:selected").each(function () {
|
||||
to.append($(this));
|
||||
});
|
||||
}
|
||||
|
||||
// 노출게시판 순서 변경
|
||||
var boardUpBtn = $(".board-setting__controls .btn.up");
|
||||
var boardDownBtn = $(".board-setting__controls .btn.down");
|
||||
var boardTopBtn = $(".board-setting__controls .btn.top");
|
||||
var boardBottomBtn = $(".board-setting__controls .btn.bottom");
|
||||
|
||||
boardUpBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
var selectElement = $(this)
|
||||
.closest(".board-setting__controls")
|
||||
.siblings(".board-setting__select");
|
||||
|
||||
if (selectElement.find("option:selected").index() == 0) return;
|
||||
|
||||
selectElement.find("option:selected").each(function () {
|
||||
var current = $(this);
|
||||
current.insertBefore(current.prev());
|
||||
});
|
||||
});
|
||||
|
||||
boardDownBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
var selectElement = $(this)
|
||||
.closest(".board-setting__controls")
|
||||
.siblings(".board-setting__select");
|
||||
|
||||
var selectedOptions = selectElement.find("option:selected");
|
||||
|
||||
$([...selectedOptions].reverse()).each(function () {
|
||||
var currentOption = $(this);
|
||||
var nextOption = currentOption.next("option:not(:selected)");
|
||||
|
||||
if (nextOption.length) {
|
||||
nextOption.after(currentOption);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
boardTopBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
var selectElement = $(this)
|
||||
.closest(".board-setting__controls")
|
||||
.siblings(".board-setting__select");
|
||||
|
||||
if (selectElement.find("option:selected").index() == 0) return;
|
||||
|
||||
var selectedOptions = [];
|
||||
selectElement.find("option:selected").each(function () {
|
||||
selectedOptions.push($(this));
|
||||
});
|
||||
|
||||
selectedOptions.reverse().forEach(function (option) {
|
||||
option.insertBefore(option.siblings().first());
|
||||
});
|
||||
});
|
||||
|
||||
boardBottomBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
var selectElement = $(this)
|
||||
.closest(".board-setting__controls")
|
||||
.siblings(".board-setting__select");
|
||||
|
||||
if (selectElement.find("option:selected").index() == selectElement.find("option").length - 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
selectElement.find("option:selected").each(function () {
|
||||
var current = $(this);
|
||||
current.insertAfter(current.siblings().last());
|
||||
});
|
||||
});
|
||||
|
||||
//테이블 행 삭제
|
||||
//
|
||||
var table = $(".table");
|
||||
var tableDeleteBtn = $("tbody tr .circle-btn.delete");
|
||||
|
||||
table.on("click", ".circle-btn.delete", function (e) {
|
||||
e.preventDefault();
|
||||
var tbody = $(this).closest("tbody");
|
||||
var tr = $(this).closest("tr");
|
||||
var th = $(this).closest("th");
|
||||
var allHidden = true;
|
||||
tr.siblings().each(function () {
|
||||
if ($(this).css("display") !== "none") {
|
||||
allHidden = false;
|
||||
}
|
||||
});
|
||||
if (th.attr("rowspan") > 1) {
|
||||
tr.next().remove();
|
||||
th.attr("rowspan", th.attr("rowspan") - 1);
|
||||
}
|
||||
tr.remove();
|
||||
if (tbody.children().length == 0 || allHidden) {
|
||||
tbody.append(
|
||||
"<tr class='row-no-data'><td colspan='100' class='text-center'>데이터가 없습니다.</td></tr>"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// 인풋 텍스트 숫자만 입력, 3자리마다 콤마
|
||||
//
|
||||
$(".input-text.time-number").on("input", function () {
|
||||
var input = $(this).val();
|
||||
$(this).val(input.replace(/[^0-9]/g, ""));
|
||||
});
|
||||
|
||||
// 체크박스 선택 시, 테이블 행 숨기기/보이기
|
||||
//
|
||||
var checkHide = $(".check-hide");
|
||||
checkHide.hide();
|
||||
|
||||
var checkHideTrigger = $(".check-hide-trigger > input[type=checkbox]");
|
||||
checkHideTrigger.click(function () {
|
||||
if ($(this).prop("checked")) {
|
||||
var checkHideId = $(this).attr("data-checkhide");
|
||||
addRowspan($(this), parseInt($(this).attr("data-rowspan")));
|
||||
$("#" + checkHideId).show();
|
||||
} else {
|
||||
var checkHideId = $(this).attr("data-checkhide");
|
||||
addRowspan($(this), parseInt($(this).attr("data-rowspan") - 1));
|
||||
$("#" + checkHideId).hide();
|
||||
}
|
||||
});
|
||||
|
||||
function addRowspan(check, number) {
|
||||
var rowspan = 1;
|
||||
if (number > 1) {
|
||||
rowspan = number;
|
||||
}
|
||||
check.closest("tr").find("th.add-rowspan").attr("rowspan", rowspan);
|
||||
}
|
||||
|
||||
// 라디오 버튼 선택 시, 테이블 숨기기/보이기
|
||||
//
|
||||
var radioTab = $(".radio-tab-content");
|
||||
var radioTabTrigger = $(".radio-tab-trigger > .custom-radio > input[type=radio]");
|
||||
radioTab.children().hide();
|
||||
radioTab.each(function () {
|
||||
$(this).children().eq(0).show();
|
||||
});
|
||||
|
||||
radioTabTrigger.click(function () {
|
||||
if (!$(this).prop("checked")) {
|
||||
return;
|
||||
}
|
||||
// data-radiotab 값과 id같아야함
|
||||
var radioTabId = $(this).closest(".radio-tab-trigger").attr("data-radiotab");
|
||||
var radioTab = $("#" + radioTabId);
|
||||
radioTab.children().hide();
|
||||
// var index = $(this).closest(".custom-radio").index();
|
||||
var index = $(this)
|
||||
.closest(".radio-tab-trigger")
|
||||
.find(".custom-radio")
|
||||
.index($(this).closest(".custom-radio"));
|
||||
radioTab.children().eq(index).show();
|
||||
});
|
||||
|
||||
// 주문조회 상품 상세 접기/펴기
|
||||
//
|
||||
|
||||
var orderSectionDetail = $(".order-section__detail");
|
||||
var orderSectionDetailTrigger = $(".order-section__detail-trigger");
|
||||
|
||||
orderSectionDetail.hide();
|
||||
|
||||
orderSectionDetailTrigger.click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).closest("tr").next(".order-section__detail").toggle();
|
||||
if ($(this).hasClass("opened")) {
|
||||
$(this).removeClass("opened");
|
||||
} else {
|
||||
$(this).addClass("opened");
|
||||
}
|
||||
});
|
||||
|
||||
// 호버시 박스 띄우기
|
||||
//
|
||||
|
||||
var hoverBoxTrigger = $(".hover-box-trigger");
|
||||
var hoverBoxContent = $(".hover-box-content");
|
||||
|
||||
hoverBoxContent.hide();
|
||||
|
||||
hoverBoxTrigger.hover(function () {
|
||||
var index = $(this).attr("data-hoverbox");
|
||||
var selectedHoverContent = $("#" + index);
|
||||
if ($(this).closest(".modal").length > 0) {
|
||||
selectedHoverContent.css({
|
||||
zIndex: 200,
|
||||
});
|
||||
}
|
||||
selectedHoverContent.show();
|
||||
|
||||
var left = $(this).offset().left;
|
||||
var top = $(this).offset().top;
|
||||
var width = $(this).width();
|
||||
var height = $(this).height();
|
||||
|
||||
selectedHoverContent.css({
|
||||
left: left + width + 10,
|
||||
top: top + height / 2 - selectedHoverContent.height() / 2,
|
||||
});
|
||||
});
|
||||
|
||||
hoverBoxTrigger.mouseleave(function () {
|
||||
hoverBoxContent.hide();
|
||||
});
|
||||
|
||||
// 주문조회 상품 상세 모두 접기/펴기
|
||||
//
|
||||
var orderOpenAll = $(".order-open-all");
|
||||
|
||||
orderOpenAll.click(function (e) {
|
||||
e.preventDefault();
|
||||
if ($(this).hasClass("opened")) {
|
||||
$(this).removeClass("opened");
|
||||
$(this).closest("tr").nextUntil(".order-section__footer", ".order-section__detail").hide();
|
||||
$(this)
|
||||
.closest("tr")
|
||||
.nextUntil(".order-section__footer")
|
||||
.find(".order-section__detail-trigger")
|
||||
.removeClass("opened");
|
||||
$(this).text("모두열기");
|
||||
} else {
|
||||
$(this).addClass("opened");
|
||||
$(this).closest("tr").nextUntil(".order-section__footer", ".order-section__detail").show();
|
||||
$(this)
|
||||
.closest("tr")
|
||||
.nextUntil(".order-section__footer")
|
||||
.find(".order-section__detail-trigger")
|
||||
.addClass("opened");
|
||||
$(this).text("모두닫기");
|
||||
}
|
||||
});
|
||||
|
||||
// 셀렉트 박스 선택 시, 컨텐츠 보이기/숨기기
|
||||
// 240123 여러개인 경우도, 적용되게 수정
|
||||
|
||||
var selectShowTrigger = $(".select-show-trigger");
|
||||
var selectShowContent = $(".select-show-content");
|
||||
|
||||
selectShowContent.hide();
|
||||
selectShowTrigger.each(function () {
|
||||
$(this).siblings(".select-show-content").eq(0).show();
|
||||
});
|
||||
|
||||
selectShowTrigger.find("select").change(function () {
|
||||
var value = $(this).val();
|
||||
var currentContent = $(this).closest(".select-show-trigger").siblings(".select-show-content");
|
||||
currentContent.each(function () {
|
||||
if (value == $(this).attr("id")) {
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 참여이벤트 셀렉트 선택
|
||||
|
||||
var eventTypeSelect = $("#event-type-select");
|
||||
var eventTypeSelectContent = $(".event-type-select__content");
|
||||
|
||||
eventTypeSelectContent.hide();
|
||||
|
||||
eventTypeSelectContent.each(function () {
|
||||
if ($(this).attr("data-eventtype") == eventTypeSelect.val()) {
|
||||
$(this).show();
|
||||
}
|
||||
});
|
||||
|
||||
eventTypeSelect.change(function () {
|
||||
var value = $(this).val();
|
||||
eventTypeSelectContent.each(function () {
|
||||
if (value == $(this).attr("data-eventtype")) {
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 탭 ui
|
||||
|
||||
var tabBox = $(".tab-box");
|
||||
var tabBoxBtn = $(".tab-box__btn");
|
||||
var tabBoxContentItems = $(".tab-box__content > *");
|
||||
|
||||
tabBoxContentItems.hide();
|
||||
tabBox.each(function () {
|
||||
$(this).nextAll($(".tab-box__content")).eq(0).find(tabBoxContentItems).show();
|
||||
});
|
||||
|
||||
tabBoxBtn.click(function (e) {
|
||||
e.preventDefault();
|
||||
var index = $(this).index();
|
||||
$(this).closest(tabBox).find(tabBoxBtn).removeClass("current");
|
||||
$(this).addClass("current");
|
||||
$(this).closest(tabBox).nextAll($(".tab-box__content")).find(tabBoxContentItems).hide();
|
||||
$(this)
|
||||
.closest(tabBox)
|
||||
.nextAll($(".tab-box__content"))
|
||||
.eq(index)
|
||||
.find(tabBoxContentItems)
|
||||
.show();
|
||||
});
|
||||
|
||||
// 쿠폰 정보 모달 (모달안에 모달)
|
||||
$("#coupon-info-pop-trigger").click(function (e) {
|
||||
$("#coupon-info-pop").modal({
|
||||
closeExisting: false,
|
||||
});
|
||||
});
|
||||
|
||||
// 상품 검색
|
||||
// 왼쪽 영역 클릭 시 오른쪽으로 추가, 오른쪽 영역 더블클릭시 삭제
|
||||
var productSearchLeftTable = $(".product-search-box > .table-wrapper.left >.table");
|
||||
var productSearchRightTable = $(".product-search-box > .table-wrapper.right >.table");
|
||||
var productSearchLeftRow = $(".product-search-box > .table-wrapper.left >.table > tbody > tr");
|
||||
var productSearchRightRow = $(".product-search-box > .table-wrapper.right >.table > tbody > tr");
|
||||
|
||||
productSearchLeftRow.click(function (e) {
|
||||
var thisId = e.currentTarget.id;
|
||||
if (productSearchRightTable.find("#" + thisId).length > 0) {
|
||||
return;
|
||||
}
|
||||
$(this).removeClass("checked");
|
||||
if (productSearchRightRow.length === 0) {
|
||||
productSearchRightTable.find("tbody > tr").remove();
|
||||
}
|
||||
$(this).clone().appendTo(productSearchRightTable.find("tbody"));
|
||||
productSearchLeftRow.removeClass("checked");
|
||||
$(this).addClass("checked");
|
||||
productSearchLeftRow = $(".product-search-box > .table-wrapper.left >.table > tbody > tr");
|
||||
productSearchRightRow = $(".product-search-box > .table-wrapper.right >.table > tbody > tr");
|
||||
productSearchRightTable.tableDnDUpdate();
|
||||
});
|
||||
|
||||
productSearchRightTable.on("dblclick", "tr", function (e) {
|
||||
e.preventDefault();
|
||||
$(this).remove();
|
||||
productSearchRightRow = $(".product-search-box > .table-wrapper.right >.table > tbody > tr");
|
||||
productSearchRightTable.tableDnDUpdate();
|
||||
|
||||
if (productSearchRightRow.length === 0) {
|
||||
productSearchRightTable
|
||||
.find("tbody")
|
||||
.append(
|
||||
"<tr class='row-no-data'><td colspan='100' class='text-center'>선택된 상품이 없습니다.</td></tr>"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// 모달 안에 모달 열었을 때, 기존 모달 닫히지 않게 하기(전역 적용)
|
||||
$.modal.defaults.closeExisting = false;
|
||||
|
||||
// 모달 바깥영역 클릭 시 닫히지 않게 하기(전역 적용)
|
||||
$.modal.defaults.clickClose = false;
|
||||
|
||||
//해당 클래스를 가진 요소 3자리 마다 콤마
|
||||
$(".comma").each(function () {
|
||||
var text = $(this).text();
|
||||
$(this).text(text.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, "$1,"));
|
||||
});
|
||||
141
src/main/resources/static/js/mngr/mpage/mngr.js
Normal file
@@ -0,0 +1,141 @@
|
||||
/* 업무 사용자 pc,mobile js
|
||||
*
|
||||
*/
|
||||
$(document).ready(function () {
|
||||
//검색폼 데이트피커 제어
|
||||
fn_set_dateRange_function("#dateRange", "juscrbStrtDt", "juscrbEndDt", "juscrbStrtDt");
|
||||
|
||||
//번호 포매팅
|
||||
$("#mbtlnb").val(fn_format_mbtlnb($("#mbtlnb").val()));
|
||||
$("#telnb").val(fn_format_mbtlnb($("#telnb").val()));
|
||||
|
||||
//이메일 셀렉트박스 값 set
|
||||
$('[name=emailAderss]').change(function () {
|
||||
let selectedEmail = $("#emailAderss option:selected").val();
|
||||
if(selectedEmail !== '99'){
|
||||
selectedEmail = $("#emailAderss option:selected").text().trim();
|
||||
}else{//직접입력
|
||||
selectedEmail = '';
|
||||
}
|
||||
$('#email2').val(selectedEmail);
|
||||
});
|
||||
|
||||
$('input').keydown(function (event) {
|
||||
if (event.keyCode === 13) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$('#pwChngAt').on("click",function (){
|
||||
if($(this).is(":checked")){
|
||||
$("#pwDiv").show();
|
||||
fn_ctrl_disable('',["#pwDiv"]);
|
||||
}else{
|
||||
$("#pwDiv").hide();
|
||||
fn_ctrl_disable(["#pwDiv"]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* ********************************************************
|
||||
* 업무사용자 수정
|
||||
******************************************************** */
|
||||
const fn_update = function () {
|
||||
|
||||
if (!confirm('업무사용자를 수정하시겠습니까?')) return;
|
||||
|
||||
console.log('gdgdgdgdgd')
|
||||
|
||||
fn_make_eamil();
|
||||
|
||||
let data = $('#jobuserUpdateForm').serialize();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/mngr/mpage/mngr/updateMngrInfoUpdt',
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (result) {
|
||||
result = JSON.parse(result.resBody.result);
|
||||
if(result.result === 1){
|
||||
alert('정상적으로 수정되었습니다.');
|
||||
/*비밀번호 변경 시*/
|
||||
let chngePwAt = result.resultInfo.chngePwAt;
|
||||
if (chngePwAt === 'Y') {
|
||||
location.href = "/mngr/logout";
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
}else{
|
||||
alert('수정이 실패하였습니다.');
|
||||
}
|
||||
}, error: function (result) {
|
||||
|
||||
if(result.responseText){
|
||||
const errorResponse = JSON.parse(result.responseText)
|
||||
|
||||
if(errorResponse.resBody.result){
|
||||
const errorResult = JSON.parse(errorResponse.resBody.result.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\n/g, "\\n"));
|
||||
alert(errorResult.errorMsg);
|
||||
}else{
|
||||
alert('수정이 실패하였습니다.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
alert('수정이 실패하였습니다.');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
/* ********************************************************
|
||||
* 접속이력 검색
|
||||
******************************************************** */
|
||||
const fn_select_history = function (_pageIndex) {
|
||||
const dv = $("#dv").val();
|
||||
let _pageUnit = 5;
|
||||
if(dv === 'M'){
|
||||
_pageUnit = 10;
|
||||
}
|
||||
$('#title').text('접속이력 조회');
|
||||
$('#subTitle').text('접속일자');
|
||||
let mngrInnb = $('#mngrInnb').val();
|
||||
let srchStartDate = $('#juscrbStrtDt').val();
|
||||
let srchEndDate = $('#juscrbEndDt').val();
|
||||
let params = {
|
||||
'mngrInnb': mngrInnb,
|
||||
'srchStartDate': srchStartDate,
|
||||
'srchEndDate': srchEndDate,
|
||||
'pageIndex': _pageIndex,
|
||||
'pageUnit': _pageUnit
|
||||
};
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/mngr/bsn/jobuser/selectJobUserConnHistListInqirePopup',
|
||||
data: params,
|
||||
success: function (result) {
|
||||
$('#jobUserList').html('');
|
||||
$('#jobUserList').html(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
/* ********************************************************
|
||||
* email 합치기
|
||||
******************************************************** */
|
||||
const fn_make_eamil = function () {
|
||||
|
||||
let domain = $('[name=email2]').val();
|
||||
let id = $('[name=email1]').val();
|
||||
$('[name=email]').val(id + '@' + domain);
|
||||
}
|
||||
|
||||
/* ********************************************************
|
||||
* 검색조건 > 날짜 전체 클릭 시 날짜 설정 초기화
|
||||
******************************************************** */
|
||||
const fn_reset_date = function (strtDate, endDate) {
|
||||
$('#' + strtDate).datepicker().datepicker("setDate", '');
|
||||
$('#' + endDate).datepicker().datepicker("setDate", '');
|
||||
}
|
||||
163
src/main/resources/static/js/mngr/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) {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||