OwnList.jsp 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <%--
  2. - FileName : OwnList.jsp
  3. - Author(s) : gyeongmo an
  4. - Date : 2014.7.2
  5. --%>
  6. <%@ page contentType="text/html; charset=utf-8" %>
  7. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  8. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  9. <%@ page import="kr.co.hsnc.common.util.*"%>
  10. <%@ page import="kr.co.hsnc.common.sql.*" %>
  11. <%@ include file="/jsp/work/taglib.jsp" %>
  12. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  13. <%
  14. ctx.init(request, response);
  15. HandlerStorage storage = ctx.getHandlerStorage();
  16. ValueObject params = storage.getParams();
  17. ValueObject user = storage.getUser();
  18. String event = storage.getEvent();
  19. ValueObject vo = storage.getValueObject("ownListRowSet");
  20. String post_no1 = "";
  21. String post_no2 = "";
  22. if(!"".equals(vo.get("post_no"))) {
  23. post_no1 = vo.get("post_no").substring(0,3);
  24. post_no2 = vo.get("post_no").substring(3,6);
  25. }
  26. %>
  27. <script type="text/javascript">
  28. function _onReady(){
  29. jQuery("#btnSave").click(function() {
  30. // 사업자번호 체크
  31. if($("#corp_reg_no").val().trim() != "")
  32. {
  33. var regNum = /^[0-9]*$/;
  34. var corpRegNo = $("#corp_reg_no").val().trim();
  35. if(!regNum.test($("#corp_reg_no").val().trim()))
  36. {
  37. alert("사업자 번호는 숫자만 입력해 주세요.");
  38. $("#corp_reg_no").focus();
  39. return false;
  40. }
  41. if(corpRegNo.length < 10) {
  42. alert("사업자번호는 10자리로 입력해 주세요.");
  43. $("#corp_reg_no").focus();
  44. return false;
  45. }
  46. }
  47. else
  48. {
  49. alert("사업자 번호를 입력해 주세요");
  50. $("#corp_reg_no").focus();
  51. return false;
  52. }
  53. if($("#copr_no").val().trim() != "")
  54. {
  55. var regNum = /^[0-9]*$/;
  56. var corpRegNo = $("#copr_no").val().trim();
  57. if(!regNum.test($("#copr_no").val().trim()))
  58. {
  59. alert("법인번호는 숫자만 입력해 주세요.");
  60. $("#copr_no").focus();
  61. return false;
  62. }
  63. if(corpRegNo.length < 13) {
  64. alert("법인번호는 13자리로 입력해 주세요.");
  65. $("#copr_no").focus();
  66. return false;
  67. }
  68. }
  69. else
  70. {
  71. alert("법인번호를 입력해 주세요");
  72. $("#copr_no").focus();
  73. return false;
  74. }
  75. if($("#rep_name").val().trim() == "")
  76. {
  77. alert("대표자명을 입력해 주세요");
  78. $("#rep_name").focus();
  79. return false;
  80. } else if($("#rep_name").val().trim().length > 200) {
  81. alert("대표자명은 200자 까지 입력할 수 있습니다.");
  82. $("#rep_name").focus();
  83. return false;
  84. }
  85. if($("#corp_kor").val().trim().length > 200) {
  86. alert("한글 업체명은 200자 까지 입력할 수 있습니다.");
  87. $("#corp_kor").focus();
  88. return false;
  89. }
  90. if($("#corp_eng").val().trim().length > 200) {
  91. alert("영문 업체명은 200자 까지 입력할 수 있습니다.");
  92. $("#corp_eng").focus();
  93. return false;
  94. }
  95. if($("#corp_sts").val().trim().length > 100) {
  96. alert("업태는 100자리까지 입력할 수 있습니다.");
  97. $("#corp_sts").focus();
  98. return false;
  99. }
  100. if($("#biz_form").val().trim().length > 100) {
  101. alert("업종은 100자리까지 입력할 수 있습니다.");
  102. $("#biz_form").focus();
  103. return false;
  104. }
  105. if($("#post_no1").val().trim() == "" || $("#post_no2").val().trim() == "")
  106. {
  107. alert("우편번호를 선택해 주세요.");
  108. $("#post_no1").focus();
  109. return false;
  110. }
  111. var regExp = /^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})-?[0-9]{3,4}-?[0-9]{4}$/;
  112. if($("#corp_tel").val().trim() == "") {
  113. alert("전화번호를 입력하세요.");
  114. $("#corp_tel").focus();
  115. return false;
  116. }
  117. else if (!regExp.test($("#corp_tel").val().trim())) {
  118. alert("잘못된 전화번호입니다. 숫자, - 를 포함한 숫자만 입력하세요. 예) 050-XXXX-XXXX");
  119. $("#corp_tel").focus();
  120. return false;
  121. } else if($("#corp_tel").val().trim().length > 100) {
  122. alert("전화번호는 100자리까지 입력할 수 있습니다.");
  123. $("#corp_tel").focus();
  124. return false;
  125. }
  126. if($("#address").val().trim().length > 500) {
  127. alert("주소는 500자리까지 입력할 수 있습니다.");
  128. $("#address").focus();
  129. return false;
  130. }
  131. if(confirm("수정하시겠습니까?")) {
  132. submitXmlRequest("/sycs/own/OwnList_form.screen", "SAVE_OWN_LIST", document.form1);
  133. }
  134. });
  135. }
  136. function doResult(resultObj) {
  137. try {
  138. document.form1.isSubmit = false;
  139. if( resultObj.getRequestEvent() == "SAVE_OWN_LIST") {
  140. if( resultObj.getSuccess() )
  141. {
  142. alert("수정되었습니다.");
  143. }
  144. }
  145. }
  146. catch(errorObject) {
  147. showErrorDlg("doResult()", errorObject);
  148. }
  149. }
  150. function searchPostCode() {
  151. /*
  152. var url = "/common/lib/dlgSearchZipCode.screen";
  153. result = window.showModalDialog(url,'zipCode','dialogWidth:550px;dialogHeight:540px;center:yes;help:no;status:no;scroll:no;resizable:no');
  154. if ( result == null ) {
  155. return;
  156. } else {
  157. document.form1.address.value = result[2];
  158. document.form1.post_no1.value = result[0].substring(0,3);
  159. document.form1.post_no2.value = result[0].substring(4,7);
  160. }
  161. */
  162. var win_id = "_searchPostCode";
  163. var link = "/common/lib/dlgSearchZipCode.screen";
  164. link += "?pop_win_id="+win_id;
  165. fLayerPop(win_id, link, 550,540, '', '', 'NO');
  166. }
  167. function searchPostCodeClose(result) {
  168. if( result != null ){
  169. document.form1.address.value = result[2];
  170. document.form1.post_no1.value = result[0].substring(0,3);
  171. document.form1.post_no2.value = result[0].substring(4,7);
  172. }
  173. fLayerPopClose('_searchPostCode');
  174. }
  175. </script>
  176. <form id="form1" name="form1" method="post">
  177. <INPUT type="hidden" name="fevent" id="fevent" value="">
  178. <!-- 제목 및 버튼 -->
  179. <table width="100%">
  180. <colgroup>
  181. <col width="500" />
  182. <col width="*" />
  183. </colgroup>
  184. <tr>
  185. <th>
  186. <div align="left" id="title">
  187. <ul>
  188. <li>본사관리</li>
  189. </ul>
  190. </div>
  191. </th>
  192. <td align="right">
  193. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSave">수정</a></span>
  194. </td>
  195. </tr>
  196. </table>
  197. <TABLE class="form-table">
  198. <col width="150px">
  199. <col>
  200. <col width="150px">
  201. <col>
  202. <tr height="25">
  203. <!-- 검색조건 타이틀 1 -->
  204. <th class="required">
  205. 사업자번호
  206. </th>
  207. <td>
  208. <input type="text" name="corp_reg_no" id="corp_reg_no" numberOnly="true" style="width: 90%;" maxlength="10" value="<%=vo.get("corp_reg_no")%>"/>
  209. </td>
  210. <th class="required">
  211. 법인번호
  212. </th>
  213. <td>
  214. <input type="text" name="copr_no" id="copr_no" numberOnly="true" style="width: 90%;" maxlength="13" value="<%=vo.get("copr_no")%>"/>
  215. </td>
  216. </tr>
  217. <tr height="25">
  218. <Th class="required">
  219. 업체명(한글)
  220. </th>
  221. <td>
  222. <input type="text" name="corp_kor" id="corp_kor" style="width: 90%;" value="<%=vo.get("corp_kor")%>"/>
  223. </td>
  224. <th class="required">
  225. 업체명(영문)
  226. </th>
  227. <td>
  228. <input type="text" name="corp_eng" id="corp_eng" style="width: 90%;" value="<%=vo.get("corp_eng")%>"/>
  229. </td>
  230. </tr>
  231. <tr height="25">
  232. <th class="required">
  233. 업태
  234. </th>
  235. <td>
  236. <input type="text" name="corp_sts" id="corp_sts" style="width: 90%;" value="<%=vo.get("corp_sts")%>"/>
  237. </td>
  238. <th class="required">
  239. 업종
  240. </th>
  241. <td>
  242. <input type="text" name="biz_form" id="biz_form" style="width: 90%;" value="<%=vo.get("biz_form")%>"/>
  243. </td>
  244. </tr>
  245. <tr height="25">
  246. <th class="required">
  247. 대표자명
  248. </th>
  249. <td>
  250. <input type="text" name="rep_name" id="rep_name" style="width: 90%;" value="<%=vo.get("rep_name")%>"/>
  251. </td>
  252. <th class="required">
  253. 전화번호
  254. </th>
  255. <td colspan="3" >
  256. <input type="text" name="corp_tel" id="corp_tel" style="width: 90%;" value="<%=vo.get("corp_tel")%>"/>
  257. </td>
  258. </tr>
  259. <tr height="25">
  260. <th class="required">
  261. 주소
  262. </th>
  263. <td colspan="3">
  264. <%= InputText.get("post_no1", post_no1, 3, 3, "desc=우편번호,readOnly,center") %>-
  265. <%= InputText.get("post_no2", post_no2, 3, 3, "desc=우편번호,readOnly,center") %>
  266. <IMG onclick="searchPostCode();" src="/img/buyer/button/bt_search_right.gif" alt="우편번호검색" border="0" align="absmiddle" style="cursor:hand;">&nbsp;
  267. <input type="text" name="address" id="address" style="width: 88%;" value="<%=vo.get("address")%>"/>
  268. </td>
  269. </tr>
  270. </table>
  271. </form>