DeliveryWithdrawDirectiveListForm.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : DeliveryWithdrawDirectiveListForm.html
  7. * @desc : 배송/회수지시 목록 Page
  8. *=============================================================
  9. * ISTYLE24
  10. * Copyright(C) 2021 TSIT, All rights reserved.
  11. *=============================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== ==================================
  14. * 1.0 2021.03.11 moon 최초 작성
  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="@{'/delivery/dwdirect/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
  28. <div class="panelStyle">
  29. <!-- TITLE -->
  30. <div class="panelTitle">
  31. <h3><i class="fa fa-info-circle"></i>아래 검색조건 중 <font color="red">주문일/회수요청일</font>은 꼭 입력해 주세요.</h3>
  32. <span class="panelControl">
  33. <i class="fa fa-chevron-up"></i>
  34. </span>
  35. </div>
  36. <!-- //TITLE -->
  37. <div class="panelContent">
  38. <table class="frmStyle">
  39. <colgroup>
  40. <col style="width:8%;"/>
  41. <col style="width:12%;"/>
  42. <col style="width:8%;"/>
  43. <col style="width:12%;"/>
  44. <col style="width:8%;"/>
  45. <col style="width:12%;"/>
  46. </colgroup>
  47. <tr>
  48. <th>지시구분</th>
  49. <td>
  50. <select name="delvGb">
  51. <option value="">전체</option>
  52. <option value="D">배송지시</option>
  53. <option value="W">회수지시</option>
  54. </select>
  55. </td>
  56. <th>택배사 전송여부</th>
  57. <td>
  58. <select name="sendYn">
  59. <option value="">전체</option>
  60. <option value="N">미전송</option>
  61. <option value="Y">전송</option>
  62. </select>
  63. </td>
  64. <th>사이트</th>
  65. <td>
  66. <select name="siteCd">
  67. <option value="">전체</option>
  68. <option th:if="${siteCdList}" th:each="oneData, status : ${siteCdList}" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
  69. </select>
  70. </td>
  71. </tr>
  72. <tr>
  73. <th>주문일/회수요청일</th>
  74. <td colspan="5" id="terms">
  75. </td>
  76. </tr>
  77. </table>
  78. <ul class="panelBar">
  79. <li class="center">
  80. <button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
  81. <button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset(); fnInitCalendar();">초기화</button>
  82. <button type="button" id="btnExcel" class="btn btn-info btn-lg" >엑셀다운로드</button>
  83. </li>
  84. </ul>
  85. </div>
  86. </div>
  87. <!-- //검색조건 영역 -->
  88. <!-- 리스트 영역 -->
  89. <div class="panelStyle">
  90. <ul class="panelBar">
  91. <li class="right">
  92. 검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
  93. 쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
  94. <select id="pageSize" name="pageSize">
  95. <option value="20" selected="selected">20개씩 보기</option>
  96. <option value="50">50개씩 보기</option>
  97. <option value="100">100개씩 보기</option>
  98. <option value="500">500개씩 보기</option>
  99. <option value="1000">1000개씩 보기</option>
  100. </select>
  101. <input type="hidden" name="pageNo" id="pageNo" value ="1"/>
  102. </li>
  103. </ul>
  104. <div id="gridList" style="width:100%; height: 700px;" class="ag-theme-balham"></div>
  105. <ul class="panelBar">
  106. <li class="center">
  107. <div class="tablePaging" id="delvWithdrawListPagination"></div>
  108. </li>
  109. </ul>
  110. </div>
  111. </form>
  112. <!-- //리스트 영역 -->
  113. </div>
  114. <script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=20210114"></script>
  115. <script th:inline="javascript">
  116. /*<![CDATA[*/
  117. // 사이트목록
  118. var currOrdNo = 0;
  119. var siteList = gagajf.convertToArray([[${siteCdList}]]);
  120. var columnDefs = [
  121. {headerName: "지시구분", field: "delvGbNm", width: 80, cellClass: "text-center"},
  122. {headerName: "택배사전송", field: "sendYn", width: 80, cellClass: "text-center",
  123. cellRenderer: function (params) { return params.value == 'Y' ? '전송' : '미전송'; }
  124. },
  125. {headerName: "사이트", field: "siteCd", width: 80, cellClass: "text-center",
  126. valueFormatter: function (params) { return gagaAgGrid.lookupValue(siteList, params.value); }
  127. },
  128. {headerName: "주문번호", field: "ordNo", width: 100, cellClass: "text-center",
  129. cellRenderer: function(params) { return gagajf.isNull(params.value) ? '' : '<a href="javascript:void(0);">' + params.value + '</a>'; }
  130. },
  131. {headerName: "주문상세번호", field: "ordDtlNo", width: 100, cellClass: "text-center"},
  132. {headerName: "상품코드", field: "goodsCd", width: 120, cellClass: "text-center",
  133. cellRenderer: function(params) { return gagajf.isNull(params.value) ? '' : '<a href="javascript:void(0);">' + params.value + '</a>'; }
  134. },
  135. {headerName: "상품명", field: "goodsNm", width: 200, cellClass: "text-left"},
  136. {headerName: "수취인명", field: "recipNm", width: 120, cellClass: "text-center"},
  137. {headerName: "수취인휴대전화", field: "recipPhnno", width: 120, cellClass: "text-center"},
  138. {headerName: "수취인전화번호", field: "recipTelno", width: 120, cellClass: "text-center"},
  139. {headerName: "수취인우편번호", field: "recipZipcode", width: 120, cellClass: "text-center"},
  140. {headerName: "수취인기본주소", field: "recipBaseAddr", width: 300, cellClass: "text-left"},
  141. {headerName: "수취인상세주소", field: "recipDtlAddr", width: 200, cellClass: "text-left"},
  142. {headerName: "주문자명", field: "ordNm", width: 100, cellClass: "text-center"},
  143. {headerName: "주문자휴대전화", field: "ordPhnno", width: 120, cellClass: "text-center"},
  144. {headerName: "주문자전화번호", field: "ordTelno", width: 120, cellClass: "text-center"},
  145. {headerName: "주문자이메일", field: "ordEmail", width: 120, cellClass: "text-left"}
  146. ];
  147. var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
  148. // 셀 클릭 이벤트
  149. gridOptions.onCellClicked = function(event) {
  150. if (event.colDef.field == 'ordNo') {
  151. currOrdNo = event.data.ordNo;
  152. // 주문 상세
  153. cfnOpenOrderDetailPopup(event.data.ordNo);
  154. } else if (event.colDef.field == 'goodsCd') {
  155. // 상품 상세
  156. cfnOpenGoodsDetailPopup('U', event.data.goodsCd);
  157. }
  158. };
  159. /*************************************************************************
  160. * 팝업 콜백
  161. **************************************************************************/
  162. var fnReOpenOrderDetailPopup = function () {
  163. cfnOpenOrderDetailPopup(currOrdNo);
  164. fnSearchList();
  165. };
  166. // 조회
  167. $('#btnSearch').on('click', function() {
  168. // Fetch data
  169. //gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
  170. fnSearchList();
  171. });
  172. /*************************************************************************
  173. * 조회
  174. **************************************************************************/
  175. var fnSearchList = function() {
  176. if($('#stDate').val() == ''){
  177. mcxDialog.alert('시작 기간을 입력하세요.');
  178. return;
  179. }
  180. if($('#edDate').val() == ''){
  181. mcxDialog.alert('종료 기간을 입력하세요.');
  182. return;
  183. }
  184. // 날짜 유효성 체크
  185. if (Number($('#stDate').val().replaceAll("-", "")) > Number($('#edDate').val().replaceAll("-", ""))) {
  186. mcxDialog.alert("시작일은 종료일보다 클 수 없습니다.");
  187. return;
  188. }
  189. gagaPaging.init('searchForm', fnSearchCallBack, 'delvWithdrawListPagination', $('#searchForm').find('#pageSize').val());
  190. gagaPaging.load($("#searchForm input[name=pageNo]").val());
  191. }
  192. /*************************************************************************
  193. * 조회 콜백
  194. **************************************************************************/
  195. var fnSearchCallBack = function(result){
  196. $('#searchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
  197. $('#searchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
  198. $('#searchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
  199. $('#searchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
  200. gridOptions.api.setRowData(result.dwdirectList);
  201. gagaPaging.createPagination(result.pageing.pageable);
  202. }
  203. //엑셀다운로드
  204. $('#btnExcel').on('click', function() {
  205. gagaAgGrid.exportToExcel('배송/회수지시 목록', gridOptions);
  206. var totalRows = gridOptions.api.getDisplayedRowCount();
  207. if(totalRows==0){
  208. mcxDialog.alert('조회된 내역이 없습니다.');
  209. return;
  210. }
  211. var date = new Date().format("YYYYMMDDHHmmss");
  212. var params = {
  213. fileName : "회수송장전송목록_"+ date,
  214. sheetName: "DATA"
  215. }
  216. gridOptions.excelStyles = [
  217. {
  218. id: 'dateFormat',
  219. dataType: 'dateTime',
  220. numberFormat: {
  221. format: 'YYYY-MM-DD;@'
  222. }
  223. },
  224. {
  225. id: 'textFormat',
  226. dataType: 'string'
  227. }
  228. ]
  229. gridOptions.api.exportDataAsExcel(params);
  230. });
  231. $(document).ready(function() {
  232. // Create a agGrid
  233. gagaAgGrid.createGrid('gridList', gridOptions);
  234. cfnCreateCalendar('#terms', 'stDate', 'edDate', false);
  235. // grid 높이 조절
  236. //uifnFitGrid('auto');
  237. gagajf.setDate('#terms', 'stDate', 'edDate', 't');
  238. //fnDatepickerDisabled();
  239. });
  240. /*]]>*/
  241. </script>
  242. </html>