|
|
@@ -0,0 +1,746 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="ko"
|
|
|
+ xmlns:th="http://www.thymeleaf.org">
|
|
|
+<!--
|
|
|
+ *******************************************************************************
|
|
|
+ * @source : BrandForm.html
|
|
|
+ * @desc : 브랜드관리 Page
|
|
|
+ *============================================================================
|
|
|
+ * STYLE24
|
|
|
+ * Copyright(C) 2020 TSIT, All rights reserved.
|
|
|
+ *============================================================================
|
|
|
+ * VER DATE AUTHOR DESCRIPTION
|
|
|
+ * === =========== ========== =============================================
|
|
|
+ * 1.0 2020.11.04 gagamel 최초 작성
|
|
|
+ *******************************************************************************
|
|
|
+ -->
|
|
|
+ <div id="main">
|
|
|
+ <!-- 메인타이틀 영역 -->
|
|
|
+ <div class="main-title">
|
|
|
+ </div>
|
|
|
+ <!-- //메인타이틀 영역 -->
|
|
|
+
|
|
|
+ <!-- 메뉴 설명 -->
|
|
|
+ <div class="infoBox menu-desc">
|
|
|
+ </div>
|
|
|
+ <!-- //메뉴 설명 -->
|
|
|
+
|
|
|
+ <!-- 검색조건 영역 -->
|
|
|
+ <div class="panelStyle">
|
|
|
+ <form id="searchForm" name="searchForm" action="#" th:action="@{'/business/brand/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
|
|
|
+ <table class="frmStyle" aria-describedby="검색조건">
|
|
|
+ <colgroup>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col style="width:15%;"/>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col style="width:15%;"/>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col/>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col style="width:8%;"/>
|
|
|
+ </colgroup>
|
|
|
+ <tr>
|
|
|
+ <th>공급업체</th>
|
|
|
+ <td>
|
|
|
+ <select name="supplyComp">
|
|
|
+ <option value="">[전체]</option>
|
|
|
+ <option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ <th>유통구분</th>
|
|
|
+ <td>
|
|
|
+ <select name="distributionGb">
|
|
|
+ <option value="">[전체]</option>
|
|
|
+ <option th:if="${distributionGbList}" th:each="oneData, status : ${distributionGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ <th>검색어</th>
|
|
|
+ <td>
|
|
|
+ <input type="text" name="searchTxt" placeholder="브랜드코드/브랜드국문명/브랜드영문명/브랜드그룹명" maxlength="20"/>
|
|
|
+ </td>
|
|
|
+ <th>사용여부</th>
|
|
|
+ <td>
|
|
|
+ <select name="useYn">
|
|
|
+ <option value="">[전체]</option>
|
|
|
+ <option value="Y">[Y] Yes</option>
|
|
|
+ <option value="N">[N] No</option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <ul class="panelBar">
|
|
|
+ <li class="center">
|
|
|
+ <button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
|
|
|
+ <button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset();">초기화</button>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ <!-- 검색조건 영역 -->
|
|
|
+
|
|
|
+ <!-- 리스트 영역 -->
|
|
|
+ <div class="panelStyle">
|
|
|
+ <!-- 버튼 배치 영역 -->
|
|
|
+ <ul class="panelBar">
|
|
|
+ <li class="right">
|
|
|
+ <button type="button" class="btn btn-default btn-lg" id="btnExcel">엑셀다운로드</button>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <!-- //버튼 배치 영역 -->
|
|
|
+
|
|
|
+ <div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
|
|
|
+ </div>
|
|
|
+ <!-- //리스트 영역 -->
|
|
|
+
|
|
|
+ <!-- 등록/수정 -->
|
|
|
+ <div class="panelStyle">
|
|
|
+ <form id="detailForm" name="detailForm" action="#" th:action="@{'/business/brand/save'}">
|
|
|
+ <input type="hidden" name="mode" value="C"/>
|
|
|
+
|
|
|
+ <table class="frmStyle" aria-describedby="등록/수정 폼">
|
|
|
+ <colgroup>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col style="width:40%;"/>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col/>
|
|
|
+ </colgroup>
|
|
|
+ <tr>
|
|
|
+ <th>브랜드코드</th>
|
|
|
+ <td>
|
|
|
+ <select name="brandGb">
|
|
|
+ <option value="Y">자사브랜드</option>
|
|
|
+ <option value="N">입점브랜드</option>
|
|
|
+ </select>
|
|
|
+ <input type="text" class="w100" name="brandCd" placeholder="자동생성" maxlength="5" required="required" data-valid-name="브랜드코드" disabled="disabled"/>
|
|
|
+ <span class="marL10 cRed"><i class="fa fa-info-circle" aria-hidden="true"></i> 자사브랜드인 경우 먼저 WMS에 등록되어 있는지를 확인해야 합니다.</span>
|
|
|
+ </td>
|
|
|
+ <th>브랜드명<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w200" name="brandEnm" placeholder="브랜드영문명" maxlength="50" required="required" data-valid-name="브랜드영문명"/> /
|
|
|
+ <input type="text" class="w200" name="brandKnm" placeholder="브랜드국문명" maxlength="50" required="required" data-valid-name="브랜드국문명"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>브랜드그룹명<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w200" name="brandGrpNm" maxlength="50" required="required" data-valid-name="브랜드그룹명"/>
|
|
|
+ </td>
|
|
|
+ <th>공급업체<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <select name="supplyCompCd" required="required" data-valid-name="공급업체">
|
|
|
+ <option value="">[선택]</option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>유통구분<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <select name="distributionGb" required="required" data-valid-name="유통구분">
|
|
|
+ <option value="">[선택]</option>
|
|
|
+ <option th:if="${distributionGbList}" th:each="oneData, status : ${distributionGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ <th>출고처<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <select name="delvLocCd">
|
|
|
+ <option value="">[선택]</option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>기본배송비<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w100 aR" name="delvFee" maxlength="6" required="required" data-valid-name="기본배송비" data-valid-type="integer"/>원
|
|
|
+ <span class="marL10 cRed"><i class="fa fa-info-circle" aria-hidden="true"></i> 변경된 배송비는 이후 등록된 상품부터 적용됩니다.</span>
|
|
|
+ </td>
|
|
|
+ <th>무료배송기준<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w100 aR" name="minOrdAmt" maxlength="7" required="required" data-valid-name="무료배송기준" data-valid-type="integer"/>원 이상 구매시
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>포인트적립율(PC정상)<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w100 aR" name="pntPrate10" maxlength="3" required="required" data-valid-name="포인트적립율(PC정상)" data-valid-type="numeric"/>%
|
|
|
+ </td>
|
|
|
+ <th>포인트적립율(모바일정상)<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w100 aR" name="pntMrate10" maxlength="3" required="required" data-valid-name="포인트적립율(모바일정상)" data-valid-type="numeric"/>%
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>포인트적립율(PC이월)<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w100 aR" name="pntPrate20" maxlength="3" required="required" data-valid-name="포인트적립율(PC이월)" data-valid-type="numeric"/>%
|
|
|
+ </td>
|
|
|
+ <th>포인트적립율(모바일이월)<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w100 aR" name="pntMrate20" maxlength="3" required="required" data-valid-name="포인트적립율(모바일이월)" data-valid-type="numeric"/>%
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr id="sellFeeRateTr" class="off">
|
|
|
+ <th>판매수수료율<i class="required" title="필수"></i></th>
|
|
|
+ <td colspan="3">
|
|
|
+ <input type="text" class="w100 aR" name="sellFeeRate" maxlength="3" required="required" data-valid-name="판매수수료율" data-valid-type="numeric"/>%
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr id="brandMdArea" class="off">
|
|
|
+ <th>담당MD</th>
|
|
|
+ <td colspan="3" id="tdBrandMd">
|
|
|
+ <div>
|
|
|
+ <input type="text" class="w100" name="mdNm" onkeypress="if( event.keyCode==13 ){$('#mdIdx').val(0); cfnOpenMdListPopup('fnMdSearchCallback', $(this).val());}"/>
|
|
|
+ <button type="button" class="btn btn-info btn-lg" id="btnSearchBrandMd" onclick="$('#mdIdx').val(0); cfnOpenMdListPopup('fnMdSearchCallback');">조회</button>
|
|
|
+ <input type="text" class="w100" name="mdNo" readonly="readonly"/>
|
|
|
+ <span class="marL10 cBlue"><i class="fa fa-info-circle" aria-hidden="true"></i> 정상/이월 모두 관리합니다.</span>
|
|
|
+ <button type="button" class="btn btn-base btn-lg" id="btnAddBrandMd">추가</button>
|
|
|
+ <button type="button" class="btn btn-success btn-lg" id="btnUpdateBrandMd">담당MD 수정</button>
|
|
|
+ <span class="marL10 cRed"><i class="fa fa-info-circle" aria-hidden="true"></i> [담당MD 수정] 버튼을 눌러야 적용됩니다.</span>
|
|
|
+ <input type="hidden" id="mdIdx" />
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+<!-- <tr> -->
|
|
|
+<!-- <th>브랜드이미지</th> -->
|
|
|
+<!-- <td colspan="3"> -->
|
|
|
+<!-- <div class="uFile w300"> -->
|
|
|
+<!-- <input id="file" name="file" type="file" class="uFileInput w300"/> -->
|
|
|
+<!-- <label for="file" class="uFileLabel">파일선택</label> -->
|
|
|
+<!-- <input type="hidden" name="imgFileNm" id="imgFileNm"/> -->
|
|
|
+<!-- </div> -->
|
|
|
+<!-- <input type="hidden" name="uploadDefaultUrl" id="uploadDefaultUrl" th:value="${@environment.getProperty('upload.default.view') + '/display/'}"/> -->
|
|
|
+<!-- <div id="imgView" class="off"> -->
|
|
|
+<!-- <img id="bannerPreViewUrl" src="" style="height:100px"/> -->
|
|
|
+<!-- </div> -->
|
|
|
+<!-- </td> -->
|
|
|
+<!-- </tr> -->
|
|
|
+ <tr id="siteArea" class="off">
|
|
|
+ <th>전시사이트</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <label class="chkBox" th:if="${siteList}" th:each="oneData, status : ${siteList}" ><input type="checkbox" name="siteCd" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/></label>
|
|
|
+ <button type="button" class="btn btn-success btn-lg" id="btnSiteBrandSave">전시사이트 수정</button>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>노출순서<i class="required" title="필수"></i></th>
|
|
|
+ <td class="infoTxt">
|
|
|
+ <input type="text" class="w100 aR" name="dispOrd" maxlength="5" required="required" data-valid-name="노출순서" data-valid-type="numeric"/>
|
|
|
+ </td>
|
|
|
+ <th>사용여부<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <label class="rdoBtn"><input type="radio" name="useYn" value="Y" checked="checked">Yes</label>
|
|
|
+ <label class="rdoBtn"><input type="radio" name="useYn" value="N">No</label>
|
|
|
+ <span class="marL10 cRed"><i class="fa fa-info-circle" aria-hidden="true"></i> No에 체크하면 "프론트"에 노출되지 않습니다.</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <!-- 버튼 배치 영역 -->
|
|
|
+ <ul class="panelBar">
|
|
|
+ <li class="right">
|
|
|
+ <button type="button" class="btn btn-info btn-lg" id="btnNew">신규</button>
|
|
|
+ <button type="button" class="btn btn-success btn-lg" id="btnSave">저장</button>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <!-- //버튼 배치 영역 -->
|
|
|
+ </div>
|
|
|
+ <!-- 등록/수정 -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+<script th:inline="javascript">
|
|
|
+/*<![CDATA[*/
|
|
|
+ let supplyCompList = gagajf.convertToArray([[${supplyCompList}]]);
|
|
|
+ let distributionGbList = gagajf.convertToArray([[${distributionGbList}]]);
|
|
|
+
|
|
|
+ let columnDefs = [
|
|
|
+ {
|
|
|
+ headerName: "브랜드코드", field: "brandCd", width: 100, cellClass: 'text-center',
|
|
|
+ cellRenderer: function(params) {
|
|
|
+ return '<a href="javascript:void(0);">' + params.value + '</a>';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {headerName: "브랜드영문명", field: "brandEnm", width: 150, cellClass: 'text-center'},
|
|
|
+ {headerName: "브랜드국문명", field: "brandKnm", width: 150, cellClass: 'text-center'},
|
|
|
+ {headerName: "브랜드그룹명", field: "brandGrpNm", width: 150, cellClass: 'text-center'},
|
|
|
+ {
|
|
|
+ headerName: "공급업체", field: "supplyCompCd", width: 150, cellClass: 'text-center',
|
|
|
+ valueGetter: function (params) {
|
|
|
+ return gagaAgGrid.lookupValue(supplyCompList, params.data.supplyCompCd);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName: "유통구분", field: "distributionGb", width: 150, cellClass: 'text-center',
|
|
|
+ valueGetter: function (params) {
|
|
|
+ return gagaAgGrid.lookupValue(distributionGbList, params.data.distributionGb);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {headerName: "출고처코드", field: "delvLocCd", width: 120, cellClass: 'text-center'},
|
|
|
+ {headerName: "출고처명", field: "delvLocNm", width: 150, cellClass: 'text-center'},
|
|
|
+ {headerName: "ERP브랜드코드", field: "erpBrandCd", width: 120, cellClass: 'text-center', hide: true},
|
|
|
+ {
|
|
|
+ headerName: "무료배송비기준",
|
|
|
+ children : [
|
|
|
+ {headerName: "기본배송비", field: "delvFee", width: 120, cellClass: 'text-center', valueFormatter: function(params) { return Number(params.value).addComma(); }},
|
|
|
+ {headerName: "최소주문금액", field: "minOrdAmt", width: 120, cellClass: 'text-center', valueFormatter: function(params) { return Number(params.value).addComma(); }}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {headerName: "판매수수료율(%)", field: "sellFeeRate", width: 150, cellClass: 'text-center'},
|
|
|
+ {
|
|
|
+ headerName: "포인트적립율(%)",
|
|
|
+ children : [
|
|
|
+ {headerName: "PC정상", field: "pntPrate10", width: 100, cellClass: 'text-center'},
|
|
|
+ {headerName: "모바일정상", field: "pntMrate10", width: 100, cellClass: 'text-center'},
|
|
|
+ {headerName: "PC이월", field: "pntPrate20", width: 100, cellClass: 'text-center'},
|
|
|
+ {headerName: "모바일이월", field: "pntMrate20", width: 100, cellClass: 'text-center'}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {headerName: "브랜드이미지", field: "brandImg", width: 150, cellClass: 'text-center', hide: true},
|
|
|
+ {headerName: "노출순서", field: "dispOrd", width: 150, cellClass: 'text-center', hide: true},
|
|
|
+ {headerName: "사용여부", field: "useYn", width: 80, cellClass: 'text-center'}
|
|
|
+ ];
|
|
|
+
|
|
|
+ let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
|
|
|
+
|
|
|
+ // Cell click
|
|
|
+ gridOptions.onCellClicked = function(event) {
|
|
|
+ if (event.colDef.field != 'brandCd')
|
|
|
+ return;
|
|
|
+
|
|
|
+ $("#detailForm select[name=brandGb]").attr("disabled", "disabled");
|
|
|
+ $("#detailForm input[name=brandCd]").val(event.data.brandCd);
|
|
|
+ $("#detailForm input[name=brandEnm]").val(event.data.brandEnm);
|
|
|
+ $("#detailForm input[name=brandKnm]").val(event.data.brandKnm);
|
|
|
+ $("#detailForm input[name=brandGrpNm]").val(event.data.brandGrpNm);
|
|
|
+ $("#detailForm input[name=erpBrandCd]").val(event.data.erpBrandCd);
|
|
|
+ $("#detailForm select[name=supplyCompCd]").val(event.data.supplyCompCd);
|
|
|
+ $("#detailForm select[name=distributionGb]").val(event.data.distributionGb);
|
|
|
+ $("#detailForm select[name=delvLocCd]").val(event.data.delvLocCd);
|
|
|
+ $("#detailForm input[name=delvFee]").val(Number(event.data.delvFee).addComma());
|
|
|
+ $("#detailForm input[name=minOrdAmt]").val(Number(event.data.minOrdAmt).addComma());
|
|
|
+ $("#detailForm input[name=sellFeeRate]").val(event.data.sellFeeRate);
|
|
|
+ $("#detailForm input[name=pntPrate10]").val(event.data.pntPrate10);
|
|
|
+ $("#detailForm input[name=pntMrate10]").val(event.data.pntMrate10);
|
|
|
+ $("#detailForm input[name=pntPrate20]").val(event.data.pntPrate20);
|
|
|
+ $("#detailForm input[name=pntMrate20]").val(event.data.pntMrate20);
|
|
|
+ $("#detailForm input:radio[name=useYn]:input[value=" + event.data.useYn + "]").click();
|
|
|
+ $("#detailForm input[name=dispOrd]").val(event.data.dispOrd);
|
|
|
+
|
|
|
+ // 담당MD 영역 노출
|
|
|
+ $("#brandMdArea").removeClass("off").addClass("on");
|
|
|
+ fnGetBrandMdList(event.data.brandCd);
|
|
|
+
|
|
|
+ $("#detailForm input[name=mode]").val("U");
|
|
|
+
|
|
|
+// // 브랜드이미지 영역 노출
|
|
|
+// var brandImg = event.data.brandImg;
|
|
|
+// if (!gagajf.isNull(brandImg)) {
|
|
|
+// $("#imgFileNm").val(brandImg);
|
|
|
+// $("#bannerPreViewUrl").attr('src', $("#uploadDefaultUrl").val()+brandImg);
|
|
|
+// $("#imgView").removeClass("off").addClass("on");
|
|
|
+// } else {
|
|
|
+// $("#imgFileNm").val('');
|
|
|
+// }
|
|
|
+// $('#detailForm input[name=file]').closest('div').find('label').text('파일선택');
|
|
|
+
|
|
|
+ // 전시사이트 영역 노출
|
|
|
+ $("#siteArea").removeClass("off").addClass("on");
|
|
|
+ fnGetBrandSiteList(event.data.brandCd);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 조회
|
|
|
+ $('#btnSearch').on('click', function() {
|
|
|
+ // Fetch data
|
|
|
+ gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
|
|
|
+ });
|
|
|
+
|
|
|
+ // 브랜드구분 변경 시
|
|
|
+ $('#detailForm select[name=brandGb]').on('change', function() {
|
|
|
+ $.getJSON('/renderer/supply/company/list/' + $(this).val()
|
|
|
+ , function(result, status) {
|
|
|
+ $('#detailForm select[name=supplyCompCd]').empty().append('<option value="">[선택]</option>');
|
|
|
+ $.each(result, function(idx, item) {
|
|
|
+ var optionHtml = '<option value="' + item.cd + '">[' + item.cd + '] '+ item.cdNm + '</option>\n';
|
|
|
+ $('#detailForm select[name=supplyCompCd]').append(optionHtml);
|
|
|
+ });
|
|
|
+ $('#detailForm select[name=supplyCompCd]').trigger('change');
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 공급업체 변경 시
|
|
|
+ $('#detailForm select[name=supplyCompCd]').on('change', function() {
|
|
|
+ if (gagajf.isNull($(this).val())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var data = { supplyCompCd : $(this).val() };
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
+ gagajf.ajaxJsonSubmit('/business/supply/company/list', jsonData, function(result) {
|
|
|
+ if (result.length == 0) {
|
|
|
+ $("#detailForm input[name=delvFee]").val(0);
|
|
|
+ $("#detailForm input[name=minOrdAmt]").val(0);
|
|
|
+ $("#detailForm input[name=sellFeeRate]").val(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#detailForm input[name=delvFee]").val(Number(result[0].delvFee).addComma());
|
|
|
+ $("#detailForm input[name=minOrdAmt]").val(Number(result[0].minOrdAmt).addComma());
|
|
|
+ $("#detailForm input[name=sellFeeRate]").val(result[0].sellFeeRate);
|
|
|
+
|
|
|
+ // 출고처 정보
|
|
|
+ $.getJSON('/renderer/delvloc/list/' + result[0].supplyCompCd
|
|
|
+ , function(delvLocList, status) {
|
|
|
+ $('#detailForm select[name=delvLocCd]').empty().append('<option value="">[선택]</option>');
|
|
|
+ $.each(delvLocList, function(idx, item) {
|
|
|
+ var optionHtml = '<option value="' + item.cd + '">[' + item.cd + '] '+ item.cdNm + '</option>\n';
|
|
|
+ $('#detailForm select[name=delvLocCd]').append(optionHtml);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 브랜드담당MD 목록
|
|
|
+ var fnGetBrandMdList = function(brandCd) {
|
|
|
+ $.getJSON('/business/brand/md/list/' + brandCd
|
|
|
+ , function(result, status) {
|
|
|
+ $("#tdBrandMd input[name=mdNm]").val('');
|
|
|
+ $("#tdBrandMd input[name=mdNo]").val('');
|
|
|
+
|
|
|
+ $("#tdBrandMd div").each(function(idx) {
|
|
|
+ if (idx > 0) {
|
|
|
+ $(this).remove();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ for (var i = 0; i < result.length; i++) {
|
|
|
+ if (result[i].formalGb == '10') {
|
|
|
+ if (i == 0) {
|
|
|
+ $("#brandMdArea input[name=mdNm]").val(result[i].mdNm);
|
|
|
+ $("#brandMdArea input[name=mdNo]").val(result[i].mdNo);
|
|
|
+ } else {
|
|
|
+ $("#tdBrandMd").append(getBrandMdTag(result[i].mdNo, result[i].mdNm));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 브랜드 노출사이트 목록
|
|
|
+ var fnGetBrandSiteList = function(brandCd) {
|
|
|
+ $.getJSON('/business/brand/site/list/' + brandCd
|
|
|
+ , function(result, status) {
|
|
|
+ $("#detailForm input[type=checkbox]").removeClass("checked");
|
|
|
+ $("#detailForm input[type=checkbox]").attr("checked", false);
|
|
|
+ result.forEach(function(item) {
|
|
|
+ $("#siteArea label").each(function() {
|
|
|
+ if (item.siteCd == $(this).find("input:checkbox[name=siteCd]").val()) {
|
|
|
+ $(this).find("input:checkbox[name=siteCd]").attr("checked", true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#detailForm input[type=checkbox][checked]").parent("label").addClass("checked");
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 업체 변경 정보
|
|
|
+ var fnChangeSupplyComp = function(brandGb){
|
|
|
+// let pntRate = [[${pntRate}]];
|
|
|
+// $("#detailForm select[name=delvLocCd]").html('<option value="">[선택]</option>');
|
|
|
+// $("#detailForm select[name=delvLocCd]").val('');
|
|
|
+// var supplyCompCd = $("#supplyCompCdTd" + brandGb + " select[name=supplyCompCd]").val();
|
|
|
+// var formId = '#detailForm';
|
|
|
+// if(typeof supplyCompCd!='undefined' && supplyCompCd!=''){
|
|
|
+// if(brandGb=="S"){
|
|
|
+// $("#detailForm input[name=pntPrate10]").val(policy.sgoodsPntPrate10);
|
|
|
+// $("#detailForm input[name=pntMrate10]").val(policy.sgoodsPntMrate10);
|
|
|
+// $("#detailForm input[name=pntPrate20]").val(policy.sgoodsPntPrate20);
|
|
|
+// $("#detailForm input[name=pntMrate20]").val(policy.sgoodsPntMrate20);
|
|
|
+// }else if(brandGb=="E"){
|
|
|
+// $("#detailForm input[name=pntPrate10]").val(policy.egoodsPntPrate10);
|
|
|
+// $("#detailForm input[name=pntMrate10]").val(policy.egoodsPntMrate10);
|
|
|
+// $("#detailForm input[name=pntPrate20]").val(policy.egoodsPntPrate20);
|
|
|
+// $("#detailForm input[name=pntMrate20]").val(policy.egoodsPntMrate20);
|
|
|
+// }
|
|
|
+// var data = {'supplyCompCd' : supplyCompCd};
|
|
|
+// var jsonData = JSON.stringify(data);
|
|
|
+// gagajf.ajaxJsonSubmit('/business/supply/company/list', jsonData, fnSupplyCompCallback);
|
|
|
+// }else{
|
|
|
+// $("#detailForm input[name=delvFee]").val('');
|
|
|
+// $("#detailForm input[name=minOrdAmt]").val('');
|
|
|
+// $("#detailForm input[name=sellFeeRate]").val('');
|
|
|
+// $("#detailForm input[name=pntPrate10]").val('');
|
|
|
+// $("#detailForm input[name=pntMrate10]").val('');
|
|
|
+// $("#detailForm input[name=pntPrate20]").val('');
|
|
|
+// $("#detailForm input[name=pntMrate20]").val('');
|
|
|
+// }
|
|
|
+ }
|
|
|
+
|
|
|
+// //이미지 클릭시 미리보기
|
|
|
+// $("#bannerPreViewUrl").click(function(){
|
|
|
+// cfnOpenImagePreViewPopup('bannerPreimgView',$('#bannerPreViewUrl').attr('src'));
|
|
|
+// });
|
|
|
+
|
|
|
+// //첨부파일 등록
|
|
|
+// $('#detailForm input[name=file]').on('change', function() {
|
|
|
+// var file = this.files[0];
|
|
|
+// file.name = 'test';
|
|
|
+// if (typeof(file) == 'undefined'){
|
|
|
+// return;
|
|
|
+// }
|
|
|
+
|
|
|
+// gagajf.ajaxFileUpload('/common/file/upload?subDir=/display'
|
|
|
+// , file
|
|
|
+// , function(result) {
|
|
|
+// $('#detailForm input[name=imgFileNm]').val(result.newFileName);
|
|
|
+// $("#bannerPreViewUrl").attr('src', $("#uploadDefaultUrl").val()+result.newFileName);
|
|
|
+// $("#imgView").removeClass("off").addClass("on");
|
|
|
+// uifnFitGrid();
|
|
|
+// }
|
|
|
+// , 'image'
|
|
|
+// );
|
|
|
+// });
|
|
|
+
|
|
|
+ var fnMdSearchCallback = function(result) {
|
|
|
+ var ind = $('#mdIdx').val();
|
|
|
+ $("#tdBrandMd input[name=mdNo]").eq(ind).val(result.userNo);
|
|
|
+ $("#tdBrandMd input[name=mdNm]").eq(ind).val(result.userNm);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 브랜드담당MD 수정
|
|
|
+ $("#btnUpdateBrandMd").on("click", function() {
|
|
|
+ var arrData = [];
|
|
|
+ var brandCd = $("#detailForm input[name=brandCd]").val();
|
|
|
+ var mdCnt = 0;
|
|
|
+
|
|
|
+ $("#tdBrandMd div").each(function() {
|
|
|
+ var mdNo = $(this).find("input[name=mdNo]").val();
|
|
|
+ if (!gagajf.isNull(mdNo)) {
|
|
|
+ mdCnt++;
|
|
|
+ }
|
|
|
+
|
|
|
+ var data = { brandCd : brandCd, mdNo : mdNo };
|
|
|
+ arrData.push(data);
|
|
|
+ });
|
|
|
+
|
|
|
+ if (mdCnt == 0) {
|
|
|
+ mcxDialog.alert('담당MD가 선택되지 않았습니다.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ mcxDialog.confirmC('담당MD를 수정하시겠습니까?', {
|
|
|
+ cancelBtnText: "취소",
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ var jsonData = JSON.stringify(arrData);
|
|
|
+ gagajf.ajaxJsonSubmit('/business/brand/md/save', jsonData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 전시사이트 수정
|
|
|
+ $("#btnSiteBrandSave").on("click", function() {
|
|
|
+ var arrSiteBrand = [];
|
|
|
+ var brandCd = $("#detailForm input[name=brandCd]").val();
|
|
|
+ var brandGrpNm = $("#detailForm input[name=brandGrpNm]").val();
|
|
|
+ var checkCnt = 0;
|
|
|
+
|
|
|
+ $("#siteArea label").each(function() {
|
|
|
+ let ele = $(this).find("input:checkbox[name=siteCd]");
|
|
|
+ let siteCd = $(ele).val();
|
|
|
+ let useYn = 'N';
|
|
|
+
|
|
|
+ if ($(ele).is(':checked')) {
|
|
|
+ useYn = 'Y';
|
|
|
+ checkCnt++;
|
|
|
+ }
|
|
|
+
|
|
|
+ var data = { brandCd : brandCd, siteCd : siteCd, useYn : useYn, brandGrpNm : brandGrpNm };
|
|
|
+ arrSiteBrand.push(data);
|
|
|
+ });
|
|
|
+
|
|
|
+ if (checkCnt <= 0) {
|
|
|
+ mcxDialog.alert('전시될 사이트를 선택해 주세요.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ mcxDialog.confirmC('전시될 사이트를 수정하시겠습니까?', {
|
|
|
+ cancelBtnText: "취소",
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ var jsonData = JSON.stringify(arrSiteBrand);
|
|
|
+ gagajf.ajaxJsonSubmit('/business/brand/site/save', jsonData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 담당MD 추가 클릭 시
|
|
|
+ $("#btnAddBrandMd").on("click", function() {
|
|
|
+ $("#tdBrandMd").append(getBrandMdTag());
|
|
|
+ });
|
|
|
+
|
|
|
+ // 담당MD 태그
|
|
|
+ var getBrandMdTag = function(mdNo, mdNm) {
|
|
|
+ var tag = '<div>\n';
|
|
|
+ tag += ' <input type="text" class="w100" name="mdNm" value="' + mdNm + '" onkeypress="if (event.keyCode == 13) { $(\'#mdIdx\').val(' + i + '); cfnOpenMdListPopup(\'fnMdSearchCallback\', $(this).val());}"/>\n';
|
|
|
+ tag += ' <button type="button" class="btn btn-info btn-lg" id="btnSearchBrandMd" onclick="$(\'#mdIdx\').val(' + i + '); cfnOpenMdListPopup(\'fnMdSearchCallback\');">조회</button>\n';
|
|
|
+ tag += ' <input type="text" class="w100" name="mdNo" value="' + mdNo + '" readonly="readonly"/>\n';
|
|
|
+ tag += ' <button type="button" class="btn icn" onclick="fnDeleteRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button>\n';
|
|
|
+ tag += '</div>\n';
|
|
|
+ return tag;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 담당MD 삭제 시
|
|
|
+ var fnDeleteRow = function(obj) {
|
|
|
+ $(obj).closest('div').remove();
|
|
|
+ }
|
|
|
+
|
|
|
+ var fnSaveCallback = function() {
|
|
|
+ $('#btnSearch').click();
|
|
|
+ $("#btnNew").click();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 엑셀다운로드
|
|
|
+ $('#btnExcel').on('click', function() {
|
|
|
+ gagaAgGrid.exportToExcel('브랜드 목록', gridOptions);
|
|
|
+ });
|
|
|
+
|
|
|
+ // 신규 버튼 클릭
|
|
|
+ $("#btnNew").on("click", function() {
|
|
|
+ $("#detailForm")[0].reset();
|
|
|
+// $("#detailForm input[name=mode]").val("C");
|
|
|
+ $("#detailForm select[name=brandGb]").trigger('change');
|
|
|
+ $("#detailForm select[name=brandGb]").removeAttr("disabled");
|
|
|
+ $('#detailForm select[name=delvLocCd]').empty().append('<option value="">[선택]</option>');
|
|
|
+
|
|
|
+ // 브랜드담당MD 영역은 수정 시 노출
|
|
|
+ $("#brandMdArea").removeClass("on").addClass("off");
|
|
|
+
|
|
|
+ // 브랜드이미지 영역은 수정 시 노출
|
|
|
+// $("#bannerPreViewUrl").attr('src', '');
|
|
|
+// $("#imgView").removeClass("on").addClass("off");
|
|
|
+// $("#imgFileNm").val('');
|
|
|
+// $('#detailForm input[name=file]').val('');
|
|
|
+// $('#detailForm input[name=file]').closest('div').find('label').text('파일선택');
|
|
|
+
|
|
|
+ // 전시사이트 영역은 수정 시 노출
|
|
|
+ $("#siteArea").removeClass("on").addClass("off");
|
|
|
+ });
|
|
|
+
|
|
|
+ // 저장
|
|
|
+ $("#btnSave").on("click", function() {
|
|
|
+ var formId = '#detailForm';
|
|
|
+ var brandGb = $("#detailForm input:radio[name=brandGb]:checked").val();
|
|
|
+ var brandEnm = $("#detailForm input[name=brandEnm]").val();
|
|
|
+ var brandCd = $("#detailForm input[name=brandCd]").val();
|
|
|
+ var erpBrandCd = $("#detailForm input[name=erpBrandCd]").val();
|
|
|
+ var brandKnm = $("#detailForm input[name=brandKnm]").val();
|
|
|
+ var brandGrpNm = $("#detailForm input[name=brandGrpNm]").val();
|
|
|
+ var supplyCompCd = $("#supplyCompCdTd" + brandGb + " select[name=supplyCompCd]").val();
|
|
|
+ var delvLocCd = $("#detailForm select[name=delvLocCd]").val();
|
|
|
+ var delvFee = $("#detailForm input[name=delvFee]").val().removeComma();
|
|
|
+ var minOrdAmt = $("#detailForm input[name=minOrdAmt]").val().removeComma();
|
|
|
+ var sellFeeRate = $("#detailForm input[name=sellFeeRate]").val();
|
|
|
+ var pntPrate10 = $("#detailForm input[name=pntPrate10]").val();
|
|
|
+ var pntMrate10 = $("#detailForm input[name=pntMrate10]").val();
|
|
|
+ var pntPrate20 = $("#detailForm input[name=pntPrate20]").val();
|
|
|
+ var pntMrate20 = $("#detailForm input[name=pntMrate20]").val();
|
|
|
+ var dispOrd = $("#detailForm input[name=dispOrd]").val();
|
|
|
+ var useYn = $("#detailForm input:radio[name=useYn]:checked").val();
|
|
|
+ var brandImg = $("#imgFileNm").val();
|
|
|
+ var mode = $("#detailForm input[name=mode]").val();
|
|
|
+
|
|
|
+ if(brandEnm==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=brandEnm]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(brandGb=='S' && erpBrandCd==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=erpBrandCd]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(brandKnm==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=brandKnm]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(brandGrpNm==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=brandGrpNm]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(supplyCompCd==''){
|
|
|
+ gagajf.alertMessage("#supplyCompCdTd" + brandGb + " select[name=supplyCompCd]", 'select');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(delvFee==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=delvFee]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(minOrdAmt==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=minOrdAmt]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(brandGb!='S' && sellFeeRate==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=sellFeeRate]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(pntPrate10==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=pntPrate10]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(pntMrate10==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=pntMrate10]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(pntPrate20==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=pntPrate20]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(pntMrate20==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=pntMrate20]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(dispOrd==''){
|
|
|
+ gagajf.alertMessage("#detailForm input[name=dispOrd]", 'input');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ mcxDialog.confirm('저장하시겠습니까?', {
|
|
|
+ cancelBtnText: "취소",
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function(){
|
|
|
+ var data = {brandGb : brandGb
|
|
|
+ ,brandEnm : brandEnm
|
|
|
+ ,brandCd : brandCd
|
|
|
+ ,erpBrandCd : erpBrandCd
|
|
|
+ ,brandKnm : brandKnm
|
|
|
+ ,brandGrpNm : brandGrpNm
|
|
|
+ ,supplyCompCd : supplyCompCd
|
|
|
+ ,delvLocCd : delvLocCd
|
|
|
+ ,delvFee : delvFee
|
|
|
+ ,minOrdAmt : minOrdAmt
|
|
|
+ ,sellFeeRate : sellFeeRate
|
|
|
+ ,pntPrate10 : pntPrate10
|
|
|
+ ,pntMrate10 : pntMrate10
|
|
|
+ ,pntPrate20 : pntPrate20
|
|
|
+ ,pntMrate20 : pntMrate20
|
|
|
+ ,dispOrd:dispOrd
|
|
|
+ ,useYn : useYn
|
|
|
+ ,brandImg : brandImg
|
|
|
+ ,mode : mode
|
|
|
+ };
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
+ gagajf.ajaxJsonSubmit($(formId).prop('action'), jsonData, fnSaveCallback);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).ready(function() {
|
|
|
+ // Create a agGrid
|
|
|
+ gagaAgGrid.createGrid('gridList', gridOptions);
|
|
|
+
|
|
|
+ $('#detailForm select[name=brandGb]').trigger('change');
|
|
|
+ });
|
|
|
+/*]]>*/
|
|
|
+</script>
|
|
|
+
|
|
|
+</html>
|