|
@@ -0,0 +1,736 @@
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
|
+<html lang="ko"
|
|
|
|
|
+ xmlns:th="http://www.thymeleaf.org">
|
|
|
|
|
+<!--
|
|
|
|
|
+ *******************************************************************************
|
|
|
|
|
+ * @source : MorebetterRegForm.html
|
|
|
|
|
+ * @desc : 다다익선 등록 화면
|
|
|
|
|
+ *============================================================================
|
|
|
|
|
+ * SISUN
|
|
|
|
|
+ * Copyright(C) 2019 TSIT, All rights reserved.
|
|
|
|
|
+ *============================================================================
|
|
|
|
|
+ * VER DATE AUTHOR DESCRIPTION
|
|
|
|
|
+ * === =========== ========== =============================================
|
|
|
|
|
+ * 1.0 2020.12.29 bin2107 최초 작성
|
|
|
|
|
+ *******************************************************************************
|
|
|
|
|
+ -->
|
|
|
|
|
+ <div class="modalPopup frGoodsPro" data-width="1100">
|
|
|
|
|
+ <div class="panelStyle" style="max-height:900px;overflow-y:scroll;">
|
|
|
|
|
+ <div class="panelTitle">
|
|
|
|
|
+ <h2>다다익선 등록</h2>
|
|
|
|
|
+ <button type="button" class="close" onclick="fnMorebetterFormClose()"><i class="fa fa-times"></i></button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <form id="moreBetterForm" name="moreBetterForm" action="#" th:action="@{'/marketing/morebetter/save'}"> <!--th:method="post" >-->
|
|
|
|
|
+ <input type="hidden" name="gbn" th:value="${params.gbn}" /> <!-- 신규/수정 구분 -->
|
|
|
|
|
+ <input type="hidden" name="supplyCompList"/> <!-- 공급업체 리스트 -->
|
|
|
|
|
+ <input type="hidden" name="brandList"/> <!-- 브랜드 리스트 -->
|
|
|
|
|
+ <input type="hidden" name="applyGoodsList"/> <!-- 적용상품 리스트 -->
|
|
|
|
|
+ <input type="hidden" name="exceptGoodsList"/> <!-- 제외상품 리스트 -->
|
|
|
|
|
+ <input type="hidden" name="burdenList"/> <!-- 업체 분담율 리스트 -->
|
|
|
|
|
+ <input type="hidden" name="sectionGbList"/> <!-- 다다익선 구간/혜택 리스트 -->
|
|
|
|
|
+
|
|
|
|
|
+ <div class="panelContent">
|
|
|
|
|
+ <ul class="notice">
|
|
|
|
|
+ <li>구성상품 등록시 기본값
|
|
|
|
|
+ <!-- 아이콘 툴팁 -->
|
|
|
|
|
+ <div class="iconTooltip">
|
|
|
|
|
+ <i class="fa fa-info" aria-hidden="true"></i>
|
|
|
|
|
+ <span class="left" style="width:400px; text-align:left;">
|
|
|
|
|
+ <!-- class="left" 또는 class="right" -->
|
|
|
|
|
+ - 상품상태 : 정보부족<br/>
|
|
|
|
|
+ - 정상가 : 구성상품의 정상가 합<br/>
|
|
|
|
|
+ - 판매가 : 구성상품 판매가 입력값의 합<br/>
|
|
|
|
|
+ - 브랜드코드 : 구성상품의 기준여부 'Y'상품의 브랜드코드<br/>
|
|
|
|
|
+ - 품목코드 : 구성상품의 기준여부 'Y'상품의 품목코드<br/>
|
|
|
|
|
+ - 포인트 : 구성상품의 기준여부 'Y'상품의 브랜드 포인트<br/>
|
|
|
|
|
+ - 배송비정책 : 구성상품의 기준여부 'Y'상품의 브랜드 배송비정책<br/>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- //아이콘 툴팁 -->
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ <table class="frmStyle">
|
|
|
|
|
+ <colgroup>
|
|
|
|
|
+ <col width="10%"/>
|
|
|
|
|
+ <col width="40%"/>
|
|
|
|
|
+ <col width="10%"/>
|
|
|
|
|
+ <col width="40%"/>
|
|
|
|
|
+ </colgroup>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>프로모션명<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <!-- 수정시 프로모션명 입력 : before -->
|
|
|
|
|
+ <input class="w50p" type="text" id="tmtbNm" name="tmtbNm" maxlength="30" required="required" data-valid-name="프로모션명"/>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>프로모션ID</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <!-- 프로모션 ID 입력 : before -->
|
|
|
|
|
+ <input class="w50p" type="text" id="disTmtbSq" name="disTmtbSq" maxlength="30" th:value="${params.tmtbSq}" disabled=""/>
|
|
|
|
|
+ <input type="hidden" id="tmtbSq" name="tmtbSq"/>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>행사 기간<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="text" class="schDate w100" name="tmtbStdt" maxlength="10" required="required" data-valid-name="시작일자"/>
|
|
|
|
|
+ ~
|
|
|
|
|
+ <input type="text" class="schDate w100" name="tmtbEddt" maxlength="10" required="required" data-valid-name="종료일자"/>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>상태</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <!-- 상태 입력 : before -->
|
|
|
|
|
+ <input class="w50p" type="text" id="disTmtbStat" name="disTmtbStat" maxlength="30" th:value="${params.tmtbStat}" disabled=""/>
|
|
|
|
|
+ <input type="hidden" id="tmtbStat" name="tmtbStat"/>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>할인 구간<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <label class="rdoBtn"><input type="radio" name="sectionGb" id="sectionGbQty" value="G810_10" checked="checked"/>수량</label>
|
|
|
|
|
+ <label class="rdoBtn"><input type="radio" name="sectionGb" id="sectionGbAmt" value="G810_11"/>금액</label>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <th>할인 구분<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <label class="rdoBtn"><input type="radio" name="dcWay" id="dcWayQty" value="G240_10" checked="checked"/>할인금액</label>
|
|
|
|
|
+ <label class="rdoBtn"><input type="radio" name="dcWay" id="dcWayAmt" value="G240_11"/>할인율</label>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>상품여부<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <label class="rdoBtn"><input type="radio" name="multiYn" id="multiYnY" value="Y" checked="checked"/>복합상품</label>
|
|
|
|
|
+ <label class="rdoBtn"><input type="radio" name="multiYn" id="multiYnN" value="N"/>단일상품</label>
|
|
|
|
|
+ </td>
|
|
|
|
|
+
|
|
|
|
|
+ </tr>
|
|
|
|
|
+
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="panelStyle" style="margin:unset;">
|
|
|
|
|
+ <!-- TITLE -->
|
|
|
|
|
+ <div class="panelTitle">
|
|
|
|
|
+ <h2>적용 대상 상품 등록</h2>
|
|
|
|
|
+ <span class="panelControl">
|
|
|
|
|
+ <i class="fa inner-fa-chevron-up"></i> <!-- 열림/닫힘 화살표 -->
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- //TITLE -->
|
|
|
|
|
+ <div class="inner-panelContent">
|
|
|
|
|
+ <!--<div><i class="fa fa-info-circle"></i> 브랜드/공급업체/상품 중 1가지는 필수로 지정하셔야 합니다.</div>
|
|
|
|
|
+ <div><i class="fa fa-info-circle"></i> 브랜드와 공급업체는 지정 시, 해당 브랜드의 공급처와 같은 AND조건으로 적용됩니다.(예시:A브랜드 상품 중 B업체 상품만)</div>
|
|
|
|
|
+ <div><i class="fa fa-info-circle"></i> 공급업체와 브랜드를 적용하시더라도 적용상품은 별개로 등록된 상품을 기준으로 사은품 지급기준으로 적용하실 수 있습니다.</div>-->
|
|
|
|
|
+
|
|
|
|
|
+ <div class="panelContent">
|
|
|
|
|
+ <table class="frmStyle">
|
|
|
|
|
+ <colgroup>
|
|
|
|
|
+ <col width="10%"/>
|
|
|
|
|
+ <col width="90%"/>
|
|
|
|
|
+ </colgroup>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>공급업체/브랜드</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <!-- 수정시 프로모션명 입력 : before -->
|
|
|
|
|
+ <div class="padding10 wid45">
|
|
|
|
|
+ <span>공급업체 설정</span>
|
|
|
|
|
+ <div class="padding10 inner-tb-solid">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddCompany">업체 추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnDeleteCompany">선택삭제</button>
|
|
|
|
|
+ <span>선택 : 00개</span>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <div id="gridFGPromotionCompanyList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="padding10 wid45">
|
|
|
|
|
+ <span>브랜드 설정</span>
|
|
|
|
|
+ <div class="padding10 inner-tb-solid">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddBrand">브랜드 추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnDeleteBrand">선택삭제</button>
|
|
|
|
|
+ <span>선택 : 00개</span>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <!-- 브랜드 선택 팝업(단수 선택 팝업... 복수를 새로 만들어야하는지 ? 아니면 변수처리해야하는지 ? -->
|
|
|
|
|
+ <div id="gridFGBrandList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>적용상품</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="padding10">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddApplyGoods">상품 추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnDeleteApplyGoods">선택삭제</button>
|
|
|
|
|
+ <span>선택 : 00개</span>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <div id="gridFGApplyGoodsList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="panelStyle" style="margin:unset;">
|
|
|
|
|
+ <!-- TITLE -->
|
|
|
|
|
+ <div class="panelTitle">
|
|
|
|
|
+ <h2>제외 대상 상품</h2>
|
|
|
|
|
+ <span class="panelControl">
|
|
|
|
|
+ <i class="fa inner-fa-chevron-up"></i> <!-- 열림/닫힘 화살표 -->
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- //TITLE -->
|
|
|
|
|
+ <div class="inner-panelContent">
|
|
|
|
|
+ <div class="panelContent">
|
|
|
|
|
+ <table class="frmStyle">
|
|
|
|
|
+ <colgroup>
|
|
|
|
|
+ <col width="10%"/>
|
|
|
|
|
+ <col width="90%"/>
|
|
|
|
|
+ </colgroup>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>제외 대상</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="padding10">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddExceptGoods">상품 추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnDeleteExtGoods">선택삭제</button>
|
|
|
|
|
+ <span>선택 : 00개</span>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <div id="gridFGExceptGoodsList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="panelStyle" style="margin:unset;">
|
|
|
|
|
+ <!-- TITLE -->
|
|
|
|
|
+ <div class="panelTitle">
|
|
|
|
|
+ <h2>할인 구간</h2>
|
|
|
|
|
+ <span class="panelControl">
|
|
|
|
|
+ <i class="fa inner-fa-chevron-up"></i> <!-- 열림/닫힘 화살표 -->
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- //TITLE -->
|
|
|
|
|
+ <div class="inner-panelContent">
|
|
|
|
|
+ <div class="panelContent">
|
|
|
|
|
+ <table class="frmStyle">
|
|
|
|
|
+ <colgroup>
|
|
|
|
|
+ <col width="10%"/>
|
|
|
|
|
+ <col width="90%"/>
|
|
|
|
|
+ </colgroup>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>할인 구간</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="padding10">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddSectionRow">행추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnDelSectionRow">행삭제</button>
|
|
|
|
|
+ <span>선택 : 00개</span>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <div id="gridSectionGbList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="panelStyle" style="margin:unset;">
|
|
|
|
|
+ <!-- TITLE -->
|
|
|
|
|
+ <div class="panelTitle">
|
|
|
|
|
+ <h2>업체 분담율</h2>
|
|
|
|
|
+ <span class="panelControl">
|
|
|
|
|
+ <i class="fa inner-fa-chevron-up"></i> <!-- 열림/닫힘 화살표 -->
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- //TITLE -->
|
|
|
|
|
+ <div class="inner-panelContent">
|
|
|
|
|
+ <div class="panelContent">
|
|
|
|
|
+ <table class="frmStyle">
|
|
|
|
|
+ <colgroup>
|
|
|
|
|
+ <col width="10%"/>
|
|
|
|
|
+ <col width="90%"/>
|
|
|
|
|
+ </colgroup>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>업체 분담율</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="padding10">
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddApplyBurden">업체추가</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnDelApplyBurden">선택삭제</button>
|
|
|
|
|
+ <span>선택 : 00개</span>
|
|
|
|
|
+ <br/>
|
|
|
|
|
+ <div id="gridApplyBurdenList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+
|
|
|
|
|
+ <ul class="panelBar">
|
|
|
|
|
+ <li class="right">
|
|
|
|
|
+ <!-- <th:block th:if="${sessionInfo.roleCd == 'G001_0000' OR sessionInfo.roleCd == 'G001_A000' OR sessionInfo.roleCd == 'G001_A101' OR sessionInfo.roleCd == 'G001_A100' OR sessionInfo.roleCd == 'G001_A001'}"> -->
|
|
|
|
|
+ <!--<button type="button" class="btn btnRight btn-success btn-lg" id="btnSearchList">목록</button>-->
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnMorebetterSave">저장</button>
|
|
|
|
|
+ <!--<button type="button" class="btn btnRight btn-success btn-lg" id="btnChangeStatIng">진행</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnPromotionDelete">삭제</button>
|
|
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnPromotionStop">중지</button>-->
|
|
|
|
|
+ <!-- </th:block> -->
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <script th:inline="javascript">
|
|
|
|
|
+ var FGAddGoodsStatList = gagajf.convertToArray([[${goodsStatList}]]); // 상품 상태 리스트
|
|
|
|
|
+ var sectionGbList = gagajf.convertToArray([[${sectionGbList}]]); // 할인구간 리스트
|
|
|
|
|
+ var dcWayList = gagajf.convertToArray([[${dcWayList}]]); // 할인구분 리스트
|
|
|
|
|
+
|
|
|
|
|
+ // 공급업체 리스트 설정
|
|
|
|
|
+ var columnFGCompanyList = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ {headerName: "공급처ID", field: "supplyCompCd", width: 120, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "공급업체명", field: "supplyCompNm", width: 150, cellClass: 'text-center'}
|
|
|
|
|
+ ];
|
|
|
|
|
+ // 브랜드 리스트 설정
|
|
|
|
|
+ var columnBrandList = [
|
|
|
|
|
+ {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: 150, cellClass: 'text-center'}
|
|
|
|
|
+ ];
|
|
|
|
|
+ // 적용상품 리스트 설정
|
|
|
|
|
+ var columnApplyGoodsList = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ {headerName: "Product ID", field: "goodsCd", width: 120, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "브랜드명", field: "brandEnm", width: 150, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "상품명", field: "goodsNm", width: 120, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "판매상태", field: "goodsStat" , width: 120, cellClass: 'text-center',
|
|
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(FGAddGoodsStatList) },
|
|
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(FGAddGoodsStatList, params.value); },
|
|
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(FGAddGoodsStatList, params.newValue); }
|
|
|
|
|
+ },
|
|
|
|
|
+ {headerName: "정상가", field: "listPrice", width: 120, cellClass: 'text-center', valueFormatter: function(params) {return params.value.addComma();}},
|
|
|
|
|
+ {headerName: "판매가", field: "currPrice", width: 120, cellClass: 'text-center', valueFormatter: function(params) {return params.value.addComma();}}
|
|
|
|
|
+ ];
|
|
|
|
|
+ // 제외상품 리스트 설정
|
|
|
|
|
+ var columnExceptGoodsList = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ {headerName: "Product ID", field: "goodsCd", width: 120, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "브랜드명", field: "brandEnm", width: 150, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "상품명", field: "goodsNm", width: 120, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "판매상태", field: "goodsStat" , width: 120, cellClass: 'text-center',
|
|
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(FGAddGoodsStatList) },
|
|
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(FGAddGoodsStatList, params.value); },
|
|
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(FGAddGoodsStatList, params.newValue); }
|
|
|
|
|
+ },
|
|
|
|
|
+ {headerName: "정상가", field: "listPrice", width: 120, cellClass: 'text-center',valueFormatter: function(params) {return params.value.addComma();}},
|
|
|
|
|
+ {headerName: "판매가", field: "currPrice", width: 120, cellClass: 'text-center',valueFormatter: function(params) {return params.value.addComma();}}
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // 업체분담율 리스트 설정
|
|
|
|
|
+ var columnApplyBurdenList = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ {headerName: "업체ID", field: "tmtbSupplyCd" , width: 120, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "분담율(%)", field: "tmtbBurdenRate" , width: 120, cellClass: 'text-center',editable: true, required: true},
|
|
|
|
|
+ {headerName: "사용여부", field: "useYn" , width: 120, cellClass: 'text-center'}
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // 구간 할인/혜택 설정
|
|
|
|
|
+ var columnSectionGbList = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ {headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
|
|
|
|
|
+ {headerName: "시퀀스", field: "tmtbSq", width: 100, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "할인구간", field: "sectionGb", width: 100, cellClass: 'text-center',
|
|
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(sectionGbList), required: true },
|
|
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(sectionGbList, params.value); },
|
|
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(sectionGbList, params.newValue); }
|
|
|
|
|
+ },
|
|
|
|
|
+ {headerName: "구간값", field: "sectionVal", width: 100, cellClass: 'text-right',
|
|
|
|
|
+ cellEditor: 'textCellEditor',
|
|
|
|
|
+ cellEditorParams: { maxlength: 50, required: true }
|
|
|
|
|
+ },
|
|
|
|
|
+ {headerName: "할인구분", field: "dcWay", width: 100, cellClass: 'text-center',
|
|
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(dcWayList), required: true },
|
|
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(dcWayList, params.value); },
|
|
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(dcWayList, params.newValue); }
|
|
|
|
|
+ },
|
|
|
|
|
+ {headerName: "할인값", field: "dcVal", width: 100, cellClass: 'text-right',
|
|
|
|
|
+ cellEditor: 'textCellEditor',
|
|
|
|
|
+ cellEditorParams: { maxlength: 50, required: true }
|
|
|
|
|
+ }
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // 공급업체 리스트 설정
|
|
|
|
|
+ var gridOptionsFGCompanyList = gagaAgGrid.getGridOptions(columnFGCompanyList);
|
|
|
|
|
+ gridOptionsFGCompanyList.rowSelection = "multiple";
|
|
|
|
|
+ // 브랜드 리스트 설정
|
|
|
|
|
+ var gridOptionsFGBrandList = gagaAgGrid.getGridOptions(columnBrandList);
|
|
|
|
|
+ gridOptionsFGBrandList.rowSelection = "multiple";
|
|
|
|
|
+ // 적용상품 리스트 설정
|
|
|
|
|
+ var gridOptionsFGApplyGoodsList = gagaAgGrid.getGridOptions(columnApplyGoodsList);
|
|
|
|
|
+ gridOptionsFGApplyGoodsList.rowSelection = "multiple";
|
|
|
|
|
+ // 제외상품 리스트 설정
|
|
|
|
|
+ var gridOptionsFGExceptGoodsList = gagaAgGrid.getGridOptions(columnExceptGoodsList);
|
|
|
|
|
+ gridOptionsFGExceptGoodsList.rowSelection = "multiple";
|
|
|
|
|
+ // 업체분담율 리스트 설정
|
|
|
|
|
+ var gridOptionsApplyBurdenList = gagaAgGrid.getGridOptions(columnApplyBurdenList);
|
|
|
|
|
+ gridOptionsApplyBurdenList.rowSelection = "multiple";
|
|
|
|
|
+ // 구간 할인/혜택 설정
|
|
|
|
|
+ var gridOptionsSectionGbList = gagaAgGrid.getGridOptions(columnSectionGbList);
|
|
|
|
|
+ // Grid editable
|
|
|
|
|
+ gridOptionsSectionGbList.defaultColDef.editable = true;
|
|
|
|
|
+ // Add on options
|
|
|
|
|
+ gridOptionsSectionGbList.suppressRowClickSelection = true;
|
|
|
|
|
+ gridOptionsSectionGbList.rowSelection = "multiple";
|
|
|
|
|
+ gridOptionsSectionGbList.stopEditingWhenGridLosesFocus = true;
|
|
|
|
|
+
|
|
|
|
|
+ $(document).ready(function() {
|
|
|
|
|
+ gagaAgGrid.createGrid("gridFGPromotionCompanyList", gridOptionsFGCompanyList);
|
|
|
|
|
+ gagaAgGrid.createGrid("gridFGBrandList", gridOptionsFGBrandList);
|
|
|
|
|
+ gagaAgGrid.createGrid("gridFGApplyGoodsList", gridOptionsFGApplyGoodsList);
|
|
|
|
|
+ gagaAgGrid.createGrid("gridFGExceptGoodsList", gridOptionsFGExceptGoodsList);
|
|
|
|
|
+ gagaAgGrid.createGrid("gridApplyBurdenList", gridOptionsApplyBurdenList);
|
|
|
|
|
+ gagaAgGrid.createGrid("gridSectionGbList", gridOptionsSectionGbList);
|
|
|
|
|
+
|
|
|
|
|
+ cfnCreateCalendar('#tmtbTerms', 'tmtbStdt', 'tmtbEddt', true, '행사기간', 'X');
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 저장 버튼 클릭시
|
|
|
|
|
+ $('#btnMorebetterSave').on('click', function() {
|
|
|
|
|
+ console.log('save 1818');
|
|
|
|
|
+ // 각 ag-grid list 수량
|
|
|
|
|
+ let supplyCompCnt = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList).length;
|
|
|
|
|
+ let brandCnt = gagaAgGrid.getAllRowData(gridOptionsFGBrandList).length;
|
|
|
|
|
+ let applyGoodsCnt = gagaAgGrid.getAllRowData(gridOptionsFGApplyGoodsList).length;
|
|
|
|
|
+ let exceptGoodsCnt = gagaAgGrid.getAllRowData(gridOptionsFGExceptGoodsList).length;
|
|
|
|
|
+ let applyBurdenCnt = gagaAgGrid.getAllRowData(gridOptionsApplyBurdenList).length;
|
|
|
|
|
+ let sectionGbCnt = gagaAgGrid.getAllRowData(gridOptionsSectionGbList).length;
|
|
|
|
|
+ console.log('supplyCompCnt>>'+supplyCompCnt);
|
|
|
|
|
+ console.log('brandCnt>>'+brandCnt);
|
|
|
|
|
+ console.log('applyGoodsCnt>>'+applyGoodsCnt);
|
|
|
|
|
+ console.log('exceptGoodsCnt>>'+exceptGoodsCnt);
|
|
|
|
|
+ console.log('applyBurdenCnt>>'+applyBurdenCnt);
|
|
|
|
|
+ console.log('sectionGbCnt>>'+sectionGbCnt);
|
|
|
|
|
+
|
|
|
|
|
+ // 행사기간 확인
|
|
|
|
|
+ let fromDate = $('#moreBetterForm input[name=tmtbStdt]').val();
|
|
|
|
|
+ let toDate = $('#moreBetterForm input[name=tmtbEddt]').val();
|
|
|
|
|
+
|
|
|
|
|
+ if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
|
|
|
|
|
+ mcxDialog.alert("행사 기간 시작일자와 종료일자를 입력하세요.");
|
|
|
|
|
+ $('#moreBetterForm input[name=tmtbStdt]').focus();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (fromDate > toDate) {
|
|
|
|
|
+ mcxDialog.alert("시작일자는 종료일자 보다 클 수 없습니다.");
|
|
|
|
|
+ $('#moreBetterForm input[name=tmtbStdt]').focus();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // validation
|
|
|
|
|
+ if (!gagajf.validation('#moreBetterForm'))
|
|
|
|
|
+ return false;
|
|
|
|
|
+
|
|
|
|
|
+ // disabled 값 넘겨주기
|
|
|
|
|
+ $('#moreBetterForm input[name=tmtbSq]').val($('#moreBetterForm input[name=disTmtbSq]').val());
|
|
|
|
|
+ $('#moreBetterForm input[name=tmtbStat]').val($('#moreBetterForm input[name=disTmtbStat]').val());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ mcxDialog.confirm('저장하시겠습니까?', {
|
|
|
|
|
+ cancelBtnText: "취소",
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function(){
|
|
|
|
|
+ var comp_idx = 0;
|
|
|
|
|
+ var brand_idx = 0;
|
|
|
|
|
+ var apply_idx = 0;
|
|
|
|
|
+ var except_idx = 0;
|
|
|
|
|
+ var burden_idx = 0;
|
|
|
|
|
+
|
|
|
|
|
+ var compAllData = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList);
|
|
|
|
|
+ /*$.each(compAllData, function(comp_idx, item) {
|
|
|
|
|
+ item.dispOrd = comp_idx+1;
|
|
|
|
|
+ });*/
|
|
|
|
|
+
|
|
|
|
|
+ var brandAllData = gagaAgGrid.getAllRowData(gridOptionsFGBrandList);
|
|
|
|
|
+ /*$.each(brandAllData, function(brand_idx, item) {
|
|
|
|
|
+ item.dispOrd = brand_idx+1;
|
|
|
|
|
+ });*/
|
|
|
|
|
+
|
|
|
|
|
+ var applyAllData = gagaAgGrid.getAllRowData(gridOptionsFGApplyGoodsList);
|
|
|
|
|
+ /*$.each(applyAllData, function(apply_idx, item) {
|
|
|
|
|
+ item.dispOrd = apply_idx+1;
|
|
|
|
|
+ });*/
|
|
|
|
|
+
|
|
|
|
|
+ var exceptAllData = gagaAgGrid.getAllRowData(gridOptionsFGExceptGoodsList);
|
|
|
|
|
+ /*$.each(exceptAllData, function(except_idx, item) {
|
|
|
|
|
+ item.dispOrd = except_idx+1;
|
|
|
|
|
+ });*/
|
|
|
|
|
+
|
|
|
|
|
+ var burdenAllData = gagaAgGrid.getAllRowData(gridOptionsApplyBurdenList);
|
|
|
|
|
+ /*$.each(burdenAllData, function(burden_idx, item) {
|
|
|
|
|
+ item.dispOrd = burden_idx+1;
|
|
|
|
|
+ });*/
|
|
|
|
|
+
|
|
|
|
|
+ var sectionGbAllData = gagaAgGrid.getAllRowData(gridOptionsSectionGbList);
|
|
|
|
|
+
|
|
|
|
|
+ var jsonSupplyCompData = JSON.stringify(compAllData);
|
|
|
|
|
+ $('#moreBetterForm input[name=supplyCompList]').val(jsonSupplyCompData);
|
|
|
|
|
+ var jsonBrandData = JSON.stringify(brandAllData);
|
|
|
|
|
+ $('#moreBetterForm input[name=brandList]').val(jsonBrandData);
|
|
|
|
|
+ var jsonApplyData = JSON.stringify(applyAllData);
|
|
|
|
|
+ $('#moreBetterForm input[name=applyGoodsList]').val(jsonApplyData);
|
|
|
|
|
+ var jsonExceptData = JSON.stringify(exceptAllData);
|
|
|
|
|
+ $('#moreBetterForm input[name=exceptGoodsList]').val(jsonExceptData);
|
|
|
|
|
+ var jsonBurdenData = JSON.stringify(burdenAllData);
|
|
|
|
|
+ $('#moreBetterForm input[name=burdenList]').val(jsonBurdenData);
|
|
|
|
|
+
|
|
|
|
|
+ var jsonSectionGbData = JSON.stringify(sectionGbAllData);
|
|
|
|
|
+ $('#moreBetterForm input[name=sectionGbList]').val(jsonSectionGbData);
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify($('#moreBetterForm').serializeObject());
|
|
|
|
|
+ gagajf.ajaxJsonSubmit($('#moreBetterForm').prop('action'), jsonData, function() {
|
|
|
|
|
+ //$('#btnSearch').trigger('click');
|
|
|
|
|
+ //$('#btnNew').trigger('click');
|
|
|
|
|
+ console.log('save 11111');
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 공급업체 설정 / 업체 추가 콜백함수
|
|
|
|
|
+ var fnSetPopupComapnyInfo = function(result) {
|
|
|
|
|
+ // 기존 리스트 데이터 for
|
|
|
|
|
+ for(let i = 0 ; i < result.length ; i++) {
|
|
|
|
|
+ let addChk = true, gridListValue = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList); // 받아온 모든 데이터
|
|
|
|
|
+
|
|
|
|
|
+ // 받아온 data for
|
|
|
|
|
+ for(let j = 0 ; j < gridListValue.length ; j++) {
|
|
|
|
|
+ // 동일한 data는 추가하지 않음
|
|
|
|
|
+ if(gridListValue[j].supplyCompCd == result[i].supplyCompCd) { addChk = false; } // 중복체크
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 중복되지 않은 데이터 리스트에 추가
|
|
|
|
|
+ if(addChk) { gagaAgGrid.addRowData(gridOptionsFGCompanyList, result[i], "supplyCompCd"); }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 브랜드 설정 / 브랜드 추가 콜백함수 (단수로 가져오므로 복수일 경우에 수정 확인 필요)
|
|
|
|
|
+ var fnSetPopupBrandInfo = function(result) {
|
|
|
|
|
+ for(let i = 0 ; i < result.length ; i++) {
|
|
|
|
|
+ let addChk = true, gridListValue = gagaAgGrid.getAllRowData(gridOptionsFGBrandList); // 받아온 모든 데이터
|
|
|
|
|
+
|
|
|
|
|
+ // 받아온 data for
|
|
|
|
|
+ for(let j = 0 ; j < gridListValue.length ; j++) {
|
|
|
|
|
+ if(gridListValue[j].brandCd == result[i].brandCd) { addChk = false; } // 중복체크
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 중복되지 않은 데이터 리스트에 추가
|
|
|
|
|
+ if(addChk) { gagaAgGrid.addRowData(gridOptionsFGBrandList, result[i], "brandCd"); }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 분담업체율 설정 / 업체 추가 콜백함수
|
|
|
|
|
+ var fnSetPopupApplyBurdenInfo = function(result) {
|
|
|
|
|
+ // 기존 리스트 데이터 for
|
|
|
|
|
+ for(let i = 0 ; i < result.length ; i++) {
|
|
|
|
|
+ console.log('old i::'+i+"::"+result[i].supplyCompCd);
|
|
|
|
|
+ let addChk = true, gridListValue = gagaAgGrid.getAllRowData(gridOptionsApplyBurdenList); // 받아온 모든 데이터
|
|
|
|
|
+
|
|
|
|
|
+ // 받아온 data for
|
|
|
|
|
+ for(let j = 0 ; j < gridListValue.length ; j++) {
|
|
|
|
|
+ console.log('new add j::'+j+":supplyCompCd:"+gridListValue[j].tmtbSupplyCd);
|
|
|
|
|
+ // 동일한 data는 추가하지 않음
|
|
|
|
|
+ if(gridListValue[j].tmtbSupplyCd == result[i].supplyCompCd) { addChk = false; } // 중복체크
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 중복되지 않은 데이터 리스트에 추가
|
|
|
|
|
+ if(addChk) {
|
|
|
|
|
+ //gagaAgGrid.addRowData(gridOptionsApplyBurdenList, result[i], "tmtbSupplyCd");
|
|
|
|
|
+ console.log('add compCd>>'+result[i].supplyCompCd);
|
|
|
|
|
+ console.log('add useYn>>'+result[i].useYn);
|
|
|
|
|
+ gagaAgGrid.addRowData(gridOptionsApplyBurdenList, {"tmtbSupplyCd" : result[i].supplyCompCd, "useYn" : result[i].useYn});
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 적용 상품 리스트 콜백함수
|
|
|
|
|
+ var fnSetPopupApplyGoodsInfo = function(result) {
|
|
|
|
|
+ gridAddGoodsList(gridOptionsFGApplyGoodsList, result);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 제외 상품 리스트 콜백함수
|
|
|
|
|
+ var fnSetPopupExceptGoodsInfo = function(result) {
|
|
|
|
|
+ gridAddGoodsList(gridOptionsFGExceptGoodsList, result);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // ag-grid 상품관련 list 콜백함수
|
|
|
|
|
+ function gridAddGoodsList(OriginGridListOption, result) {
|
|
|
|
|
+ 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, result[i], "goodsCd"); }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 공급업체 설정 업체 추가 버튼 클릭시
|
|
|
|
|
+ $('#moreBetterForm #btnAddCompany').on('click', function() {
|
|
|
|
|
+ cfnOpenCompanyListPopup("fnSetPopupComapnyInfo");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 브랜드 추가 버튼 클릭시 (복수 브랜드때 수정 필요)
|
|
|
|
|
+ $('#moreBetterForm #btnAddBrand').on('click', function() {
|
|
|
|
|
+ cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 적용 상품 추가 버튼 클릭시
|
|
|
|
|
+ $('#moreBetterForm #btnAddApplyGoods').on('click', function() {
|
|
|
|
|
+ cfnOpenGoodsPopup("fnSetPopupApplyGoodsInfo");
|
|
|
|
|
+ });
|
|
|
|
|
+ // 제외 상품 추가 버튼 클릭시
|
|
|
|
|
+ $('#moreBetterForm #btnAddExceptGoods').on('click', function() {
|
|
|
|
|
+ cfnOpenGoodsPopup("fnSetPopupExceptGoodsInfo");
|
|
|
|
|
+ });
|
|
|
|
|
+ // 업체분담율 추가 버튼 클릭시
|
|
|
|
|
+ $('#moreBetterForm #btnAddApplyBurden').on('click', function() {
|
|
|
|
|
+ //cfnOpenApplyBurdenPopup("fnSetPopupApplyBurdenInfo");
|
|
|
|
|
+ cfnOpenCompanyListPopup("fnSetPopupApplyBurdenInfo");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 공급업체 설정 선택삭제 버튼 클릭시
|
|
|
|
|
+ $('#moreBetterForm #btnDeleteCompany').on('click', function() {
|
|
|
|
|
+ gridOptionsFGCompanyList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGCompanyList)});
|
|
|
|
|
+ });
|
|
|
|
|
+ // 브랜드 설정 선택삭제 버튼 클릭시
|
|
|
|
|
+ $('#moreBetterForm #btnDeleteBrand').on('click', function() {
|
|
|
|
|
+ gridOptionsFGBrandList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGBrandList)});
|
|
|
|
|
+ });
|
|
|
|
|
+ // 적용상품 선택삭제 버튼 클릭시
|
|
|
|
|
+ $('#moreBetterForm #btnDeleteApplyGoods').on('click', function() {
|
|
|
|
|
+ gridOptionsFGApplyGoodsList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGApplyGoodsList)});
|
|
|
|
|
+ });
|
|
|
|
|
+ // 제외상품 선택삭제 버튼 클릭시
|
|
|
|
|
+ $('#moreBetterForm #btnDeleteExtGoods').on('click', function() {
|
|
|
|
|
+ gridOptionsFGExceptGoodsList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGExceptGoodsList)});
|
|
|
|
|
+ });
|
|
|
|
|
+ // 업체분담율 선택삭제 버튼 클릭시
|
|
|
|
|
+ $('#moreBetterForm #btnDelApplyBurden').on('click', function() {
|
|
|
|
|
+ gridOptionsApplyBurdenList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsApplyBurdenList)});
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //패널영역 줄이기
|
|
|
|
|
+ $(document).on("click",".panelControl .inner-fa-chevron-up", function() {
|
|
|
|
|
+ $(this).parent().parent().parent().find(".inner-panelContent").slideUp(100);
|
|
|
|
|
+ $(this).attr("class","fa inner-fa-chevron-down");
|
|
|
|
|
+ });
|
|
|
|
|
+ //패널영역 펼치기
|
|
|
|
|
+ $(document).on("click",".panelControl .inner-fa-chevron-down", function() {
|
|
|
|
|
+ $(this).parent().parent().parent().find(".inner-panelContent").slideDown(100);
|
|
|
|
|
+ $(this).attr("class","fa inner-fa-chevron-up");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 창 닫기
|
|
|
|
|
+ var fnMorebetterFormClose = function(){
|
|
|
|
|
+ uifnPopupClose('popupMorebetterReg');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 행추가
|
|
|
|
|
+ $('#btnAddSectionRow').on('click', function() {
|
|
|
|
|
+ var tmtbSq = $('#moreBetterForm input[name=disTmtbSq]').val();
|
|
|
|
|
+ var sectionGbValue = $('input:radio[name="sectionGb"]:checked').val();
|
|
|
|
|
+ var dcWayValue = $('input:radio[name="dcWay"]:checked').val();
|
|
|
|
|
+
|
|
|
|
|
+ var data = { tmtbSq: tmtbSq ,sectionGb: sectionGbValue, sectionVal: null, dcWay: dcWayValue, dcVal: null };
|
|
|
|
|
+ gagaAgGrid.addRowData(gridOptionsSectionGbList, data, "sectionVal");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 행삭제
|
|
|
|
|
+ $('#btnDelSectionRow').on('click', function() {
|
|
|
|
|
+ var selectedData = gridOptionsSectionGbList.api.getSelectedRows();
|
|
|
|
|
+ var removedData = gagaAgGrid.removeRowData(gridOptionsSectionGbList);
|
|
|
|
|
+
|
|
|
|
|
+ if (selectedData.length == 0) {
|
|
|
|
|
+ mcxDialog.alert('선택된 행이 없습니다.');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (removedData.length > 0) {
|
|
|
|
|
+
|
|
|
|
|
+ mcxDialog.confirm('삭제하시겠습니까?', {
|
|
|
|
|
+ cancelBtnText: "취소",
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function(){
|
|
|
|
|
+ var deleteData = [];
|
|
|
|
|
+
|
|
|
|
|
+ $.each(removedData, function(idx, item) {
|
|
|
|
|
+ deleteData.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify(deleteData);
|
|
|
|
|
+ gagajf.ajaxJsonSubmit('/morebetter/sectionVal/delete', jsonData, fnSearch);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 할인구간 선택 시 기본 조건 변경
|
|
|
|
|
+ $("#moreBetterForm input[name=sectionGb]").bind('click change', function () {
|
|
|
|
|
+ var sectionGbValue = $(this).val();
|
|
|
|
|
+ var dcWayValue = $('input:radio[name="dcWay"]:checked').val();
|
|
|
|
|
+ var loopRowData = gagaAgGrid.getAllRowData(gridOptionsSectionGbList);
|
|
|
|
|
+
|
|
|
|
|
+ if (loopRowData.length == 0) {
|
|
|
|
|
+ mcxDialog.alert('ROW 데이터가 없습니다.');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for(i=0; i<loopRowData.length; i++){
|
|
|
|
|
+ loopRowData[i].sectionGb = sectionGbValue;
|
|
|
|
|
+ loopRowData[i].sectionVal = "";
|
|
|
|
|
+ loopRowData[i].dcWay = dcWayValue;
|
|
|
|
|
+ loopRowData[i].dcVal = "";
|
|
|
|
|
+ }
|
|
|
|
|
+ gridOptionsSectionGbList.api.setRowData(loopRowData);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 할인구분 선택 시 기본 조건 변경
|
|
|
|
|
+ $("#moreBetterForm input[name=dcWay]").bind('click change', function () {
|
|
|
|
|
+ var sectionGbValue = $('input:radio[name="sectionGb"]:checked').val();
|
|
|
|
|
+ var dcWayValue = $(this).val();
|
|
|
|
|
+ var loopRowData = gagaAgGrid.getAllRowData(gridOptionsSectionGbList);
|
|
|
|
|
+
|
|
|
|
|
+ if (loopRowData.length == 0) {
|
|
|
|
|
+ mcxDialog.alert('ROW 데이터가 없습니다.');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for(i=0; i<loopRowData.length; i++){
|
|
|
|
|
+ loopRowData[i].sectionGb = sectionGbValue;
|
|
|
|
|
+ loopRowData[i].sectionVal = "";
|
|
|
|
|
+ loopRowData[i].dcWay = dcWayValue;
|
|
|
|
|
+ loopRowData[i].dcVal = "";
|
|
|
|
|
+ }
|
|
|
|
|
+ gridOptionsSectionGbList.api.setRowData(loopRowData);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $(document).ready(function() {
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ </script>
|
|
|
|
|
+</html>
|