ContTargetList.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <%--
  2. - Author(s) : Kim Myung Ho
  3. - Date : 2014.07.04
  4. - Description: 계약작성 대상 리스트
  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. RowSet template_list = storage.getRowSet("TEMPLATE_LIST");
  19. String template_cds="";
  20. String template_names="선택";
  21. for(int i=0;i<template_list.size();i++){
  22. template_cds = template_cds+"|"+(template_list.getRow(i).get("TEMPLATE_CD"));
  23. template_names = template_names+"|"+(template_list.getRow(i).get("TEMPLATE_NAME"));
  24. }
  25. %>
  26. <script language="JavaScript">
  27. /*예약함수*/
  28. var sheet1;
  29. var sheet1Row;
  30. var sheet1PageNo = 1;
  31. var pageLastRowIndex = 1;
  32. var validationResult = false;
  33. var filterShow = false;
  34. function _onReady(){
  35. /**
  36. * IBSheet object initialize
  37. */
  38. gridInit(sheet1);
  39. /**
  40. * Application Initialize
  41. */
  42. $("#btnSearch").click(function() {
  43. jQuery("#fevent").val("SHEET_SELECT");
  44. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/ContTargetList_sheet.screen";
  45. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  46. });
  47. $("#p_dept_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which); if(keycode == 8){$("#p_dept_cd").val("");$("#p_dept_nm").val("");}});
  48. $("#p_cont_status").change(function(){$("#btnSearch").click();});
  49. $("#p_build_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == 13)$("#btnSearch").click();});
  50. $("#p_dealer_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == 13)$("#btnSearch").click();});
  51. $("#btnSearch").click();
  52. $("#dataClear").click(function(){$("#ContFromDt").val("");$("#ContToDt").val("");});
  53. jQuery("#btnExcel").click(function() {
  54. if(sheet1.RowCount() == 0) {
  55. alert("내역이 없습니다.");
  56. return;
  57. }
  58. var params = { FileName : "ContTargetList.xls", SheetName : "ContTargetList", SheetDesign:0, Merge:1, DownCols:"PUR_CONT_MOD_ID|DEPT_NAME|ORD_DOC_NO|MOD_NO|CST_DOC_NAME|ORD_CON_DATE|MEMBER_NAME|ORD_SUPPLY_AMT"+
  59. "|CURRENCY_GB|WORK_START_END_DATE|TEMPLATE_CD|STATUS_CD", TitleText:"구매_계약대상", UserMerge:"0,0,1,12", AutoSizeColumn:1 } ;
  60. sheet1.Down2Excel(params);
  61. });
  62. autoResize();
  63. }
  64. /**
  65. * IBSheet object initialize
  66. */
  67. function gridInit(sheetName){
  68. var init_sheet = {};
  69. init_sheet.Cfg = {SearchMode:2, Page:100};
  70. init_sheet.Cols = [
  71. {Header:'Del', Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center", Hidden:"True"},
  72. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  73. {Header:'계약번호', Type:"Text", SaveName:"PUR_CONT_MOD_ID", Width:0, Align:"Center", Hidden:"True"},
  74. {Header:'현장명', Type:"Text", SaveName:"DEPT_NAME", Width:200, Align:"Left" , Edit:"false"},
  75. {Header:'계약번호', Type:"Text", SaveName:"ORD_DOC_NO", Width:130, Align:"Left", Edit:"false"},
  76. {Header:'변경차수', Type:"Text", SaveName:"MOD_NO", Width:50, Align:"Center" , Edit:"false" <%=params.get("ChgCont").equals("N") ? ", Hidden:'True'":""%>},
  77. {Header:'계약명', Type:"Text", SaveName:"CST_DOC_NAME", Width:200, Align:"Left" , Edit:"false"},
  78. {Header:'계약일자', Type:"Text", SaveName:"ORD_CON_DATE", Width:60, Align:"Center" , Edit:"false"},
  79. {Header:'업체명', Type:"Text", SaveName:"MEMBER_NAME", Width:100, Align:"Left" , Edit:"false"},
  80. {Header:'계약금액', Type:"Text", SaveName:"ORD_SUPPLY_AMT", Width:80, Align:"right", Edit:"false"},
  81. {Header:'통화구분', Type:"Text", SaveName:"CURRENCY_GB", Width:50, Align:"Center" , Edit:"false"},
  82. {Header:'계약기간', Type:"Text", SaveName:"WORK_START_END_DATE", Width:120, Align:"Center", Edit:"false"},
  83. {Header:'상태', Type:"Combo", SaveName:"STATUS_CD", Width:80, Align:"center", Edit:"false", Hidden:"True", ComboText:"선택|계약대상|작성중", ComboCode:"|00|10"},
  84. {Header:'계약서종류', Type:"Combo", SaveName:"TEMPLATE_CD", Width:100, Align:"Left", ComboText:"<%=template_names%>", ComboCode:"<%=template_cds%>"},
  85. {Header:'☞계약서작성', Type:"Image", SaveName:"BTN", Width:55, Align:"Center", Edit:"false", Cursor:'pointer'},
  86. ];
  87. init_sheet.HeaderMode = {Sort:1};
  88. IBS_InitSheet(sheetName, init_sheet);
  89. sheetName.SetDataAutoTrim(0);
  90. sheetName.SetImageList(1,"/img/buyer/btn/btn_write.gif");
  91. sheetName.SetActionMenu("ExcelDown");
  92. setGridSize();
  93. }
  94. /*
  95. IBSheet Event : Mouse Right Menu
  96. */
  97. function sheet1_OnSelectMenu(Text, Code) {
  98. // text 또는 code값으로 Action수행
  99. switch(Text) {
  100. case "ExcelDown":
  101. jQuery("#btnExcel").click();
  102. break;
  103. }
  104. }
  105. /**
  106. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  107. */
  108. function sheet1_OnSearchEnd(code, message) {
  109. if(code == 0) {
  110. setGridSize();
  111. } else {
  112. //조회 에러 수행
  113. alert(message);
  114. }
  115. }
  116. /**
  117. * IBSheet Event: Click
  118. */
  119. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  120. if(Row == 0)return;
  121. if (sheet1.ColSaveName(Col) == "BTN") {
  122. var status = sheet1.GetCellValue(Row,8);
  123. if(sheet1.GetCellValue(Row, "TEMPLATE_CD")== "" ){
  124. alert("계약서 종류를 선택 해 주세요.");
  125. return;
  126. }
  127. $("#PUR_CONT_MOD_ID").val(sheet1.GetCellValue(Row, "PUR_CONT_MOD_ID"));
  128. $("#TEMPLATE_CD").val(sheet1.GetCellValue(Row, "TEMPLATE_CD"));
  129. $("#fevent").val("FORM_SELECT");
  130. $("#form1").attr("action", "/cont/purchase/ContWrite.screen");
  131. $("#form1").attr("target", "_self");
  132. $("#form1").attr("method", "get");
  133. $("#form1").submit();
  134. }
  135. }
  136. /**
  137. * IBSheet Event Change
  138. */
  139. function sheet1_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
  140. var comboValue = sheet1.GetCellValue(Row,"TEMPLATE_CD");
  141. if(comboValue != "" ){
  142. sheet1.SetCellImage(Row ,"BTN", "/img/buyer/btn/btn_write.gif");
  143. return;
  144. }
  145. }
  146. /**
  147. * IBSheet size setting
  148. */
  149. function setGridSize() {sheet1.FitColWidth();}
  150. //자동로그인 기능
  151. function f_gologin(login_id,login_pw){
  152. var f = document.form1;
  153. if('<%= user.get("ACCT_TYPE_CODE")%>' != "ADMIN"){
  154. dlgAlert("User who logged in as administrator only can do automatic log-in.");
  155. return;
  156. }
  157. f.login_id.value = login_id;
  158. f.login_pw.value = login_pw;
  159. if( !submitXmlRequest("/sign_on_check", "", document.form1) ) {
  160. alert("Log-in is being processed.");
  161. };
  162. }
  163. function sheet1_OnSmartResize(Width, Height) {
  164. sheet1.FitColWidth();
  165. autoResize();
  166. }
  167. function autoResize(){
  168. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  169. var iframeHeight= document.body.scrollHeight - t1_height;
  170. var iframeWidth= document.body.scrollWidth;
  171. sheet1.SetSheetHeight(iframeHeight);
  172. }
  173. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  174. </script>
  175. <modular:search id="form1">
  176. <modular:key id="fevent" />
  177. </modular:search>
  178. <form id="form1" name="form1" method="post" modular:type="search">
  179. <INPUT type="hidden" name="fevent" id="fevent" value="">
  180. <INPUT type="hidden" name="PUR_CONT_MOD_ID" value="">
  181. <INPUT type="hidden" name="TEMPLATE_CD" value="">
  182. <INPUT type='hidden' name="acct_id" value="<%= params.get("acct_id") %>">
  183. <INPUT type='hidden' name="ChgCont" value="<%= params.get("ChgCont") %>">
  184. <INPUT type='hidden' name="p_cont_status" value="02, 00"><!--2016.03.09 -->
  185. <div align="left" id="title">
  186. <ul>
  187. <li>구매_<%if(params.get("ChgCont").equals("Y")){%>변경<%} %>계약 대상</li>
  188. </ul>
  189. </div>
  190. <!-- 검색조건 시작 -->
  191. <table id="search-table" class="search-form-table">
  192. <colgroup>
  193. <col width="100" />
  194. <col width="*" />
  195. <col width="100" />
  196. <col width="*" />
  197. <col width="100" />
  198. </colgroup>
  199. <tr height="25">
  200. <th>현장</th>
  201. <td>
  202. <%=InputText.getSiteCodeNew("p_dept_cd", "p_dept_nm", "", user, params.get("p_dept_cd"), params.get("p_dept_nm"))%>
  203. </td>
  204. <th>계약명</th>
  205. <td>
  206. <INPUT type="text" name="p_build_nm" class="input" value="<%= params.get("p_build_nm") %>" style="width:90%">
  207. </td>
  208. <td class="button" rowspan="2">
  209. <span class="btnSearch center" id="btnSearch"><a href="javascript:void(0);">검색</a></span>
  210. <span class="btnSearch center" id="btnExcel"><a href="javascript:void(0);">엑셀</a></span>
  211. </td>
  212. </tr>
  213. <tr>
  214. <th>업체명</th>
  215. <td>
  216. <INPUT type="text" name="p_dealer_nm" class="input" value="<%= params.get("p_dealer_nm") %>" style="width:90%">
  217. </td>
  218. <th>계약기간</th>
  219. <td>
  220. <%= InputText.get("ContFromDt", params.get("ContFromDt"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  221. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('ContFromDt');">
  222. ~
  223. <%= InputText.get("ContToDt", params.get("ContToDt"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  224. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('ContToDt');">
  225. <IMG name="dataClear" id="dataClear" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
  226. </td>
  227. </tr>
  228. </table>
  229. </form>
  230. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 400px; overflow: auto;">
  231. <script>createIBSheet('sheet1','100%', '400px');</script>
  232. </div>