merge master into develop - CscListRForm.jsp FAQ 아코디언 버그 수정
This commit is contained in:
74
build/resources/main/static/mngr/js/bnft/script.js
Normal file
74
build/resources/main/static/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();
|
||||
}
|
||||
});
|
||||
});
|
||||
399
build/resources/main/static/mngr/js/crm/dlvylc/dlvylc.js
Normal file
399
build/resources/main/static/mngr/js/crm/dlvylc/dlvylc.js
Normal file
@@ -0,0 +1,399 @@
|
||||
/**********************************************
|
||||
자주쓰는 배송지 조회 페이징
|
||||
***********************************************/
|
||||
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) {
|
||||
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
|
||||
},
|
||||
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);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
/**********************************************
|
||||
배송지 등록 팝업 호출 ok
|
||||
***********************************************/
|
||||
const fn_move_dlvylc_regpage_pop = function (isPop, mbrInnb, mbrDvCd, dftDlvylcAt) {
|
||||
$("#dlvylcUpdate").remove();
|
||||
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);
|
||||
}
|
||||
console.log("data.recpntNm", data.recpntNm);
|
||||
if (data.recpntNm == null) {
|
||||
$("#newDlvyLc").prop("checked", true);
|
||||
} else {
|
||||
$("#defaultDlvyLc").prop("checked", true);
|
||||
}
|
||||
}
|
||||
/**********************************************
|
||||
배송지 관리 팝업에서 배송 정보 가져오기
|
||||
***********************************************/
|
||||
const fn_select_mngrOrdr_postcode = function (callback, index) {
|
||||
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(),
|
||||
dlvylcAreaCd: $(".dlvylcAreaCd").eq(index).val(),
|
||||
prefcd: $(".prefcd").eq(index).val(),
|
||||
cstmclerCd: $(".cstmclerCd").eq(index).val(),
|
||||
mbtlnb: $(".dlvylcMbtlnb").eq(index).val(),
|
||||
extraAddress: extraAddress
|
||||
});
|
||||
fn_close_modal("dlvylcManage");
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
배송지 관리 팝업 언어 설정
|
||||
***********************************************/
|
||||
const fn_toggle_langHeader = function () {
|
||||
var id = $('[name=dlvylcAreaCd]:checked').attr('id');
|
||||
|
||||
$('.langKr, .langJp').hide();
|
||||
$('.' + id).show();
|
||||
|
||||
if (id == 'langJp') {
|
||||
$('#zip').prop('readonly', false);
|
||||
$('#cstmclerCd').prop('disabled', true);
|
||||
$('#prefcode').prop('disabled', false);
|
||||
} else {
|
||||
$('#zip').prop('readonly', true);
|
||||
$('#cstmclerCd').prop('disabled', false);
|
||||
$('#prefcode').prop('disabled', true);
|
||||
|
||||
$('#postcodeAlert').hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
ibsnet api 호출
|
||||
***********************************************/
|
||||
const fn_select_postcodeJp = function () {
|
||||
$('#postcodeAlert').hide();
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: 'https://zipcloud.ibsnet.co.jp/api/search?zipcode=' + $('#zip').val()
|
||||
+'&callback=' + 'fn_set_postcodeJp',
|
||||
dataType: 'jsonp',
|
||||
success: function(data) {
|
||||
if(data.status == 200) {
|
||||
let result = data.results[0];
|
||||
|
||||
let adres = result.address1;
|
||||
let dtlAdres = [result.address2, result.address3].join(" ");
|
||||
let prefcode = result.prefcode;
|
||||
|
||||
$("#adres").val(adres);
|
||||
$("#dtlAdres").val(dtlAdres);
|
||||
$("#prefcode").val(prefcode);
|
||||
$("#adresDv").val("01");
|
||||
} else {
|
||||
$('#postcodeAlert').show();
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error('API 호출 실패:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
배송지 관리 팝업 언어별 form 초기화
|
||||
***********************************************/
|
||||
let dlvylcFormPreValues = {};
|
||||
const fn_clear_dlvylcForm = function () {
|
||||
const tableInputs = $("#dlvylcFormTable").find("input[name]");
|
||||
|
||||
if (Object.keys(dlvylcFormPreValues).length == 0) {
|
||||
tableInputs.each(function () {
|
||||
const input = $(this);
|
||||
const name = input.attr("name");
|
||||
dlvylcFormPreValues[name] = input.val();
|
||||
input.val("");
|
||||
});
|
||||
} else {
|
||||
tableInputs.each(function () {
|
||||
const input = $(this);
|
||||
const name = input.attr("name");
|
||||
const currentValue = input.val();
|
||||
input.val(dlvylcFormPreValues[name] ?? "");
|
||||
dlvylcFormPreValues[name] = currentValue;
|
||||
});
|
||||
}
|
||||
}
|
||||
425
build/resources/main/static/mngr/js/crm/dlvylc/dlvylc_2.js
Normal file
425
build/resources/main/static/mngr/js/crm/dlvylc/dlvylc_2.js
Normal file
@@ -0,0 +1,425 @@
|
||||
/**********************************************
|
||||
자주쓰는 배송지 조회 페이징
|
||||
***********************************************/
|
||||
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()));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
리턴 formId 세팅
|
||||
***********************************************/
|
||||
let formIdSave;
|
||||
const fn_set_formId = function (formId) {
|
||||
if (formId !== ''){
|
||||
formIdSave = formId;
|
||||
} else {
|
||||
formId = formIdSave;
|
||||
}
|
||||
|
||||
return formId;
|
||||
}
|
||||
/**********************************************
|
||||
배송지 관리 팝업 (처음 호출 할 때)
|
||||
***********************************************/
|
||||
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;
|
||||
}
|
||||
formId = fn_set_formId(formId);
|
||||
|
||||
$.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) {
|
||||
$("#dlvylcUpdate").remove();
|
||||
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(),
|
||||
dlvylcAreaCd: $(".dlvylcAreaCd").eq(index).val(),
|
||||
prefcd: $(".prefcd").eq(index).val(),
|
||||
cstmclerCd: $(".cstmclerCd").eq(index).val(),
|
||||
mbtlnb: $(".dlvylcMbtlnb").eq(index).val(),
|
||||
extraAddress: extraAddress
|
||||
}, formId);
|
||||
fn_close_modal("dlvylcManage");
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
배송지 관리 팝업 언어 설정
|
||||
***********************************************/
|
||||
const fn_toggle_langHeader = function () {
|
||||
var id = $('[name=dlvylcAreaCd]:checked').attr('id');
|
||||
|
||||
$('.langKr, .langJp').hide();
|
||||
$('.' + id).show();
|
||||
|
||||
if (id == 'langJp') {
|
||||
$('#zip').prop('readonly', false);
|
||||
$('#cstmclerCd').prop('disabled', true);
|
||||
$('#prefcode').prop('disabled', false);
|
||||
} else {
|
||||
$('#zip').prop('readonly', true);
|
||||
$('#cstmclerCd').prop('disabled', false);
|
||||
$('#prefcode').prop('disabled', true);
|
||||
|
||||
$('#postcodeAlert').hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
ibsnet api 호출
|
||||
***********************************************/
|
||||
const fn_select_postcodeJp = function () {
|
||||
$('#postcodeAlert').hide();
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: 'https://zipcloud.ibsnet.co.jp/api/search?zipcode=' + $('#zip').val()
|
||||
+'&callback=' + 'fn_set_postcodeJp',
|
||||
dataType: 'jsonp',
|
||||
success: function(data) {
|
||||
if(data.status == 200) {
|
||||
let result = data.results[0];
|
||||
|
||||
let adres = result.address1;
|
||||
let dtlAdres = [result.address2, result.address3].join(" ");
|
||||
let prefcode = result.prefcode;
|
||||
|
||||
$("#adres").val(adres);
|
||||
$("#dtlAdres").val(dtlAdres);
|
||||
$("#prefcode").val(prefcode);
|
||||
$("#adresDv").val("01");
|
||||
} else {
|
||||
$('#postcodeAlert').show();
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error('API 호출 실패:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
배송지 관리 팝업 언어별 form 초기화
|
||||
***********************************************/
|
||||
let dlvylcFormPreValues = {};
|
||||
const fn_clear_dlvylcForm = function () {
|
||||
const tableInputs = $("#dlvylcFormTable").find("input[name]");
|
||||
|
||||
if (Object.keys(dlvylcFormPreValues).length == 0) {
|
||||
tableInputs.each(function () {
|
||||
const input = $(this);
|
||||
const name = input.attr("name");
|
||||
dlvylcFormPreValues[name] = input.val();
|
||||
input.val("");
|
||||
});
|
||||
} else {
|
||||
tableInputs.each(function () {
|
||||
const input = $(this);
|
||||
const name = input.attr("name");
|
||||
const currentValue = input.val();
|
||||
input.val(dlvylcFormPreValues[name] ?? "");
|
||||
dlvylcFormPreValues[name] = currentValue;
|
||||
});
|
||||
}
|
||||
}
|
||||
6
build/resources/main/static/mngr/js/jquery-ui.min.js
vendored
Normal file
6
build/resources/main/static/mngr/js/jquery-ui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
925
build/resources/main/static/mngr/js/script.js
Normal file
925
build/resources/main/static/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,"));
|
||||
});
|
||||
Reference in New Issue
Block a user