|
@@ -0,0 +1,1432 @@
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
|
+<html lang="ko"
|
|
|
|
|
+ xmlns:th="http://www.thymeleaf.org">
|
|
|
|
|
+<!--
|
|
|
|
|
+ *******************************************************************************
|
|
|
|
|
+ * @source : CouponPopupForm.html
|
|
|
|
|
+ * @desc : 쿠폰 등록 팝업 화면
|
|
|
|
|
+ *============================================================================
|
|
|
|
|
+ * ISTYLE24
|
|
|
|
|
+ * Copyright(C) 2020 TSIT, All rights reserved.
|
|
|
|
|
+ *============================================================================
|
|
|
|
|
+ * VER DATE AUTHOR DESCRIPTION
|
|
|
|
|
+ * === =========== ========== =============================================
|
|
|
|
|
+ * 1.0 2020.12.23 xyzp1539 최초 작성
|
|
|
|
|
+ *******************************************************************************
|
|
|
|
|
+ -->
|
|
|
|
|
+<div class="modalPopup" data-width="1200">
|
|
|
|
|
+ <div class="panelStyle" >
|
|
|
|
|
+ <div class="panelTitle">
|
|
|
|
|
+ <h2 th:text="${'쿠폰 ' + (mode == 'N' ? '등록' : '수정')}">쿠폰등록</h2>
|
|
|
|
|
+ <button type="button" class="close" onclick="uifnPopupClose('CouponRegForm')"><i class="fa fa-times"></i></button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="panelContent">
|
|
|
|
|
+ <form id="CouponForm" name="CouponForm" action="#" th:action="@{'/marketing/coupon/save'}" >
|
|
|
|
|
+ <input type="hidden" name="supplyCompList" id="supplyCompList">
|
|
|
|
|
+ <input type="hidden" name="brandList" id="brandList">
|
|
|
|
|
+ <input type="hidden" name="applyGoodsList" id="applyGoodsList">
|
|
|
|
|
+ <input type="hidden" name="exceptGoodsList" id="excepGoodsList">
|
|
|
|
|
+ <input type="hidden" name="burdenList" id="burdenList">
|
|
|
|
|
+ <input type="hidden" name="cateList" id="cateList">
|
|
|
|
|
+ <input type="hidden" name="cpnId2" id="cpnId2" th:if="${cpnDetail}" th:value="${cpnDetail.cpnId}">
|
|
|
|
|
+
|
|
|
|
|
+ <div class="tabs">
|
|
|
|
|
+ <div class="tabsNav">
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li class="on"><a href="#coupontab1">기본정보</a></li>
|
|
|
|
|
+ <li><a href="#coupontab2">적용대상</a></li>
|
|
|
|
|
+ <li><a href="#coupontab3">입점업체분담율</a></li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <ul class="tabsCont">
|
|
|
|
|
+ <li class="tab on" id="coupontab1">
|
|
|
|
|
+ <div class="panelStyle">
|
|
|
|
|
+ <table class="frmStyle">
|
|
|
|
|
+ <colgroup>
|
|
|
|
|
+ <col style="width:10%">
|
|
|
|
|
+ <col style="width:40%;">
|
|
|
|
|
+ <col style="width:10%">
|
|
|
|
|
+ <col style="width:40%;">
|
|
|
|
|
+ </colgroup>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>쿠폰번호<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td colspan="5">
|
|
|
|
|
+ <input type="hidden" name="copyCpnId" maxlength="50" value="">
|
|
|
|
|
+ <input type="text" name="cpnId" id="cpnId" maxlength="50" style="width:70%;" disabled="true" readonly="readonly" placeholder="자동생성" data-valid-name="쿠폰번호">
|
|
|
|
|
+ <label class="chkBox checked" onclick="clickCreateChk(this);">
|
|
|
|
|
+ <input type="checkbox" name="cpnCreateType" value="true" class="type-check" checked />쿠폰번호 자동생성
|
|
|
|
|
+ </label>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>쿠폰명<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td colspan="5">
|
|
|
|
|
+ <input type="text" name="cpnNm" id="cpnNm" style="width: 70%;" required="required" data-valid-name="쿠폰명">
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>쿠폰유형<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td colspan="5">
|
|
|
|
|
+ <input type="hidden" id="cpnType" name="cpnType" required="required" data-valid-name="쿠폰유형">
|
|
|
|
|
+ <label class="rdoBtn" th:if="${cpnTypeList}" th:each="oneData, status : ${cpnTypeList}"> <input type="radio" name="rdoCpnType" th:text="${oneData.cdNm}" th:value="${oneData.cd}"/></label>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>사용가능고객구분<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="usableCustGb" id="usableCustGb" required="required" data-valid-name="사용가능고객구분">
|
|
|
|
|
+ <option th:if="${usableCustGbList}" th:each="oneData , status : ${usableCustGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>사이트<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="siteCd" id="siteCd" required="required" data-valid-name="사이트">
|
|
|
|
|
+ <option th:if="${siteCdList}" th:each="oneData , status : ${siteCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>사용고객등급구분<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="usableCustGrade" id="usableCustGrade" required="required" data-valid-name="사용고객등급구분">
|
|
|
|
|
+ <option value="ALL">[전체]</option>
|
|
|
|
|
+ <option th:if="${usableCustGradeList}" th:each="oneData , status : ${usableCustGradeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>만료알림여부<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="endAlimYn" id="endAlimYn" required="required" data-valid-name="만료알림여부">
|
|
|
|
|
+ <option value="Y">Y</option>
|
|
|
|
|
+ <option value="N" selected="selected">N</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>할인방식<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="hidden" name="dcWay" id="dcWay" required="required" data-valid-name="할인방식">
|
|
|
|
|
+ <label class="rdoBtn" th:if="${dcWayList}" th:each="oneData, status : ${dcWayList}"> <input type="radio" name="rdoDcWay" th:text="${oneData.cdNm}" th:value="${oneData.cd}"/></label>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>구매제한금액<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="text" id="buyLimitAmt" name="buyLimitAmt" class="w200" required="required" value="0" style="text-align: right;" data-valid-name="구매제한금액" data-valid-type="numeric">원
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>할인값(PC)<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="text" class="w200" id="dcPval" name="dcPval" value="0" required="required" data-valid-name="할인값(PC)" data-valid-type="numeric" style="text-align: right"><span id="dcPvalSpan">원</span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>할인값(모바일웹)<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="text" class="w200" id="dcMval" name="dcMval" value="0" required="required" data-valid-name="할인값(모바일웹)" data-valid-type="numeric" style="text-align: right"><span id="dcMvalSpan">원</span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>할인값(모바일앱)<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="text" class="w200" id="dcAval" name="dcAval" value="0" required="required" data-valid-name="할인값(모바일앱)" data-valid-type="numeric" style="text-align: right"><span id="dcAvalSpan">원</span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>최대할인금액<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="text" class="w200" id="maxDcAmt" name="maxDcAmt" value="0" required="required" data-valid-name="최대할인금액" data-valid-type="numeric" style="text-align: right;"><span id="maxDcAmtSpan">원</span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>다운로드시작일시<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="hidden" name="downStdt" id="downStdt" required="required" data-valid-name="다운로드시작일시">
|
|
|
|
|
+ <input type="text" class="schDate w100" name="downStDay" id="downStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
|
|
|
|
|
+ <select name="downStHH" id="downStHH">
|
|
|
|
|
+ <option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select name="downStMM" id="downStMM">
|
|
|
|
|
+ <option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <th>다운로드종료일시<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="hidden" id="downEddt" name="downEddt" required="required" data-valid-name="다운로드종료일시">
|
|
|
|
|
+ <input type="text" class="schDate w100" name="downEdDay" id="downEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
|
|
|
|
|
+ <select name="downEdHH" id="downEdHH">
|
|
|
|
|
+ <option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select name="downEdMM" id="downEdMM">
|
|
|
|
|
+ <option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>기간/일수구분<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="pdGb" id="pdGb" onchange="pdGbChange(this)" required="required" data-valid-name="기간/일수구분">
|
|
|
|
|
+ <option value="P">기간</option>
|
|
|
|
|
+ <option value="D">일수</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>적용범위<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="hidden" name="applyScope" id="applyScope" required="required" data-valid-name="적용범위">
|
|
|
|
|
+ <label class="rdoBtn"> <input type="radio" name="rdoApplyScope" value="A"/>전체</label>
|
|
|
|
|
+ <label class="rdoBtn"> <input type="radio" name="rdoApplyScope" value="I"/>개별</label>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr class="availDayTr" style="display: none;">
|
|
|
|
|
+ <th>유효기간일수<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="text" name="availDays" id="availDays" class="w200" data-valid-name="유효기간일수">
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th class="availDateTr">유효기간시작일시<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td class="availDateTr">
|
|
|
|
|
+ <input type="hidden" name="availStdt" id="availStdt" data-valid-name="유효기간시작일시">
|
|
|
|
|
+ <input type="text" class="schDate w100" name="availStDay" id="availStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
|
|
|
|
|
+ <select name="availStHH" id="availStHH">
|
|
|
|
|
+ <option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select name="availStMM" id="availStMM">
|
|
|
|
|
+ <option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <th class="availDateTr">유효기간종료일시<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td class="availDateTr">
|
|
|
|
|
+ <input type="hidden" id="availEddt" name="availEddt" data-valid-name="유효기간종료일시">
|
|
|
|
|
+ <input type="text" class="schDate w100" name="availEdDay" id="availEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
|
|
|
|
|
+ <select name="availEdHH" id="availEdHH">
|
|
|
|
|
+ <option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select name="availEdMM" id="availEdMM">
|
|
|
|
|
+ <option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>첫구매여부<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="firstYn" id="firstYn" onchange="firstYnChange(this)" required="required" data-valid-name="첫구매여부">
|
|
|
|
|
+ <option value="Y">Y</option>
|
|
|
|
|
+ <option value="N" selected="selected">N</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>다운로드가능여부<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="downYn" id="downYn" required="required" data-valid-name="다운로드가능여부">
|
|
|
|
|
+ <option value="Y">Y</option>
|
|
|
|
|
+ <option value="Y" selected="selected">N</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th class="buyDateTr">첫구매기간시작일시<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td class="buyDateTr">
|
|
|
|
|
+ <input type="hidden" id="buyEddt" name="buyEddt" data-valid-name="첫구매기간종료일시">
|
|
|
|
|
+ <input type="text" class="schDate w100" name="buyStDay" id="buyStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
|
|
|
|
|
+ <select name="buyStHH" id="buyStHH">
|
|
|
|
|
+ <option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select name="buyStMM" id="buyStMM">
|
|
|
|
|
+ <option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <th class="buyDateTr">첫구매기간종료일시<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td class="buyDateTr">
|
|
|
|
|
+ <input type="hidden" name="buyStdt" id="buyStdt" data-valid-name="첫구매기간시작일시">
|
|
|
|
|
+ <input type="text" class="schDate w100" name="buyEdDay" id="buyEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
|
|
|
|
|
+ <select name="buyEdHH" id="buyEdHH">
|
|
|
|
|
+ <option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select name="buyEdMM" id="buyEdMM">
|
|
|
|
|
+ <option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>신규회원여부<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="custJoinYn" id="custJoinYn" onchange="custJoinYnChange(this)" required="required" data-valid-name="신규회원여부">
|
|
|
|
|
+ <option value="Y">Y</option>
|
|
|
|
|
+ <option value="N" selected="selected">N</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>총발행제한수량<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="text" class="w200" name="totPubLimitQty" id="totPubLimitQty" value="0" required="required" data-valid-name="총발행제한수량" data-valid-type="numeric" style="text-align: right;">개<span class="cRed" id="totPubLimitQtySpan"> *제한없음</span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th class="custJoinDateTr">신규회원기간시작일시<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td class="custJoinDateTr">
|
|
|
|
|
+ <input type="hidden" name="custJoinStdt" id="custJoinStdt" data-valid-name="신규회원기간시작일시">
|
|
|
|
|
+ <input type="text" class="schDate w100" name="custJoinStDay" id="custJoinStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
|
|
|
|
|
+ <select name="custJoinStHH" id="custJoinStHH">
|
|
|
|
|
+ <option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select name="custJoinStMM" id="custJoinStMM">
|
|
|
|
|
+ <option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <th class="custJoinDateTr">신규회원기간종료일시<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td class="custJoinDateTr">
|
|
|
|
|
+ <input type="hidden" id="custJoinEddt" name="custJoinEddt" data-valid-name="신규회원기간종료일시">
|
|
|
|
|
+ <input type="text" class="schDate w100" name="custJoinEdDay" id="custJoinEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
|
|
|
|
|
+ <select name="custJoinEdHH" id="custJoinEdHH">
|
|
|
|
|
+ <option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select name="custJoinEdMM" id="custJoinEdMM">
|
|
|
|
|
+ <option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>1인당발행제한수량<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="text" class="w200" name="custPubLimitQty" id="custPubLimitQty" value="0" required="required" data-valid-name="1인당발행제한수량" data-valid-type="numeric" style="text-align: right;">개<span class="cRed" id="custPubLimitQtySpan"> *제한없음</span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>1회발행수량<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td><input type="text" class="w200" name="onePubQty" id="onePubQty" value="1" required="required" data-valid-name="1회발행수량" data-valid-type="numeric" style="text-align: right;">개</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>재발급여부<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="reissuance" id="reissuance" required="required" data-valid-name="재발급여부" >
|
|
|
|
|
+ <option th:if="${reissuanceList}" th:each="oneData , status : ${reissuanceList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>다운로드구분<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="dnGb" id="dnGb" required="required" data-valid-name="다운로드구분">
|
|
|
|
|
+ <option th:if="${dnGbList}" th:each="oneData , status:${dnGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr class="payTypeTr" style="display: none;">
|
|
|
|
|
+ <th>결제수단<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td colspan="5">
|
|
|
|
|
+ <select name="payType" id="payType" data-valid-name="결제수단">
|
|
|
|
|
+ <option value="">[전체]</option>
|
|
|
|
|
+ <option th:if="${payTypeList}" th:each="oneData , status : ${payTypeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>쿠폰상태<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="cpnStat" id="cpnStat" data-valid-name="쿠폰상태" required="required">
|
|
|
|
|
+ <option th:if="${cpnStatList}" th:each="oneData , status : ${cpnStatList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>제휴링크코드<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select name="afChannel" id="afChannel" onchange="fnChangeAfLinkCdList()" data-valid-name="제휴링크코드" required="required">
|
|
|
|
|
+ <option th:if="${upperAfLinkCdList}" th:each="oneData , status : ${upperAfLinkCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select name="afLinkCd" id="afLinkCd">
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <div class="mdPopBtnB aR">
|
|
|
|
|
+ <button type="button" class="btn btn-info btn-lg" onclick="fnCustomerIssuePopUp();" th:if="${mode == 'U'}">쿠폰발행</button>
|
|
|
|
|
+ <button type="button" class="btn btn-info btn-lg" onclick="fnCouponCreate();" th:if="${mode == 'N'}">등록</button>
|
|
|
|
|
+ <button type="button" class="btn btn-info btn-lg" onclick="fnCouponUpdate();" th:if="${mode == 'U'}">수정</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <!-- 쿠폰적용대상-->
|
|
|
|
|
+ <li class="tab" id="coupontab2" >
|
|
|
|
|
+ <div class="panelStyle">
|
|
|
|
|
+ <div class="inner-panelContent">
|
|
|
|
|
+ <div class="panelContent">
|
|
|
|
|
+ <div class="panelBar">
|
|
|
|
|
+ <h4>적용 대상 상품 등록</h4>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <table class="frmStyle">
|
|
|
|
|
+ <colgroup>
|
|
|
|
|
+ <col style="width:15%;">
|
|
|
|
|
+ <col style="width:85%;">
|
|
|
|
|
+ </colgroup>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>공급처</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="padding10 inner-tb-solid">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnSupplyAdd">공급처 추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnSupplyDel">선택삭제</button>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <div id="supplyGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>브랜드</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="padding10 inner-tb-solid">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnBrandAdd">브랜드 추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnBrandDel">선택삭제</button>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <div id="brandGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>카테고리</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="padding10 inner-tb-solid">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnCateAdd">카테고리 추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnCateDel">선택삭제</button>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <div id="cateGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>적용상품</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="padding10 inner-tb-solid">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsAdd">상품 추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsDel">선택삭제</button>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <div id="goodsGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="inner-panelContent">
|
|
|
|
|
+ <div class="panelContent">
|
|
|
|
|
+ <div class="panelBar">
|
|
|
|
|
+ <h4>적용 대상 상품 등록</h4>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <table class="frmStyle">
|
|
|
|
|
+ <colgroup>
|
|
|
|
|
+ <col style="width:15%;">
|
|
|
|
|
+ <col style="width:85%;">
|
|
|
|
|
+ </colgroup>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>제외상품</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="padding10 inner-tb-solid">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnExcepGoodsAdd">제외상품 추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnExcepGoodsDel">선택삭제</button>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <div id="excepGoodsGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <!-- 쿠폰적용대상끝-->
|
|
|
|
|
+ <!-- 입점업체분담율-->
|
|
|
|
|
+ <li class="tab" id="coupontab3">
|
|
|
|
|
+ <div class="panelStyle">
|
|
|
|
|
+ <ul class="panelBar">
|
|
|
|
|
+ <li class="left">
|
|
|
|
|
+ <button type="button" class="btn btn-warning btn-lg" id="btnAddRow">행추가</button>
|
|
|
|
|
+ <button type="button" class="btn btn-danger btn-lg" id="btnDelRow">행삭제</button>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+
|
|
|
|
|
+ <div id="inComGridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <!-- 입점업체분담끝-->
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</div>
|
|
|
|
|
+<script th:inline="javascript">
|
|
|
|
|
+ /*<![CDATA[*/
|
|
|
|
|
+ // 상세조회 리스트
|
|
|
|
|
+ var mode = [[${mode}]];
|
|
|
|
|
+ var cpnDetail = [[${cpnDetail}]];
|
|
|
|
|
+ var cpnDtlRefvalSupplyCompList = [[${cpnDtlRefvalSupplyCompList}]];
|
|
|
|
|
+ var cpnDtlRefvalApplyGoodsList = [[${cpnDtlRefvalApplyGoodsList}]];
|
|
|
|
|
+ var cpnDtlRefvalCateList = [[${cpnDtlRefvalCateList}]];
|
|
|
|
|
+ var cpnDtlRefvalBrandList = [[${cpnDtlRefvalBrandList}]];
|
|
|
|
|
+ var cpnDtlRefvalExceptGoodsList = [[${cpnDtlRefvalExceptGoodsList}]];
|
|
|
|
|
+ var cpnDtlBurdenList = [[${cpnDtlBurdenList}]];
|
|
|
|
|
+ var issueCnt = [[${issueCnt}]];
|
|
|
|
|
+
|
|
|
|
|
+ // 공통코드 리스트
|
|
|
|
|
+ var ibSupplyComList = gagajf.convertToArray([[${ibSupplyCompList}]]);
|
|
|
|
|
+ var formalGbList = gagajf.convertToArray([[${formalGbList}]]);
|
|
|
|
|
+ var cateGbList = gagajf.convertToArray([[${cateGbList}]]);
|
|
|
|
|
+ var delYnList = { "Y":"Yes", "N":"No" };
|
|
|
|
|
+ var siteCdList = gagajf.convertToArray([[${siteCdList}]]);
|
|
|
|
|
+ var selfBrandList = gagajf.convertToArray([[${selfBrandList}]]);
|
|
|
|
|
+
|
|
|
|
|
+ // ag-grid 입점업체분담율 컬럼
|
|
|
|
|
+ var columnDefs = [
|
|
|
|
|
+ { headerName: "입점업체" , field:"supplyCompCd" , width:150, cellClass:"text-center" ,
|
|
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(ibSupplyComList) },
|
|
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(ibSupplyComList, params.value); },
|
|
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(ibSupplyComList, params.newValue);}
|
|
|
|
|
+ } ,
|
|
|
|
|
+ { headerName: "쿠폰분담율(%)", field:"burdenRate" , width:150, cellClass: "text-center" ,
|
|
|
|
|
+ cellEditorParams: { maxlength: 10, required: true }
|
|
|
|
|
+ } ,
|
|
|
|
|
+ { headerName: "삭제여부" , field: "delYn" , width:150, cellClass: "text-center" ,
|
|
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(delYnList) },
|
|
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(delYnList, params.value); },
|
|
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(delYnList, params.newValue); }
|
|
|
|
|
+ } ,
|
|
|
|
|
+ { headerName: "쿠폰번호" , field: "cpnId" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // ag-grid 공급처 컬럼
|
|
|
|
|
+ var supplyColumnDefs = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ { headerName : "공급업체코드" , field: "supplyCompCd" , width:150, cellClass: 'text-center'} ,
|
|
|
|
|
+ { headerName: "공급업체명" , field: "supplyCompNm" , width:150, cellClass: 'text-center'},
|
|
|
|
|
+ { headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // ag-grid 브랜드 컬럼
|
|
|
|
|
+ var brandSelColumnDefs = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ { headerName : "브랜드ID" , field: "brandCd" , width: 120, cellClass : 'text-center'} ,
|
|
|
|
|
+ { headerName : "브랜드명" , field: "brandEnm" , width: 120, cellClass: 'text-center'} ,
|
|
|
|
|
+ { headerName : "공급업체명", field: "supplyCompNm" , width: 150, cellClass: 'text-center' } ,
|
|
|
|
|
+ { headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // ag-grid 적용상품 컬럼
|
|
|
|
|
+ var goodsSelColumnDefs = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ { headerName: "상품구분" , field: "goodsGb" , width: 100, cellClass: 'text-center'} ,
|
|
|
|
|
+ { headerName: "Product ID" , field: "goodsCd" , width: 120, cellClass: 'text-center'},
|
|
|
|
|
+ { headerName: "상품명" , field: "goodsNm" , width: 250 , cellClass: 'text-center'} ,
|
|
|
|
|
+ { headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // ag-grid 카테고리 컬럼
|
|
|
|
|
+ var cateSelColumnDefs = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ { headerName: "사이트" , field: "siteCd" , width: 100 , cellClass: 'text-center' ,
|
|
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(siteCdList) },
|
|
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(siteCdList, params.value); },
|
|
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(siteCdList, params.newValue); }
|
|
|
|
|
+ },
|
|
|
|
|
+ { headerName: "카테고리구분" , field: "cateGb" , width: 100 , cellClass: 'text-center' ,
|
|
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(cateGbList) },
|
|
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(cateGbList, params.value); },
|
|
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(cateGbList, params.newValue); }
|
|
|
|
|
+ },
|
|
|
|
|
+ { headerName: "카테고리코드" , field: "cateNo" , width: 100 , cellClass: 'text-center'} ,
|
|
|
|
|
+ { headerName: "카테고리명" , field: "cateNm" , width: 120 , cellClass: 'text-center'},
|
|
|
|
|
+ { headerName: "이월/정상구분" , field: "formalGb" , width: 120 , cellClass: 'text-center',
|
|
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(formalGbList) },
|
|
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(formalGbList, params.value); },
|
|
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(formalGbList, params.newValue); }
|
|
|
|
|
+ },
|
|
|
|
|
+ { headerName: "브랜드명" , field:"brandCd" , width:150, cellClass: "text-center", required: true ,
|
|
|
|
|
+ editable: true, cellEditor: 'agRichSelectCellEditor',
|
|
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(selfBrandList) },
|
|
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(selfBrandList, params.value); },
|
|
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(selfBrandList, params.newValue); }
|
|
|
|
|
+ },
|
|
|
|
|
+ { headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // ag-grid 제외상품 컬럼
|
|
|
|
|
+ var excepGoodsColumnDefs = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ { headerName: "상품구분" , field: "goodsGb" , width: 100, cellClass: 'text-center'} ,
|
|
|
|
|
+ { headerName: "Product ID" , field: "goodsCd" , width: 120, cellClass: 'text-center'},
|
|
|
|
|
+ { headerName: "상품명" , field: "goodsNm" , width: 250 , cellClass: 'text-center'} ,
|
|
|
|
|
+ { headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ var inComGridOptions = gagaAgGrid.getGridOptions(columnDefs);
|
|
|
|
|
+ var cateGridOptions = gagaAgGrid.getGridOptions(cateSelColumnDefs);
|
|
|
|
|
+ var goodsGridOptions = gagaAgGrid.getGridOptions(goodsSelColumnDefs);
|
|
|
|
|
+ var brandGridOptions = gagaAgGrid.getGridOptions(brandSelColumnDefs);
|
|
|
|
|
+ var supplyGridOptions = gagaAgGrid.getGridOptions(supplyColumnDefs);
|
|
|
|
|
+ var excepGoodsGridOptions = gagaAgGrid.getGridOptions(excepGoodsColumnDefs);
|
|
|
|
|
+
|
|
|
|
|
+ inComGridOptions.defaultColDef.editable = true;
|
|
|
|
|
+ inComGridOptions.rowSelection = "multiple";
|
|
|
|
|
+ goodsGridOptions.rowSelection = "multiple";
|
|
|
|
|
+ supplyGridOptions.rowSelection = "multiple";
|
|
|
|
|
+ excepGoodsGridOptions.rowSelection = "multiple";
|
|
|
|
|
+ cateGridOptions.rowSelection = "multiple";
|
|
|
|
|
+ brandGridOptions.rowSelection = "multiple";
|
|
|
|
|
+ inComGridOptions.stopEditingWhenGridLosesFocus = true;
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰 등록 버튼 클릭시
|
|
|
|
|
+ function fnCouponCreate(){
|
|
|
|
|
+ mcxDialog.confirm('저장하시겠습니까?' , {
|
|
|
|
|
+ cancelBtnText:"취소",
|
|
|
|
|
+ sureBtnText:"확인",
|
|
|
|
|
+ sureBtnClick: function () {
|
|
|
|
|
+ gagajf.removeCommaAtNumberFormattedInput('#CouponForm');
|
|
|
|
|
+ // 필수값들 셋팅
|
|
|
|
|
+ setReqValue();
|
|
|
|
|
+ // 필수값 validation 체크
|
|
|
|
|
+ if (!gagajf.validation('#CouponForm')) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ checkValidation();
|
|
|
|
|
+
|
|
|
|
|
+ gagajf.ajaxFormSubmit($('#CouponForm').prop('action'), '#CouponForm', function() {
|
|
|
|
|
+ uifnPopupClose('CouponRegForm');
|
|
|
|
|
+ $('#btnSearch').trigger('click');
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰 수정 시
|
|
|
|
|
+ function fnCouponUpdate(){
|
|
|
|
|
+ mcxDialog.confirm('수정하시겠습니까?' , {
|
|
|
|
|
+ cancelBtnText:"취소",
|
|
|
|
|
+ sureBtnText:"확인",
|
|
|
|
|
+ sureBtnClick: function () {
|
|
|
|
|
+ gagajf.removeCommaAtNumberFormattedInput('#CouponForm');
|
|
|
|
|
+ // 필수값들 셋팅
|
|
|
|
|
+ setReqValue();
|
|
|
|
|
+ // 필수값 validation 체크
|
|
|
|
|
+ if (!gagajf.validation('#CouponForm')) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ checkValidation();
|
|
|
|
|
+
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").prop("disabled", false);
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").attr("required", true);
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").attr("placeholder", "");
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").attr("readonly", false);
|
|
|
|
|
+
|
|
|
|
|
+ gagajf.ajaxFormSubmit($('#CouponForm').prop('action'), '#CouponForm', function() {
|
|
|
|
|
+ uifnPopupClose('CouponRegForm');
|
|
|
|
|
+ $('#btnSearch').trigger('click');
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function checkValidation(){
|
|
|
|
|
+ //신규가입 지급한다면 validation 체크
|
|
|
|
|
+ if( $('#custJoinYn option:selected').val() == "Y" ){
|
|
|
|
|
+ var fromDate = $('#CouponForm input[name=custJoinStdt]').val();
|
|
|
|
|
+ var toDate = $('#CouponForm input[name=custJoinEddt]').val();
|
|
|
|
|
+
|
|
|
|
|
+ if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
|
|
|
|
|
+ mcxDialog.alertC("신규가입기간 시작일자와 종료일자를 입력하세요.", {
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function() {
|
|
|
|
|
+ $('#CouponForm input[name=custJoinStdt]').focus();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (fromDate > toDate) {
|
|
|
|
|
+ mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function() {
|
|
|
|
|
+ $('#CouponForm input[name=custJoinEddt]').focus();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 첫구매 지급하면 validation 체크
|
|
|
|
|
+ if( $('#firstYn option:selected').val() == "Y" ){
|
|
|
|
|
+ var fromDate = $('#CouponForm input[name=buyStdt]').val();
|
|
|
|
|
+ var toDate = $('#CouponForm input[name=buyEddt]').val();
|
|
|
|
|
+
|
|
|
|
|
+ if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
|
|
|
|
|
+ mcxDialog.alertC("신규가입기간 시작일자와 종료일자를 입력하세요.", {
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function() {
|
|
|
|
|
+ $('#CouponForm input[name=buyStdt]').focus();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (fromDate > toDate) {
|
|
|
|
|
+ mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function() {
|
|
|
|
|
+ $('#CouponForm input[name=buyEddt]').focus();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 할인율 validation 체크 (100을 넘길수없음)
|
|
|
|
|
+ if($('#dcWay').val() == 'G240_11') {
|
|
|
|
|
+ if($('#dcPval').val() > 100) {
|
|
|
|
|
+ mcxDialog.alert('PC할인율은 100을 초과할수없습니다.');
|
|
|
|
|
+ $('#dcPval').focus();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ } else if( $('#dcMval').val() > 100) {
|
|
|
|
|
+ mcxDialog.alert('모바일(웹)할인율은 100을 초과할수없습니다.');
|
|
|
|
|
+ $('#dcMval').focus();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ } else if( $('#dcAval').val() > 100) {
|
|
|
|
|
+ mcxDialog.alert('모바일(앱)할인율은 100을 초과할수없습니다.');
|
|
|
|
|
+ $('#dcAval').focus();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 할인방식 변경
|
|
|
|
|
+ $("#CouponForm input[name=rdoDcWay]").bind('click change', function () {
|
|
|
|
|
+ var radioValue = $(this).val();
|
|
|
|
|
+ //발급이력이있으면 수정안됨
|
|
|
|
|
+ if(issueCnt > 0 ) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(radioValue == 'G240_10') {
|
|
|
|
|
+ $('#dcPvalSpan').text("원");
|
|
|
|
|
+ $('#dcMvalSpan').text("원");
|
|
|
|
|
+ $('#dcAvalSpan').text("원");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('#dcPvalSpan').text("%");
|
|
|
|
|
+ $('#dcMvalSpan').text("%");
|
|
|
|
|
+ $('#dcAvalSpan').text("%");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰 상태 변경
|
|
|
|
|
+ $("#CouponForm input[name=rdoCpnType]").bind('click change', function () {
|
|
|
|
|
+ var radioValue = $(this).val();
|
|
|
|
|
+
|
|
|
|
|
+ if(mode == "U") {
|
|
|
|
|
+ radioValue = cpnDetail.cpnType;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 상품쿠폰 선택시 적용범위 개별로 변경 나머진 전체
|
|
|
|
|
+ if(radioValue == 'G230_11') {
|
|
|
|
|
+ $("input:radio[name='rdoApplyScope']:radio[value='I']").prop('checked', true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("input:radio[name='rdoApplyScope']:radio[value='A']").prop('checked', true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 주문서 쿠폰 선택시 결제수단 노출
|
|
|
|
|
+ if(radioValue == 'G230_20') {
|
|
|
|
|
+ $('.payTypeTr').css('display' , '');
|
|
|
|
|
+ $('#CouponForm #payType').attr('required' , true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('.payTypeTr').css('display' , 'none');
|
|
|
|
|
+ $('#CouponForm #payType').attr('required' , false );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $('#CouponForm #cpnType').val(radioValue);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 적용대상 - 브랜드 추가 버튼시
|
|
|
|
|
+ $('#btnBrandAdd').on('click' , function(){
|
|
|
|
|
+ cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 브랜드 설정 / 브랜드 추가 콜백함수 (단수로 가져오므로 복수일 경우에 수정 확인 필요)
|
|
|
|
|
+ var fnSetPopupBrandInfo = function(result) {
|
|
|
|
|
+ for(let i = 0 ; i < result.length ; i++) {
|
|
|
|
|
+ let addChk = true, gridListValue = gagaAgGrid.getAllRowData(brandGridOptions); // 받아온 모든 데이터
|
|
|
|
|
+
|
|
|
|
|
+ // 받아온 data for
|
|
|
|
|
+ for(let j = 0 ; j < gridListValue.length ; j++) {
|
|
|
|
|
+ if(gridListValue[j].brandCd == result[i].brandCd) { addChk = false; } // 중복체크
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 중복되지 않은 데이터 리스트에 추가
|
|
|
|
|
+ if(addChk) {
|
|
|
|
|
+ gagaAgGrid.addRowData(brandGridOptions, {"brandCd" : result[i].brandCd, "brandEnm" : result[i].brandEnm, "supplyCompNm" : result[i].supplyCompNm});
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 적용대상 - 브랜드 삭제 버튼시
|
|
|
|
|
+ $('#btnBrandDel').on('click' , function(){
|
|
|
|
|
+ var selectVal = brandGridOptions.api.getSelectedRows();
|
|
|
|
|
+
|
|
|
|
|
+ if(selectVal.length == 0) {
|
|
|
|
|
+ mcxDialog.alert("선택된 행이 없습니다");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(cpnDetail != null ) {
|
|
|
|
|
+ mcxDialog.confirm('삭제하시겠습니까?', {
|
|
|
|
|
+ cancelBtnText: "취소",
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function(){
|
|
|
|
|
+ gagaAgGrid.removeRowData(brandGridOptions , false);
|
|
|
|
|
+ var cpnRefvalSqArr = [];
|
|
|
|
|
+
|
|
|
|
|
+ $.each(selectVal , function(idx , item){
|
|
|
|
|
+ cpnRefvalSqArr.push(item.cpnRefvalSq);
|
|
|
|
|
+ });
|
|
|
|
|
+ var data = { cpnRefvalSqArr : cpnRefvalSqArr
|
|
|
|
|
+ ,cpnId : cpnDetail.cpnId
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
|
|
+ gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 신규화면이면 그리드상 삭제
|
|
|
|
|
+ brandGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(brandGridOptions)});
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 적용대상 - 공급처 추가 버튼시
|
|
|
|
|
+ $('#btnSupplyAdd').on('click' , function (){
|
|
|
|
|
+ cfnOpenCompanyListPopup("fnSetPopupComapnyInfo" , "M");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 공급업체 설정 / 업체 추가 콜백함수
|
|
|
|
|
+ var fnSetPopupComapnyInfo = function(result) {
|
|
|
|
|
+ // 기존 리스트 데이터 for
|
|
|
|
|
+ for(let i = 0 ; i < result.length ; i++) {
|
|
|
|
|
+ let addChk = true, gridListValue = gagaAgGrid.getAllRowData(supplyGridOptions); // 받아온 모든 데이터
|
|
|
|
|
+
|
|
|
|
|
+ // 받아온 data for
|
|
|
|
|
+ for(let j = 0 ; j < gridListValue.length ; j++) {
|
|
|
|
|
+ // 동일한 data는 추가하지 않음
|
|
|
|
|
+ if(gridListValue[j].supplyCompCd == result[i].supplyCompCd) { addChk = false; } // 중복체크
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 중복되지 않은 데이터 리스트에 추가
|
|
|
|
|
+ if(addChk) {
|
|
|
|
|
+ gagaAgGrid.addRowData(supplyGridOptions, {"supplyCompCd" : result[i].supplyCompCd, "supplyCompNm" : result[i].supplyCompNm});
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 적용대상 - 공급처 삭제시시
|
|
|
|
|
+ $('#btnSupplyDel').on('click' , function () {
|
|
|
|
|
+ var selectVal = supplyGridOptions.api.getSelectedRows();
|
|
|
|
|
+
|
|
|
|
|
+ if(selectVal.length == 0) {
|
|
|
|
|
+ mcxDialog.alert("선택된 행이 없습니다");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(cpnDetail != null ) {
|
|
|
|
|
+ mcxDialog.confirm('삭제하시겠습니까?', {
|
|
|
|
|
+ cancelBtnText: "취소",
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function(){
|
|
|
|
|
+ gagaAgGrid.removeRowData(supplyGridOptions , false);
|
|
|
|
|
+ var cpnRefvalSqArr = [];
|
|
|
|
|
+
|
|
|
|
|
+ $.each(selectVal , function(idx , item){
|
|
|
|
|
+ cpnRefvalSqArr.push(item.cpnRefvalSq);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ var data = { cpnRefvalSqArr : cpnRefvalSqArr
|
|
|
|
|
+ ,cpnId : $('#CouponForm #cpnId').val()
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
|
|
+ gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 신규화면이면 그리드상 삭제
|
|
|
|
|
+ supplyGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(supplyGridOptions)});
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 적용대상 - 카테고리 추가시
|
|
|
|
|
+ $('#btnCateAdd').on('click' , function () {
|
|
|
|
|
+ cfnOpenCategoryPopup("fnSetPopupCategoryInfo");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 카테고리 추가 콜백 함수
|
|
|
|
|
+ var fnSetPopupCategoryInfo = function (result) {
|
|
|
|
|
+ // 기존 리스트 데이터 for
|
|
|
|
|
+ for(let i = 0 ; i < result.length ; i++) {
|
|
|
|
|
+ let addChk = true, gridListValue = gagaAgGrid.getAllRowData(cateGridOptions); // 받아온 모든 데이터
|
|
|
|
|
+
|
|
|
|
|
+ // 받아온 data for
|
|
|
|
|
+ for(let j = 0 ; j < gridListValue.length ; j++) {
|
|
|
|
|
+ // 동일한 data는 추가하지 않음
|
|
|
|
|
+ if(gridListValue[j].cateNo == result[i].cateNo) { addChk = false; } // 중복체크
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 중복되지 않은 데이터 리스트에 추가
|
|
|
|
|
+ if(addChk) {
|
|
|
|
|
+ gagaAgGrid.addRowData(cateGridOptions, {"siteCd":result[i].siteCd , "cateGb":result[i].cateGb , "cateNo":result[i].cateNo, "cateNm":result[i].cateNm , "formalGb":result[i].formalGb , "brandEnm":null});
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 적용대상 - 카테고리 삭제시
|
|
|
|
|
+ $('#btnCateDel').on('click' , function () {
|
|
|
|
|
+ var selectVal = cateGridOptions.api.getSelectedRows();
|
|
|
|
|
+
|
|
|
|
|
+ if(selectVal.length == 0) {
|
|
|
|
|
+ mcxDialog.alert("선택된 행이 없습니다");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(cpnDetail != null) {
|
|
|
|
|
+ mcxDialog.confirm('삭제하시겠습니까?', {
|
|
|
|
|
+ cancelBtnText: "취소",
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function(){
|
|
|
|
|
+ gagaAgGrid.removeRowData(cateGridOptions , false);
|
|
|
|
|
+
|
|
|
|
|
+ var cpnRefvalSqArr = [];
|
|
|
|
|
+
|
|
|
|
|
+ $.each(selectVal , function(idx , item){
|
|
|
|
|
+ cpnRefvalSqArr.push(item.cpnRefvalSq);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ var data = { cpnRefvalSqArr : cpnRefvalSqArr
|
|
|
|
|
+ ,cpnId : $('#CouponForm #cpnId').val()
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
|
|
+ gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cateGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(cateGridOptions)});
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 적용대상 - 상품 추가시
|
|
|
|
|
+ $('#btnGoodsAdd').on('click' , function () {
|
|
|
|
|
+ cfnOpenGoodsPopup("fnSetPopupApplyGoodsInfo");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 적용 상품 리스트 콜백함수
|
|
|
|
|
+ var fnSetPopupApplyGoodsInfo = function(result) {
|
|
|
|
|
+ gridAddGoodsList(goodsGridOptions, result , "apply");
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 적용대상 - 상품 삭제 시
|
|
|
|
|
+ $('#btnGoodsDel').on('click' , function () {
|
|
|
|
|
+ var selectVal = goodsGridOptions.api.getSelectedRows();
|
|
|
|
|
+
|
|
|
|
|
+ if(selectVal.length == 0) {
|
|
|
|
|
+ mcxDialog.alert("선택된 행이 없습니다");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(cpnDetail != null ) {
|
|
|
|
|
+ mcxDialog.confirm('삭제하시겠습니까?', {
|
|
|
|
|
+ cancelBtnText: "취소",
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function(){
|
|
|
|
|
+ gagaAgGrid.removeRowData(goodsGridOptions , false);
|
|
|
|
|
+ var cpnRefvalSqArr = [];
|
|
|
|
|
+
|
|
|
|
|
+ $.each(selectVal , function(idx , item){
|
|
|
|
|
+ cpnRefvalSqArr.push(item.cpnRefvalSq);
|
|
|
|
|
+ });
|
|
|
|
|
+ var data = { cpnRefvalSqArr : cpnRefvalSqArr
|
|
|
|
|
+ ,cpnId : $('#CouponForm #cpnId').val()
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
|
|
+ gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ goodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(goodsGridOptions)});
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 적용대상 - 제외상품 추가시
|
|
|
|
|
+ $('#btnExcepGoodsAdd').on('click' , function(){
|
|
|
|
|
+ cfnOpenGoodsPopup("fnSetPopupExceptGoodsInfo");
|
|
|
|
|
+ });
|
|
|
|
|
+ // 적용 상품 리스트 콜백함수
|
|
|
|
|
+ var fnSetPopupExceptGoodsInfo = function(result) {
|
|
|
|
|
+ gridAddGoodsList(excepGoodsGridOptions, result , "except");
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 적용대상 - 제외상품 삭제시
|
|
|
|
|
+ $('#btnExcepGoodsDel').on('click' , function () {
|
|
|
|
|
+ var selectVal = excepGoodsGridOptions.api.getSelectedRows();
|
|
|
|
|
+
|
|
|
|
|
+ if(selectVal.length == 0) {
|
|
|
|
|
+ mcxDialog.alert("선택된 행이 없습니다");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(cpnDetail != null ) {
|
|
|
|
|
+ mcxDialog.confirm('삭제하시겠습니까?', {
|
|
|
|
|
+ cancelBtnText: "취소",
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function(){
|
|
|
|
|
+ gagaAgGrid.removeRowData(excepGoodsGridOptions , false);
|
|
|
|
|
+ var cpnRefvalSqArr = [];
|
|
|
|
|
+
|
|
|
|
|
+ $.each(selectVal , function(idx , item){
|
|
|
|
|
+ cpnRefvalSqArr.push(item.cpnRefvalSq);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ var data = { cpnRefvalSqArr : cpnRefvalSqArr
|
|
|
|
|
+ ,cpnId : $('#CouponForm #cpnId').val()
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
|
|
+
|
|
|
|
|
+ gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ excepGoodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(excepGoodsGridOptions)});
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // ag-grid 상품관련 list 콜백함수
|
|
|
|
|
+ function gridAddGoodsList(OriginGridListOption, result, gubun) {
|
|
|
|
|
+ var goodsGbVal = "G800_10";
|
|
|
|
|
+ if(gubun == 'except'){
|
|
|
|
|
+ goodsGbVal = "G800_30";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for(let i = 0 ; i < result.length ; i++) {
|
|
|
|
|
+ let addChk = true, gridListValue = gagaAgGrid.getAllRowData(OriginGridListOption); // 받아온 모든 데이터
|
|
|
|
|
+
|
|
|
|
|
+ // 받아온 data for
|
|
|
|
|
+ for(let j = 0 ; j < gridListValue.length ; j++) {
|
|
|
|
|
+ if(gridListValue[j].goodsCd == result[i].goodsCd) { addChk = false; } // 중복체크
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 중복되지 않은 데이터 리스트에 추가
|
|
|
|
|
+ if(addChk) {
|
|
|
|
|
+ gagaAgGrid.addRowData(OriginGridListOption, {"goodsGb": goodsGbVal, "goodsCd" : result[i].goodsCd, "goodsNm" : result[i].goodsNm});
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 기간 일수 변경시
|
|
|
|
|
+ function pdGbChange(pThis){
|
|
|
|
|
+ var selectVal = $(pThis).val();
|
|
|
|
|
+
|
|
|
|
|
+ if(typeof selectVal == "undefined") {
|
|
|
|
|
+ if(mode == "U") {
|
|
|
|
|
+ selectVal = cpnDetail.pdGb;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ selectVal = "P";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(selectVal == "P") {
|
|
|
|
|
+ $('.availDateTr').css('display' , '');
|
|
|
|
|
+ $('.availDayTr').css('display' , 'none');
|
|
|
|
|
+ $('#CouponForm #availDays').attr('required' , false);
|
|
|
|
|
+ $('#CouponForm #availStDay').attr('required' , true);
|
|
|
|
|
+ $('#CouponForm #availEdDay').attr('required' , true);
|
|
|
|
|
+ $('#CouponForm #availStdt').attr('required' , true);
|
|
|
|
|
+ $('#CouponForm #availEddt').attr('required' , true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('.availDateTr').css('display' , 'none');
|
|
|
|
|
+ $('.availDayTr').css('display' , '');
|
|
|
|
|
+ $('#CouponForm #availDays').attr('required' , true);
|
|
|
|
|
+ $('#CouponForm #availStDay').attr('required' , false);
|
|
|
|
|
+ $('#CouponForm #availEdDay').attr('required' , false);
|
|
|
|
|
+ $('#CouponForm #availStdt').attr('required' , false);
|
|
|
|
|
+ $('#CouponForm #availEddt').attr('required' , false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 첫구매여부 변경시
|
|
|
|
|
+ function firstYnChange(pThis){
|
|
|
|
|
+ var selectVal = $(pThis).val();
|
|
|
|
|
+
|
|
|
|
|
+ if(typeof selectVal == "undefined") {
|
|
|
|
|
+ if(mode == "U") {
|
|
|
|
|
+ selectVal = cpnDetail.firstYn;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ selectVal = "N";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(selectVal == "Y" ) {
|
|
|
|
|
+ $('.buyDateTr').css('display' , '');
|
|
|
|
|
+ $('#buyStdt').attr('required' , true);
|
|
|
|
|
+ $('#buyEddt').attr('required' , true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('.buyDateTr').css('display' , 'none');
|
|
|
|
|
+ $('#buyStdt').attr('required' , false);
|
|
|
|
|
+ $('#buyEddt').attr('required' , false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 신규회원여부 변경시
|
|
|
|
|
+ function custJoinYnChange(pThis){
|
|
|
|
|
+ var selectVal = $(pThis).val();
|
|
|
|
|
+
|
|
|
|
|
+ if(typeof selectVal == "undefined") {
|
|
|
|
|
+ if(mode == "U") {
|
|
|
|
|
+ selectVal = cpnDetail.custJoinYn;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ selectVal = "N";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(selectVal == "Y" ) {
|
|
|
|
|
+ $('.custJoinDateTr').css('display' , '');
|
|
|
|
|
+ $('#custJoinStdt').attr('required' , true);
|
|
|
|
|
+ $('#custJoinEddt').attr('required' , true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('.custJoinDateTr').css('display' , 'none');
|
|
|
|
|
+ $('#custJoinStdt').attr('required' , false);
|
|
|
|
|
+ $('#custJoinEddt').attr('required' , false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 행추가시
|
|
|
|
|
+ $('#btnAddRow').on('click' , function(){
|
|
|
|
|
+ var data = { supplyCompCd: null , burdenRate : null , delYn : null};
|
|
|
|
|
+ gagaAgGrid.addRowData(inComGridOptions , data , "supplyCompCd" );
|
|
|
|
|
+ });
|
|
|
|
|
+ // 행삭제시
|
|
|
|
|
+ $('#btnDelRow').on('click' , function(){
|
|
|
|
|
+ inComGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(inComGridOptions)});
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰번호 자동생성 클릭시
|
|
|
|
|
+ function clickCreateChk(){
|
|
|
|
|
+ var flag = $('#CouponForm input[name=cpnCreateType]').prop("checked");
|
|
|
|
|
+ // 발급받은 이력이 있으면 수정 안됨
|
|
|
|
|
+ if(issueCnt > 0 ) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(!flag) {
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").prop("disabled", true);
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").attr("required", false);
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").attr("readonly", true);
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").attr("placeholder", "자동생성");
|
|
|
|
|
+ $('#CouponForm input[name=cpnCreateType]').prop("checked" , false);
|
|
|
|
|
+ } else{
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").prop("disabled", false);
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").attr("required", true);
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").attr("placeholder", "");
|
|
|
|
|
+ $("#CouponForm input[name=cpnId]").attr("readonly", false);
|
|
|
|
|
+ $('#CouponForm input[name=cpnCreateType]').prop("checked" , true);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 제휴링크채널 수정 (제휴링크가 꼭필요한지 확인필요)
|
|
|
|
|
+ function fnChangeAfLinkCdList(){
|
|
|
|
|
+ var actionUrl = "/business/aflink/list" + '?' + $('#afChannel').serialize();
|
|
|
|
|
+ var tag = "";
|
|
|
|
|
+
|
|
|
|
|
+ $("#CouponForm #afLinkCd").children('option').remove();
|
|
|
|
|
+
|
|
|
|
|
+ gagajf.ajaxJsonSubmit(actionUrl, '', function(data) {
|
|
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
|
|
+ if (data[i].useYn == 'Y') {
|
|
|
|
|
+ tag += '<option value="' + data[i].afLinkCd + '">[' + data[i].afLinkCd + '] ' + data[i].afLinkNm + '</option>';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $("#CouponForm #afLinkCd").append(tag);
|
|
|
|
|
+ $("#CouponForm #afLinkCd option:first").attr("selected" , "selected");
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ // 쿠폰발행팝업
|
|
|
|
|
+ function fnCustomerIssuePopUp(){
|
|
|
|
|
+ cfnCpnPubForCustPopup();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 전송시 값 세팅
|
|
|
|
|
+ function setReqValue(){
|
|
|
|
|
+ // 쿠폰유형값 세팅
|
|
|
|
|
+ $('#CouponForm #cpnType').val($('#CouponForm input:radio[name="rdoCpnType"]:checked').val());
|
|
|
|
|
+ // 할인방식값 세팅
|
|
|
|
|
+ $('#CouponForm #dcWay').val($('#CouponForm input:radio[name="rdoDcWay"]:checked').val());
|
|
|
|
|
+ // 적용범위값 세팅
|
|
|
|
|
+ $('#CouponForm #applyScope').val($('#CouponForm input:radio[name="rdoApplyScope"]:checked').val());
|
|
|
|
|
+ // 다운로드기간 세팅
|
|
|
|
|
+ $('#CouponForm #downStdt').val($('#CouponForm #downStDay').val() + " " + $('#CouponForm #downStHH').val() + ":" + $('#CouponForm #downStMM').val() + ":00");
|
|
|
|
|
+ $('#CouponForm #downEddt').val($('#CouponForm #downEdDay').val() + " " + $('#CouponForm #downEdHH').val() + ":" + $('#CouponForm #downEdMM').val() + ":59");
|
|
|
|
|
+ // 유효기간 세팅
|
|
|
|
|
+ $('#CouponForm #availStdt').val($('#CouponForm #availStDay').val() + " " + $('#CouponForm #availStHH').val() + ":" + $('#CouponForm #availStMM').val() + ":00");
|
|
|
|
|
+ $('#CouponForm #availEddt').val($('#CouponForm #availEdDay').val() + " " + $('#CouponForm #availEdHH').val() + ":" + $('#CouponForm #availEdMM').val() + ":59");
|
|
|
|
|
+ // 첫구매기간세팅
|
|
|
|
|
+ $('#CouponForm #buyStdt').val($('#CouponForm #buyStDay').val() + " " + $('#CouponForm #buyStHH').val() + ":" + $('#CouponForm #buyStMM').val() + ":00");
|
|
|
|
|
+ $('#CouponForm #buyEddt').val($('#CouponForm #buyEdDay').val() + " " + $('#CouponForm #buyEdHH').val() + ":" + $('#CouponForm #buyEdMM').val() + ":59");
|
|
|
|
|
+ // 신규회원기간 세팅
|
|
|
|
|
+ $('#CouponForm #custJoinStdt').val($('#CouponForm #custJoinStDay').val() + " " + $('#CouponForm #custJoinStHH').val() + ":" + $('#CouponForm #custJoinStMM').val() + ":00");
|
|
|
|
|
+ $('#CouponForm #custJoinEddt').val($('#CouponForm #custJoinEdDay').val() + " " + $('#CouponForm #custJoinEdHH').val() + ":" + $('#CouponForm #custJoinEdMM').val() + ":59");
|
|
|
|
|
+ // 적용대상 - 공급처 그리드 전체값 세팅
|
|
|
|
|
+ var supplyAllData = gagaAgGrid.getAllRowData(supplyGridOptions);
|
|
|
|
|
+ var jsonSupplyCompData = JSON.stringify(supplyAllData);
|
|
|
|
|
+ $('#CouponForm #supplyCompList').val(jsonSupplyCompData);
|
|
|
|
|
+ // 적용대상 - 브랜드 그리드 전체값 세팅
|
|
|
|
|
+ var brandAllData = gagaAgGrid.getAllRowData(brandGridOptions);
|
|
|
|
|
+ var jsonBrandData = JSON.stringify(brandAllData);
|
|
|
|
|
+ $('#CouponForm #brandList').val(jsonBrandData);
|
|
|
|
|
+ // // 적용대상 - 카테고리 그리드 전체값 세팅
|
|
|
|
|
+ var cateAllData = gagaAgGrid.getAllRowData(cateGridOptions);
|
|
|
|
|
+ var jsonCateData = JSON.stringify(cateAllData);
|
|
|
|
|
+ $('#CouponForm #cateList').val(jsonCateData);
|
|
|
|
|
+ // 적용대상 - 적용상품 그리드 전체값 세팅
|
|
|
|
|
+ var goodsAllData = gagaAgGrid.getAllRowData(goodsGridOptions);
|
|
|
|
|
+ var jsonGoodsData = JSON.stringify(goodsAllData);
|
|
|
|
|
+ $('#CouponForm #applyGoodsList').val(jsonGoodsData);
|
|
|
|
|
+ // 적용대상 - 제외상품 그리드 전체값 세팅
|
|
|
|
|
+ var exceptGoodsAllData = gagaAgGrid.getAllRowData(excepGoodsGridOptions);
|
|
|
|
|
+ var jsonExceptGoodsData = JSON.stringify(exceptGoodsAllData);
|
|
|
|
|
+ $('#CouponForm #excepGoodsList').val(jsonExceptGoodsData);
|
|
|
|
|
+ // 입점업체분담율 그리드 전체값 세팅
|
|
|
|
|
+ var inCompBurdenAllData = gagaAgGrid.getAllRowData(inComGridOptions);
|
|
|
|
|
+ var jsonInCompBurdenData = JSON.stringify(inCompBurdenAllData);
|
|
|
|
|
+ $('#CouponForm #burdenList').val(jsonInCompBurdenData);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $(document).ready(function() {
|
|
|
|
|
+ gagaAgGrid.createGrid('inComGridList', inComGridOptions);
|
|
|
|
|
+ gagaAgGrid.createGrid('brandGridList', brandGridOptions);
|
|
|
|
|
+ gagaAgGrid.createGrid('cateGridList', cateGridOptions);
|
|
|
|
|
+ gagaAgGrid.createGrid('supplyGridList', supplyGridOptions);
|
|
|
|
|
+ gagaAgGrid.createGrid('goodsGridList', goodsGridOptions);
|
|
|
|
|
+ gagaAgGrid.createGrid('excepGoodsGridList', excepGoodsGridOptions);
|
|
|
|
|
+
|
|
|
|
|
+ // 초기화시 데이터 세팅
|
|
|
|
|
+ if (mode == "N") {
|
|
|
|
|
+ $('input[name=rdoCpnType]').eq(0).attr("checked", true);
|
|
|
|
|
+ $('input[name=rdoDcWay]').eq(0).attr("checked", true);
|
|
|
|
|
+ $('input[name=rdoApplyScope]').eq(0).attr("checked", true)
|
|
|
|
|
+ $('#CouponForm #availEdHH option:last').attr("selected", "selected");
|
|
|
|
|
+ $('#CouponForm #availEdMM option:last').attr("selected", "selected");
|
|
|
|
|
+ $('#downEdHH option:last').attr("selected", "selected");
|
|
|
|
|
+ $('#downEdMM option:last').attr("selected", "selected");
|
|
|
|
|
+ $('#custJoinEdHH option:last').attr("selected", "selected");
|
|
|
|
|
+ $('#custJoinEdMM option:last').attr("selected", "selected");
|
|
|
|
|
+ $('#buyEdHH option:last').attr("selected", "selected");
|
|
|
|
|
+ $('#buyEdMM option:last').attr("selected", "selected");
|
|
|
|
|
+ $("#CouponForm #afChannel option:first").attr("selected" , "selected");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 수정모드시 그리드 세팅
|
|
|
|
|
+ inComGridOptions.api.setRowData(cpnDtlBurdenList);
|
|
|
|
|
+ supplyGridOptions.api.setRowData(cpnDtlRefvalSupplyCompList);
|
|
|
|
|
+ goodsGridOptions.api.setRowData(cpnDtlRefvalApplyGoodsList);
|
|
|
|
|
+ excepGoodsGridOptions.api.setRowData(cpnDtlRefvalExceptGoodsList);
|
|
|
|
|
+ brandGridOptions.api.setRowData(cpnDtlRefvalBrandList);
|
|
|
|
|
+ cateGridOptions.api.setRowData(cpnDtlRefvalCateList);
|
|
|
|
|
+ // 기본정보 세팅
|
|
|
|
|
+ $("#CouponForm input:radio[name='rdoDcWay']:radio[value=" + cpnDetail.dcWay + "]").prop('checked', true);
|
|
|
|
|
+ $("#CouponForm input:radio[name='rdoCpnType']:radio[value=" + cpnDetail.cpnType + "]").prop('checked', true);
|
|
|
|
|
+ $("#CouponForm input:radio[name='rdoApplyScope']:radio[value=" + cpnDetail.applyScope + "]").prop('checked', true);
|
|
|
|
|
+ $("#CouponForm #dcPval").val(cpnDetail.dcPval);
|
|
|
|
|
+ $("#CouponForm #dcMval").val(cpnDetail.dcMval);
|
|
|
|
|
+ $("#CouponForm #dcAval").val(cpnDetail.dcAval);
|
|
|
|
|
+ $("#CouponForm #maxDcAmt").val(cpnDetail.maxDcAmt);
|
|
|
|
|
+ $("#CouponForm #totPubLimitQty").val(cpnDetail.totPubLimitQty);
|
|
|
|
|
+ $("#CouponForm #custPubLimitQty").val(cpnDetail.custPubLimitQty);
|
|
|
|
|
+ $("#CouponForm #onePubQty").val(cpnDetail.onePubQty);
|
|
|
|
|
+ $("#CouponForm #usableCustGb").val(cpnDetail.usableCustGb).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #usableCustGrade").val(cpnDetail.usableCustGrade).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #endAlimYn").val(cpnDetail.endAlimYn).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #firstYn").val(cpnDetail.firstYn).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #reissuance").val(cpnDetail.reissuance).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #dnGb").val(cpnDetail.dnGb).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #cpnStat").val(cpnDetail.cpnStat).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #custJoinYn").val(cpnDetail.custJoinYn).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #pdGb").val(cpnDetail.pdGb).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #siteCd").val(cpnDetail.siteCd).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #afChannel").val(cpnDetail.afChannel).prop("selected", true);
|
|
|
|
|
+ $("#CouponForm #cpnNm").val(cpnDetail.cpnNm);
|
|
|
|
|
+ $("#CouponForm #downYn").val(cpnDetail.downYn);
|
|
|
|
|
+ $("#CouponForm #buyLimitAmt").val(cpnDetail.buyLimitAmt);
|
|
|
|
|
+ $("#CouponForm #cpnId").val(cpnDetail.cpnId);
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
|
|
+ $("#CouponForm input:checkbox[name='cpnCreateType']").parent("label").addClass("formControl");
|
|
|
|
|
+ $("#CouponForm input:checkbox[name='cpnCreateType']").parent("label").prop('disabled', true);
|
|
|
|
|
+ $("#CouponForm input:checkbox[name='cpnCreateType']").addClass("formControl");
|
|
|
|
|
+ $("#CouponForm input:checkbox[name='cpnCreateType']").prop('disabled', true);
|
|
|
|
|
+ */
|
|
|
|
|
+ // 만약 쿠폰 발급한 내역이 있으면 쿠폰수정못하게 readonly , disabled 속성 추가
|
|
|
|
|
+ if (issueCnt > 0) {
|
|
|
|
|
+ $("#CouponForm #usableCustGb").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #usableCustGb").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #afChannel").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #afChannel").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #usableCustGrade").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #usableCustGrade").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #endAlimYn").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #endAlimYn").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #firstYn").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #firstYn").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #reissuance").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #reissuance").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #dnGb").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #dnGb").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #custJoinYn").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #custJoinYn").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #pdGb").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #pdGb").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #downYn").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #downYn").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #siteCd").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #siteCd").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #cpnNm").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #cpnNm").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #dcPval").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #dcPval").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #dcMval").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #dcMval").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #dcAval").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #dcAval").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #maxDcAmt").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #maxDcAmt").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #totPubLimitQty").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #totPubLimitQty").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #custPubLimitQty").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #custPubLimitQty").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #onePubQty").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #onePubQty").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #downStDay").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #downStDay").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #downStHH").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #downStHH").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #downStMM").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #downStMM").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #buyLimitAmt").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm input:radio[name='rdoDcWay']").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm input:radio[name='rdoCpnType']").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm input:radio[name='rdoApplyScope']").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm .rdoBtn").css('cursor', 'auto');
|
|
|
|
|
+ $("#CouponForm #cpnId").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #cpnId").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm input:checkbox[name='cpnCreateType']").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm input:checkbox[name='cpnCreateType']").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm input:checkbox[name=cpnCreateType]").attr('checked', true);
|
|
|
|
|
+ $("#CouponForm input:checkbox[name=cpnCreateType]").parent().addClass('checked');
|
|
|
|
|
+ }
|
|
|
|
|
+ // 다운로드기간 세팅
|
|
|
|
|
+ splitDate("start", cpnDetail.downStdt, "down");
|
|
|
|
|
+ splitDate("end", cpnDetail.downEddt, "down");
|
|
|
|
|
+ // 유효기간이 날짜인경우 날짜 세팅
|
|
|
|
|
+ if (cpnDetail.pdGb == "P") {
|
|
|
|
|
+ splitDate("start", cpnDetail.availStdt, "avail");
|
|
|
|
|
+ splitDate("end", cpnDetail.availEddt, "avail");
|
|
|
|
|
+ $("#CouponForm #availStDay").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #availStDay").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #availStHH").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #availStHH").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #availStMM").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #availStMM").attr('disabled', true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#CouponForm #availDays").val(cpnDetail.availDays);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 첫구매여부 적용하는 경우 날짜 세팅
|
|
|
|
|
+ if (cpnDetail.firstYn == "Y") {
|
|
|
|
|
+ splitDate("start", cpnDetail.buyStdt, "buy");
|
|
|
|
|
+ splitDate("end", cpnDetail.buyEddt, "buy");
|
|
|
|
|
+ $("#CouponForm #buyStDay").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #buyStDay").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #buyStHH").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #buyStHH").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #buyStMM").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #buyStMM").attr('disabled', true);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 신규회원여부 적용하는 경우 날짜 세팅
|
|
|
|
|
+ if (cpnDetail.custJoinYn == "Y") {
|
|
|
|
|
+ splitDate("start", cpnDetail.custJoinStdt, "custJoin");
|
|
|
|
|
+ splitDate("end", cpnDetail.custJoinEddt, "custJoin");
|
|
|
|
|
+ $("#CouponForm #custJoinStDay").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #custJoinStDay").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #custJoinStHH").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #custJoinStHH").attr('disabled', true);
|
|
|
|
|
+ $("#CouponForm #custJoinStMM").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #custJoinStMM").attr('disabled', true);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 기본세팅
|
|
|
|
|
+ pdGbChange();
|
|
|
|
|
+ firstYnChange();
|
|
|
|
|
+ custJoinYnChange();
|
|
|
|
|
+ fnChangeAfLinkCdList();
|
|
|
|
|
+
|
|
|
|
|
+ // 제휴채널2뎁스 기본세팅
|
|
|
|
|
+ if(cpnDetail != null ) {
|
|
|
|
|
+ $("#CouponForm #afLinkCd").val(cpnDetail.afLinkCd).prop("selected", true);
|
|
|
|
|
+ if(issueCnt > 0 ) {
|
|
|
|
|
+ $("#CouponForm #afLinkCd").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm #afLinkCd").attr('disabled', true);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 날짜분리 ( 시작/종료날짜구분(start , end) , 날짜String , 적용타겟대상 )
|
|
|
|
|
+ function splitDate(stedGb , date , targetGb ){
|
|
|
|
|
+ var str = date;
|
|
|
|
|
+ var dateStr = str.split(' ');
|
|
|
|
|
+ var timeArr = dateStr[1].split(':');
|
|
|
|
|
+
|
|
|
|
|
+ if(stedGb == "start") {
|
|
|
|
|
+ $("#CouponForm #"+targetGb+"StDay").val(dateStr[0]);
|
|
|
|
|
+ $("#CouponForm #"+targetGb+"StHH").val(timeArr[0]);
|
|
|
|
|
+ $("#CouponForm #"+targetGb+"StMM").val(timeArr[1]);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#CouponForm #"+targetGb+"EdDay").val(dateStr[0]);
|
|
|
|
|
+ $("#CouponForm #"+targetGb+"EdHH").val(timeArr[0]);
|
|
|
|
|
+ $("#CouponForm #"+targetGb+"EdMM").val(timeArr[1]);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 제한없음 문구 변경
|
|
|
|
|
+ $("input[name=totPubLimitQty],input[name=custPubLimitQty],input[name=buyLimitAmt],input[name=onePubQty]").change(function(){
|
|
|
|
|
+ if($(this).val() == "0"){
|
|
|
|
|
+ $("#"+$(this).attr("name")+"Span").html("*제한없음");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#"+$(this).attr("name")+"Span").html("");
|
|
|
|
|
+ }
|
|
|
|
|
+ $("#"+$(this).attr("name")+"Span").css("color", "red");
|
|
|
|
|
+ });
|
|
|
|
|
+ setTimeout(function(){
|
|
|
|
|
+ $("input[name=totPubLimitQty],input[name=custPubLimitQty],input[name=buyLimitAmt],input[name=onePubQty]").change();
|
|
|
|
|
+ }, 1);
|
|
|
|
|
+
|
|
|
|
|
+ // 콤마 찍어주기
|
|
|
|
|
+ $(function(){
|
|
|
|
|
+ setComma("CouponForm" , true);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ function setComma(formId, pBoolean){
|
|
|
|
|
+ setTimeout(function(){
|
|
|
|
|
+ //숫자타입 콤마 찍어주기
|
|
|
|
|
+ $("#"+formId+" [data-valid-type=numeric]").each(function(){
|
|
|
|
|
+ $(this).change(function(){
|
|
|
|
|
+ if(pBoolean){
|
|
|
|
|
+ $(this).val($(this).val().addComma());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $(this).val($(this).val().removeComma());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ if(pBoolean){
|
|
|
|
|
+ $(this).val($(this).val().addComma());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $(this).val($(this).val().removeComma());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 300);
|
|
|
|
|
+ }
|
|
|
|
|
+ /*]]>*/
|
|
|
|
|
+</script>
|
|
|
|
|
+</html>
|