payItemCodePopup.jsp 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <%--
  2. - FileName : payItemCodePopup.jsp
  3. - Author(s) : Kim Myung HO
  4. - Date : 2014.08.14
  5. - Description: PAY ITEM 검색
  6. --%>
  7. <%@ page contentType="text/html; charset=utf-8" %>
  8. <%@ page import="kr.co.hsnc.common.sql.RowSet" %>
  9. <%@ page import="kr.co.hsnc.common.util.ValueObject" %>
  10. <%@ page import="com.udapsoft.waf.system.*" %>
  11. <%@ page import="com.udapsoft.waf.common.*" %>
  12. <%@ page import="kr.co.udapsoft.common.*" %>
  13. <%@ page import="com.udapsoft.waf.common.ui.HTMLMaker" %>
  14. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  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 user = ctx.getUser();
  21. ValueObject params = storage.getParams();
  22. String event = storage.getEvent();
  23. %>
  24. <SCRIPT language="JavaScript">
  25. var sheet1;
  26. var sheet1Row;
  27. var sheet1PageNo = 1;
  28. var pageLastRowIndex = 1;
  29. var validationResult = false;
  30. var filterShow = false;
  31. // 마지막으로 선택된 행의 번호를 기억하고 있음
  32. var CurMasterRow = 0;
  33. function _onReady(){
  34. gridInit(sheet1);
  35. autoResize();
  36. jQuery("#btnSearch").click(function() {
  37. jQuery("#fevent").val("SHEET_SELECT");
  38. jQuery("#p_condition").val(jQuery(':radio[name="condition"]:checked').val());
  39. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/outside/payItemCodePopup_sheet.screen";
  40. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  41. //마지막으로 선택된 행이 없음
  42. CurMasterRow= 0;
  43. });
  44. jQuery("#btnClose").click(function() {
  45. setTimeout(function(){parent.SearchPayItemClose(null);},100);
  46. });
  47. jQuery("#btnSearch").click();
  48. }
  49. function gridInit(sheetName){
  50. var init_sheet = {};
  51. init_sheet.Cfg = {SearchMode:2, Page:30};
  52. init_sheet.Cols = [
  53. {Header:'GROUP', Type:"Text", SaveName:"GR_ESTDESC", Width:100, Align:"Left", Edit:"false"},
  54. {Header:'PAY ITEM', Type:"Text", SaveName:"PCODE", Width:150, Align:"Left", Edit:"false"},
  55. {Header:'PAYITEM', Type:"Text", SaveName:"PAYITEM", Width:100, Align:"center", Edit:"false", Hidden:"True"},
  56. {Header:'COSTCODE', Type:"Text", SaveName:"COSTCODE", Width:150, Align:"center", Edit:"false", Hidden:"True"},
  57. {Header:'COSTTYPE', Type:"Text", SaveName:"COSTTYPE", Width:100, Align:"center", Edit:"false", Hidden:"True"},
  58. {Header:'PAY ITEM DESC', Type:"Text", SaveName:"ESTDESC", Width:150, Align:"Left", Edit:"false"},
  59. {Header:'ESTAMT', Type:"Text", SaveName:"ESTAMT", Width:150, Align:"Left", Edit:"false", Hidden:"True"},
  60. ];
  61. init_sheet.HeaderMode = {Sort:1};
  62. IBS_InitSheet(sheetName, init_sheet);
  63. sheetName.SetDataAutoTrim(0);
  64. setGridSize();
  65. }
  66. function setGridSize() {
  67. sheet1.FitColWidth();
  68. }
  69. function sheet1_OnSearchEnd(code, message) {
  70. if(code == 0) {
  71. setGridSize();
  72. } else {
  73. //조회 에러 수행
  74. alert(message);
  75. }
  76. }
  77. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  78. returnValue = new Array(sheet1.GetCellValue(Row, 2),sheet1.GetCellValue(Row, 3),sheet1.GetCellValue(Row, 4),sheet1.GetCellValue(Row, 5),sheet1.GetCellValue(Row, 6));
  79. setTimeout(function(){parent.SearchPayItemClose(returnValue);},100);
  80. }
  81. function sheet1_OnSmartResize(Width, Height) {
  82. sheet1.FitColWidth();
  83. autoResize();
  84. }
  85. /**
  86. * enter click 시 자동으로 검색이되도록 조
  87. */
  88. function check_Enter(){
  89. if (event.keyCode==13)
  90. jQuery("#btnSearch").click();
  91. }
  92. function autoResize(){
  93. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title_pop").scrollHeight + 20;
  94. var iframeHeight= document.body.scrollHeight - t1_height;
  95. var iframeWidth= document.body.scrollWidth;
  96. sheet1.SetSheetHeight(iframeHeight);
  97. }
  98. document.onkeydown = closePopupWindow;
  99. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  100. </SCRIPT>
  101. <modular:search id="form1">
  102. <modular:key id="fevent" />
  103. </modular:search>
  104. <!-- <BODY onresize="autoResize()" > -->
  105. <FORM id="form1" name="form1" method="post" modular:type="search">
  106. <INPUT type="hidden" name="fevent" id="fevent" value="">
  107. <INPUT type="hidden" name="req" value="<%=params.get("req")%>" />
  108. <INPUT type="hidden" name="site" value="<%=params.get("site")%>" />
  109. <INPUT type="hidden" name="p_condition" value="0" />
  110. <!-- 검색조건 시작 -->
  111. <table id="search-table" class="search-form-table">
  112. <colgroup>
  113. <col width="100" />
  114. <col width="*" />
  115. <col width="100" />
  116. </colgroup>
  117. <tr>
  118. <th>검색어</th>
  119. <td>
  120. <input type="text" id="estdesc" name="estdesc" size="10" maxsize="10" style="width:96%;" class="input" onKeyDown="check_Enter();" />
  121. </td>
  122. <td class="button" rowspan="2">
  123. <span class="btnSearch center" id="btnSearch"><a href="javascript:void(0);">검색</a></span>
  124. <span class="btnSearch center" id="btnClose"><a href="javascript:void(0);">닫기</a></span>
  125. </td>
  126. </tr>
  127. <tr>
  128. <th>구분</th>
  129. <td>
  130. <SELECT name="costtype" size="1" style="width:100px;">
  131. <%
  132. if(params.get("gb").equals("SUB")){
  133. %>
  134. <OPTION value='S'>외주</OPTION>
  135. <OPTION value='O'>경비</OPTION>
  136. <%}else if(params.get("gb").equals("PUR")){ %>
  137. <OPTION value='M' selected >자재</OPTION>
  138. <OPTION value='E'>장비</OPTION>
  139. <%}else if(params.get("gb").equals("LAB")){ %>
  140. <OPTION value='O'>경비</OPTION>
  141. <OPTION value='L'>노무</OPTION>
  142. <%
  143. }
  144. %>
  145. </SELECT>
  146. <LABEL for="cond_1"><INPUT id="cond_1" type="radio" name="condition" value="0" checked >PAY ITEM DESC</LABEL>
  147. <LABEL for="cond_2"><INPUT id="cond_2" type="radio" name="condition" value="1" >PAY ITEM</LABEL>
  148. </td>
  149. </tr>
  150. </table>
  151. <!-- 검색조건 종료 -->
  152. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 330px; overflow: auto;">
  153. <script>createIBSheet('sheet1','100%', '330px');</script>
  154. </div>
  155. </form>
  156. <!-- </BODY> -->