OutSupplierApprList.jsp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. <%--
  2. - FileName : OutSupplierApprList.jsp
  3. - Author(s) : Sung Min Lee
  4. - Date : 2014.06.17
  5. -
  6. - Description: 협력업체평가현황
  7. --%>
  8. <%@ page contentType="text/html; charset=utf-8" %>
  9. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  10. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  11. <%@ page import="com.udapsoft.waf.common.util.DateUtil"%>
  12. <%@ page import="kr.co.hsnc.common.util.*"%>
  13. <%@ page import="kr.co.hsnc.common.sql.*" %>
  14. <%@ include file="/jsp/work/taglib.jsp" %>
  15. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  16. <%
  17. ctx.init(request, response);
  18. HandlerStorage storage = ctx.getHandlerStorage();
  19. ValueObject params = storage.getParams();
  20. ValueObject user = storage.getUser();
  21. String event = storage.getEvent();
  22. RowSet materialKindCodeLv1 = storage.getRowSet("materialKindCodeLv1");
  23. RowSet materialKindCodeLv2 = new RowSetImpl();
  24. RowSet materialKindCodeLv3 = new RowSetImpl();
  25. String sToday = DateUtil.getSystemDate().substring(0,8);
  26. %>
  27. <script type="text/javascript" src="/js/creditEvaluationPop.js"></script>
  28. <script language="javascript">
  29. /*예약함수*/
  30. var sheet1 = new ibsheetObject();
  31. var sheet1Row;
  32. var sheet1PageNo = 1;
  33. var pageLastRowIndex = 1;
  34. var validationResult = false;
  35. var filterShow = false;
  36. $(document).on("keyup", "input:text", function(e) {
  37. if($(this).attr("numberOnly") == "true")
  38. {
  39. $(this).val( $(this).val().replace(/[^0-9]/gi,"") );
  40. }
  41. if (e.keyCode == 13)
  42. {
  43. $.searchList();
  44. }
  45. });
  46. $.gridInit = function(sheetName)
  47. {
  48. var init_sheet = {};
  49. init_sheet.Cfg = {SearchMode:2, Page:30, MergeSheet:msHeaderOnly};
  50. init_sheet.Cols = [
  51. {Header:"Status", Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Edit:"False", Hidden:"True"},
  52. {Header:"공종|대분류", Type:"Text", SaveName:"KIND_BIG", Width:100, Align:"Center", Edit:"True"},
  53. {Header:"공종|중분류", Type:"Text", SaveName:"KIND_MID", Width:100, Align:"Center", Edit:"True"},
  54. {Header:"공종|소분류", Type:"Text", SaveName:"KIND_SMALL", Width:100, Align:"Center", Edit:"True"},
  55. {Header:"CORP_ID|CORP_ID", Type:"Text", SaveName:"CORP_ID", Width:0, Align:"Center", Edit:"True", Hidden:"True"},
  56. {Header:"업체명|업체명", Type:"Text", SaveName:"CORP_KOR", Width:220, Align:"Left", Edit:"True"},
  57. {Header:"최초등록일|최초등록일", Type:"Date", SaveName:"REG_DT", Width:100, Align:"Center", Edit:"True"},
  58. {Header:"경영평가|평가\n점수", Type:"Text", SaveName:"APPR_TOT_RATE", Width:60, Align:"Center", Edit:"True", Format:"SaupNo"},
  59. {Header:"경영평가|평가\n등급", Type:"Text", SaveName:"ITEM_STD_CD", Width:60, Align:"Center", Edit:"True"},
  60. {Header:"신용등급|신용\n등급", Type:"Text", SaveName:"CREDIT_GRADE", Width:60, Align:"Center", Edit:"True"},
  61. {Header:"신용등급|현금\n흐름", Type:"Text", SaveName:"CASH_GRADE", Width:60, Align:"Center", Edit:"True"},
  62. {Header:"준공평가(평균)|평가\n점수", Type:"Text", SaveName:"APPR_TOT_RATE2", Width:60, Align:"Center", Edit:"True"},
  63. {Header:"준공평가(평균)|평가\n등급", Type:"Text", SaveName:"ITEM_STD_CD2", Width:60, Align:"Center", Edit:"True"},
  64. {Header:"상태|상태", Type:"Text", SaveName:"CORP_STATUS", Width:100, Align:"Center", Edit:"True"},
  65. {Header:"신평사코드|신평사코드", Type:"Text", SaveName:"CREDIT_CORP_CD", Width:0, Align:"Center", Hidden:"True"},
  66. {Header:"사업자번호|사업자번호", Type:"Text", SaveName:"CORP_REG_NO", Width:0, Align:"Center", Hidden:"True"},
  67. {Header:"평가차수|평가차수", Type:"Text", SaveName:"ARR_ID", Width:100, Align:"Center", Hidden:"True"},
  68. {Header:"평가일자|평가일자", Type:"Text", SaveName:"APPR_DY", Width:100, Align:"Center", Hidden:"True"},
  69. {Header:"구분|구분", Type:"Text", SaveName:"DOC_CD", Width:100, Align:"Center", Hidden:"True"}
  70. ];
  71. init_sheet.HeaderMode = {Sort:1};
  72. IBS_InitSheet(sheet1, init_sheet);
  73. sheet1.SetDataAutoTrim(0);
  74. sheet1.SetEditable(false);
  75. sheet1.SetDataLinkMouse("APPR_TOT_RATE", 1);
  76. sheet1.SetColFontColor("APPR_TOT_RATE", "#0000ff");
  77. sheet1.SetDataLinkMouse("CREDIT_GRADE", 1);
  78. sheet1.SetColFontColor("CREDIT_GRADE", "#0000ff");
  79. sheet1.SetDataLinkMouse("CASH_GRADE", 1);
  80. sheet1.SetColFontColor("CASH_GRADE", "#0000ff");
  81. sheet1.FitColWidth();
  82. var obj = { Format: "Ymd", X:300, Y:600, CallBack: "Test" };
  83. }
  84. $(function(){
  85. $.searchList = function()
  86. {
  87. $("#fevent").val("GET_LIST");
  88. var url = Modular.model.PageContext.CONTEXT_ROOT + "/supplier/outside/OutSupplierApprList_sheet.screen";
  89. Modular.view.IBSheet7.doSearch(sheet1, url, $("#form1"), 30, "");
  90. }
  91. $("#btn_search").click(function(){
  92. $.searchList();
  93. });
  94. $("#btn_excel").click(function(){
  95. var params = {FileName:"협력업체 평가현황.xls",SheetName:"협력업체 평가현황",Merge:1,SheetDesign:1, HiddenColumn:1 };
  96. sheet1.Down2Excel (params);
  97. });
  98. $("#btn_reg").click(function(){
  99. $("#fevent").val("");
  100. // $("#form1").attr("action", "/supplier/purchase/SuppJoinRequest.screen");
  101. $("#form1").attr("target", "_self");
  102. $("#form1").attr("method", "post");
  103. $("#form1").submit();
  104. });
  105. $("[name=date_img]").click(function(){
  106. var id = $(this).attr("id").substring(0, $(this).attr("id").lastIndexOf("_"));
  107. dlgCalendar(id);
  108. });
  109. $("#dataClear").click(function(){
  110. $("#appr_dy_s").val("");
  111. $("#appr_dy_e").val("");
  112. });
  113. $("#material_Kind_Code_Lv1").change(function(){
  114. var f = document.form1;
  115. if($("#material_Kind_Code_Lv1").val().trim() == "")
  116. {
  117. $("#material_Kind_Code_Lv2").empty().data("options");
  118. $("#material_Kind_Code_Lv2").append("<option value=''>-- 전체 --</option>");
  119. $("#material_Kind_Code_Lv3").empty().data("options");
  120. $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
  121. }
  122. else
  123. {
  124. $("#fevent").val("GET_MATL_KIND_CODE_LV2");
  125. $("#materiallevel").val("2");
  126. $("#materialgroup").val($("#material_Kind_Code_Lv1").val());
  127. submitXmlRequest("/supplier/outside/OutSupplierList_form.screen", "GET_MATL_KIND_CODE_LV2", f, "ROWSET");
  128. }
  129. });
  130. $("#material_Kind_Code_Lv2").change(function(){
  131. var f = document.form1;
  132. if($("#material_Kind_Code_Lv2").val().trim() == "")
  133. {
  134. $("#material_Kind_Code_Lv3").empty().data("options");
  135. $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
  136. }
  137. else
  138. {
  139. $("#fevent").val("GET_MATL_KIND_CODE_LV3");
  140. $("#materiallevel").val("3");
  141. $("#materialgroup").val($("#material_Kind_Code_Lv2").val());
  142. submitXmlRequest("/supplier/outside/OutSupplierList_form.screen", "GET_MATL_KIND_CODE_LV3", f, "ROWSET");
  143. }
  144. });
  145. });
  146. $(document).ready(function(){
  147. setSearchDate();
  148. $.gridInit(sheet1);
  149. //$.searchList();
  150. autoResize();
  151. });
  152. function sheet1_OnSearchEnd(code, message)
  153. {
  154. sheet1.FitColWidth();
  155. }
  156. function autoResize(){
  157. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  158. var iframeHeight= document.body.scrollHeight - t1_height;
  159. var iframeWidth= document.body.scrollWidth;
  160. sheet1.SetSheetHeight(iframeHeight);
  161. }
  162. //2016.4.28 날짜지정
  163. function setSearchDate(){
  164. var newDay = new Date( get_year(), get_month(), "");
  165. var lastDay = newDay.getDate();
  166. var searchFromDate = get_year() +'-01-01';
  167. var searchToDate = get_year() +'-'+ get_month() + '-' + lastDay;
  168. jQuery('#appr_dy_s').val(searchFromDate);
  169. jQuery('#appr_dy_e').val(searchToDate);
  170. }
  171. function doResult(resultObj) {
  172. try {
  173. if ( resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV2" )
  174. {
  175. if ( resultObj.getSuccess() == true )
  176. {
  177. var rowSet = resultObj.getRowSet();
  178. $("#material_Kind_Code_Lv2").empty().data("options");
  179. $("#material_Kind_Code_Lv2").append("<option value=''>-- 전체 --</option>");
  180. for ( var i = 0; i < rowSet.getRowSize(); i++ )
  181. {
  182. $("#material_Kind_Code_Lv2").append("<option value='"+rowSet.getColValue( i, 0 )+"'>"+rowSet.getColValue( i, 1 ) +"</option>");
  183. }
  184. document.form1.isSubmit = false;
  185. } else {
  186. dlgErrorMsg(resultObj);
  187. }
  188. }
  189. else if ( resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV3" )
  190. {
  191. if ( resultObj.getSuccess() == true )
  192. {
  193. var rowSet = resultObj.getRowSet();
  194. $("#material_Kind_Code_Lv3").empty().data("options");
  195. $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
  196. for ( var i = 0; i < rowSet.getRowSize(); i++ )
  197. {
  198. $("#material_Kind_Code_Lv3").append("<option value='"+rowSet.getColValue( i, 0 )+"'>"+rowSet.getColValue( i, 1 )+"</option>");
  199. }
  200. document.form1.isSubmit = false;
  201. }
  202. else
  203. {
  204. dlgErrorMsg(resultObj);
  205. }
  206. }
  207. else if(resultObj.getRequestEvent() == "GET_CREADIT_REG_CHK")
  208. {
  209. document.form1.isSubmit = false;
  210. var url = resultObj.getValueObject().get("returnUrl");
  211. window.open(url, "pop", "width=1024,height=600, resizable=yes, scrollbars=yes");
  212. }
  213. else if(resultObj.getRequestEvent() == "GET_CREADIT_REG_CHK2")
  214. {
  215. document.form1.isSubmit = false;
  216. var url = resultObj.getValueObject().get("return_url");
  217. var open = window.open('',"go_ksrm","width=900,height=600,scrollbar=auto");
  218. var f = document.form1;
  219. f.action = url;
  220. f.target = "go_ksrm";
  221. f.method = "post";
  222. f.submit();
  223. }
  224. }
  225. catch(errorObject) {
  226. showErrorDlg("doResult()", errorObject);
  227. }
  228. }
  229. /**
  230. * IBSheet Event: DBLCLICK
  231. */
  232. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  233. var f = document.form1;
  234. if (sheet1.ColSaveName(Col) == "APPR_TOT_RATE") {
  235. var reportInfo = new ReportInfo();
  236. if(sheet1.GetCellValue(Row, "APPR_TOT_RATE").trim() != "" )
  237. {
  238. reportInfo.title = "공사 협력업체 경영평가표";
  239. if(sheet1.GetCellValue(Row, "DOC_CD").trim() == "13" )
  240. {
  241. reportInfo.reportName = "/report/mrd/buyer/supplier/outside/OutSupplierReport13.mrd";
  242. }
  243. else if (sheet1.GetCellValue(Row, "DOC_CD").trim() == "14" )
  244. {
  245. reportInfo.reportName = "/report/mrd/buyer/supplier/outside/OutSupplierReport14.mrd";
  246. }
  247. else{
  248. reportInfo.reportName = "/report/mrd/buyer/supplier/outside/OutSupplierReport.mrd";
  249. }
  250. reportInfo.width = 1000; // Default: 1024
  251. reportInfo.height = 700; // Default: 768
  252. reportInfo.set(sheet1.GetCellValue(Row, "CORP_ID")); // $1
  253. reportInfo.set(sheet1.GetCellValue(Row, "ARR_ID")); // $2
  254. reportInfo.set(sheet1.GetCellValue(Row, "APPR_DY").substring(0,4));
  255. reportInfo.showPopup();
  256. }
  257. }
  258. // else if (sheet1.ColSaveName(Col) == "APPR_TOT_RATE2") {
  259. // var reportInfo = new ReportInfo();
  260. // if(sheet1.GetCellValue(Row, "APPR_TOT_RATE2").trim() != "" )
  261. // {
  262. // reportInfo.title = "협력업체 현장평가표";
  263. // reportInfo.reportName = "/report/mrd/buyer/supplier/outside/OutSuppFixApprReport.mrd";
  264. // reportInfo.width = 1000; // Default: 1024
  265. // reportInfo.height = 700; // Default: 768
  266. // reportInfo.set(sheet1.GetCellValue(Row, "CORP_ID")); // $1
  267. // reportInfo.set(sheet1.GetCellValue(Row, "ARR_ID")); // $2
  268. // reportInfo.set(sheet1.GetCellValue(Row, "APPR_DY").substring(0,4));
  269. // reportInfo.showPopup();
  270. // }
  271. // }
  272. else if (sheet1.ColSaveName(Col) == "CREDIT_GRADE" || sheet1.ColSaveName(Col) == "CASH_GRADE" )
  273. {
  274. var code = sheet1.GetCellValue(Row, "CREDIT_CORP_CD");
  275. var reg_no = sheet1.GetCellValue(Row, "CORP_REG_NO");
  276. /*
  277. 이크레더블 : E
  278. 서울신용평가 : S
  279. 나이스디앤비 : N
  280. 한국기업데이터 : K
  281. 나이스평가정보:M
  282. */
  283. if(code == "E")
  284. {
  285. var u = "2d2d424547494e204349504845522d2d313131310000000b3030303030303030eef0492ff42855bbffb697d670d4e3d109dafed98f4d7900293e8d4b9c1dcebd28eb9d58fd4c815c4d4829f1415fdfb730302d2d454e44204349504845522d2d";
  286. var p = "2d2d424547494e204349504845522d2d313131310000000830303030303030301bb8ae01f161a326e30cc8d45f3844afd1bd2d39f5da22e9405f40dff013966445d4ea4029f89ad1385c4624cf679cc230302d2d454e44204349504845522d2d";
  287. var i = reg_no; //협력업체사업자번호
  288. var k = ""; //협력업체법인번호
  289. var m ='3';
  290. var link ='http://www.esrm.co.kr/esrm/SrmplusLogin?u='+ u +'&p='+ p +'&i='+ i +'&k='+ k +'&c=7&m='+ m +'&g=2';
  291. var features ='height=768, width=1024, status=no, scrollbars=auto, resizable=yes';
  292. window.open(link, 'watchwin', features);
  293. }
  294. else if(code == "S")
  295. {
  296. var link = "http://www.bizrating.co.kr/url/urlPage.do?param1=ZXRlY2g=&param2=YWV0ZWNo&param3=" + reg_no;
  297. window.open(link, "pop", "width=975,height=600, resizable=yes, scrollbars=yes");
  298. }
  299. else if(code == "N")
  300. {
  301. var f = document.form1;
  302. $("#p_corp_reg_no").val(reg_no);
  303. $("#fevent").val("GET_CREADIT_REG_CHK");
  304. submitXmlRequest("/supplier/purchase/PuSupplierList_form.screen", "GET_CREADIT_REG_CHK", f, "VALUEOBJECT");
  305. }
  306. else if(code == "K")
  307. {
  308. var f = document.form1;
  309. $("#p_corp_reg_no").val(reg_no);
  310. $("#fevent").val("GET_CREADIT_REG_CHK2");
  311. submitXmlRequest("/supplier/purchase/PuSupplierList_form.screen", "GET_CREADIT_REG_CHK2", f, "VALUEOBJECT");
  312. }
  313. else if(code == "M")
  314. {
  315. var vnk = "<%= sToday%>" * 677;
  316. var link = "http://service.ecredit.co.kr/p01/A0001M001.nice?bizno=" + reg_no + "&eid=ETECENC&nk=" + vnk;
  317. window.open(link, "pop", "width=975,height=600, resizable=yes, scrollbars=yes");
  318. }
  319. }
  320. }
  321. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  322. </script>
  323. <modular:search id="form1">
  324. <modular:key id="fevent" />
  325. </modular:search>
  326. <form id="form1" name="form1" method="post" modular:type="search">
  327. <INPUT type="hidden" name="fevent" id="fevent" value="" />
  328. <div align="left" id="title">
  329. <ul>
  330. <li>협력업체 평가현황(외주)</li>
  331. </ul>
  332. </div>
  333. <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="search-table">
  334. <!-- 검색조건 영역 : 시작 -->
  335. <tr>
  336. <td height="1">
  337. <table cellspacing="1" cellpadding="0" class="search-form-table">
  338. <col width="10%">
  339. <col width="30%">
  340. <col width="10%">
  341. <col width="30%">
  342. <col width="20%">
  343. <tr height="25">
  344. <!-- 검색조건 타이틀 1 -->
  345. <th>
  346. 공종
  347. </th>
  348. <td>
  349. <%= HTMLMaker.getSelectTag(materialKindCodeLv1, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv1", "style='width:28%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", "", 0) %>
  350. <%= HTMLMaker.getSelectTag(materialKindCodeLv2, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv2", "style='width:28%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", "", 0) %>
  351. <%= HTMLMaker.getSelectTag(materialKindCodeLv3, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv3", "style='width:28%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", "", 0) %>
  352. </td>
  353. <th>
  354. 사업자번호
  355. </th>
  356. <td>
  357. <input type="text" name="corp_no" id="corp_no" style="width: 86%;" numberOnly="true" value=""/>
  358. </td>
  359. <td rowspan="2" class="button" style="text-align: center;">
  360. <!-- 검색버튼 영역 : 시작 -->
  361. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_search">검색</a></span>
  362. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_excel">엑셀</a></span>
  363. <!-- 검색버튼 영역 : 종료 -->
  364. </td>
  365. </tr>
  366. <tr height="25">
  367. <!-- 검색조건 타이틀 1 -->
  368. <th>
  369. 업체명
  370. </th>
  371. <td>
  372. <input type="text" name="corp_name" id="corp_name" style="width: 86%;" value=""/>
  373. </td>
  374. <th >
  375. 평가일자
  376. </th>
  377. <td>
  378. <%= InputText.get("appr_dy_s", params.get("appr_dy_s"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  379. <img alt="달력" id="appr_dy_s_img" name="date_img" src="/img/buyer/btn/bt_calender.gif" style="vertical-align: middle; cursor: pointer;">
  380. ~
  381. <%= InputText.get("appr_dy_e", params.get("appr_dy_e"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  382. <img alt="달력" name="date_img" id="appr_dy_e_img" src="/img/buyer/btn/bt_calender.gif" style="vertical-align: middle; cursor: pointer;">
  383. <IMG name="dataClear" id="dataClear" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
  384. <!--
  385. <input type="text" name="appr_dy_s" id="appr_dy_s" value="" style="width: 30%;">&nbsp;
  386. <img alt="달력" id="appr_dy_s_img" name="date_img" src="/img/buyer/btn/bt_calender.gif" style="vertical-align: middle; cursor: pointer;">
  387. ~
  388. <input type="text" name="appr_dy_e" id="appr_dy_e" style="width: 30%;" value="">&nbsp;
  389. <img alt="달력" name="date_img" id="appr_dy_e_img" src="/img/buyer/btn/bt_calender.gif" style="vertical-align: middle; cursor: pointer;">
  390. -->
  391. </td>
  392. </tr>
  393. </table>
  394. </td>
  395. </tr>
  396. <!-- 검색조건 영역 : 종료 -->
  397. <!-- 검색조건 영역, 테이터 영역 구분 여백 : 시작 -->
  398. <tr>
  399. <td height="1">
  400. <table border="0" cellspacing="0" cellpadding="0" class="search_data_div_height">
  401. <tr>
  402. <td>
  403. </td>
  404. </tr>
  405. </table>
  406. </td>
  407. </tr>
  408. </table>
  409. </form>
  410. <div style="width: 100%; height: 100%; margin-top: 5px;">
  411. <!-- 데이터 영역 : 시작 -->
  412. <!-- ibsheet7 그리드 생성 -->
  413. <script>createIBSheet("sheet1","100%", "250px");</script>
  414. <!-- 데이터 영역 : 종료 -->
  415. </div>