OneToOneQnaRegisterFormWeb.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org"
  4. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  5. layout:decorator="web/common/layout/CallcenterLayoutWeb">
  6. <!--
  7. *******************************************************************************
  8. * @source : OneToOneQnaRegisterFormWeb.html
  9. * @desc : 1:1문의 등록 Page
  10. *============================================================================
  11. * STYLE24
  12. * Copyright(C) 2020 TSIT, All rights reserved.
  13. *============================================================================
  14. * VER DATE AUTHOR DESCRIPTION
  15. * === =========== ========== =============================================
  16. * 1.0 2021.02.19 gagamel 최초 작성
  17. *******************************************************************************
  18. -->
  19. <body>
  20. <th:block layout:fragment="content">
  21. <div id="container" class="container cs">
  22. <div class="breadcrumb">
  23. <ul>
  24. <li class="bread_home"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MAIN);">홈</a></li>
  25. <li class="bread_2depth"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_FAQ);">고객센터</a></li>
  26. <li class="bread_3depth">1:1문의</li>
  27. </ul>
  28. </div>
  29. <div class="wrap">
  30. <div class="content contactUs_my">
  31. <div class="cont_body">
  32. <!-- CONT-BODY -->
  33. <div class="lnb" id="callcenterLnb">
  34. </div>
  35. <div class="cont">
  36. <div>
  37. <div class="sec_head">
  38. <h3>1:1 문의</h3>
  39. </div>
  40. <div class="sec_body">
  41. <div class="t_info blt_dot mb15 light">문의를 남겨 주시면 24시간 이내(토/일/공휴일 제외)에 답변 드릴 수 있도록 최선을 다 하겠습니다.</div>
  42. <form class="form_wrap" role="form" name="qnaForm" id="qnaForm" th:action="@{'/onetoone/qna/create'}" method="post">
  43. <div class="form_field">
  44. <label class="ui_col_2 input_label">문의 유형</label>
  45. <div class="ui_col_10 form_full">
  46. <div class="input_wrap">
  47. <select name="counselClsf" required="required" data-valid-name="문의유형">
  48. <option value="">유형을 선택해 주세요</option>
  49. <option th:if="${counselClsfList}" th:each="oneData, status : ${counselClsfList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option>
  50. </select>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="form_field">
  55. <label class="ui_col_2 input_label">제목</label>
  56. <div class="ui_col_10 form_full">
  57. <div class="input_wrap">
  58. <span class="input_group_addon"><span class="ico"></span></span>
  59. <input type="text" class="form_control" placeholder="30자 내외로 작성해주세요" maxlength="30" name="questTitle" required="required" data-valid-name="제목"/>
  60. </div>
  61. <!-- 숫자, 특수문자, 불완성형 한글 제외하여 입력 -->
  62. </div>
  63. </div>
  64. <div class="form_field">
  65. <label class="ui_col_2 input_label">내용</label>
  66. <div class="ui_col_10 form_full">
  67. <div class="input_wrap">
  68. <textarea class="doc_contactus" name="questContent" cols="30" rows="10" style="resize: none;" required="required" data-valid-name="내용"></textarea>
  69. <p class="txt_cnt">
  70. <span id="contactus_cnt" class="contactus_cnt">(<em class="c_primary">0</em>/500자)</span>
  71. </p>
  72. </div>
  73. <!-- 특수문자 : \ / : < > 사용 불가 > 입력 시, “특수문자 \ / : < > 는 사용할 수 없습니다.” 얼럿 호출 스크립트 입력 불가능 -->
  74. </div>
  75. </div>
  76. <div class="form_field">
  77. <label class="ui_col_2 input_label">첨부이미지</label>
  78. <div class="ui_col_10 form_full">
  79. <div class="input_wrap">
  80. <!-- 이미지첨부 -->
  81. <div class="form_field">
  82. <div class="imgUpload">
  83. <label for="fileAdd" class="fileAdd">업로드</label>
  84. <input type="file" id="fileAdd" name="file1"/>
  85. <input type="hidden" name="fileAddOrgFileNm"/>
  86. <input type="hidden" name="fileAddSysFileNm"/>
  87. </div>
  88. <div class="imgUpload">
  89. <label for="fileAdd" class="fileAdd">업로드</label>
  90. <input type="file" id="file2" name="file2"/>
  91. <input type="hidden" name="file2OrgFileNm"/>
  92. <input type="hidden" name="file2SysFileNm"/>
  93. </div>
  94. </div>
  95. <!-- //이미지첨부 -->
  96. <div class="info_addfile">
  97. <ul>
  98. <li>- 사진은 최대 20MB 이하의 JPG,PNG,GIF <span>파일2장까지 첨부 가능</span>합니다.</li>
  99. <li>- 파일명에 한글은 사용불가입니다.</li>
  100. <li>- 첨부된 사진은 문의 외의 목적으로는 사용되지 않습니다.</li>
  101. </ul>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="form_field">
  107. <label class="ui_col_2 input_label">휴대폰</label>
  108. <div class="ui_col_10 cellphone">
  109. <div class="input_wrap">
  110. <input type="text" class="form_control" name="cellPhnno" maxlength="13" placeholder="휴대폰 번호를 010-1234-5678 형식으로 입력해주세요." required="required" data-valid-name="휴대폰번호"/> <!-- 잘못 입력시 클래스명 : err 추가 -->
  111. <!-- 알림 신청 체크박스(선택 _ 기본값) -->
  112. <div class="ck_box">
  113. <input type="hidden" name="smsReqYn"/>
  114. <input type="checkbox" name="chkSmsReqYn" value="Y" checked="checked"/>
  115. <label for="chkSmsReqYn"><span>알림 신청</span></label>
  116. </div>
  117. </div>
  118. <div class="help_block" style="display: none;" id="divCellPhnno">
  119. <p class="t_err">휴대폰 번호를 형식에 맞게 정확히 입력해주세요.</p>
  120. </div>
  121. </div>
  122. </div>
  123. </form>
  124. </div>
  125. <div class="sec_foot t_c">
  126. <button type="button" class="btn btn_default btn_md" onclick="history.back(-1);"><span>취소</span></button>
  127. <button type="button" class="btn btn_dark btn_md" id="btnSaveQna"><span>확인</span></button>
  128. </div>
  129. </div>
  130. </div>
  131. <!-- // CONT-BODY -->
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <!-- // container -->
  137. <script th:inline="javascript">
  138. /*<![CDATA[*/
  139. $(document).ready(function() {
  140. // 고객센터 LNB 설정
  141. fnSetCallcenterLnb(2);
  142. });
  143. // text_area
  144. $('.doc_contactus').keyup(function (e) {
  145. var content = $(this).val();
  146. $('#contactus_cnt').html("(<em class='c_primary'>" + content.length + "</em>/500자)");
  147. if (content.length > 500) {
  148. alert("최대 500자까지 입력 가능합니다.");
  149. $(this).val(content.substring(0, 500));
  150. $('#contactus_cnt').html("(<em class='c_primary'>500</em>/500자)");
  151. }
  152. });
  153. // 파일첨부 선택 시
  154. $('#fileAdd').on('change', function() { fnChooseFile(this); });
  155. $('#file2').on('change', function() { fnChooseFile(this); });
  156. var fnChooseFile = function(obj) {
  157. // multiple 속성이 있으면 files에는 다수의 객체가 할당됨
  158. var file = obj.files[0];
  159. if (!gagajf.isNull(file.name)) {
  160. var extension = "\.(jpg|jpeg|png)$";
  161. if (!(new RegExp(extension, "i")).test(file.name)) {
  162. mcxDialog.alert('이미지는 [jpg, jpeg, png] 파일만 가능합니다.');
  163. return false;
  164. }
  165. }
  166. if (!gagajf.isNull(file.size) && Number(file.size) > 20 * 1000000) {
  167. mcxDialog.alert('이미지는 최대 20MB 이하 파일만 가능합니다.');
  168. return false;
  169. }
  170. // 파일 업로드
  171. gagajf.ajaxFileUpload('/common/file/upload?subDir=/counsel'
  172. , file
  173. , function(result) {
  174. // 업로드한 파일명 설정
  175. $('input[name=' + obj.name + 'OrgFileNm]').val(result.oldFileName);
  176. $('input[name=' + obj.name + 'SysFileNm]').val(result.newFileName);
  177. }
  178. );
  179. }
  180. // 저장
  181. $('#btnSaveQna').on('click', function() {
  182. // 입력 값 체크
  183. if (!gagajf.validation('#qnaForm'))
  184. return false;
  185. if (!gagajf.isNull($('#qnaForm input[name=cellPhnno]').val())) {
  186. let regexp = /^(01(?:0|1|[6-9])-(?:\d{3}|\d{4})-\d{4})$/;
  187. if (!regexp.test($('#qnaForm input[name=cellPhnno]').val())) {
  188. $('#qnaForm input[name=cellPhnno]').addClass('err');
  189. $('#divCellPhnno').show();
  190. $('#qnaForm input[name=cellPhnno]').select();
  191. $('#qnaForm input[name=cellPhnno]').focus();
  192. return false;
  193. }
  194. }
  195. $('#qnaForm input[name=cellPhnno]').removeClass('err');
  196. $('#divCellPhnno').hide();
  197. $('#qnaForm input[name=smsReqYn]').val($('#qnaForm input:checkbox[name=chkSmsReqYn]').is(":checked") ? 'Y' : 'N');
  198. mcxDialog.confirm("저장하시겠습니까?", {
  199. cancelBtnText: "취소",
  200. sureBtnText: "확인",
  201. sureBtnClick: function() {
  202. gagajf.ajaxFormSubmit($('#qnaForm').prop('action')
  203. , $('#qnaForm')
  204. , function() {
  205. cfnGoToPage(_PAGE_ONETOONE_QNA);
  206. }
  207. );
  208. }
  209. });
  210. });
  211. /*]]>*/
  212. </script>
  213. </th:block>
  214. </body>
  215. </html>