dlgSearchSpotDept_Unitcd.jsp 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <%--
  2. - FileName : dlgSearchSpotDept_Unitcd.jsp
  3. - Author(s) : gyeongmo an
  4. -
  5. - Description: 부서 검색
  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. request.setCharacterEncoding("utf-8");
  24. // 콤보박스 : 발전사업본부 추가로 인한 라디오버튼에서 콤보박스로 변경 By hanwool 2012-07-25
  25. RowSet DivisionRowSet = storage.getRowSet("DivisionRowSet");//사업부 리스트
  26. // sheet 에서 띄웠는지 체크
  27. String sheetOpenYn = "N";
  28. if(params.get("sheetOpenYn").equals("Y")) {
  29. sheetOpenYn = "Y";
  30. }
  31. String returnRow = "";
  32. String returnCol1 = "";
  33. String returnCol2 = "";
  34. if(!params.get("returnRow").equals("")) {
  35. returnRow = params.get("returnRow");
  36. }
  37. if(!params.get("returnCol1").equals("")) {
  38. returnCol1 = params.get("returnCol1");
  39. }
  40. if(!params.get("returnCol2").equals("")) {
  41. returnCol2 = params.get("returnCol2");
  42. }
  43. %>
  44. <SCRIPT language="JavaScript">
  45. /*예약함수*/
  46. var sheet1;
  47. var sheet1Row;
  48. var sheet1PageNo = 1;
  49. var pageLastRowIndex = 1;
  50. var validationResult = false;
  51. var filterShow = false;
  52. function _onReady(){
  53. gridInit(sheet1);
  54. //검색어 기능 수정 -2011.01.31 한지훈(검색어가 있는 경우 자동검색 없는 경우 자동검색 하지 않음.)
  55. deptDisplayControl();
  56. document.form01.dept_nm.value = "";
  57. jQuery("#btnSearch").click(function() {
  58. var deadflg_value = $(':radio[name="deadflg"]:checked').val();
  59. document.form01.deadflg_value.value = deadflg_value;
  60. jQuery("#fevent").val("SpotDept");
  61. var url = Modular.model.PageContext.CONTEXT_ROOT + "/lib/dlgSearchSpotDept_Unitcd_search_sheet.screen";
  62. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form01"), 30, "");
  63. });
  64. jQuery("#btnClose").click(function() {
  65. setTimeout(function(){
  66. if('<%=sheetOpenYn%>' == "Y") {
  67. parent.searchSiteClose(null,'<%=returnRow%>', '<%=returnCol1%>', '<%=returnCol2%>');
  68. } else {
  69. dlgSearchSpotDeptEnd(null,'<%=params.get("obj_dept_cd")%>', '<%=params.get("obj_dept_nm")%>');
  70. }
  71. },100);
  72. });
  73. jQuery("#btnSearch").click();
  74. }
  75. function gridInit(sheetName){
  76. var init_sheet = {};
  77. init_sheet.Cfg = {SearchMode:2, Page:30};
  78. init_sheet.Cols = [
  79. {Header:'현장코드', Type:"Text", SaveName:"DEPT_CD", Width:70, Align:"Center", Edit:"false"},
  80. {Header:'현장명', Type:"Text", SaveName:"DEPT_NM", Width:250, Align:"Left", Edit:"false"},
  81. {Header:'사업부코드', Type:"Text", SaveName:"AC_UNIT_CD", Width:0, Align:"Left", Hidden:"True"},
  82. {Header:'사업부', Type:"Text", SaveName:"AC_UNIT_NM", Width:65, Align:"Left", Edit:"false"},
  83. {Header:'기준통화', Type:"Text", SaveName:"STD_CURRENCY_CD", Width:50, Align:"Center", Edit:"false", Hidden:"True" },
  84. {Header:'기준소수점', Type:"Text", SaveName:"STD_DIGIT", Width:67, Align:"Center", Edit:"false", Hidden:"True" },
  85. ];
  86. init_sheet.HeaderMode = {Sort:1};
  87. IBS_InitSheet(sheetName, init_sheet);
  88. sheetName.SetDataAutoTrim(0);
  89. setGridSize();
  90. }
  91. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  92. returnValue = new Array(sheet1.GetCellValue(Row, 0),sheet1.GetCellValue(Row, 1));
  93. //window.close();
  94. //parent.searchSiteClose(returnValue);
  95. var retArray = new Array();
  96. retArray[0] = sheet1.GetCellValue(Row, 0);
  97. retArray[1] = sheet1.GetCellValue(Row, 1);
  98. document.form01.rtnVal0.value = sheet1.GetCellValue(Row, 0);
  99. document.form01.rtnVal1.value = sheet1.GetCellValue(Row, 1);
  100. doSelect_dept_change(retArray[0], retArray[1]);
  101. }
  102. function sheet1_OnSearchEnd(code, message) {
  103. setGridSize();
  104. }
  105. function setGridSize() {
  106. sheet1.FitColWidth();
  107. }
  108. function deptDisplayControl() {
  109. var radioObj = document.getElementsByName("ac_unit_cd");
  110. var accType = "<%=user.get("ACCT_TYPE_CODE")%>";
  111. if( accType != "ADMIN" && accType != "EXECUTIVE" ){
  112. for( i = 0; i <radioObj.length; i++ ){
  113. if( accType.substring(0,2) == radioObj[i].value ){
  114. radioObj[i].checked = true;
  115. }else {
  116. radioObj[i].disabled = true;
  117. }
  118. }
  119. }
  120. }
  121. function prcKeyPress()
  122. {
  123. if( event.keyCode == 13 )
  124. {
  125. jQuery("#btnSearch").click();
  126. }
  127. }
  128. //키처리
  129. document.onkeydown = function(){
  130. //F5 새로고침
  131. if(event.keyCode == "116"){
  132. jQuery("#btnSearch").click();
  133. }
  134. //ESC 창닫기
  135. if(event.keyCode == "27"){
  136. window.close();
  137. }
  138. }
  139. function sheet1_OnSmartResize(Width, Height) {
  140. sheet1.FitColWidth();
  141. autoResize();
  142. }
  143. function autoResize(){
  144. var t1_height = document.getElementById("search-table").scrollHeight + 24;
  145. var iframeHeight= document.body.scrollHeight - t1_height;
  146. var iframeWidth= document.body.scrollWidth;
  147. sheet1.SetSheetHeight(iframeHeight);
  148. }
  149. //현장 변경
  150. function doSelect_dept_change(dept_cd, dept_nm)
  151. {
  152. var f = document.form01;
  153. f.site_code.value = dept_cd ;
  154. f.dept_nm.value = dept_nm ;
  155. f.action = "/lib/dlgSearchSpotDept_Change.screen";
  156. f.target = "worker_set";
  157. formSubmit(f);
  158. }
  159. function doSelect()
  160. {
  161. var retArray = new Array();
  162. retArray[0] = document.form01.rtnVal0.value; // 부서코드
  163. retArray[1] = document.form01.rtnVal1.value; // 부서명
  164. //window.returnValue = retArray;
  165. //self.close();
  166. if('<%=sheetOpenYn%>' == "Y") {
  167. parent.searchSiteClose(retArray,'<%=returnRow%>', '<%=returnCol1%>', '<%=returnCol2%>');
  168. } else {
  169. dlgSearchSpotDeptEnd(retArray,'<%=params.get("obj_dept_cd")%>', '<%=params.get("obj_dept_nm")%>');
  170. }
  171. }
  172. </SCRIPT>
  173. <SCRIPT language="JavaScript" src="/js/common.js"></SCRIPT>
  174. <modular:search id="form01">
  175. <modular:key id="fevent" />
  176. </modular:search>
  177. <BODY onresize="autoResize()" >
  178. <FORM id="form01" name="form01" method="post" modular:type="search">
  179. <INPUT type="hidden" name="fevent" id="fevent" value="">
  180. <INPUT type="hidden" name="site_code" >
  181. <INPUT type="hidden" name="site_ac_unit_cd" >
  182. <INPUT type="hidden" name="site_ac_unit_nm" >
  183. <INPUT type="hidden" name="site_std_currency_cd" > <!-- 현장의 기준통화(2010.08.30 최기완) -->
  184. <INPUT type="hidden" name="site_local_currency_cd" > <!-- 현장의 현지통화(2010.09.08 최기완) -->
  185. <INPUT type="hidden" name="site_std_currency_digit" > <!-- 현장의 기준통화소수점(2010.09.08 최기완) -->
  186. <INPUT type="hidden" name="site_local_currency_digit" ><!-- 현장의 현지통화소수점(2010.09.08 최기완) -->
  187. <INPUT type="hidden" name="site_krw_currency_digit" > <!-- 현장의 원화통화소수점(2010.09.08 최기완) -->
  188. <INPUT type="hidden" name="IN_DEPT_CD" >
  189. <INPUT type="hidden" name="nation" value="<%=ctx.get("nation") %>" >
  190. <INPUT type="hidden" name="ntype" value="<%=ctx.get("ntype") %>" >
  191. <%-- <INPUT type="hidden" name="prp_key" value="<%=params.get("prp_key") %>" > --%>
  192. <INPUT type="hidden" name="prp_key" value="Y" >
  193. <INPUT type="hidden" name="rtnVal0" value="" >
  194. <INPUT type="hidden" name="rtnVal1" value="" >
  195. <INPUT type="hidden" name="rtnVal2" value="" >
  196. <INPUT type="hidden" name="rtnVal3" value="" >
  197. <INPUT type="hidden" name="rtnVal4" value="" >
  198. <INPUT type="hidden" name="rtnVal5" value="" >
  199. <INPUT type="hidden" name="rtnVal6" value="" >
  200. <INPUT type="hidden" name="rtnVal7" value="" >
  201. <INPUT type="hidden" name="deadflg_value" value="" >
  202. <INPUT type="text" value="auto summit for disable" size="0" style="display:none;">
  203. <!-- 검색조건 시작 -->
  204. <table id="search-table" class="search-form-table">
  205. <colgroup>
  206. <col width="100" />
  207. <col width="*" />
  208. <col width="150" />
  209. </colgroup>
  210. <tr>
  211. <th>현장명</th>
  212. <td>
  213. <INPUT class="input" type="text" name="dept_nm" size="48" maxlength="50" value="" onKeyPress="prcKeyPress()" style="IME-MODE : active;">
  214. </td>
  215. <td class="button" rowspan="3">
  216. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  217. <span class="btnSearch center"><a href="javascript:void(0);" id="btnClose">닫기</a></span>
  218. </td>
  219. </tr>
  220. <tr>
  221. <th>사업부</th>
  222. <td>
  223. <%= HTMLMaker.getSelectTag( DivisionRowSet, "DETAILCD", "DETAILNM", "ac_unit_cd", "width:190px;height=18px;","","",10,"","onChange=jQuery(\'#btnSearch\').click();" ) %>&nbsp;
  224. </td>
  225. </tr>
  226. <tr>
  227. <th>진행구분</th>
  228. <td>
  229. <LABEL for="deadflg_0"><INPUT id="deadflg_0" type="radio" name="deadflg" value="" onClick="jQuery('#btnSearch').click();">전체</LABEL>
  230. <LABEL for="deadflg_1"><INPUT id="deadflg_1" type="radio" name="deadflg" value="0" onClick="jQuery('#btnSearch').click();" checked>진행</LABEL>
  231. <LABEL for="deadflg_2"><INPUT id="deadflg_2" type="radio" name="deadflg" value="1" onClick="jQuery('#btnSearch').click();">완료</LABEL>
  232. </td>
  233. </tr>
  234. </table>
  235. <!-- 검색조건 종료 -->
  236. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 380px; overflow: auto;">
  237. <script>createIBSheet('sheet1','100%', '380px');</script>
  238. </div>
  239. <IFRAME width="0" height="0" name='worker_set'></IFRAME>
  240. </FORM>
  241. </BODY>