LookbookListForm.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : LookbookListForm.html
  7. * @desc : 룩북관리 Page
  8. *============================================================================
  9. * STYLE24
  10. * Copyright(C) 2020 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2021.3.4 bin2107 최초 작성
  15. *******************************************************************************
  16. -->
  17. <div id="main">
  18. <!-- 메인타이틀 영역 -->
  19. <div class="main-title">
  20. </div>
  21. <!-- //메인타이틀 영역 -->
  22. <!-- 메뉴 설명 -->
  23. <div class="infoBox menu-desc">
  24. </div>
  25. <!-- //메뉴 설명 -->
  26. <!-- 검색조건 영역 -->
  27. <form id="searchForm" name="searchForm" action="#" th:action="@{'/display/lookbook/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
  28. <div class="panelStyle">
  29. <table class="frmStyle">
  30. <colgroup>
  31. <col style="width:10%;"/>
  32. <col style="width:15%;"/>
  33. <col style="width:10%;"/>
  34. <col style="width:15%;"/>
  35. <col style="width:10%;"/>
  36. <col style="width:40%;"/>
  37. </colgroup>
  38. <tr>
  39. <th>사이트</th>
  40. <td>
  41. <select name="siteCd">
  42. <option th:if="${siteCdList}" th:each="oneData, status : ${siteCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  43. </select>
  44. </td>
  45. <th>브랜드</th>
  46. <td>
  47. <input type="hidden" class="w100" name="brandCd" value="" />
  48. <input type="text" class="w100" name="brandNm" value="" />
  49. <button type="button" class="btn btnRight btn-success btn-lg" onclick="fnSearchLbBrandGroup();">브랜드조회</button>
  50. </td>
  51. <!--<td>
  52. <select name="brandCd">
  53. <option value="">[선택]</option>
  54. <option th:if="${brandGroupList}" th:each="oneData, status : ${brandGroupList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  55. </select>
  56. </td>-->
  57. <th>전시기간</th>
  58. <td colspan="5" id="sellTerms">
  59. <span class="nowrap">
  60. <input name="dispStdt" id="schStDate" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="노출기간 시작일" />
  61. <select id="schStTimeHour" required="required" data-valid-name="노출기간 시작시간">
  62. <th:block th:each="num, index : ${#numbers.sequence(0,23)}">
  63. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" >시간</option>
  64. </th:block>
  65. </select>
  66. <select id="schStTimeMin" required="required" data-valid-name="노출기간 시작시간">
  67. <th:block th:each="num: ${#numbers.sequence(0,59)}">
  68. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}분|" >분</option>
  69. </th:block>
  70. </select>
  71. <input name="dispStTime" id="schStTime" type="hidden" data-valid-name="노출기간 시작시간" value='000000' />
  72. ~
  73. <input name="dispEddt" id="schEdDate" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="노출기간 종료일" />
  74. <select id="schEdTimeHour" required="required" data-valid-name="노출기간 종료시간">
  75. <th:block th:each="num: ${#numbers.sequence(0,23)}">
  76. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" th:selected="${#numbers.formatInteger(num,2)}==23 ? 'true'">시간</option>
  77. </th:block>
  78. </select>
  79. <select id="schEdTimeMin" required="required" data-valid-name="노출기간 종료시간">
  80. <th:block th:each="num: ${#numbers.sequence(0,59)}">
  81. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}분|" th:selected="${#numbers.formatInteger(num,2)}==59 ? 'true'">분</option>
  82. </th:block>
  83. </select>
  84. <input name="dispEdTime" id="schEdTime" type="hidden" data-valid-name="노출기간 종료시간" value='235959' />
  85. </span>
  86. </td>
  87. </tr>
  88. </table>
  89. <ul class="panelBar">
  90. <li class="center">
  91. <button type="button" class="btn btn-default btn-lg" id="btnInit">초기화</button>
  92. <button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
  93. </li>
  94. </ul>
  95. </div>
  96. <!-- 검색조건 영역 -->
  97. <!-- 리스트 영역 -->
  98. <div class="panelStyle">
  99. <!-- 상단영역 START -->
  100. <ul class="panelBar">
  101. <li class="left">
  102. <span class="btnLeft">
  103. <button type="button" class="btn btn-danger btn-lg" id="btnDel">노출안함</button>
  104. </span>
  105. </li>
  106. <li class="right">
  107. <span class="btnRight">
  108. <button type="button" class="btn btn-success btn-lg" id="btnReg">등록</button>
  109. </span>
  110. 검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
  111. 쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
  112. <select id="pageSize" name="pageSize">
  113. <option value="50" selected="selected">50개씩 보기</option>
  114. <option value="100">100개씩 보기</option>
  115. <option value="500">500개씩 보기</option>
  116. <option value="1000">1000개씩 보기</option>
  117. </select>
  118. <input type="hidden" name="pageNo" id="pageNo" value ="1"/>
  119. </li>
  120. </ul>
  121. <!-- 상단영역 END -->
  122. <div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
  123. <ul class="panelBar">
  124. <li class="center">
  125. <div class="tablePaging" id="lookbookListPagination"></div>
  126. </li>
  127. </ul>
  128. </div>
  129. <!-- //리스트 영역 -->
  130. </form>
  131. </div>
  132. <script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
  133. <script th:inline="javascript">
  134. /*<![CDATA[*/
  135. var brandGroupList = [[${brandGroupList}]];
  136. let columnDefs = [
  137. {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
  138. {headerName: "룩북일련번호", field: "lookbookSq", width: 100, cellClass: 'text-center'
  139. ,cellRenderer: function(params) {
  140. return '<a href="javascript:void(0);">' + params.value + '</a>';
  141. }
  142. },
  143. {headerName: "타이틀", field: "title", width: 200, cellClass: 'text-center'},
  144. {headerName: "브랜드", field: "brandCd", width: 80, cellClass: 'text-center'},
  145. {headerName: "브랜드명", field: "brandNm", width: 80, cellClass: 'text-center'},
  146. {headerName: "메인룩북", field: "mainDispYn", width: 80, cellClass: 'text-center'},
  147. {headerName: "노출여부", field: "dispYn", width: 80, cellClass: 'text-center'},
  148. {headerName: "노출시작일", field: "dispStdt", width: 150, cellClass: 'text-center'},
  149. {headerName: "노출종료일", field: "dispEddt", width: 150, cellClass: 'text-center'},
  150. {headerName: "등록자", field: "regNm", width: 80, cellClass: 'text-center'},
  151. {headerName: "등록일자", field: "regDt", width: 150, cellClass: 'text-center'},
  152. {headerName: "수정자", field: "updNm", width: 80, cellClass: 'text-center'},
  153. {headerName: "수정일자", field: "updDt", width: 150, cellClass: 'text-center'}
  154. ];
  155. let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
  156. gridOptions.rowSelection = "multiple";
  157. // 셀 클릭 이벤트
  158. gridOptions.onCellClicked = function(event) {
  159. if (event.colDef.field == 'lookbookSq') {
  160. // 룩북 상세
  161. cfnOpenLookbookBannerPopup('U',event.data.lookbookSq);
  162. }
  163. }
  164. // 등록 팝업
  165. $("#btnReg").on('click', function(){
  166. cfnOpenLookbookBannerPopup('N');
  167. });
  168. // 초기화 버튼
  169. $("#btnInit").on('click', function (){
  170. $("#searchForm")[0].reset();
  171. gagajf.setDate('schStDate', 'schEdDate', 't');
  172. });
  173. // 조회
  174. $("#btnSearch").on('click', function(){
  175. var fromDate = '';
  176. var toDate = '';
  177. if(!gagajf.isNull($("#searchForm input[name=dispStdt]").val())){
  178. $("#searchForm input[name=dispStTime]").val($('#searchForm #schStTimeHour').val()+$('#searchForm #schStTimeMin').val()+'00');
  179. fromDate = $("#searchForm input[name=dispStdt]").val().replaceAll('-','')+$("#searchForm input[name=dispStTime]").val();
  180. }
  181. if(!gagajf.isNull($("#searchForm input[name=dispEddt]").val())){
  182. $("#searchForm input[name=dispEdTime]").val($('#searchForm #schEdTimeHour').val()+$('#searchForm #schEdTimeMin').val()+'59');
  183. toDate = $("#searchForm input[name=dispEddt]").val().replaceAll('-','')+$("#searchForm input[name=dispEdTime]").val();
  184. }
  185. if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
  186. if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
  187. mcxDialog.alertC("시작일자와 종료일자를 입력하세요.", {
  188. sureBtnText: "확인",
  189. sureBtnClick: function() {
  190. $('#searchForm input[name=dispStTime]').focus();
  191. }
  192. });
  193. return false;
  194. }
  195. if (fromDate > toDate) {
  196. mcxDialog.alertC("시작일자는 종료일자 보다 클 수 없습니다.", {
  197. sureBtnText: "확인",
  198. sureBtnClick: function() {
  199. $('#searchForm input[name=dispEdTime]').focus();
  200. }
  201. });
  202. return false;
  203. }
  204. }
  205. fnSearch();
  206. });
  207. var fnSearch = function(){
  208. gagaPaging.init('searchForm', fnSearchCallBack, 'lookbookListPagination', $('#searchForm').find('#pageSize').val());
  209. gagaPaging.load(1);
  210. };
  211. //페이징
  212. $('#searchForm select[name=pageSize]').on('change', function() {
  213. $("#searchForm input[name=pageNo]").val('1');
  214. gagaPaging.init('searchForm', fnSearchCallBack, 'lookbookListPagination', $('#searchForm').find('#pageSize').val());
  215. gagaPaging.load(1);
  216. });
  217. var fnSearchCallBack = function(result){
  218. $('#searchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
  219. $('#searchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
  220. $('#searchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
  221. $('#searchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
  222. gridOptions.api.setRowData(result.lookbookList);
  223. gagaPaging.createPagination(result.pageing.pageable);
  224. }
  225. // 노출안함
  226. $("#btnDel").on('click', function (){
  227. var selectRowData = gagaAgGrid.selectedRowData(gridOptions);
  228. if (selectRowData.length > 0) {
  229. mcxDialog.confirm('변경하시겠습니까?', {
  230. cancelBtnText: "취소",
  231. sureBtnText: "확인",
  232. sureBtnClick: function(){
  233. var selectDataArr = [];
  234. $.each(selectRowData, function(idx, item) {
  235. selectDataArr.push(item.lookbookSq);
  236. });
  237. var data = {
  238. selectDataArr : selectDataArr
  239. };
  240. var jsonData = JSON.stringify(data);
  241. gagajf.ajaxJsonSubmit('/display/lookbook/delete', jsonData, fnSaveCollback);
  242. }
  243. });
  244. }else{
  245. mcxDialog.alert('선택된 행이 없습니다.');
  246. return;
  247. }
  248. });
  249. var fnSaveCollback = function (){
  250. $("#btnInit").click();
  251. $('#btnSearch').trigger('click');
  252. }
  253. var fnSearchLbBrandGroup = function (){
  254. cfnOpenBrandGroupListPopup("fnCallBackLbBrandGroup", "S", "S");
  255. }
  256. var fnCallBackLbBrandGroup = function (result){
  257. $("#searchForm").find("input[name=brandCd]").val(result[0].brandGroupNo);
  258. $("#searchForm").find("input[name=brandNm]").val(result[0].brandGroupNm);
  259. }
  260. $(document).ready(function() {
  261. // Create a agGrid
  262. gagaAgGrid.createGrid('gridList', gridOptions);
  263. });
  264. /*]]>*/
  265. </script>
  266. </html>