dlgBidHistoryDeptPop.jsp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <%--
  2. - FileName : dlgBidHistoryDeptPop.jsp
  3. - Author(s) : gyeongmo an
  4. - Date : 2014-06-30
  5. - Copyright : Copyright (c) 2014 www.udapsoft.co.kr, Inc.
  6. -
  7. - Description: 사용자 검색
  8. --%>
  9. <%@ page contentType="text/html; charset=utf-8" %>
  10. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  11. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  12. <%@ page import="kr.co.udapsoft.common.code.*" %>
  13. <%@ page import="kr.co.hsnc.common.util.*"%>
  14. <%@ page import="kr.co.hsnc.common.sql.*" %>
  15. <%@ page import="kr.co.hsnc.common.sql.RowSet" %>
  16. <%@ page import="kr.co.hsnc.common.util.ValueObject" %>
  17. <%@ page import="com.udapsoft.waf.system.*" %>
  18. <%@ page import="com.udapsoft.waf.common.*" %>
  19. <%@ page import="kr.co.udapsoft.common.*" %>
  20. <%@ page import="com.udapsoft.waf.common.ui.HTMLMaker" %>
  21. <%@ include file="/jsp/work/taglib.jsp" %>
  22. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  23. <%
  24. ctx.init(request, response);
  25. ValueObject user = null;
  26. user = ctx.getUser();
  27. ValueObject params = ctx.getParams();
  28. HandlerStorage storage = ctx.getHandlerStorage();
  29. request.setCharacterEncoding("utf-8");
  30. %>
  31. <SCRIPT language="JavaScript">
  32. /*예약함수*/
  33. var sheet1;
  34. var sheet1Row;
  35. var sheet1PageNo = 1;
  36. var pageLastRowIndex = 1;
  37. var validationResult = false;
  38. var filterShow = false;
  39. var argObj = window.dialogArguments;
  40. function _onReady(){
  41. gridInit(sheet1);
  42. jQuery("#btnSearch").click(function() {
  43. jQuery("#fevent").val("DEPTPOP");
  44. var url = Modular.model.PageContext.CONTEXT_ROOT + "dlgBidHistoryDeptPop_sheet.screen";
  45. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  46. });
  47. jQuery("#btnSave").click(function() {
  48. if (confirm("저장 하시겠습니까?")){
  49. var f = document.form1;
  50. $("#fevent").val("DEPT_SAVE");
  51. var url = Modular.model.PageContext.CONTEXT_ROOT + "dlgBidHistoryDeptPop_process.screen";
  52. var result = Modular.view.IBSheet7.doSave(sheet1, url, $("#form1"), false);
  53. }
  54. });
  55. jQuery("#btnClose").click(function() {
  56. setTimeout(function(){parent.SearchUserClose(null);},100);
  57. });
  58. jQuery("#btnSearch").click();
  59. }
  60. function sheet1_OnSaveEnd(code, msg)
  61. {
  62. var event = $("#fevent").val();
  63. if(event == "DEPT_SAVE"){
  64. alert("수정 하였습니다.");
  65. jQuery("#btnSearch").click();
  66. }
  67. }
  68. function gridInit(sheetName){
  69. var init_sheet = {};
  70. init_sheet.Cfg = {SearchMode:2, Page:30};
  71. init_sheet.Cols = [
  72. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:10, Align:"Center" },
  73. {Header:'SEQ', Type:"Text", SaveName:"DETAILCD", Width:10, Align:"Left" },
  74. {Header:'현장코드', Type:"Text", SaveName:"dept_cd", Width:30, Align:"Center" },
  75. {Header:'코드', Type:"Image", SaveName:"IMG_GB", Width:10, Align:"Center" , Edit:"false", Cursor:'pointer'},
  76. {Header:'삭제', Type:"Image", SaveName:"IMG_DEL", Width:10, Align:"Center" , Edit:"false", Cursor:'pointer'},
  77. {Header:'현장명', Type:"Text", SaveName:"dept_nm", Width:100, Align:"Left" },
  78. ];
  79. init_sheet.HeaderMode = {Sort:1};
  80. IBS_InitSheet(sheetName, init_sheet);
  81. sheetName.SetDataAutoTrim(0);
  82. sheetName.SetEditable(false);
  83. sheetName.SetImageList(1,"/img/buyer/button/bt_search_right.gif");
  84. sheetName.SetImageList(2,"/img/buyer/button/bt_eraser1.gif");
  85. setGridSize();
  86. }
  87. function autoResize(){
  88. var t1_height = document.getElementById("search-table").scrollHeight + 10;
  89. var iframeHeight= document.body.scrollHeight - t1_height;
  90. var iframeWidth = document.body.scrollWidth;
  91. sheet1.SetSheetHeight(iframeHeight);
  92. }
  93. function setGridSize() {
  94. sheet1.FitColWidth();
  95. }
  96. function sheet1_OnSearchEnd(code, message) {
  97. if(code == 0) {
  98. setGridSize();
  99. } else {
  100. alert("조회 실패");
  101. }
  102. }
  103. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  104. if(Row == 0)return;
  105. if( Col == 3){//추가
  106. searchAccDept();
  107. $("#TEMP_ROW").val(Row);
  108. }
  109. if( Col == 4){//삭제
  110. sheet1.SetCellValue(Row,"dept_cd",''); //부서코드
  111. sheet1.SetCellValue(Row,"dept_nm",''); //부서명
  112. }
  113. }
  114. function searchAccDept(p_dept_cd, p_dept_nm){
  115. var win_id = "_searchSite";
  116. var link = "/lib/dlgSearchSpotDept_Unitcd_New.screen";
  117. link += "?sheetOpenYn=Y&pop_win_id="+win_id;
  118. fLayerPop(win_id, link, 550,500, '', '', 'NO');
  119. }
  120. function searchSiteClose(result){
  121. if( result == null ){
  122. }else{
  123. sheet1.SetCellValue($("#TEMP_ROW").val(),"dept_cd",result[0]); //부서코드
  124. sheet1.SetCellValue($("#TEMP_ROW").val(),"dept_nm", result[1]); //부서명
  125. }
  126. fLayerPopClose('_searchSite');
  127. }
  128. function prcKeyPress()
  129. {
  130. if( event.keyCode == 13 )
  131. {
  132. jQuery("#btnSearch").click();
  133. }
  134. }
  135. //키처리
  136. document.onkeydown = function(){
  137. //F5 새로고침
  138. if(event.keyCode == "13"){
  139. jQuery("#btnSearch").click();
  140. }
  141. //ESC 창닫기
  142. if(event.keyCode == "27"){
  143. window.close();
  144. }
  145. }
  146. </SCRIPT>
  147. <modular:search id="form1">
  148. <modular:key id="fevent" />
  149. </modular:search>
  150. <BODY onresize="autoResize()" >
  151. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  152. <INPUT type="hidden" name="fevent" id="fevent" value="">
  153. <INPUT type='hidden' name="TEMP_ROW" value="">
  154. <!-- 검색조건 시작 -->
  155. <table id="search-table" class="search-form-table">
  156. <colgroup>
  157. <col width="100" />
  158. <col width="*" />
  159. <col width="200" />
  160. </colgroup>
  161. <tr>
  162. <th>현장명</th>
  163. <td>
  164. <%=InputText.get("dept_nm", "", 30, 20, "hangule, required")%>
  165. </td>
  166. <td class="button" rowspan="2">
  167. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  168. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSave">저장</a></span>
  169. </td>
  170. </tr>
  171. </table>
  172. <!-- 검색조건 종료 -->
  173. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
  174. <script>createIBSheet('sheet1','100%', '350px');</script>
  175. </div>
  176. </FORM>
  177. </body>