QuotPurSuppReg.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <%--
  2. - FileName : QuotPurSuppReg.jsp
  3. - Author(s) : HOONSEOK CHOI
  4. - Date : 2023-11
  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="com.udapsoft.waf.common.ui.InitCombo" %>
  10. <%@ page import="kr.co.udapsoft.common.code.CommCodeManager" %>
  11. <%@ page import="kr.co.hsnc.common.util.*"%>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <%@ include file="/jsp/work/taglib.jsp" %>
  14. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  15. <%
  16. ctx.init(request, response);
  17. HandlerStorage storage = ctx.getHandlerStorage();
  18. ValueObject params = storage.getParams();
  19. ValueObject user = storage.getUser();
  20. String event = storage.getEvent();
  21. ValueObject vo = storage.getValueObject("QuotPurSuppReg");
  22. String status = "";
  23. status = params.get("status");
  24. String job_gubun = "";
  25. if(params.get("job_div").equals("P"))
  26. {
  27. job_gubun = "구매";
  28. }
  29. else
  30. {
  31. job_gubun = "외주";
  32. }
  33. //공통코드
  34. CommCodeManager commCodeManager = new CommCodeManager();
  35. InitCombo initCombo = new InitCombo();
  36. %>
  37. <script type="text/javascript">
  38. <!--
  39. $(function(){
  40. var event = "<%=event%>";
  41. var status = "<%=vo.get("STATUS_CD")%>";
  42. var f = document.form1;
  43. if(event == "")
  44. {
  45. $("#btn_delete_area").css("display", "none");
  46. }
  47. else if(event == "GET_DETAIL")
  48. {
  49. $("#corp_reg_no").attr("readonly", true);
  50. $("#corp_reg_no").css("background-color", "#f0f0f0");
  51. if(status == "AA")
  52. {
  53. $("#btn_delete_area").css("display", "inline");
  54. }
  55. else
  56. {
  57. $("#corp_reg_no").attr("readonly", true);
  58. $("#corp_reg_no").addClass("bg_gry");
  59. }
  60. }
  61. //숫자만 입력받기.
  62. $(document).on("keyup", "input:text[numberOnly]", function() {$(this).val( $(this).val().replace(/[^0-9]/gi,"") );});
  63. $("#btn_list").click(function(){
  64. var job_div = $("#job_div").val();
  65. $("#form1").attr("action", "/quot/purchase/QuotPurSuppRegList.screen");
  66. $("#form1").attr("target", "_self");
  67. $("#form1").attr("method", "post");
  68. $("#form1").submit();
  69. });
  70. $("#btn_save").click(function(){
  71. var u_email = $("#email");
  72. // 정규식 - 이메일 유효성 검사
  73. var regEmail = /([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
  74. //입력값 체크
  75. if($("#corp_reg_no").val().trim() != "")
  76. {
  77. var regNum = /^[0-9]{10}$/;
  78. if(!regNum.test($("#corp_reg_no").val().trim()))
  79. {
  80. alert("사업자 번호를 확인해 주세요.");
  81. $("#corp_reg_no").focus();
  82. return false;
  83. }
  84. }
  85. else
  86. {
  87. alert("사업자 번호를 입력해 주세요");
  88. $("#corp_reg_no").focus();
  89. return false;
  90. }
  91. if($("#corp_kor").val().trim() == "")
  92. {
  93. alert("업체명을 입력해 주세요");
  94. $("#corp_kor").focus();
  95. return false;
  96. }
  97. else if($("#rep_name").val().trim() == "")
  98. {
  99. alert("대표자명을 입력해 주세요");
  100. $("#rep_name").focus();
  101. return false;
  102. }
  103. else if($("#charge_name").val().trim() == "")
  104. {
  105. alert("담당자명을 입력해 주세요");
  106. $("#charge_name").focus();
  107. return false;
  108. }
  109. else if($("#h_phon_1").val().trim() == "" || $("#h_phon_2").val().trim() == "" || $("#h_phon_3").val().trim() == "" )
  110. {
  111. alert("휴대전화 번호를 입력해 주시기 바랍니다.");
  112. return false;
  113. }
  114. if(u_email.val().trim() == "")
  115. {
  116. alert("이메일주소를 입력 해 주세요");
  117. u_email.focus();
  118. return false;
  119. }
  120. else
  121. {
  122. if(!regEmail.test(u_email.val()))
  123. {
  124. alert("이메일 주소가 유효하지 않습니다");
  125. u_email.focus();
  126. return false;
  127. }
  128. }
  129. if( status == "" ) {
  130. if( confirm("저장 하시겠습니까? ") ) {
  131. submitXmlRequest("/quot/purchase/QuotPurSuppReg_form.screen", "NEW_SAVE_DATA", f, "VALUEOBJECT");
  132. }
  133. } else {
  134. if( confirm("수정 하시겠습니까? ") ) {
  135. submitXmlRequest("/quot/purchase/QuotPurSuppReg_form.screen", "NEW_UPDATE_DATA", f, "VALUEOBJECT");
  136. }
  137. }
  138. });
  139. $("#btn_delete").click(function(){
  140. if(confirm("삭제 하시겠습니까?"))
  141. {
  142. submitXmlRequest("/quot/purchase/QuotPurSuppReg_form.screen", "DELETE_DATA", f);
  143. }
  144. });
  145. });
  146. function doResult(resultObj) {
  147. try {
  148. if(resultObj.getRequestEvent() == "DELETE_DATA")
  149. {
  150. if( resultObj.getSuccess() )
  151. {
  152. document.form1.isSubmit = false;
  153. alert("삭제 되었습니다.");
  154. $("#form1").attr("action", "/quot/purchase/QuotPurSuppRegList.screen");
  155. $("#form1").attr("target", "_self");
  156. $("#form1").attr("method", "post");
  157. $("#form1").submit();
  158. }
  159. else
  160. {
  161. document.form1.isSubmit = false;
  162. alert("삭제가 실패하였습니다.");
  163. }
  164. } else if( resultObj.getRequestEvent() == "NEW_SAVE_DATA" ) {
  165. if( resultObj.getSuccess() )
  166. {
  167. alert("저장 하였습니다.");
  168. var job_div = $("#job_div").val();
  169. $("#form1").attr("action", "/quot/purchase/QuotPurSuppRegList.screen");
  170. $("#form1").attr("target", "_self");
  171. $("#form1").attr("method", "post");
  172. $("#form1").submit();
  173. document.form1.isSubmit = false;
  174. }
  175. else
  176. {
  177. alert(resultObj.getValueObject().get("errMsg"));
  178. document.form1.isSubmit = false;
  179. }
  180. } else if ( resultObj.getRequestEvent() == "NEW_UPDATE_DATA" ) {
  181. if( resultObj.getSuccess() )
  182. {
  183. document.form1.isSubmit = false;
  184. alert("수정 하였습니다.");
  185. $("#fevent").val("GET_DETAIL");
  186. $("#form1").attr("action", "/quot/purchase/QuotPurSuppReg.screen");
  187. $("#form1").submit();
  188. }
  189. else
  190. {
  191. document.form1.isSubmit = false;
  192. alert("수정 실패하였습니다.");
  193. }
  194. }
  195. }
  196. catch(errorObject) {
  197. showErrorDlg("doResult()", errorObject);
  198. }
  199. }
  200. //-->
  201. </script>
  202. <modular:search id="form1">
  203. <modular:key id="fevent" />
  204. </modular:search>
  205. <form id="form1" name="form1" method="post" modular:type="search">
  206. <INPUT type="hidden" name="fevent" id="fevent" value="">
  207. <input type="hidden" name="p_corp_id" id="p_corp_id" value="<%=params.get("p_corp_id") %>" />
  208. <input type="hidden" name="p_charge_seq" id="p_charge_seq" value="<%=vo.get("CHARGE_SEQ") %>" />
  209. <input type="hidden" name="job_div" id="job_div" value="<%=params.get("job_div") %>" />
  210. <!-- <input type="hidden" name="p_status" id="p_status" value="" /> -->
  211. <!-- 목록 파라메터 -->
  212. <input type="hidden" name="corp_no" id="corp_no" value="<%=params.get("corp_no") %>" />
  213. <input type="hidden" name="corp_name" id="corp_name" value="<%=params.get("corp_name") %>" />
  214. <%-- <input type="hidden" name="STATUS_CD" id="STATUS_CD" value="<%=params.get("STATUS_CD") %>" /> --%>
  215. <table border="0" cellspacing="0" cellpadding="0" style="width: 100%;">
  216. <tr>
  217. <td style="text-align: left;">
  218. <div align="left" id="title" style="float: left;">
  219. <ul>
  220. <li><%=job_gubun %>_견적용 협력업체 상세</li>
  221. <li>
  222. </ul>
  223. </div>
  224. </td>
  225. <td style="text-align: right; vertical-align: bottom;">
  226. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_list">목록</a></span>
  227. <span class="btnSearch center" id="btn_save_area"><a href="javascript:void(0);" id="btn_save">저장</a></span>
  228. <span class="btnSearch center" id="btn_delete_area"><a href="javascript:void(0);" id="btn_delete">삭제</a></span>
  229. </td>
  230. </tr>
  231. </table>
  232. <!-- 발주의뢰정보 : 시작 -->
  233. <div class="application-info magT10">
  234. <div class="application-sub-title">
  235. <span class="title">회사정보</span>
  236. </div>
  237. </div>
  238. <table cellspacing="1" cellpadding="0" class="form-table">
  239. <colgroup>
  240. <col width="100px"/>
  241. <col WIDTH="25%"/>
  242. <col width="100px"/>
  243. <col WIDTH="25%"/>
  244. <col width="100px"/>
  245. <col WIDTH="25%"/>
  246. </colgroup>
  247. <!-- 검색조건 타이틀 1 -->
  248. <TH class="required">
  249. 사업자번호
  250. </th>
  251. <td>
  252. <input type="text" name="corp_reg_no" id="corp_reg_no" numberOnly="true" SIZE="10" maxlength="10" value="<%=vo.get("corp_reg_no")%>" />
  253. </td>
  254. <TH class="required">
  255. 업체명
  256. </th>
  257. <td>
  258. <input type="text" name="corp_kor" id="corp_kor" style="width: 85%;" value="<%=vo.get("corp_kor")%>" />
  259. </td>
  260. <TH class="required">
  261. 대표자명
  262. </th>
  263. <td>
  264. <input type="text" name="rep_name" id="rep_name" style="width: 85%;" value="<%=vo.get("rep_name")%>"/>
  265. </td>
  266. </tr>
  267. <tr height="25">
  268. <th class="required">
  269. 상태
  270. </th>
  271. <td>
  272. <%=CommCodeManager.getSelectCodeSearchList("QUOT_SUPP_REG_STATUS","STATUS_CD","height=18;width:80px;","",vo.get("STATUS_CD"),"","DETAILCD") %>
  273. </td>
  274. <th class="required">
  275. 국내/외 구분
  276. </th>
  277. <td colspan="3">
  278. <%=CommCodeManager.getSelectCodeSearchList("IN_OUT_DIV","in_out_div","height=18;width:80px;","",vo.get("in_out_div"),"","DETAILCD") %>
  279. </td>
  280. </tr>
  281. <tr>
  282. <th>의견</th>
  283. <td colspan="5">
  284. <textarea name="remark" id="remark" rows="5" style="width: 100%;"><%=vo.get("remark") %></textarea>
  285. </td>
  286. </tr>
  287. </table>
  288. <div class="application-info magT20">
  289. <div class="application-sub-title">
  290. <span class="title">담당자 정보</span>
  291. </div>
  292. </div>
  293. <table cellspacing="1" cellpadding="0" class="form-table">
  294. <colgroup>
  295. <col width="100px"/>
  296. <col WIDTH="25%"/>
  297. <col width="100px"/>
  298. <col WIDTH="25%"/>
  299. <col width="100px"/>
  300. <col WIDTH="25%"/>
  301. </colgroup>
  302. <tr height="25">
  303. <TH class="required">
  304. 담당자명
  305. </th>
  306. <td class="search_table_data">
  307. <input type="text" name="charge_name" id="charge_name" style="width: 85%;" value="<%=vo.get("charge_name")%>"/>
  308. </td>
  309. <TH class="required">
  310. 이메일
  311. </th>
  312. <td class="search_table_data">
  313. <input type="text" name="email" id="email" style="width: 85%;ime-mode:inactive" value="<%=vo.get("charge_email")%>"/>
  314. </td>
  315. <TH class="required">
  316. 휴대전화
  317. </th>
  318. <td class="search_table_data">
  319. <input type="text" name="h_phon_1" id="h_phon_1" SIZE="3" numberOnly="true" maxlength="3" value="<%=vo.get("HP1")%>"/> -
  320. <input type="text" name="h_phon_2" id="h_phon_2" SIZE="4" numberOnly="true" maxlength="4" value="<%=vo.get("hp2")%>"/> -
  321. <input type="text" name="h_phon_3" id="h_phon_3" SIZE="4" numberOnly="true" maxlength="4" value="<%=vo.get("hp3")%>"/>
  322. </td>
  323. </tr>
  324. </table>
  325. </form>