BatchForm.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : BatchForm.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 2020.12.02 gagamel 최초 작성
  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. <div class="panelStyle">
  28. <!-- Search -->
  29. <form id="searchForm" name="searchForm" action="#" th:action="@{'/system/batch/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
  30. <table class="frmStyle" aria-describedby="검색조건">
  31. <colgroup>
  32. <col style="width:10%;"/>
  33. <col style="width:40%;"/>
  34. <col style="width:10%;"/>
  35. <col/>
  36. </colgroup>
  37. <tr>
  38. <th>업무구분</th>
  39. <td>
  40. <select name="bizGb" class="w150">
  41. <option value="">[전체]</option>
  42. <option th:if="${bizGbList}" th:each="oneData, status : ${bizGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  43. </select>
  44. </td>
  45. <th>구분</th>
  46. <td>
  47. <select name="searchGb">
  48. <option value="">[선택]</option>
  49. <option value="batchId">배치ID</option>
  50. <option value="batchNm">배치명</option>
  51. </select>
  52. <input type="text" class="w300" name="searchTxt" placeholder="" maxlength="50"/>
  53. </td>
  54. </tr>
  55. </table>
  56. <ul class="panelBar">
  57. <li class="center">
  58. <button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
  59. </li>
  60. </ul>
  61. </form>
  62. </div>
  63. <!-- 리스트 영역 -->
  64. <div class="panelStyle">
  65. <div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
  66. </div>
  67. <!-- //리스트 영역 -->
  68. <!-- 등록/수정 영역 -->
  69. <div class="panelStyle">
  70. <form id="detailForm" name="detailForm" action="#" th:action="@{'/system/batch/save'}">
  71. <input type="hidden" name="mode" value="N"/>
  72. <table class="frmStyle" aria-describedby="등록/수정 폼">
  73. <colgroup>
  74. <col style="width:10%;"/>
  75. <col style="width:40%;"/>
  76. <col style="width:10%;"/>
  77. <col/>
  78. </colgroup>
  79. <tr>
  80. <th>배치ID<em class="required" title="필수"></em></th>
  81. <td>
  82. <input type="text" name="batchId" class="w300" placeholder="" required="required" maxlength="50" data-valid-name="배치ID"/>
  83. </td>
  84. <th>배치명<em class="required" title="필수"></em></th>
  85. <td>
  86. <input type="text" name="batchNm" placeholder="" maxlength="100" required="required" data-valid-name="배치명"/>
  87. </td>
  88. </tr>
  89. <tr>
  90. <th>업무구분<em class="required" title="필수"></em></th>
  91. <td>
  92. <select name="bizGb" class="w150" required="required" data-valid-name="업무구분">
  93. <option value="">[선택]</option>
  94. <option th:if="${bizGbList}" th:each="oneData, status : ${bizGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  95. </select>
  96. </td>
  97. <th>배치주기<em class="required" title="필수"></em></th>
  98. <td>
  99. <select name="batchFrq" required="required" data-valid-name="배치주기">
  100. <option value="">[선택]</option>
  101. <option value="H">[H] 시간배치</option>
  102. <option value="D">[D] 일배치</option>
  103. <option value="M">[M] 월배치</option>
  104. <option value="Y">[Y] 연배치</option>
  105. </select>
  106. </td>
  107. </tr>
  108. <tr>
  109. <th>배치설명</th>
  110. <td colspan="3">
  111. <textarea class="textareaR4" name="batchDesc"></textarea>
  112. </td>
  113. </tr>
  114. <tr>
  115. <th>사용여부<em class="required" title="필수"></em></th>
  116. <td colspan="3">
  117. <input type="hidden" name="useYn"/>
  118. <label class="chkBox"><input type="checkbox" name="chkUseYn" value="Y" checked="checked" readonly="readonly"/>사용</label>
  119. </td>
  120. </tr>
  121. </table>
  122. <ul class="panelBar">
  123. <li class="right">
  124. <button type="button" class="btn btn-info btn-lg" id="btnNew">신규</button>
  125. <button type="button" class="btn btn-success btn-lg" id="btnSave">저장</button>
  126. </li>
  127. </ul>
  128. </form>
  129. </div>
  130. <!-- //등록/수정 영역 -->
  131. </div>
  132. <script th:inline="javascript">
  133. /*<![CDATA[*/
  134. var bizGbList = gagajf.convertToArray([[${bizGbList}]]);
  135. // specify the columns
  136. var columnDefs = [
  137. {
  138. headerName: "배치ID", field: "batchId", width: 200,
  139. cellRenderer: function(params) {
  140. return '<a href="javascript:void(0);">' + params.value + '</a>';
  141. }
  142. },
  143. {headerName: "배치명", field: "batchNm", width: 250},
  144. {
  145. headerName: "업무구분", field: "bizGb", width: 100, cellClass: 'text-center',
  146. cellRenderer: function (params) { return gagaAgGrid.lookupValue(bizGbList, params.value); }
  147. },
  148. {
  149. headerName: "배치주기", field: "batchFrq", width: 100, cellClass: 'text-center',
  150. cellRenderer: function(params) {
  151. let batchFrqNm = '시간배치';
  152. if (params.value == 'D') batchFrqNm = '일배치';
  153. else if (params.value == 'M') batchFrqNm = '월배치';
  154. else if (params.value == 'Y') batchFrqNm = '연배치';
  155. return batchFrqNm;
  156. }
  157. },
  158. {headerName: "배치설명", field: "batchDesc", width: 400, hide: true},
  159. {headerName: "사용여부", field: "useYn", width: 100, cellClass: 'text-center'}
  160. ];
  161. // Get GridOptions
  162. var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
  163. // Cell Click
  164. gridOptions.onCellClicked = function(event) {
  165. if (event.colDef.field != 'batchId')
  166. return;
  167. $('#detailForm input[name=mode]').val('U');
  168. $('#detailForm input[name=batchId]').val(event.data.batchId);
  169. $('#detailForm input[name=batchId]').attr('readonly', true);
  170. $('#detailForm input[name=batchNm]').val(event.data.batchNm);
  171. $('#detailForm select[name=bizGb]').val(event.data.bizGb);
  172. $('#detailForm select[name=batchFrq]').val(event.data.batchFrq);
  173. $('#detailForm textarea[name=batchDesc]').val(event.data.batchDesc);
  174. if (event.data.useYn == 'Y') {
  175. $("#detailForm input:checkbox[name=chkUseYn]").prop('checked', true);
  176. $("#detailForm input:checkbox[name=chkUseYn]").parent().addClass('checked');
  177. } else {
  178. $("#detailForm input:checkbox[name=chkUseYn]").prop('checked', false);
  179. $("#detailForm input:checkbox[name=chkUseYn]").parent().removeClass('checked');
  180. }
  181. $('#detailForm input:checkbox[name=chkUseYn]').attr('readonly', false);
  182. }
  183. // 조회
  184. $('#btnSearch').on('click', function() {
  185. // Fetch data
  186. gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
  187. });
  188. // 신규
  189. $('#btnNew').on('click', function() {
  190. $('#detailForm')[0].reset();
  191. $('#detailForm input[name=mode]').val('N');
  192. $('#detailForm input[name=batchId]').attr('readonly', false);
  193. $('#detailForm input:checkbox[name=chkUseYn]').prop('checked', true);
  194. $('#detailForm input:checkbox[name=chkUseYn]').attr('readonly', true);
  195. $('#detailForm input[name=batchId]').focus();
  196. });
  197. // 저장 처리
  198. $('#btnSave').on('click', function() {
  199. // 입력 값 체크
  200. if (!gagajf.validation('#detailForm'))
  201. return;
  202. $('#detailForm input[name=useYn]').val($('#detailForm input:checkbox[name=chkUseYn]').is(":checked") ? 'Y' : 'N');
  203. mcxDialog.confirm("저장하시겠습니까?", {
  204. cancelBtnText: "취소",
  205. sureBtnText: "확인",
  206. sureBtnClick: function() {
  207. gagajf.ajaxFormSubmit($('#detailForm').prop('action')
  208. , $('#detailForm')
  209. , function() {
  210. $('#btnNew').trigger('click');
  211. $('#btnSearch').trigger('click');
  212. }
  213. );
  214. }
  215. });
  216. });
  217. $(document).ready(function() {
  218. // Create a agGrid
  219. gagaAgGrid.createGrid('gridList', gridOptions);
  220. });
  221. /*]]>*/
  222. </script>
  223. </html>