GoodsPopupListForm.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : GoodsPopupListForm.html
  7. * @desc : 상품 조회 팝업
  8. *============================================================================
  9. * STYLE24
  10. * Copyright(C) 2020 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2020.10.26 eskim 최초 작성
  15. *******************************************************************************
  16. -->
  17. <div class="modalPopup" data-width="1700">
  18. <div class="panelStyle">
  19. <!-- TITLE -->
  20. <div class="panelTitle">
  21. <h2>상품조회</h2>
  22. <button type="button" class="close" onclick="uifnPopupClose('popupGoods')"><i class="fa fa-times"></i></button>
  23. </div>
  24. <!-- //TITLE -->
  25. <form id="goodsPopupForm" name="goodsPopupForm" action="#" th:action="@{'/goods/popup/list'}">
  26. <div class="panelContent">
  27. <ul class="notice">
  28. <li>아래 검색조건 중 <font color="red">업체, 키워드, 발생일</font>중 하나를 꼭 입력해 주세요.</li>
  29. </ul>
  30. <table class="frmStyle">
  31. <colgroup>
  32. <col style="width: 7%;"/>
  33. <col style="width: 21%;"/>
  34. <col style="width: 7%;"/>
  35. <col style="width: 18%;"/>
  36. <col style="width: 7%;"/>
  37. <col style="width: 18%;"/>
  38. <col style="width: 7%;"/>
  39. <col/>
  40. </colgroup>
  41. <tr>
  42. <th>업체/브랜드<em class="required" title="필수"></em></th>
  43. <td colspan="3">
  44. <select name="supplyCompCd" id="supplyCompCd">
  45. <option value="" >[전체]</option>
  46. <option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  47. </select>
  48. <span id="multiBrand"></span>
  49. </td>
  50. <th>상품타입</th>
  51. <td>
  52. <select name="goodsType" id="goodsType">
  53. <option value="">[전체]</option>
  54. <option th:if="${goodsTypeList}" th:each="oneData, status : ${goodsTypeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  55. </select>
  56. </td>
  57. <th rowspan="4">키워드<em class="required" title="필수"></em></th>
  58. <td rowspan="4">
  59. <select name="search" id="search">
  60. <option value="searchGoodsCd">상품코드</option>
  61. <option value="searchGoodsNm">상품명</option>
  62. <option value="searchGoodsNum">품번</option>
  63. <option value="searchSupplyGoodsCd">업체상품코드</option>
  64. </select>
  65. <!-- <input type="text" class="w40p" name="condition" id="condition" maxlength="50"/> -->
  66. <textarea class="textareaR3 w70p" name="condition" id="condition"></textarea>
  67. </td>
  68. </tr>
  69. <tr>
  70. <th>품목</th>
  71. <td>
  72. <div class="multiCheckBox" style="width:300px">
  73. <button type="button" class="sltBtn">[전체]</button>
  74. <ul style="overflow:auto; height:170px;">
  75. <li><label class="chkBox"><input type="checkbox" name="전체선택" id="multiItemkindCd" onclick="uifnAllCheck('multiItemkindCd')">전체선택</label></li>
  76. <li th:if="${itemkindList}" th:each="oneData, status : ${itemkindList}"><label class="chkBox"><input type="checkbox" name="multiItemkindCd" th:id="${'itemkindCd' + oneData.cd}" th:value="${oneData.cd}" ><th:block th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></th:block></label></li>
  77. </ul>
  78. </div>
  79. </td>
  80. <th>상품상태</th>
  81. <td>
  82. <div class="multiCheckBox" style="width:200px">
  83. <button type="button" class="sltBtn">[전체]</button>
  84. <ul style="overflow:auto; height:170px">
  85. <li><label class="chkBox"><input type="checkbox" name="전체선택" id="multiGoodsStat" onclick="uifnAllCheck('multiGoodsStat')">전체선택</label></li>
  86. <li th:if="${goodsStatList}" th:each="oneData, status : ${goodsStatList}"><label class="chkBox"><input type="checkbox" name="multiGoodsStat" th:id="${'goodsStat' + oneData.cd}" th:value="${oneData.cd}" ><th:block th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></th:block></label></li>
  87. </ul>
  88. </div>
  89. </td>
  90. <th>정상/이월 구분</th>
  91. <td>
  92. <select name="formalGb" id="formalGb">
  93. <option value="">[전체]</option>
  94. <option th:if="${formalGbList}" th:each="oneData, status : ${formalGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  95. </select>
  96. </td>
  97. </tr>
  98. <tr>
  99. <th>년도/시즌</th>
  100. <td>
  101. <!-- <select name="styleYear" id="styleYear">
  102. <option value="">[전체]</option>
  103. <option th:if="${styleYearList}" th:each="oneData, status : ${styleYearList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  104. </select>
  105. <select name="seasonCd" id="seasonCd">
  106. <option value="">[전체]</option>
  107. <option th:if="${seasonList}" th:each="oneData, status : ${seasonList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  108. </select> -->
  109. <div class="multiCheckBox" style="width:140px;">
  110. <button type="button" class="sltBtn">[전체]</button>
  111. <ul style="overflow:auto; height:140px">
  112. <li><label class="chkBox"><input type="checkbox" name="전체선택" id="multiStyleYear" onclick="uifnAllCheck('multiStyleYear')">전체선택</label></li>
  113. <li th:if="${styleYearList}" th:each="oneData, status : ${styleYearList}"><label class="chkBox"><input type="checkbox" name="multiStyleYear" th:id="${'styleYear' + oneData.cd}" th:value="${oneData.cd}" ><th:block th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></th:block></label></li>
  114. </ul>
  115. </div>
  116. <div class="multiCheckBox" style="width:170px;">
  117. <button type="button" class="sltBtn">[전체]</button>
  118. <ul style="overflow:auto; height:170px">
  119. <li><label class="chkBox"><input type="checkbox" name="전체선택" id="multiSeasonCd" onclick="uifnAllCheck('multiSeasonCd')">전체선택</label></li>
  120. <li th:if="${seasonList}" th:each="oneData, status : ${seasonList}"><label class="chkBox"><input type="checkbox" name="multiSeasonCd" th:id="${'seasonCd' + oneData.cd}" th:value="${oneData.cd}" ><th:block th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></th:block></label></li>
  121. </ul>
  122. </div>
  123. </td>
  124. <th>연령대</th>
  125. <td>
  126. <select name="ageGrpCd" id="ageGrpCd">
  127. <option value="">[전체]</option>
  128. <option th:if="${ageGrpCdList}" th:each="oneData, status : ${ageGrpCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  129. </select>
  130. </td>
  131. <th>성별</th>
  132. <td>
  133. <select name="sexGb" id="sexGb">
  134. <option value="">[전체]</option>
  135. <option th:if="${sexGbList}" th:each="oneData, status : ${sexGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  136. </select>
  137. </td>
  138. </tr>
  139. <tr>
  140. <th>재고연동여부</th>
  141. <td>
  142. <select name="erpStockLinkYn" id="erpStockLinkYn">
  143. <option value="">[전체]</option>
  144. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  145. </select>
  146. </td>
  147. <th>자사몰노출여부</th>
  148. <td>
  149. <select name="dispYn" id="dispYn">
  150. <option value="">[전체]</option>
  151. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  152. </select>
  153. </td>
  154. <th>품절여부</th>
  155. <td>
  156. <select name="soldOutYn" id="soldOutYn">
  157. <option value="">[전체]</option>
  158. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  159. </select>
  160. </td>
  161. </tr>
  162. <tr>
  163. <th>반품가능여부</th>
  164. <td>
  165. <select name="returnableYn" id="returnableYn">
  166. <option value="">[전체]</option>
  167. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  168. </select>
  169. <!-- <label class="chkBox"><input type="checkbox" name="returnableYn" value="Y"/>반품가능</label>
  170. <label class="chkBox"><input type="checkbox" name="changeableYn" value="Y"/>교환가능</label>
  171. <label class="chkBox"><input type="checkbox" name="returnFeeFreeYn" value="Y"/>무료반품</label>
  172. <label class="chkBox"><input type="checkbox" name="changeFeeFreeYn" value="Y"/>무료교환</label> -->
  173. </td>
  174. <th>담당MD</th>
  175. <td>
  176. <select name="mdId" id="mdId">
  177. <option value="">[전체]</option>
  178. <option th:if="${brandMdList}" th:each="oneData, status : ${brandMdList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option>
  179. </select>
  180. </td>
  181. <th>판매가</th>
  182. <td>
  183. <input type="text" class="w90" name="currPriceSt" id="currPriceSt" maxlength="10" data-valid-type="numeric"/>원 ~ <input type="text" class="w90" name="currPriceEd" id="currPriceEd" maxlength="10" data-valid-type="numeric"/>원
  184. </td>
  185. <th>할인율</th>
  186. <td>
  187. <input type="text" class="w70" name="dcRateSt" id="dcRateSt" maxlength="3" data-valid-type="numeric"/> % ~ <input type="text" class="w70" name="dcRateEd" id="dcRateEd" maxlength="3" data-valid-type="numeric"/> %
  188. </td>
  189. </tr>
  190. <tr>
  191. <th>발생일<em class="required" title="필수"></em></th>
  192. <td colspan="7" id="sellTermsP"></td>
  193. </tr>
  194. </table>
  195. <ul class="panelBar">
  196. <li class="center">
  197. <button type="button" class="btn btn-gray btn-lg" id="btnPopupGoodsInit" >초기화</button>
  198. <button type="button" class="btn btn-info btn-lg" id="btnPopupGoodsSearch" >조회</button>
  199. </li>
  200. </ul>
  201. </div>
  202. <ul class="panelBar">
  203. <li>검색 결과 : <em><span id="gridRowTotalCount">0</span></em>개가 검색되었습니다.
  204. <input type="hidden" name="pageNo" id="pageNo" value ="1"/>
  205. </li>
  206. <li class="right">
  207. <select class="w100" name="pageSize" id="pageSize">
  208. <option value="50" selected>50개</option>
  209. <option value="100">100개</option>
  210. <option value="500">500개</option>
  211. </select>
  212. <span class="btnRight" style="margin-top: 4px;">쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;</span>
  213. </li>
  214. </ul>
  215. <div id="gridPopupGoodsList" style="width: 100%; height: 400px;" class="ag-theme-balham lh60"></div>
  216. <!-- 버튼 배치 영역 -->
  217. <ul class="panelBar">
  218. <li class="center">
  219. <div class="tablePaging" id="goodsPopupListPagination"></div>
  220. </li>
  221. </ul>
  222. <ul class="panelBar">
  223. <li class="right">
  224. <button type="button" class="btnRight btn btn-base btn-lg" id="btnPopupGoodsApply">적용</button>
  225. </li>
  226. </ul>
  227. </form>
  228. <!-- //버튼 배치 영역 -->
  229. </div>
  230. </div>
  231. <script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
  232. <script th:inline="javascript">
  233. /*<![CDATA[*/
  234. var sessRoleCd = [[${sessionInfo.roleCd}]];
  235. var goodsStatList = gagajf.convertToArray([[${goodsStatList}]]);
  236. var formalGbList = gagajf.convertToArray([[${formalGbList}]]);
  237. var seasonList = gagajf.convertToArray([[${seasonList}]]);
  238. var uploadGoodsUrl = [[${@environment.getProperty('upload.goods.view')}]];
  239. var popupGoodsColumnDefs = [
  240. {width: 40, minWidth: 40, cellClass: 'text-right', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
  241. {headerName: 'No', width: 60, cellClass: 'text-center',
  242. valueGetter: function(params) { return cfnGridNumner('goodsPopupForm',params.node.rowIndex, 'A');}
  243. },
  244. {headerName: "이미지", field: "sysImgNm", width: 100, height: 60, cellClass: 'text-center'
  245. ,cellRenderer: function(params) {
  246. return '<img width="60" src="'+ _goodsUrl+ "/" + params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
  247. }
  248. },
  249. {headerName: "브랜드", field: "brandCd", width: 100, cellClass: 'text-center'},
  250. {headerName: "브랜드명", field: "brandEnm", width: 130, cellClass: 'text-center'},
  251. {headerName: "상품코드", field: "goodsCd", width: 140, cellClass: 'text-center'},
  252. {headerName: "상품명", field: "goodsNm", width: 200, cellClass: 'text-left'},
  253. {headerName: "품목", field: "itemkindNm", width: 150, cellClass: 'text-left'},
  254. {headerName: "재고", field: "stockQtySum", width: 80, cellClass: 'text-right',
  255. valueFormatter: function(params) { return params.value.addComma();}
  256. },
  257. {headerName: "상품상태", field: "goodsStat" , width: 120, cellClass: 'text-center',
  258. cellEditorParams: { values: gagaAgGrid.extractValues(goodsStatList) },
  259. valueFormatter: function (params) { return gagaAgGrid.lookupValue(goodsStatList, params.value); },
  260. valueParser: function (params) { return gagaAgGrid.lookupKey(goodsStatList, params.newValue); }
  261. },
  262. {headerName: "15일간판매수량", field: "sellDay15Qty", width: 120, cellClass: 'text-right',
  263. valueFormatter: function(params) { return params.value.addComma();}
  264. },
  265. {headerName: "년도", field: "styleYear" , width: 90, cellClass: 'text-center'},
  266. {headerName: "시즌", field: "seasonCd" , width: 90, cellClass: 'text-center',
  267. cellEditorParams: { values: gagaAgGrid.extractValues(seasonList) },
  268. valueFormatter: function (params) { return gagaAgGrid.lookupValue(seasonList, params.value); },
  269. valueParser: function (params) { return gagaAgGrid.lookupKey(seasonList, params.newValue); }
  270. },
  271. {headerName: "정상가", field: "listPrice" , width: 100, cellClass: 'text-right'
  272. ,valueFormatter: function(params) {return params.value.addComma();},
  273. cellEditor: 'textCellEditor',
  274. cellEditorParams: { maxlength: 14, validType: 'numeric'}
  275. },
  276. {headerName: "판매가", field: "currPrice" , width: 100, cellClass: 'text-right'
  277. ,valueFormatter: function(params) {return params.value.addComma();},
  278. cellEditor: 'textCellEditor',
  279. cellEditorParams: { maxlength: 14, validType: 'numeric'}
  280. },
  281. {headerName: "할인율", field: "dcRate" , width: 90, cellClass: 'text-right'},
  282. {headerName: "가격변경일", field: "priceUpdDt", width: 150, cellClass: 'text-center',
  283. cellRenderer: function(params) {
  284. return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
  285. }
  286. },
  287. {headerName: "이월구분", field: "formalGb", width: 100, cellClass: 'text-center',
  288. cellEditorParams: { values: gagaAgGrid.extractValues(formalGbList) },
  289. valueFormatter: function (params) { return gagaAgGrid.lookupValue(formalGbList, params.value); },
  290. valueParser: function (params) { return gagaAgGrid.lookupKey(formalGbList, params.newValue); }
  291. },
  292. {headerName: "반품가능", field: "returnableYn" , width: 90, cellClass: 'text-center'},
  293. {headerName: "수정일자", field: "updDt", width: 150, cellClass: 'text-center',
  294. cellRenderer: function(params) {
  295. return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
  296. }
  297. },
  298. {headerName: "수정자", field: "updNm" , width: 100, cellClass: 'text-center'}
  299. ];
  300. // Get GridOptions
  301. var popupGoodsGridOptions = gagaAgGrid.getGridOptions(popupGoodsColumnDefs);
  302. // Add on options
  303. popupGoodsGridOptions.suppressRowClickSelection = true;
  304. popupGoodsGridOptions.rowSelection = 'multiple';
  305. popupGoodsGridOptions.rowHeight = 60; //이미지가 있을경우 높이 지정해야함.
  306. popupGoodsGridOptions.getRowStyle = function(params) {
  307. if ("G008_00" == params.data.goodsStat || "G008_10" == params.data.goodsStat || "G008_20" == params.data.goodsStat || "G008_30" == params.data.goodsStat) {
  308. return { background: '#23c6c8' };
  309. }
  310. }
  311. // 초기화클릭시
  312. $('#btnPopupGoodsInit').on('click', function() {
  313. $('#goodsPopupForm')[0].reset();
  314. //$("#goodsPopupForm input[type=radio]").removeClass("checked");
  315. $("#goodsPopupForm input[type=checkbox]").removeClass("checked");
  316. //$("#goodsPopupForm input[type=radio]").parent("label").removeClass("checked");
  317. $("#goodsPopupForm input[type=checkbox]").parent("label").removeClass("checked");
  318. $("#goodsPopupForm input[type=radio][checked]").parent("label").addClass("checked");
  319. fnSupplyBrandInit();
  320. });
  321. // 조회클릭시
  322. $('#btnPopupGoodsSearch').on('click', function() {
  323. fnPopupGoodsSearch();
  324. });
  325. // 조회
  326. var fnPopupGoodsSearch = function() {
  327. var formId = '#goodsPopupForm';
  328. // Fetch data
  329. //gagaAgGrid.fetch($(formId).prop('action'), popupGoodsGridOptions, formId, fnPopupGoodsSearchCallBack);
  330. if(!fnPopupGoodsConditionCheck()) return;
  331. gagaPaging.init('goodsPopupForm', fnPopupGoodsSearchCallBack, 'goodsPopupListPagination', $('#goodsPopupForm').find('#pageSize').val());
  332. gagaPaging.load(1);
  333. }
  334. //검색 조건 확인
  335. var fnPopupGoodsConditionCheck = function(){
  336. var formId = '#goodsPopupForm';
  337. var form = document.goodsPopupForm;
  338. if($("#goodsPopupForm input[name=searchGb]").val() == "EXCEL") return true;
  339. var searchFlag = false;
  340. var cnt = 0;
  341. if( !gagajf.isNull($("#goodsPopupForm select[name=supplyCompCd]").val())
  342. || !gagajf.isNull($("#goodsPopupForm textarea[name=condition]").val())
  343. || (!gagajf.isNull($("#goodsPopupForm input[name=stDate]").val()) && !gagajf.isNull($("#goodsPopupForm input[name=edDate]").val())
  344. || !gagajf.isNull($("#goodsPopupForm select[name=brandGrpNm]").val())
  345. )
  346. ){
  347. searchFlag = true;
  348. }else{
  349. /* for (i = 0; i < form.elements.length; i++ ) {
  350. var el = form.elements[i];
  351. if ((el.getAttribute("type") == "text" || el.getAttribute("type") == "select-one") || el.name== "supplyCompCd") {
  352. if (!(el.value == null || el.value == "")) {
  353. cnt++;
  354. }
  355. }
  356. }
  357. if(cnt > 0) searchFlag = true; */
  358. }
  359. if(searchFlag == false){
  360. mcxDialog.alert("검색조건을 입력하세요.");
  361. return false;
  362. }
  363. if(!gagajf.isNull($("#goodsPopupForm input[name=currPriceSt]").val()) && !gagajf.isNull($("#goodsPopupForm input[name=currPriceEd]").val())){
  364. if (Number($("#goodsPopupForm input[name=currPriceSt]").val().removeComma()) > Number($("#goodsPopupForm input[name=currPriceEd]").val().removeComma()) ){
  365. mcxDialog.alertC("판매가를 확인해 주세요.", {
  366. sureBtnText: "확인",
  367. sureBtnClick: function() {
  368. $("#goodsPopupForm input[name=currPriceEd]").focus();
  369. }
  370. });
  371. return false;
  372. }
  373. }
  374. if(!gagajf.isNull($("#goodsPopupForm input[name=dcRateSt]").val()) && !gagajf.isNull($("#goodsPopupForm input[name=dcRateEd]").val())){
  375. if (Number($("#goodsPopupForm input[name=dcRateSt]").val().removeComma()) > Number($("#goodsPopupForm input[name=dcRateEd]").val().removeComma()) ){
  376. mcxDialog.alertC("할인율를 확인해 주세요.", {
  377. sureBtnText: "확인",
  378. sureBtnClick: function() {
  379. $("#goodsPopupForm input[name=dcRateEd]").focus();
  380. }
  381. });
  382. return false;
  383. }
  384. }
  385. var fromDate = $('#goodsPopupForm input[name=stDate]').val();
  386. var toDate = $('#goodsPopupForm input[name=edDate]').val();
  387. if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
  388. if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
  389. mcxDialog.alertC("등록일 조회시 시작일자와 종료일자를 입력하세요.", {
  390. sureBtnText: "확인",
  391. sureBtnClick: function() {
  392. $('#goodsPopupForm input[name=stDate]').focus();
  393. }
  394. });
  395. return false;
  396. }
  397. if (fromDate > toDate) {
  398. mcxDialog.alertC("노출기간 시작일자는 종료일자 보다 클 수 없습니다.", {
  399. sureBtnText: "확인",
  400. sureBtnClick: function() {
  401. $('#goodsPopupForm input[name=stDate]').focus();
  402. }
  403. });
  404. return false;
  405. }
  406. }
  407. return true;
  408. }
  409. var fnPopupGoodsSearchCallBack = function(result) {
  410. if (!gagajf.isNull(result.couponGoodsList)) {
  411. PopupCouponGoodsList = result.couponGoodsList;
  412. }
  413. $('#goodsPopupForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
  414. $('#goodsPopupForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
  415. $('#goodsPopupForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
  416. $('#goodsPopupForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
  417. popupGoodsGridOptions.api.setRowData(result.goodsList);
  418. gagaPaging.createPagination(result.pageing.pageable);
  419. }
  420. // 적용버튼 클릭시
  421. $('#btnPopupGoodsApply').on('click', function() {
  422. var callback = [[${params.callBackFun}]];
  423. //console.log(callback);
  424. var selectedData = popupGoodsGridOptions.api.getSelectedRows();
  425. if(selectedData.length == 0){
  426. mcxDialog.alert("선택된 데이터가 없습니다.");
  427. return false;
  428. }
  429. var jsonData = JSON.stringify(selectedData);
  430. if( typeof callback != 'undefined' && callback){
  431. if (typeof callback == 'function') {
  432. callback(jsonData);
  433. }else{
  434. if( callback ) {
  435. if( callback.indexOf("(") == -1 ) eval( callback +"(" + jsonData+")");
  436. else eval( callback(jsonData) );
  437. }
  438. }
  439. //uiPopupClose('goodsPopupForm');
  440. }
  441. });
  442. //업체변경시
  443. $('#goodsPopupForm select[name=supplyCompCd]').on('change', function() {
  444. var actionUrl = '/renderer/supplyCompany/brand/list/' + $(this).val();
  445. if(sessRoleCd == "G001_B000"){
  446. actionUrl = '/renderer/brand/AuthBrandlist';
  447. }
  448. //$("#goodsPopupForm select[name=brandCd] option:gt(0)").remove();
  449. //cfnCreateCombo(actionUrl, $('#goodsPopupForm select[name=brandCd]'), "[전체]", brandCd);
  450. cfnCreateMultiCombo(actionUrl,"multiBrand", "[전체]",null, 'Y', null, null, 'goodsPopupForm');
  451. });
  452. // 업체 브랜드 초기화
  453. var fnSupplyBrandInit = function(){
  454. $("#goodsPopupForm select[name=supplyCompCd]").val([[${sessionInfo.supplyCompCd}]]);
  455. //$("#goodsPopupForm select[name=supplyCompCd]").attr("disabled", true);
  456. //$("select[disabled]").addClass("formControl");
  457. $('#goodsPopupForm').find('#multiBrand').empty();
  458. var actionUrl = '/renderer/brand/AuthBrandlist';
  459. cfnCreateMultiCombo(actionUrl,"multiBrand", "[전체]",null, 'Y', null, null, 'goodsPopupForm');
  460. }
  461. $(document).ready(function() {
  462. cfnCreateCalendar('#sellTermsP', 'stDate', 'edDate', true, '등록일', 'X');
  463. var selectCode = '<select name="dateGbn" id="dateGbn" class="w100">';
  464. selectCode += '<option value="R" seledted>상품등록일</option>';
  465. selectCode += '<option value="P">가격변경일</option>';
  466. selectCode += '<option value="S">최초승인일</option>';
  467. selectCode += '</select>';
  468. $("#goodsPopupForm").find('#sellTermsP').prepend(selectCode);
  469. // Create a agGrid
  470. gagaAgGrid.createGrid('gridPopupGoodsList', popupGoodsGridOptions);
  471. // 입점 사용자 브랜드 조회 처리
  472. if(sessRoleCd == "G001_B000"){
  473. fnSupplyBrandInit();
  474. }
  475. });
  476. /*]]>*/
  477. </script>
  478. </html>