Files
sake/src/main/webapp/WEB-INF/views/mngr/promtn/coupon/CouponChoisePopupC.jsp
2025-10-29 17:08:05 +09:00

263 lines
12 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CouponChoisePopupR.jsp
Description : 쿠폰 선택 popup jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
since : 2023.12.14 추지훈 최초 생성
--%>
<script>
$(document).ready(function() {
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
let param = '<c:out value="${ resultMap.paramVO.couponSndngTy }"/>';
fn_search_coupon_choisepage_pop(pageIndex, param);
fn_delete_couponchoise();
$('select').niceSelect();
// $('.nice-select .list').niceScroll();
// 혜택 구분 체크박스 제어
$('#bnefSearchDiv input[name="searchBnefDv"]').click(function() {
var checkBoxAll = true;
$('#bnefSearchDiv input[name="searchBnefDv"]').each(function() {
if (!$(this).prop('checked')) {
checkBoxAll = false;
}
});
$('#bnefSearchDiv .check-all input[type="checkbox"]').prop('checked', checkBoxAll);
});
// 전체 체크, 전체 해제 제어
$('.check-all input[type="checkbox"]').change(function() {
var isChecked = $(this).prop('checked');
$('input[name="searchBnefDv"]').prop('checked', isChecked);
});
if ($(".table.draggable").length > 0) {
$(".table.draggable").tableDnD({
onDragClass: "dragging",
});
}
});
<%-- const fn_reset_form2 = function(formId) {
console.log("formId : ", formId);
if ($('#' + formId)[0]) {
const radioArr = [];
$('#' + formId).eq(0).find('input,select,textarea').each(function() {
let type = this.type;
let tag = this.tagName.toLowerCase();
if (type === 'text' || tag === 'textarea') {
this.value = '';
} else if (type === 'checkbox') {
this.checked = false;
} else if (type === 'radio') {
this.checked = false;
if (!radioArr.includes($(this).prop('name'))) {
radioArr.push($(this).prop('name'));
}
} else if (tag === 'select') {
const firstOption = $(this).find('option:first');
firstOption.prop('selected', true);
$(".select-box > select").niceSelect('update');
}
});
radioArr.forEach((element) => $('input[name=' + element + ']').eq(0).prop('checked', 'checked'));
}
} --%>
</script>
<div id="couponChoisePopup" class="modal" style="max-width: 1200px;">
<div class="modal-header">
<h4>쿠폰 선택</h4>
</div>
<div class="modal-content">
<form id="popupListForm" name="popupListForm" >
<div class="table-wrapper">
<table class="table">
<caption>쿠폰팩에 들어갈 쿠폰 선택 모달</caption>
<colgroup>
<col style="width: 12%;">
<col>
<col style="width: 12%;">
<col>
</colgroup>
<tbody>
<tr>
<th>쿠폰 명</th>
<td colspan="3">
<div class="td-inner">
<input class="input-text xl" type="text" id="searchCoupNm" name="searchCoupNm" title="쿠폰명" value="<c:out value="${ resultMap.paramVO.searchCoupNm }" />">
</div>
</td>
</tr>
<tr>
<th>등록 브랜드 몰</th>
<td>
<div class="td-inner">
<div class="select-box">
<select class="md" id="sopmalCd" name="sopmalCd" title="쇼핑몰">
<c:forEach var="list" items="${ resultMap.sopmalList }" varStatus="">
<option value="${ list.sopmalCd }" ${f:setSelected(resultMap.paramVO.sopmalCd, list.sopmalCd)} >${ list.sopmalNm }</option>
</c:forEach>
</select>
</div>
</div>
</td>
<th>쿠폰 혜택</th>
<td>
<div class="td-inner">
<div class="b-checkbox-container" id="bnefSearchDiv">
<label class="b-checkbox checkbox check-all">
<input type="checkbox" value="" <c:if test="${ fn:contains(resultMap.paramVO.searchBnefDv, '01, 02, 03')}">checked="checked"</c:if>>
<span class="check"></span>
<span class="control-label">전체</span>
</label>
<c:forEach var="codeList" items="${ resultMap.benfDvCdList }" varStatus="">
<label class="b-checkbox checkbox">
<input type="checkbox" name="searchBnefDv" value="<c:out value="${ codeList.cd }"/>" <c:if test="${ fn:contains(resultMap.paramVO.searchBnefDv, codeList.cd) }">checked="checked"</c:if>>
<span class="check"></span>
<span class="control-label"><c:out value="${ codeList.cdNm}" /></span>
</label>
</c:forEach>
</div>
</div>
</td>
</tr>
<tr>
<th>쿠폰 사용제한</th>
<td>
<div class="td-inner">
<div class="custom-radio-container">
<div class="custom-radio">
<input type="radio" id="searchOtrCouponSmtmUseAt-22" name="searchOtrCouponSmtmUseAt" value="" checked>
<label for="searchOtrCouponSmtmUseAt-22">전체</label>
</div>
<div class="custom-radio">
<input type="radio" id="searchOtrCouponSmtmUseAt-23" name="searchOtrCouponSmtmUseAt" value="Y">
<label for="searchOtrCouponSmtmUseAt-23">단독 사용</label>
</div>
<div class="custom-radio">
<input type="radio" id="searchOtrCouponSmtmUseAt-24" name="searchOtrCouponSmtmUseAt" value="N">
<label for="searchOtrCouponSmtmUseAt-24">공동 사용</label>
</div>
</div>
</div>
</td>
<th>중복할인</th>
<td>
<div class="td-inner">
<div class="custom-radio-container">
<div class="custom-radio">
<input type="radio" id="searchDplctDscntAt-25" name="searchDplctDscntAt" value="" checked>
<label for="searchDplctDscntAt-25">전체</label>
</div>
<div class="custom-radio">
<input type="radio" id="searchDplctDscntAt-26" name="searchDplctDscntAt" value="Y">
<label for="searchDplctDscntAt-26">사용</label>
</div>
<div class="custom-radio">
<input type="radio" id="searchDplctDscntAt-27" name="searchDplctDscntAt" value="N">
<label for="searchDplctDscntAt-27">미사용</label>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="form-control-container">
<div class="left"></div>
<div class="center">
<button class="btn outline" id="resetBtn" type="button" onclick="fn_reset_form('popupListForm'); return false;">초기화</button>
<button class="btn primary" id="searchBtn" type="button" onkeypress="this;" onclick="fn_search_coupon_choisepage_pop(1)">검색</button>
</div>
<div class="right"></div>
</div>
<input type="hidden" id="couponInnb" name="couponInnb"/>
<input type="hidden" id="couponSndngTy" name="couponSndngTy" value="<c:out value="${ resultMap.paramVO.couponSndngTy }"/>"/>
<input type="hidden" id="pageIndex" name="pageIndex" value="1"/>
<input type="hidden" id="pageUnit" name="pageUnit" value="${ resultMap.paramVO.pageUnit }"/>
</form>
<div class="product-search-box">
<div id="couponAjaxList" class="table-wrapper left">
</div>
<div class="table-wrapper right">
<div class="form-control-container mb-5">
<div class="left">
<h3 class="content-section__inner-title mb-0">선택된 쿠폰</h3>
</div>
<div class="center">
</div>
<div class="right">
<p class="info-oneline"><i class="icon icon_info"></i>쿠폰을 "더블클릭"하면 제외됩니다.
</div>
</div>
<table class="table vertical tight draggable">
<caption>해당 테이블에 대한 설명</caption>
<colgroup>
<col>
</colgroup>
<thead>
<tr>
<th>선택된 쿠폰 리스트</th>
</tr>
</thead>
<tbody id="appendList">
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<%-- <button class="btn outlise" onclick="fn_close_modal('couponChoisePopup')">닫기</button> --%>
<a href="#" rel="modal:close" class="btn outline">취소</a>
<button class="btn primary" onclick="fn_send_cupnpkregistpage('couponChoisePopup')">확인</button>
</div>
</div>
<script src="/admin/js/script.js" defer=""></script>