PuSupplierCompList.jsp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <%--
  2. - FileName : PuSupplierApprList.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. <%@ page import="kr.co.hsnc.common.config.WAFConfig"%>
  15. <%@ include file="/jsp/work/taglib.jsp" %>
  16. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  17. <%
  18. ctx.init(request, response);
  19. HandlerStorage storage = ctx.getHandlerStorage();
  20. ValueObject params = storage.getParams();
  21. ValueObject user = storage.getUser();
  22. String event = storage.getEvent();
  23. // String defaultDS = WAFConfig.get("waf.sql.Default.DS");
  24. //검색조건 현장 설정
  25. String initSearchDeptCd = params.get("searchDeptCd");
  26. String initSearchDeptNm = params.get("searchDeptNm");
  27. String sToday = DateUtil.getSystemDate().substring(0,8);
  28. %>
  29. <script type="text/javascript" src="/js/creditEvaluationPop.js"></script>
  30. <script language="javascript">
  31. /*예약함수*/
  32. var sheet1 = new ibsheetObject();
  33. var sheet1Row;
  34. var sheet1PageNo = 1;
  35. var pageLastRowIndex = 1;
  36. var validationResult = false;
  37. var filterShow = false;
  38. $(document).on("keyup", "input:text", function(e) {
  39. if($(this).attr("numberOnly") == "true")
  40. {
  41. $(this).val( $(this).val().replace(/[^0-9]/gi,"") );
  42. }
  43. if (e.keyCode == 13)
  44. {
  45. $.searchList();
  46. }
  47. });
  48. $.gridInit = function(sheetName)
  49. {
  50. var init_sheet = {};
  51. init_sheet.Cfg = {SearchMode:2, Page:30, MergeSheet:msHeaderOnly};
  52. init_sheet.Cols = [
  53. {Header:"Status", Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  54. {Header:"CORP_ID", Type:"Text", SaveName:"CORP_ID", Width:0, Align:"Center", Hidden:"True"},
  55. {Header:"현장명", Type:"Text", SaveName:"DEPT_NAME", Width:220, Align:"Left" },
  56. {Header:"☞계약명", Type:"Text", SaveName:"CST_DOC_NAME", Width:220, Align:"Left" },
  57. {Header:"업체명", Type:"Text", SaveName:"CORP_KOR", Width:220, Align:"Left" },
  58. {Header:"현장평가자", Type:"Text", SaveName:"USER_NAME", Width:60, Align:"Center" },
  59. {Header:"본사평가자", Type:"Text", SaveName:"WRITE_NM", Width:60, Align:"Center" },
  60. {Header:"평가자ID", Type:"Text", SaveName:"APPR_BY_ID", Width:100, Align:"Center", Hidden:"True"},
  61. {Header:"☞준공평가점수", Type:"Text", SaveName:"APPR_TOT_RATE", Width:80, Align:"Center" },
  62. {Header:"평가등급", Type:"Text", SaveName:"ITEM_STD_CD", Width:70, Align:"Center" },
  63. {Header:"공종", Type:"Text", SaveName:"ITEM_STD_NM", Width:50, Align:"Center" },
  64. {Header:"상태", Type:"Text", SaveName:"STATUS_CODE", Width:70, Align:"Center" },
  65. {Header:"평가차수", Type:"Text", SaveName:"ARR_ID", Width:100, Align:"Center", Hidden:"True"},
  66. {Header:"평가일자", Type:"Text", SaveName:"APPR_DY", Width:100, Align:"Center", Hidden:"True"},
  67. {Header:"DOC_CD", Type:"Text", SaveName:"DOC_CD", Width:100, Align:"Center", Hidden:"True"},
  68. {Header:"DEPT_CD", Type:"Text", SaveName:"DEPT_CD", Width:100, Align:"Center", Hidden:"True"},
  69. {Header:"기준년도", Type:"Text", SaveName:"ADM_YEAR", Width:50, Align:"Center" },
  70. {Header:"PUR_CONT_ID", Type:"Text", SaveName:"PUR_CONT_ID", Width:100, Align:"Center", Hidden:"True"},
  71. {Header:"ORD_DOC_NO", Type:"Text", SaveName:"ORD_DOC_NO", Width:40, Align:"Center" , Hidden:"True"},
  72. {Header:"평가의견", Type:"Text", SaveName:"APPR_NOTE", Width:150, Align:"Left"},
  73. {Header:"REGU_STATUS_CD", Type:"Text", SaveName:"REGU_STATUS_CD", Width:40, Align:"Left", Hidden:"True"}
  74. ];
  75. init_sheet.HeaderMode = {Sort:1};
  76. IBS_InitSheet(sheetName, init_sheet);
  77. sheetName.SetDataAutoTrim(0);
  78. sheetName.SetEditable(false);
  79. sheet1.SetDataLinkMouse("APPR_TOT_RATE", 1);
  80. sheet1.SetColFontColor("APPR_TOT_RATE", "#0000ff");
  81. sheet1.SetDataLinkMouse("CST_DOC_NAME", 1);
  82. sheet1.SetColFontColor("CST_DOC_NAME", "#0000ff");
  83. sheet1.SetDataLinkMouse("CREDIT_GRADE", 1);
  84. sheet1.SetColFontColor("CREDIT_GRADE", "#0000ff");
  85. sheet1.SetDataLinkMouse("CASH_GRADE", 1);
  86. sheet1.SetColFontColor("CASH_GRADE", "#0000ff");
  87. sheetName.FitColWidth();
  88. // var obj = { Format: "Ymd", X:300, Y:600, CallBack: "Test" };
  89. }
  90. $(function(){
  91. $.searchList = function()
  92. {
  93. $("#fevent").val("GET_LIST");
  94. var url = Modular.model.PageContext.CONTEXT_ROOT + "/supplier/purchase/PuSupplierCompList_sheet.screen";
  95. Modular.view.IBSheet7.doSearch(sheet1, url, $("#form1"), 30, "");
  96. }
  97. $("#btn_search").click(function(){
  98. $.searchList();
  99. });
  100. $("#btn_excel").click(function(){
  101. var params = {FileName:"협력업체 평가현황.xls",SheetName:"협력업체 평가현황",Merge:1,SheetDesign:1, HiddenColumn:1};
  102. sheet1.Down2Excel (params);
  103. });
  104. });
  105. $(document).ready(function(){
  106. setSearchDate();
  107. $.gridInit(sheet1);
  108. //$.searchList();
  109. autoResize();
  110. });
  111. function autoResize(){
  112. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  113. var iframeHeight= document.body.scrollHeight - t1_height;
  114. var iframeWidth= document.body.scrollWidth;
  115. sheet1.SetSheetHeight(iframeHeight);
  116. }
  117. function setSearchDate(){
  118. var newDay = new Date( get_year(), get_month(), "");
  119. var lastDay = newDay.getDate();
  120. //var yyyymmbeginning = get_year() +'-'+ get_month() +'-'+ '01';
  121. //var yyyymmlast = get_year() +'-'+ get_month() +'-'+ lastDay;
  122. var searchFromDate = get_year() +'-'+ '01';
  123. var searchToDate = get_year() +'-'+ get_month();
  124. jQuery('#searchFromDate').val(searchFromDate);
  125. jQuery('#searchToDate').val(searchToDate);
  126. }
  127. function doResult(resultObj) {
  128. try {
  129. if ( resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV2" )
  130. {
  131. if ( resultObj.getSuccess() == true )
  132. {
  133. } else {
  134. dlgErrorMsg(resultObj);
  135. }
  136. }
  137. }
  138. catch(errorObject) {
  139. showErrorDlg("doResult()", errorObject);
  140. }
  141. }
  142. /**
  143. * IBSheet Event: DBLCLICK
  144. */
  145. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  146. var f = document.form1;
  147. if (sheet1.ColSaveName(Col) == "APPR_TOT_RATE") {
  148. var reportInfo = new ReportInfo();
  149. if(sheet1.GetCellValue(Row, "APPR_TOT_RATE").trim() != "")
  150. {
  151. if(sheet1.GetCellValue(Row, "DOC_CD") == "03")
  152. {
  153. reportInfo.title = "기자재공급업체 현장평가표(Manufacturer)";
  154. if(sheet1.GetCellValue(Row, "ADM_YEAR") == "2014")
  155. { reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PuSupplierReport3.mrd";}
  156. else if(sheet1.GetCellValue(Row, "ADM_YEAR") == "2016")
  157. { reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PuSupplierReport3_2016.mrd";}
  158. else if(sheet1.GetCellValue(Row, "ADM_YEAR") == "2019")
  159. { reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PuSupplierReport3_2019.mrd";}
  160. else if(sheet1.GetCellValue(Row, "ADM_YEAR") == "2020")
  161. { reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PuSupplierReport3_2020.mrd";}
  162. else
  163. { reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PuSupplierReport3_2023.mrd";}
  164. reportInfo.set(sheet1.GetCellValue(Row, "CORP_ID")); // $1
  165. reportInfo.set(sheet1.GetCellValue(Row, "ARR_ID")); // $2
  166. reportInfo.set(sheet1.GetCellValue(Row, "DOC_CD")); // $3
  167. reportInfo.set(sheet1.GetCellValue(Row, "APPR_DY").substring(0,4));
  168. }
  169. else if(sheet1.GetCellValue(Row, "DOC_CD") == "04")
  170. {
  171. reportInfo.title = "기자재공급업체 현장평가표(Agent)";
  172. if(sheet1.GetCellValue(Row, "ADM_YEAR") == "2014")
  173. { reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PuSupplierReport4.mrd";}
  174. else if(sheet1.GetCellValue(Row, "ADM_YEAR") == "2016")
  175. { reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PuSupplierReport4_2016.mrd";}
  176. else if(sheet1.GetCellValue(Row, "ADM_YEAR") == "2019")
  177. { reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PuSupplierReport4_2019.mrd";}
  178. else if(sheet1.GetCellValue(Row, "ADM_YEAR") == "2020")
  179. { reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PuSupplierReport4_2020.mrd";}
  180. else
  181. { reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PuSupplierReport4_2023.mrd";}
  182. reportInfo.set(sheet1.GetCellValue(Row, "CORP_ID")); // $1
  183. reportInfo.set(sheet1.GetCellValue(Row, "ARR_ID")); // $2
  184. reportInfo.set(sheet1.GetCellValue(Row, "DOC_CD")); // $3
  185. reportInfo.set(sheet1.GetCellValue(Row, "APPR_DY").substring(0,4));
  186. }
  187. reportInfo.width = 1000; // Default: 1024
  188. reportInfo.height = 700; // Default: 768
  189. // reportInfo.reportOption = "/rf /rsn ["+f.defaultDS.value+"]"; // Default: '/rf'
  190. reportInfo.showPopup();
  191. }
  192. }
  193. else if (sheet1.ColSaveName(Col) == "CREDIT_GRADE")
  194. {
  195. var code = sheet1.GetCellValue(Row, "CREDIT_CORP_CD");
  196. var reg_no = sheet1.GetCellValue(Row, "CORP_REG_NO");
  197. /*
  198. 이크레더블 : E
  199. 서울신용평가 : S
  200. 나이스디앤비 : N
  201. 한국기업데이터 : K
  202. 나이스평가정보:M
  203. */
  204. if(code == "E")
  205. {
  206. var u = "2d2d424547494e204349504845522d2d313131310000000b3030303030303030eef0492ff42855bbffb697d670d4e3d109dafed98f4d7900293e8d4b9c1dcebd28eb9d58fd4c815c4d4829f1415fdfb730302d2d454e44204349504845522d2d";
  207. var p = "2d2d424547494e204349504845522d2d313131310000000830303030303030301bb8ae01f161a326e30cc8d45f3844afd1bd2d39f5da22e9405f40dff013966445d4ea4029f89ad1385c4624cf679cc230302d2d454e44204349504845522d2d";
  208. var i = reg_no; //협력업체사업자번호
  209. var k = ""; //협력업체법인번호
  210. var m ='3';
  211. var link ='http://www.esrm.co.kr/esrm/SrmplusLogin?u='+ u +'&p='+ p +'&i='+ i +'&k='+ k +'&c=7&m='+ m +'&g=2';
  212. var features ='height=768, width=1024, status=no, scrollbars=auto, resizable=yes';
  213. window.open(link, 'watchwin', features);
  214. }
  215. else if(code == "S")
  216. {
  217. var link = "http://www.bizrating.co.kr/url/urlPage.do?param1=ZXRlY2g=&param2=YWV0ZWNo&param3=" + reg_no;
  218. window.open(link, "pop", "width=975,height=600, resizable=yes, scrollbars=yes");
  219. }
  220. else if(code == "N")
  221. {
  222. var f = document.form1;
  223. $("#p_corp_reg_no").val(reg_no);
  224. $("#fevent").val("GET_CREADIT_REG_CHK");
  225. submitXmlRequest("/supplier/purchase/PuSupplierList_form.screen", "GET_CREADIT_REG_CHK", f, "VALUEOBJECT");
  226. }
  227. else if(code == "K")
  228. {
  229. var link = "http://www.k-srm.co.kr/refbfautologin.do?acctp=J1&isSSL=&ID=ETEC& siteKey=kzCur4ryVY=&BZNO=" + reg_no;
  230. window.open(link,"go_ksrm","width=900,height=600,scrollbar=auto");
  231. }
  232. else if(code == "M")
  233. {
  234. var vnk = "<%= sToday%>" * 677;
  235. var link = "http://service.ecredit.co.kr/p01/A0001M001.nice?bizno=" + reg_no + "&eid=ETECENC&nk=" + vnk;
  236. window.open(link, "pop", "width=975,height=600, resizable=yes, scrollbars=yes");
  237. }
  238. }
  239. else if (sheet1.ColSaveName(Col) == "CST_DOC_NAME"){
  240. var p_corp_id = sheet1.GetCellValue(Row, "CORP_ID");
  241. var p_dept_cd = sheet1.GetCellValue(Row, "DEPT_CD");
  242. var p_ord_doc_no = sheet1.GetCellValue(Row, "ORD_DOC_NO");
  243. var p_pur_cont_id = sheet1.GetCellValue(Row, "PUR_CONT_ID");
  244. var p_user_sabun = "<%=user.get("USER_SABUN")%>";
  245. var p_status = sheet1.GetCellValue(Row, "REGU_STATUS_CD");
  246. var argObj = new Object();
  247. argObj.p_corp_id = p_corp_id;
  248. argObj.p_dept_cd = p_dept_cd;
  249. argObj.p_ord_doc_no = p_ord_doc_no;
  250. argObj.p_pur_cont_id = p_pur_cont_id;
  251. argObj.p_user_sabun = p_user_sabun;
  252. argObj.P_CHARGE_CD = "C";
  253. argObj.title = '현장 평가표 생성';
  254. var dialogHeight = 440;
  255. var dialogWeight = 900;
  256. if(sheet1.GetCellValue(Row, "ADM_YEAR") == "2019"){
  257. dialogHeight = 500;
  258. } else if(sheet1.GetCellValue(Row, "ADM_YEAR") == "2020"){
  259. dialogHeight = 550;
  260. }else{
  261. dialogHeight = 650;
  262. dialogWeight = 1100;
  263. }
  264. var win_id = "SuppFixApprPop";
  265. var url = "PuSuppFixApprPop.screen?p_corp_id="+p_corp_id+"&p_dept_cd="+p_dept_cd+"&p_pur_cont_id="+p_pur_cont_id+"&p_user_sabun="+p_user_sabun+"&p_status="+p_status+"&P_CHARGE_CD=C&sModule=LM";
  266. result = fLayerPop(win_id, url, dialogWeight,dialogHeight, '', '', 'NO');
  267. //result = window.showModalDialog(url, argObj,'dialogWidth:900px;dialogHeight:' + dialogHeight + 'px; center:yes; help:no; status:no; scroll:no; resizable:no');
  268. //$.searchList();
  269. }
  270. }
  271. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  272. </script>
  273. <modular:search id="form1">
  274. <modular:key id="fevent" />
  275. </modular:search>
  276. <form id="form1" name="form1" method="post" modular:type="search">
  277. <INPUT type="hidden" name="fevent" id="fevent" value=""/>
  278. <INPUT type="hidden" name="materialgroup" id="materialgroup" value=""/>
  279. <INPUT type="hidden" name="p_corp_reg_no" id="p_corp_reg_no" value="" />
  280. <div align="left" id="title">
  281. <ul>
  282. <li>구매_협력업체 현장평가현황</li>
  283. </ul>
  284. </div>
  285. <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="search-table">
  286. <!-- 검색조건 영역 : 시작 -->
  287. <tr>
  288. <td height="1">
  289. <table cellspacing="1" cellpadding="0" class="search-form-table">
  290. <col width="10%">
  291. <col width="30%">
  292. <col width="10%">
  293. <col width="30%">
  294. <col width="20%">
  295. <tr height="25">
  296. <!-- 검색조건 타이틀 1 -->
  297. <th>
  298. 현장명
  299. </th>
  300. <td>
  301. <%=InputText.getSiteCodeNew("searchDeptCd", "searchDeptNm", "", user, initSearchDeptCd, initSearchDeptNm)%>
  302. </td>
  303. <th>
  304. 계약명
  305. </th>
  306. <td>
  307. <input type="text" name="build_name" id="build_name" style="width: 86%;" value="<%=params.get("build_name")%>"/>
  308. </td>
  309. <td rowspan="2" class="button" style="text-align: center;">
  310. <!-- 검색버튼 영역 : 시작 -->
  311. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_search">검색</a></span>
  312. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_excel">엑셀</a></span>
  313. <!-- 검색버튼 영역 : 종료 -->
  314. </td>
  315. </tr>
  316. <tr height="25">
  317. <!-- 검색조건 타이틀 1 -->
  318. <th>
  319. 업체명
  320. </th>
  321. <td >
  322. <input type="text" name="corp_kor" id="corp_kor" style="width: 36%;" value="<%=params.get("corp_kor")%>"/>
  323. </td>
  324. <th>평가년월
  325. </th>
  326. <TD>
  327. <%= InputText.get("searchFromDate", "", 10, 50, "hangule,center, desc=평가년월, ReadOnly") %>
  328. <IMG name="start_img" id="calender_from" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgMCalendar('searchFromDate');">
  329. ~
  330. <%= InputText.get("searchToDate", "", 10, 50, "hangule,center, desc=평가년월, ReadOnly") %>
  331. <IMG name="start_img" id="calender_to" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgMCalendar('searchToDate');">
  332. </TD>
  333. </tr>
  334. </table>
  335. </td>
  336. </tr>
  337. <!-- 검색조건 영역 : 종료 -->
  338. <!-- 검색조건 영역, 테이터 영역 구분 여백 : 시작 -->
  339. <tr>
  340. <td height="1">
  341. <table border="0" cellspacing="0" cellpadding="0" class="search_data_div_height">
  342. <tr>
  343. <td>
  344. </td>
  345. </tr>
  346. </table>
  347. </td>
  348. </tr>
  349. </table>
  350. <div style="width: 100%; height: 100%; padding-top: 5px;">
  351. <!-- 데이터 영역 : 시작 -->
  352. <!-- ibsheet7 그리드 생성 -->
  353. <script>createIBSheet("sheet1","100%", "250px;");</script>
  354. <!-- 데이터 영역 : 종료 -->
  355. </div>
  356. </form>