ExcelUploadPopupForm.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : ExcelUploadPopupForm.html
  7. * @desc : 엑셀 업로드 팝업 Page
  8. *============================================================================
  9. * STYLE24
  10. * Copyright(C) 2019 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2020.10.22 eskim 최초 작성
  15. *******************************************************************************
  16. -->
  17. <div class="modalPopup" data-width="600">
  18. <div class="panelStyle">
  19. <!-- TITLE -->
  20. <div class="panelTitle">
  21. <strong>엑셀업로드</strong>
  22. <button type="button" class="close" onclick="uifnPopupClose('popupExcelUpload')"><i class="fa fa-times"></i></button>
  23. </div>
  24. <!-- //TITLE -->
  25. <!-- CONTENT -->
  26. <div class="panelContent">
  27. <form id="excelPopupForm" name="excelPopupForm" action="">
  28. <input type="hidden" name="procJob" id="procJob" th:value="${params.procJob}"/>
  29. <input type="hidden" name="callBackFun" id="callBackFun" th:value="${params.callBackFun}"/>
  30. <table class="frmStyle">
  31. <colgroup>
  32. <col style="width:20%;"/>
  33. <col/>
  34. <col style="width:20%;"/>
  35. </colgroup>
  36. <tbody>
  37. <tr>
  38. <th>파일</th>
  39. <td><div class="uFile w300">
  40. <input id="excelFile" name="excelFile" type="file" class="uFileInput"/>
  41. <label for="excelFile" class="uFileLabel">파일선택</label>
  42. <input type="hidden" name="OrgFileNm"/>
  43. <input type="hidden" name="NewFileNm"/>
  44. </div>
  45. </td>
  46. </tr>
  47. </tbody>
  48. </table>
  49. <!-- 버튼 배치 영역 -->
  50. <ul class="panelBar">
  51. <li class="right">
  52. <button type="button" class="btn btn-success btn-lg" id="btnExcelUploadSave">저장</button>
  53. </li>
  54. </ul>
  55. <!-- //버튼 배치 영역 -->
  56. </form>
  57. </div>
  58. </div>
  59. <!-- //CONTENT -->
  60. </div>
  61. <script th:inline="javascript">
  62. /*<![CDATA[*/
  63. //첨부파일 등록
  64. $('#excelPopupForm input[name=excelFile]').on('change', function() {
  65. var file = this.files[0];
  66. if (typeof(file) == 'undefined'){
  67. return;
  68. }
  69. gagajf.ajaxFileUpload('/common/file/upload?subDir=/excel'
  70. , file
  71. , function(result) {
  72. $('#excelPopupForm input[name=OrgFileNm]').val(result.newFileName);
  73. $('#excelPopupForm input[name=NewFileNm]').val(result.newFileName);
  74. }
  75. , 'excel'
  76. );
  77. });
  78. //저장
  79. $('#btnExcelUploadSave').on('click', function (){
  80. if(gagajf.isNull($("#excelPopupForm input[name=OrgFileNm]").val())){
  81. mcxDialog.alert("파일을 첨부해 주세요.");
  82. $("#excelPopupForm input[name=excelFile]").focus();
  83. return false;
  84. }
  85. var callback = $('#excelPopupForm input[name=callBackFun]').val();
  86. if( typeof callback != 'undefined' && callback){
  87. var data = {procJob : $('#excelPopupForm input[name=procJob]').val()
  88. , callBackFun : $('#excelPopupForm input[name=callBackFun]').val()
  89. , excelFileNm : $('#excelPopupForm input[name=NewFileNm]').val()
  90. };
  91. var jsonData = JSON.stringify(data);
  92. if (typeof callback == 'function') {
  93. callback(jsonData);
  94. }else{
  95. if( callback ) {
  96. if( callback.indexOf("(") == -1 ) eval( callback +"(" + jsonData+")");
  97. else eval( callback(jsonData) );
  98. }
  99. }
  100. uifnPopupClose('popupExcelUpload');
  101. }
  102. });
  103. /*]]>*/
  104. </script>
  105. </html>