SuppDeptRequest.jsp 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044
  1. <%--
  2. - FileName : SuppDeptRequest.jsp
  3. - Author(s) : mklee
  4. - Date : 2016-12-21
  5. --%>
  6. <%@ page import="java.sql.Clob"%>
  7. <%@ page contentType="text/html; charset=utf-8" %>
  8. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  9. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  10. <%@ page import="com.udapsoft.waf.common.util.*" %>
  11. <%@ page import="kr.co.udapsoft.common.code.*" %>
  12. <%@ page import="kr.co.hsnc.common.util.*"%>
  13. <%@ page import="kr.co.hsnc.common.sql.*" %>
  14. <%@ page import="kr.co.hsnc.common.config.WAFConfig" %>
  15. <%@ include file="/jsp/work/taglib.jsp" %>
  16. <%@ page import="kr.co.hsnc.common.util.Formatter"%>
  17. <%@ page import="java.net.URLEncoder"%>
  18. <%@ page import="kr.co.udapsoft.ebid.buyer.common.file.FileManager"%>
  19. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  20. <%
  21. ctx.init(request, response);
  22. HandlerStorage storage = ctx.getHandlerStorage();
  23. ValueObject params = storage.getParams();
  24. ValueObject user = storage.getUser();
  25. String event = storage.getEvent();
  26. ValueObject vo = storage.getValueObject("SuppJoinRequest");
  27. RowSet getFileListRowSet = storage.getRowSet("getFileListRowSet");
  28. String status = "";
  29. status = params.get("status");
  30. String job_gubun = "외주";
  31. java.util.Calendar curDate = java.util.Calendar.getInstance();
  32. curDate.add ( curDate.YEAR, 0 );
  33. java.text.SimpleDateFormat fmtDay = new java.text.SimpleDateFormat("yyyy");
  34. String nyear = fmtDay.format(curDate.getTime()); // 오늘
  35. String gwurl = "http://gw.sgcenc.co.kr/";
  36. if (params.get("corp_status").isEmpty()){
  37. params.set("corp_status","A");
  38. }
  39. %>
  40. <SCRIPT language="JavaScript">
  41. $(function(){
  42. var event = "<%=event%>";
  43. var status = "<%=vo.get("STATUS_CODE")%>";
  44. var f = document.form1;
  45. getFileListForTextarea();
  46. if(event == "") //신규
  47. {
  48. $("#btn_confim_area").css("display", "none");
  49. $("#btn_delete_area").css("display", "none");
  50. $("#REJECT_REASON").attr("readonly", true);
  51. $("#btn_approval").css("display", "none");
  52. $("#btn_reject").css("display", "none");
  53. document.getElementById('CREDIT_VALUE1').innerHTML = "신용평가등급";
  54. document.getElementById('LICENCE_YN_TEXT').innerHTML = "미보유";
  55. }
  56. else if(event == "GET_DETAIL")
  57. {
  58. $("#corp_reg_no").attr("readonly", true);
  59. $("#corp_reg_no").css("background-color", "#f0f0f0");
  60. if ("<%= vo.get("liquid_rate")%>" < 100) {
  61. document.getElementById('liquid_rate1').innerHTML = "<font color='red'>" + "<%= vo.get("liquid_rate")%>" + "</font>";
  62. }else{
  63. document.getElementById('liquid_rate1').innerHTML = "<%= vo.get("liquid_rate")%>";
  64. }
  65. if ("<%= vo.get("debt_rate")%>" > 250) {
  66. document.getElementById('debt_rate1').innerHTML = "<font color='red'>" + "<%= vo.get("debt_rate")%>" + "</font>";
  67. }else{
  68. document.getElementById('debt_rate1').innerHTML = "<%= vo.get("debt_rate")%>";
  69. }
  70. if (Number("<%= nyear%>") - Number(<%= vo.get("syear")%>) <= 2 ) {
  71. document.getElementById('syear1').innerHTML = "영업기간 2년미만";
  72. }else{
  73. document.getElementById('syear1').innerHTML = "";
  74. }
  75. if ( "<%= vo.get("LICENCE_YN") %>" == "N" ) {
  76. document.getElementById('LICENCE_YN_TEXT').innerHTML = "<font color='red'><b>" + "미보유" + "</b></font>";
  77. }else{
  78. document.getElementById('LICENCE_YN_TEXT').innerHTML = "미보유";
  79. }
  80. if ( ("<%= vo.get("CREDIT_VALUE1") %>" > "C") || ("<%= vo.get("CASH_GRADE1") %>" > "C") ) {
  81. document.getElementById('CREDIT_VALUE1').innerHTML = "<font color='red'>" + "신용평가등급" + "</font>";
  82. }else{
  83. document.getElementById('CREDIT_VALUE1').innerHTML = "신용평가등급";
  84. }
  85. if(status == "AA" || status == "BB") //수정가능상태
  86. {
  87. /*작성자만 수정가능*/
  88. <% if ( vo.get("cre_by").equals(user.get("acct_id")) ) {%>
  89. $("#btn_confim").css("display", "inline");
  90. $("#btn_save").css("display", "inline");
  91. $("#btn_delete_area").css("display", "inline");
  92. $("#REJECT_REASON").attr("readonly", true);
  93. <%}else{%>
  94. $("#btn_confim").css("display", "none");
  95. $("#btn_save").css("display", "none");
  96. $("#btn_delete_area").css("display", "none");
  97. $("#REJECT_REASON").attr("readonly", true);
  98. <%}%>
  99. }
  100. else //00, BB, 03
  101. {
  102. $("#btn_confim").css("display", "none");
  103. $("#btn_save").css("display", "none");
  104. $("#btn_delete_area").css("display", "none");
  105. }
  106. //외주담당자
  107. if ( "<%= user.get("RIGHT_NAME")%>" == "OUTSIDE" && status == "00" ) {
  108. $("#btn_approval").css("display", "inline");
  109. $("#btn_reject").css("display", "inline");
  110. }else
  111. {
  112. $("#btn_approval").css("display", "none");
  113. $("#btn_reject").css("display", "none");
  114. }
  115. setCreditValue();
  116. }
  117. //숫자만 입력받기.
  118. //$(document).on("keyup", "input:text[numberOnly]", function() {$(this).val( $(this).val().replace(/[^0-9]/gi,"") );});
  119. //부채비율
  120. $("#debt_amt").keyup(function(){debt_rate();});
  121. $("#capital_amt").keyup(function(){debt_rate();});
  122. //유동비율
  123. $("#liquid_asset").keyup(function(){liquid_rate();});
  124. $("#liquid_debt").keyup(function(){liquid_rate();});
  125. $("#syear").keyup(function(){syear();});
  126. $("#LICENCE_YN1").click(function(){LICENCE_YN();});
  127. $("#LICENCE_YN2").click(function(){LICENCE_YN();});
  128. $("#LICENCE_YN3").click(function(){LICENCE_YN();});
  129. $("#CREDIT_VALUE").click(function(){CREDIT_VALUE();});
  130. $("#CASH_GRADE").click(function(){CREDIT_VALUE();});
  131. $("#btn_list").click(function(){
  132. $("#fevent").val("");
  133. $("#form1").attr("action", "/supplier/outside/SuppDeptRequestList.screen");
  134. $("#form1").attr("target", "_self");
  135. $("#form1").attr("method", "post");
  136. $("#form1").submit();
  137. });
  138. $("#btn_approval").click(function(){
  139. if(confirm("승인 하시겠습니까?"))
  140. {
  141. $("#p_status").val("03");
  142. submitXmlRequest("/supplier/outside/SuppDeptRequest_form.screen", "DATA_APP", f);
  143. }
  144. });
  145. $("#btn_reject").click(function(){
  146. if(confirm("반려 하시겠습니까?"))
  147. {
  148. $("#p_status").val("BB");
  149. submitXmlRequest("/supplier/outside/SuppDeptRequest_form.screen", "DATA_REJECT", f);
  150. }
  151. });
  152. $("#btn_confim").click(function(){
  153. var u_email = $("#email");
  154. //var u_phone = $('#user_phone');
  155. // 정규식 - 이메일 유효성 검사
  156. 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})(\]?)$/;
  157. // 정규식 -전화번호 유효성 검사
  158. //var regPhone = /^((01[1|6|7|8|9])[1-9]+[0-9]{6,7})|(010[1-9][0-9]{7})$/;
  159. //입력값 체크
  160. if($("#corp_reg_no").val().trim() != "")
  161. {
  162. var regNum = /^[0-9]{10}$/;
  163. if(!regNum.test($("#corp_reg_no").val().trim()))
  164. {
  165. alert("사업자 번호를 확인해 주세요.");
  166. $("#corp_reg_no").focus();
  167. return false;
  168. }
  169. }
  170. else
  171. {
  172. alert("사업자 번호를 입력해 주세요");
  173. $("#corp_reg_no").focus();
  174. return false;
  175. }
  176. if($("#corp_kor").val().trim() == "")
  177. {
  178. alert("업체명을 입력해 주세요");
  179. $("#corp_kor").focus();
  180. return false;ㄲ
  181. }
  182. else if($("#rep_name").val().trim() == "")
  183. {
  184. alert("대표자명을 입력해 주세요");
  185. $("#rep_name").focus();
  186. return false;
  187. }
  188. else if($("#user_name").val().trim() == "")
  189. {
  190. alert("담당자명을 입력해 주세요");
  191. $("#user_name").focus();
  192. return false;
  193. }
  194. if(u_email.val().trim() == "")
  195. {
  196. alert("이메일주소를 입력 해 주세요");
  197. u_email.focus();
  198. return false;
  199. }
  200. else
  201. {
  202. if(!regEmail.test(u_email.val()))
  203. {
  204. alert("이메일 주소가 유효하지 않습니다");
  205. u_email.focus();
  206. return false;
  207. }
  208. }
  209. if($("#CREDIT_CD").val().trim() == "")
  210. {
  211. alert("신용평가사를 선택 해 주세요");
  212. $("#CREDIT_CD").focus();
  213. return false;
  214. }
  215. if($("#CREDIT_CD").val().trim() != "Z" && $("#CREDIT_VALUE").val().trim() == "")
  216. {
  217. alert("신용평가 등급을 선택 해 주세요");
  218. $("#CREDIT_VALUE").focus();
  219. return false;
  220. }
  221. if($("#CREDIT_CD").val().trim() != "Z" && $("#CASH_GRADE").val().trim() == "")
  222. {
  223. alert("현금흐름등급을 선택 해 주세요");
  224. $("#CASH_GRADE").focus();
  225. return false;
  226. }
  227. if($("#debt_amt").val().trim() == "")
  228. {
  229. alert("부채총계를 입력해 주세요");
  230. $("#debt_amt").focus();
  231. return false;
  232. }
  233. if($("#capital_amt").val().trim() == "")
  234. {
  235. alert("자본총계를 입력해 주세요");
  236. $("#capital_amt").focus();
  237. return false;
  238. }
  239. if($("#liquid_asset").val().trim() == "")
  240. {
  241. alert("유동자산을 입력해 주세요");
  242. $("#liquid_asset").focus();
  243. return false;
  244. }
  245. if($("#liquid_debt").val().trim() == "")
  246. {
  247. alert("유동부채를 입력해 주세요");
  248. $("#liquid_debt").focus();
  249. return false;
  250. }
  251. if($("#syear").val().trim() == "")
  252. {
  253. alert("설립년도를 입력해 주세요");
  254. $("#syear").focus();
  255. return false;
  256. }
  257. if($("#hp1").val().trim() == "" || $("#hp2").val().trim() == "" || $("#hp3").val().trim() == "" )
  258. {
  259. alert("휴대전화 번호를 입력해 주시기 바랍니다.");
  260. return false;
  261. }
  262. //첨부파일4개 "checkbox"
  263. var f = document.form1
  264. if ( !f.p_100.checked && !f.p_110.checked && !f.p_120.checked )
  265. {
  266. alert("첨부파일 한개이상 등록하십시요.");
  267. return false;
  268. }
  269. if($("#REQ_REMARK").val().trim() == "")
  270. {
  271. alert("추천사유를 입력해 주세요");
  272. $("#REQ_REMARK").focus();
  273. return false;
  274. }
  275. if($("#DEPT_NM").val().trim() == "")
  276. {
  277. alert("추천부서를 입력해 주세요");
  278. $("#DEPT_NM").focus();
  279. return false;
  280. }
  281. if($("#REQ_EMP").val().trim() == "")
  282. {
  283. alert("추천인을 입력해 주세요");
  284. $("#REQ_EMP").focus();
  285. return false;
  286. }
  287. var f = document.form1;
  288. $("#flag").val("app");
  289. $("#p_status").val("AA");
  290. $("#fevent").val("CHK_APPVAR");
  291. submitXmlRequest("/supplier/outside/SuppDeptRequest_form.screen", "CHK_APPVAR", f, "VALUEOBJECT");
  292. });
  293. $("#btn_save").click(function(){
  294. var u_email = $("#email");
  295. // 정규식 - 이메일 유효성 검사
  296. 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})(\]?)$/;
  297. //입력값 체크
  298. if($("#corp_reg_no").val().trim() != "")
  299. {
  300. var regNum = /^[0-9]{10}$/;
  301. if(!regNum.test($("#corp_reg_no").val().trim()))
  302. {
  303. alert("사업자 번호를 확인해 주세요.");
  304. $("#corp_reg_no").focus();
  305. return false;
  306. }
  307. }
  308. else
  309. {
  310. alert("사업자 번호를 입력해 주세요");
  311. $("#corp_reg_no").focus();
  312. return false;
  313. }
  314. if($("#corp_kor").val().trim() == "")
  315. {
  316. alert("업체명을 입력해 주세요");
  317. $("#corp_kor").focus();
  318. return false;
  319. }
  320. if( confirm("저장 하시겠습니까? ") ){
  321. if( status == "" ) {
  322. $("#flag").val("insert");
  323. }else{
  324. $("#flag").val("update");
  325. }
  326. var f = document.form1;
  327. $("#fevent").val("CHK_APPVAR");
  328. submitXmlRequest("/supplier/outside/SuppDeptRequest_form.screen", "CHK_APPVAR", f, "VALUEOBJECT");
  329. }
  330. });
  331. $("#btn_delete").click(function(){
  332. if(confirm("삭제 하시겠습니까?"))
  333. {
  334. var f = document.form1;
  335. $("#flag").val("delete");
  336. $("#fevent").val("CHK_APPVAR");
  337. submitXmlRequest("/supplier/outside/SuppDeptRequest_form.screen", "CHK_APPVAR", f, "VALUEOBJECT");
  338. }
  339. });
  340. });
  341. function doResult(resultObj) {
  342. try {
  343. if( resultObj.getRequestEvent() == "SAVE_DATA") {
  344. if( resultObj.getSuccess() )
  345. {
  346. document.form1.isSubmit = false;
  347. alert("저장 하였습니다.");
  348. $("#fevent").val("");
  349. $("#form1").attr("action", "/supplier/outside/SuppDeptRequestList.screen");
  350. $("#form1").attr("target", "_self");
  351. $("#form1").attr("method", "post");
  352. $("#form1").submit();
  353. }
  354. else
  355. {
  356. alert(resultObj.getValueObject().get("errMsg"));
  357. document.form1.isSubmit = false;
  358. }
  359. }
  360. else if(resultObj.getRequestEvent() == "UPDATE_DATA"){
  361. if( resultObj.getSuccess() )
  362. {
  363. document.form1.isSubmit = false;
  364. if(jQuery("#flag").val() == "update"){
  365. alert("저장 하였습니다.");
  366. $("#fevent").val("GET_DETAIL");
  367. $("#form1").attr("action", "/supplier/outside/SuppDeptRequest.screen");
  368. $("#form1").submit();
  369. }else if(jQuery("#flag").val() == "app"){
  370. var f = document.form1;
  371. var p_corp_id = f.p_corp_id.value;
  372. dlgSignForm('ebid_ocustD', '/supplier/outside/SuppRequestSign.screen?p_corp_id='+p_corp_id+'^acct_type=1^sign_type=1' );
  373. }
  374. }else
  375. {
  376. alert(resultObj.getValueObject().get("errMsg"));
  377. document.form1.isSubmit = false;
  378. }
  379. }
  380. else if( resultObj.getRequestEvent() == "CHK_APPVAR" ) {
  381. var vo = resultObj.getValueObject();
  382. var check = vo.get('cnt');
  383. if(check == 0){ //가능
  384. document.form1.isSubmit = false;
  385. var f = document.form1
  386. if(jQuery("#flag").val() == "insert"){
  387. $("#fevent").val("SAVE_DATA");
  388. $("#p_status").val("AA");
  389. submitXmlRequest("/supplier/outside/SuppDeptRequest_form.screen", "SAVE_DATA", f, "VALUEOBJECT");
  390. }else if(jQuery("#flag").val() == "update"){
  391. $("#fevent").val("UPDATE_DATA");
  392. $("#p_status").val("AA");
  393. submitXmlRequest("/supplier/outside/SuppDeptRequest_form.screen", "UPDATE_DATA", f, "VALUEOBJECT");
  394. }else if(jQuery("#flag").val() == "app"){
  395. jQuery("#fevent").val("UPDATE_DATA");
  396. $("#p_status").val("AA");
  397. submitXmlRequest("/supplier/outside/SuppDeptRequest_form.screen", "UPDATE_DATA", f, "VALUEOBJECT");
  398. }else if(jQuery("#flag").val() == "delete"){
  399. jQuery("#fevent").val("DELETE_DATA");
  400. submitXmlRequest("/supplier/outside/SuppDeptRequest_form.screen", "DELETE_DATA", f);
  401. }
  402. }else{
  403. document.form1.isSubmit = false;
  404. alert("이미 결재중입니다.");
  405. }
  406. }
  407. else if(resultObj.getRequestEvent() == "DELETE_DATA")
  408. {
  409. if( resultObj.getSuccess() )
  410. {
  411. document.form1.isSubmit = false;
  412. alert("삭제 되었습니다.");
  413. $("#form1").attr("action", "/supplier/outside/SuppDeptRequestList.screen");
  414. $("#form1").attr("target", "_self");
  415. $("#form1").attr("method", "post");
  416. $("#form1").submit();
  417. }
  418. else
  419. {
  420. document.form1.isSubmit = false;
  421. dlgErrorMsg(resultObj);
  422. }
  423. }
  424. else if(resultObj.getRequestEvent() == "DATA_APP")
  425. {
  426. if( resultObj.getSuccess() )
  427. {
  428. document.form1.isSubmit = false;
  429. alert("승인 되었습니다.");
  430. $("#form1").attr("action", "/supplier/outside/SuppDeptRequestList.screen");
  431. $("#form1").attr("target", "_self");
  432. $("#form1").attr("method", "post");
  433. $("#form1").submit();
  434. }
  435. else
  436. {
  437. document.form1.isSubmit = false;
  438. dlgErrorMsg(resultObj);
  439. }
  440. }
  441. else if(resultObj.getRequestEvent() == "DATA_REJECT")
  442. {
  443. if( resultObj.getSuccess() )
  444. {
  445. document.form1.isSubmit = false;
  446. alert("반려 되었습니다.");
  447. $("#form1").attr("action", "/supplier/outside/SuppDeptRequestList.screen");
  448. $("#form1").attr("target", "_self");
  449. $("#form1").attr("method", "post");
  450. $("#form1").submit();
  451. }
  452. else
  453. {
  454. document.form1.isSubmit = false;
  455. alert("실패하였습니다.");
  456. }
  457. }
  458. else if(resultObj.getRequestEvent() == "GET_ATTACHFILE")
  459. {
  460. if( resultObj.getSuccess() ) {
  461. document.form1.p_AttachFile1.value = resultObj.getValueObject().get("SUPP_DEPT_REQ");
  462. }else {
  463. dlgErrorMsg(resultObj);
  464. }
  465. document.form1.isSubmit = false;
  466. }
  467. }
  468. catch(errorObject) {
  469. showErrorDlg("doResult()", errorObject);
  470. }
  471. }
  472. //결재
  473. function dlgSignForm( sign_class_cd, uri ) {
  474. var f = document.form1;
  475. var sheet1 = document.all.sheet1;
  476. var url = "/slipSign/suppSign_form.screen";
  477. url += "?sign_class_cd=" + sign_class_cd;
  478. url += "&uri=" + uri;
  479. url += "&p_corp_id=" + f.p_corp_id.value;
  480. url += "&acct_type=1";
  481. if(confirm("결재 하시겠습니까?") ){
  482. window.open(url, "_blank","width=200,height=100,SCROLLBARS=no");
  483. }else{
  484. return;
  485. }
  486. }
  487. function fileCheck(val){
  488. var obj = eval("document.getElementById('" + val + "')");
  489. if(obj.style.display == "none"){
  490. obj.style.display = "inline";
  491. }else{
  492. obj.style.display = "none";
  493. }
  494. }
  495. function doAttachFile(obj, No, fileName ) {
  496. if(obj.value == ''){
  497. alert("데이터를 저장 후, 파일을 첨부할 수가 있습니다.");
  498. }
  499. else if(obj.value != ''){
  500. var upLoadFlg = "Y";
  501. if("<%=vo.get("STATUS_CODE")%>" == "00" || "<%=vo.get("STATUS_CODE")%>" == "03"){
  502. upLoadFlg = "N";
  503. }
  504. <% if ( !vo.get("cre_by").equals(user.get("acct_id")) && vo.get("STATUS_CODE") != "") {%>
  505. upLoadFlg = "N";
  506. <%}%>
  507. viewFileListNew1('SUPP_DEPT_REQ_'+obj.value, No, document.form1.p_AttachFile2, upLoadFlg, "own/outside/req/"+obj.value, null, fileName) ;
  508. }
  509. }
  510. function getFileListForTextarea(){
  511. document.form1.p_AttachFile1.value = "";
  512. var f = document.form1;
  513. jQuery("#fevent").val("GET_ATTACHFILE");
  514. submitXmlRequest("/supplier/outside/SuppDeptRequest_form.screen", "GET_ATTACHFILE", f, "VALUEOBJECT");
  515. }
  516. function debt_rate(){
  517. var debt_amt = $("#debt_amt").val();
  518. if(debt_amt == "")
  519. debt_amt = 0;
  520. else
  521. debt_amt = debt_amt.replace(/,/gi,"");
  522. var capital_amt = $("#capital_amt").val();
  523. if(capital_amt == "")
  524. capital_amt = 0;
  525. else
  526. capital_amt = capital_amt.replace(/,/gi,"");
  527. if(debt_amt > 0 && capital_amt > 0){
  528. var rate = Number(debt_amt)/Number(capital_amt) * 100;
  529. $("#debt_rate").val(Math.round(rate *100)/100);
  530. if (rate >= 250){
  531. document.getElementById('debt_rate1').innerHTML = "<font color='red'>" + Math.round(rate *100)/100 + "</font>";
  532. }else{
  533. document.getElementById('debt_rate1').innerHTML = Math.round(rate *100)/100;
  534. }
  535. }else{
  536. document.getElementById('debt_rate1').innerHTML = "";
  537. }
  538. }
  539. function liquid_rate(){
  540. var liquid_asset = $("#liquid_asset").val();
  541. if(liquid_asset == "")
  542. liquid_asset = 0;
  543. else
  544. liquid_asset = liquid_asset.replace(/,/gi,"");
  545. var liquid_debt = $("#liquid_debt").val();
  546. if(liquid_debt == "")
  547. liquid_debt = 0;
  548. else
  549. liquid_debt = liquid_debt.replace(/,/gi,"");
  550. if(liquid_asset > 0 && liquid_debt > 0){
  551. var rate = Number(liquid_asset)/Number(liquid_debt) * 100;
  552. $("#liquid_rate").val(Math.round(rate *100)/100);
  553. if (rate < 100) {
  554. document.getElementById('liquid_rate1').innerHTML = "<font color='red'>" + Math.round(rate *100)/100 + "</font>";
  555. }else{
  556. document.getElementById('liquid_rate1').innerHTML = Math.round(rate *100)/100;
  557. }
  558. }else{
  559. document.getElementById('liquid_rate1').innerHTML = "";
  560. }
  561. }
  562. function syear(){
  563. var syear = $("#syear").val();
  564. if(syear == "")
  565. syear = 0;
  566. if(syear > 0){
  567. var rate = Number("<%= nyear%>") - Number(syear) ;
  568. if (rate <= 2 ) {
  569. document.getElementById('syear1').innerHTML = "영업기간 2년미만";
  570. }else{
  571. document.getElementById('syear1').innerHTML = "";
  572. }
  573. }else{
  574. document.getElementById('syear1').innerHTML = "";
  575. }
  576. }
  577. function LICENCE_YN(){
  578. if ($(':radio[name="LICENCE_YN"]:checked').val() == "N") {
  579. document.getElementById('LICENCE_YN_TEXT').innerHTML = "<font color='red'><b>" + "미보유" + "</b></font>";
  580. }else{
  581. document.getElementById('LICENCE_YN_TEXT').innerHTML = "미보유";
  582. }
  583. }
  584. function CREDIT_VALUE(){
  585. if (($("#CREDIT_VALUE").val().substring(0,1) > "C") || ($("#CASH_GRADE").val().substring(0,1) > "C")) {
  586. document.getElementById('CREDIT_VALUE1').innerHTML = "<font color='red'>" + "신용평가등급" + "</font>";
  587. }else{
  588. document.getElementById('CREDIT_VALUE1').innerHTML = "신용평가등급";
  589. }
  590. }
  591. function viewFileListNew1(fileGB, id, obj, isModify, isDrectory, iframeID, user_filename) {
  592. var win_id = "_viewFileList";
  593. var link = "/common/file/FileListNew.screen";
  594. link += "?pop_win_id="+win_id;
  595. link += "&extFunction=viewFileListClose1";
  596. link += "&file_gb=" + fileGB;
  597. link += "&id=" + id;
  598. if( obj.id != null )
  599. link += "&obj_id=" + obj.id;
  600. if( iframeID != null )
  601. link += "&iframeID=" + iframeID;
  602. if( isModify != null )
  603. link += "&is_modify=" + isModify;
  604. if( isDrectory != null )
  605. link += "&sys_gb=" + isDrectory;
  606. if( user_filename != null )
  607. link += "&user_filename=" + user_filename;
  608. fLayerPop(win_id, link, 750,430, '', '', 'NO', '200');
  609. }
  610. function PopClose(win_id,result){
  611. alert(99999);
  612. }
  613. function doAppFile(doc_id){
  614. if(doc_id == ""){
  615. alert("결재 정보가 없습니다.");
  616. return;
  617. }
  618. var doc_chk = doc_id.substring(doc_id.length-3, doc_id.length);
  619. doc_chk = doc_chk * 1;
  620. var link = "";
  621. var year = "<%=vo.get("year") %>";
  622. link = "<%=gwurl%>upload_approval/TEC/doc/" + year.substr(0,4) + "/" + doc_chk + "/"+ doc_id+".mht";
  623. window.open(link,"_viewDraft","");
  624. }
  625. function setCreditValue(){
  626. if($("#CREDIT_CD").val().trim() == "Z" ){
  627. $("#CREDIT_VALUE").val("");
  628. $("#CREDIT_VALUE").attr("disabled", true);
  629. $("#CASH_GRADE").val("");
  630. $("#CASH_GRADE").attr("disabled", true);
  631. }else{
  632. $("#CREDIT_VALUE").attr("disabled", false);
  633. $("#CASH_GRADE").attr("disabled", false);
  634. }
  635. }
  636. function SearchUser(NAME,CODE,DEPT_YN){
  637. GB = "";
  638. var win_id = "_searchUserPopup";
  639. var link = "/lib/dlgSearchUserPop.screen";
  640. link += "?pop_win_id="+win_id;
  641. link += "&NAME="+NAME;
  642. link += "&CODE="+CODE;
  643. link += "&GB="+GB;
  644. fLayerPop(win_id, link, 700,400, '', '', 'NO');
  645. }
  646. function SearchUserClose(result){
  647. $("#REQ_EMP").val(result[1])//이름
  648. $("#DEPT_NM").val(result[3])//부서
  649. //$("#REQ_EMP").val(result[0])//사번
  650. setTimeout(function(){ fLayerPopClose('_searchUserPopup');},100);
  651. }
  652. </SCRIPT>
  653. <modular:search id="form1">
  654. <modular:key id="fevent" />
  655. </modular:search>
  656. <form id="form1" name="form1" method="post" modular:type="search">
  657. <INPUT type="hidden" name="fevent" id="fevent" value="">
  658. <INPUT type="hidden" name="p_corp_id" id="p_corp_id" value="<%=params.get("p_corp_id") %>" />
  659. <INPUT type="hidden" name="job_div" id="job_div" value="O" />
  660. <INPUT type="hidden" name="p_status" id="p_status" value="" />
  661. <INPUT type="hidden" name="debt_rate" id="debt_rate" value="<%=vo.get("debt_rate") %>"/>
  662. <INPUT type="hidden" name="liquid_rate" id="liquid_rate" value="<%=vo.get("liquid_rate") %>" />
  663. <INPUT type="hidden" name="p_AttachFile2" id="p_AttachFile2" onPropertyChange="JavaScript:getFileListForTextarea();" />
  664. <INPUT type="hidden" name="flag" id="flag" value="">
  665. <!-- 목록 파라메터 -->
  666. <INPUT type="hidden" name="corp_no" id="corp_no" value="<%=params.get("corp_no") %>" />
  667. <INPUT type="hidden" name="corp_name" id="corp_name" value="<%=params.get("corp_name") %>" />
  668. <INPUT type="hidden" name="corp_status" id="corp_status" value="<%=params.get("corp_status") %>" />
  669. <table border="0" cellspacing="0" cellpadding="0" style="width: 100%;">
  670. <tr>
  671. <td style="text-align: left;">
  672. <div align="left" id="title" style="float: left;">
  673. <ul>
  674. <li><%=job_gubun %>_협력업체가입요청 상세(<%=vo.get("status").equals("") ? "작성중" : vo.get("status")%>)</li>
  675. <li>
  676. </ul>
  677. </div>
  678. </td>
  679. <td style="text-align: right; vertical-align: bottom;">
  680. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_list">목록</a></span>
  681. <span class="btnSearch center" id="btn_save_area"><a href="javascript:void(0);" id="btn_save">저장</a></span>
  682. <span class="btnSearch center" id="btn_delete_area"><a href="javascript:void(0);" id="btn_delete">삭제</a></span>
  683. <span class="btnSearch center" id="btn_confim_area"><a href="javascript:void(0);" id="btn_confim">결재</a></span>
  684. <span class="btnSearch center" id="btn_approval_area"><a href="javascript:void(0);" id="btn_approval">승인</a></span>
  685. <span class="btnSearch center" id="btn_reject_area"><a href="javascript:void(0);" id="btn_reject">반려</a></span>
  686. </td>
  687. </tr>
  688. </table>
  689. <!-- 발주의뢰정보 : 시작 -->
  690. <div class="application-info magT10">
  691. <div class="application-sub-title">
  692. <span class="title">회사정보</span>
  693. </div>
  694. </div>
  695. <table cellspacing="1" cellpadding="0" class="form-table">
  696. <colgroup>
  697. <col width="100px"/>
  698. <col WIDTH="25%"/>
  699. <col width="100px"/>
  700. <col WIDTH="25%"/>
  701. <col width="100px"/>
  702. <col WIDTH="25%"/>
  703. </colgroup>
  704. <!-- 검색조건 타이틀 1 -->
  705. <TH class="required">
  706. 사업자번호
  707. </th>
  708. <td>
  709. <input type="text" name="corp_reg_no" id="corp_reg_no" numberOnly="true" SIZE="13" maxlength="10" value="<%=vo.get("corp_reg_no")%>" />(숫자만입력)
  710. </td>
  711. <TH class="required">
  712. 업체명
  713. </th>
  714. <td>
  715. <input type="text" name="corp_kor" id="corp_kor" style="width: 85%;" value="<%=vo.get("corp_kor")%>" />
  716. </td>
  717. <TH class="required">
  718. 대표자명
  719. </th>
  720. <td>
  721. <input type="text" name="rep_name" id="rep_name" maxlength="30" style="width: 85%;" value="<%=vo.get("rep_name")%>"/>
  722. </td>
  723. </tr>
  724. <tr height="25">
  725. <TH class="required">
  726. 담당자명
  727. </th>
  728. <td class="search_table_data">
  729. <input type="text" name="user_name" id="user_name" style="width: 85%;" value="<%=vo.get("user_name")%>"/>
  730. </td>
  731. <TH class="required">
  732. 이메일
  733. </th>
  734. <td class="search_table_data">
  735. <input type="text" name="email" id="email" style="width: 85%;ime-mode:inactive" value="<%=vo.get("email")%>"/>
  736. </td>
  737. <TH class="required">
  738. 휴대전화
  739. </th>
  740. <td class="search_table_data">
  741. <input type="text" name="hp1" id="hp1" SIZE="3" numberOnly="true" maxlength="3" value="<%=vo.get("HP1")%>"/> -
  742. <input type="text" name="hp2" id="hp2" SIZE="4" numberOnly="true" maxlength="4" value="<%=vo.get("hp2")%>"/> -
  743. <input type="text" name="hp3" id="hp3" SIZE="4" numberOnly="true" maxlength="4" value="<%=vo.get("hp3")%>"/>
  744. </td>
  745. </tr>
  746. <tr height="25">
  747. <th class="required">
  748. <b><span id="CREDIT_VALUE1"></span></b>
  749. </th>
  750. <td COLSPAN="3">
  751. <%=CommCodeManager.getSelectCodeList("CREDIT_CD","CREDIT_CD","height=18;","<option value=''>--선택--</option>",vo.get("CREDIT_CD"), " onchange='setCreditValue();'") %>&nbsp;
  752. <span>신용등급</span>
  753. <%=CommCodeManager.getSelectCodeList("CREDIT_VALUE","CREDIT_VALUE","height=18;","<option value=''>--선택--</option>",vo.get("CREDIT_VALUE")) %>&nbsp;
  754. <span>현금흐름등급</span>
  755. <%=CommCodeManager.getSelectCodeList("CASH_GRADE","CASH_GRADE","height=18;","<option value=''>--선택--</option>",vo.get("CASH_GRADE")) %>
  756. </td>
  757. <th class="required">
  758. 설립년도
  759. </th>
  760. <td>
  761. <input type="text" name="syear" id="syear" SIZE="10" numberOnly="true" maxlength="4" value="<%=vo.get("syear")%>"/>
  762. <b><font color='red'><span id="syear1"></span></font></b>
  763. </td>
  764. </tr>
  765. <tr height="25">
  766. <th class="required">
  767. 부채총계
  768. </th>
  769. <td>
  770. <%= InputText.get("debt_amt", Formatter2.currency(vo.get("debt_amt"),0), 13, 300, "desc=부채총계,Number,right","Number") %>
  771. </td>
  772. <th class="required">
  773. 자본총계
  774. </th>
  775. <td>
  776. <%= InputText.get("capital_amt", Formatter2.currency(vo.get("capital_amt"),0), 13, 300, "desc=자본총계,Number,right","Number") %>
  777. </td>
  778. <th>
  779. 부채비율
  780. </th>
  781. <td>
  782. <b><span id="debt_rate1"></span>%</b>(부채총계/자본총계)
  783. </td>
  784. </tr>
  785. <tr height="25">
  786. <th class="required">
  787. 유동자산
  788. </th>
  789. <td>
  790. <%= InputText.get("liquid_asset", Formatter2.currency(vo.get("liquid_asset"),0), 13, 300, "desc=유동자산,Number,right","Number") %>
  791. </td>
  792. <th class="required">
  793. 유동부채
  794. </th>
  795. <td>
  796. <%= InputText.get("liquid_debt", Formatter2.currency(vo.get("liquid_debt"),0), 13, 300, "desc=유동부채,Number,right","Number") %>
  797. </td>
  798. <th>
  799. 유동비율
  800. </th>
  801. <td>
  802. <b><span id="liquid_rate1"></span>%</b>(유동자산/유동부채)
  803. </td>
  804. </tr>
  805. <tr height="25">
  806. <th class="required">
  807. 건설업면허
  808. </th>
  809. <%-- <% if ( user.get("RIGHT_NAME").equals("OUTSIDE") || user.get("RIGHT_NAME").equals("ADMIN NEW") ) {%> --%>
  810. <td>
  811. <LABEL for="LICENCE_YN1"><INPUT id="LICENCE_YN1" type="radio" name="LICENCE_YN" value="Y" desc="건설업면허" <%=vo.get("LICENCE_YN").equals("Y") ? "checked=\"checked\"" : "" %>> 보유</LABEL>
  812. <LABEL for="LICENCE_YN2"><INPUT id="LICENCE_YN2" type="radio" name="LICENCE_YN" value="N" desc="건설업면허" <%=vo.get("LICENCE_YN").equals("N") ? "checked=\"checked\"" : "" %>> </LABEL><span id="LICENCE_YN_TEXT"></span>
  813. <LABEL for="LICENCE_YN3"><INPUT id="LICENCE_YN3" type="radio" name="LICENCE_YN" value="T" desc="장비임대/설계/인허가" <%=vo.get("LICENCE_YN").equals("T") ? "checked=\"checked\"" : "" %>> 장비임대/설계/인허가</LABEL>
  814. </td>
  815. <th>
  816. 결재정보
  817. </th>
  818. <td>
  819. <img id="search_spot_button" src='/img/buyer/button/bt_change.gif' border='0' align="top" align='absmiddle' alt='[Approval File]' onClick='doAppFile("<%= vo.get("doc_id") %>");' style='cursor:pointer;'>
  820. </td>
  821. <th>
  822. 작성자
  823. </th>
  824. <td>
  825. <%= vo.get("WRITE_NAME") %>&nbsp;
  826. </td>
  827. <%-- <% }
  828. else{%>
  829. <td COLSPAN="5">
  830. <LABEL for="LICENCE_YN1"><INPUT id="LICENCE_YN1" type="radio" name="LICENCE_YN" value="Y" desc="건설업면허" <%=vo.get("LICENCE_YN").equals("Y") ? "checked=\"checked\"" : "" %>> 보유</LABEL>
  831. <LABEL for="LICENCE_YN2"><INPUT id="LICENCE_YN2" type="radio" name="LICENCE_YN" value="N" desc="건설업면허" <%=vo.get("LICENCE_YN").equals("N") ? "checked=\"checked\"" : "" %>> </LABEL><span id="LICENCE_YN_TEXT"></span>
  832. <LABEL for="LICENCE_YN3"><INPUT id="LICENCE_YN3" type="radio" name="LICENCE_YN" value="T" desc="장비임대/설계/인허가" <%=vo.get("LICENCE_YN").equals("T") ? "checked=\"checked\"" : "" %>> 장비임대/설계/인허가</LABEL>
  833. </td>
  834. <%} %> --%>
  835. </tr>
  836. </table>
  837. <br>
  838. <font color="red"><b>
  839. ※ 신용평가등급 B- 미만 또는 미발급업체 / 부채비율 250% 이상 / 유동비율 100% 이하 / 영업기간 2년 미만 / 건설업면허 미보유 공사업체의 경우, <u>협력업체 등록이 제한</u>될 수 있습니다.
  840. <br>
  841. <br>
  842. ※ 신규 협력업체 등록 요청은 전결규정에 의거, 담당임원까지 결재 받으시기 바랍니다. </b> </font>
  843. <div class="application-info magT20">
  844. <div class="application-sub-title">
  845. <span class="title">요청정보</span>
  846. </div>
  847. </div>
  848. <table cellspacing="1" cellpadding="0" class="form-table">
  849. <colgroup>
  850. <col width="100px"/>
  851. <col WIDTH="25%"/>
  852. <col width="100px"/>
  853. <col WIDTH="25%"/>
  854. <col width="100px"/>
  855. <col WIDTH="25%"/>
  856. </colgroup>
  857. <tr height="25">
  858. <TH class="required">
  859. 추천부서
  860. </th>
  861. <td class="search_table_data">
  862. <input type="text" name="DEPT_NM" id="DEPT_NM" maxlength="66" style="width: 95%;" value="<%=vo.get("DEPT_NM")%>" />
  863. </td>
  864. <TH class="required">
  865. 추천인
  866. </th>
  867. <td class="search_table_data">
  868. <input type="text" name="REQ_EMP" id="REQ_EMP" maxlength="16" style="width: 75%;ime-mode:inactive" value="<%=vo.get("REQ_EMP")%>" />
  869. <IMG id=btnevalemp src="/img/buyer/button/bt_search_right.gif" alt="추천인" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:SearchUser('','','N');">
  870. </td>
  871. <TH class="required">
  872. 추천일자
  873. </th>
  874. <td class="search_table_data">
  875. <%=vo.get("REQ_DATE")%>
  876. </td>
  877. <TR>
  878. <tr height="25">
  879. <TH class="required"><!-- wrap=off -->
  880. 추천사유<br>(상세기술)
  881. </th>
  882. <td class="search_table_data" colspan="3">
  883. <textarea name="REQ_REMARK" id="REQ_REMARK" style="width:95%;height:80px;overflow:scroll;" rows="1" class="input" > <%=vo.get("REQ_REMARK")%></textarea>
  884. </td>
  885. <TH class="required">
  886. 반려사유
  887. </th>
  888. <td class="search_table_data" >
  889. <textarea name="REJECT_REASON" id="REJECT_REASON" style="width:95%;height:80px" rows="1" class="input" ><%=vo.get("REJECT_REASON")%></textarea>
  890. </td>
  891. </tr>
  892. <tr height="70">
  893. <TH class="required">
  894. 첨부파일
  895. </th>
  896. <td class="search_table_data" colspan="3">
  897. <table border=0 >
  898. <%
  899. if(getFileListRowSet.size() > 0){
  900. int i_mod = 0;
  901. for(int i = 0; getFileListRowSet.size() > i; i++){
  902. i_mod = i%2;
  903. if(i_mod == 0){ %>
  904. <TR>
  905. <% } %>
  906. <td width="10px">
  907. <input type="checkbox" name="p_<%=getFileListRowSet.getRow(i).get("DETAILCD") %>" id="p_<%=getFileListRowSet.getRow(i).get("DETAILCD") %>" value="<%=getFileListRowSet.getRow(i).get("DETAILCD") %>" style="cursor:pointer;" onClick="fileCheck('<%=getFileListRowSet.getRow(i).get("DETAILCD") %>')" <%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("")){out.print("checked");} %> >
  908. </td>
  909. <td width="200px">
  910. <%=getFileListRowSet.getRow(i).get("DETAILNM") %>
  911. </td>
  912. <td width="30px" height="24">
  913. <IMG src="/img/supplier/button/bt_attach_file.gif" id="<%=getFileListRowSet.getRow(i).get("DETAILCD") %>" alt="첨부파일 관리" align="top" style="display:<%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("")){out.print("inline");}else{out.print("none");} %>" onClick="doAttachFile(document.form1.p_corp_id, '<%=getFileListRowSet.getRow(i).get("DETAILCD") %>', '<%=getFileListRowSet.getRow(i).get("DETAILNM")%>');" class="button">
  914. </td>
  915. <% if(i_mod == 1) { %>
  916. </TR>
  917. <% } %>
  918. <%
  919. }
  920. }
  921. %>
  922. </table>
  923. </td>
  924. <td colspan="2" >
  925. <textarea name="p_AttachFile1" id="p_AttachFile1" style="width:98%;height:100px" rows="1" class="input" readOnly></textarea>
  926. </td>
  927. </tr>
  928. </table>
  929. </form>