dlgSearchSpotDept_Unitcd_New.jsp 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <%--
  2. - FileName : dlgSearchSpotDept_Unitcd_New.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_New_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. if( '<%=user.get("RIGHT_NAME")%>' != 'SITE_CONT' ){
  70. dlgSearchSpotDeptNewEnd(null,'<%=params.get("obj_dept_cd")%>', '<%=params.get("obj_dept_nm")%>');
  71. }else {
  72. parent.fLayerPopClose('_searchSiteNew');
  73. }
  74. }
  75. },100);
  76. });
  77. //jQuery("#btnSearch").click();
  78. }
  79. function gridInit(sheetName){
  80. var init_sheet = {};
  81. init_sheet.Cfg = {SearchMode:2, Page:30};
  82. init_sheet.Cols = [
  83. {Header:'현장코드', Type:"Text", SaveName:"DEPT_CD", Width:70, Align:"Center", Edit:"false"},
  84. {Header:'현장명', Type:"Text", SaveName:"DEPT_NM", Width:250, Align:"Left", Edit:"false"},
  85. {Header:'사업부코드', Type:"Text", SaveName:"AC_UNIT_CD", Width:0, Align:"Left", Hidden:"True"},
  86. {Header:'사업부', Type:"Text", SaveName:"AC_UNIT_NM", Width:65, Align:"Left", Edit:"false"},
  87. {Header:'기준통화', Type:"Text", SaveName:"STD_CURRENCY_CD", Width:50, Align:"Center", Edit:"false", Hidden:"True" },
  88. {Header:'기준소수점', Type:"Text", SaveName:"STD_DIGIT", Width:67, Align:"Center", Edit:"false", Hidden:"True" },
  89. {Header:'MAPPING_SEQ', Type:"Text", SaveName:"MAPPING_SEQ", Width:67, Align:"Center", Edit:"false", Hidden:"True"}
  90. ];
  91. init_sheet.HeaderMode = {Sort:1};
  92. IBS_InitSheet(sheetName, init_sheet);
  93. sheetName.SetDataAutoTrim(0);
  94. setGridSize();
  95. }
  96. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  97. returnValue = new Array(sheet1.GetCellValue(Row, 0),sheet1.GetCellValue(Row, 1));
  98. //window.close();
  99. //parent.searchSiteClose(returnValue);
  100. var retArray = new Array();
  101. retArray[0] = sheet1.GetCellValue(Row, 0);
  102. retArray[1] = sheet1.GetCellValue(Row, 1);
  103. document.form01.rtnVal0.value = sheet1.GetCellValue(Row, 0);
  104. document.form01.rtnVal1.value = sheet1.GetCellValue(Row, 1);
  105. doSelect_dept_change(retArray[0], retArray[1]);
  106. }
  107. function sheet1_OnSearchEnd(code, message) {
  108. setGridSize();
  109. }
  110. function setGridSize() {
  111. sheet1.FitColWidth();
  112. }
  113. function deptDisplayControl() {
  114. var radioObj = document.getElementsByName("ac_unit_cd");
  115. var accType = "<%=user.get("ACCT_TYPE_CODE")%>";
  116. if( accType != "ADMIN" && accType != "EXECUTIVE" ){
  117. for( i = 0; i <radioObj.length; i++ ){
  118. if( accType.substring(0,2) == radioObj[i].value ){
  119. radioObj[i].checked = true;
  120. }else {
  121. radioObj[i].disabled = true;
  122. }
  123. }
  124. }
  125. }
  126. function prcKeyPress()
  127. {
  128. if( event.keyCode == 13 )
  129. {
  130. jQuery("#btnSearch").click();
  131. }
  132. }
  133. //키처리
  134. document.onkeydown = function(){
  135. //F5 새로고침
  136. if(event.keyCode == "116"){
  137. jQuery("#btnSearch").click();
  138. }
  139. //ESC 창닫기
  140. if(event.keyCode == "27"){
  141. window.close();
  142. }
  143. }
  144. function sheet1_OnSmartResize(Width, Height) {
  145. sheet1.FitColWidth();
  146. autoResize();
  147. }
  148. function autoResize(){
  149. var t1_height = document.getElementById("search-table").scrollHeight + 24;
  150. var iframeHeight= document.body.scrollHeight - t1_height;
  151. var iframeWidth= document.body.scrollWidth;
  152. sheet1.SetSheetHeight(iframeHeight);
  153. }
  154. //현장 변경
  155. function doSelect_dept_change(dept_cd, dept_nm)
  156. {
  157. var f = document.form01;
  158. f.site_code.value = dept_cd ;
  159. f.dept_nm.value = dept_nm ;
  160. f.fevent.value = '';
  161. f.action = "/lib/dlgSearchSpotDept_Change.screen";
  162. f.target = "worker_set";
  163. formSubmit(f);
  164. }
  165. function doSelect()
  166. {
  167. var retArray = new Array();
  168. retArray[0] = document.form01.rtnVal0.value; // 부서코드
  169. retArray[1] = document.form01.rtnVal1.value; // 부서명
  170. retArray[2] = document.form01.rtnVal6.value; // 부서명
  171. //window.returnValue = retArray;
  172. //self.close();
  173. if('<%=sheetOpenYn%>' == "Y") {
  174. parent.searchSiteClose(retArray,'<%=returnRow%>', '<%=returnCol1%>', '<%=returnCol2%>');
  175. } else {
  176. dlgSearchSpotDeptNewEnd(retArray,'<%=params.get("obj_dept_cd")%>', '<%=params.get("obj_dept_nm")%>');
  177. }
  178. }
  179. </SCRIPT>
  180. <SCRIPT language="JavaScript" src="/js/common.js"></SCRIPT>
  181. <modular:search id="form01">
  182. <modular:key id="fevent" />
  183. </modular:search>
  184. <BODY onresize="autoResize()" >
  185. <FORM id="form01" name="form01" method="post" modular:type="search">
  186. <INPUT type="hidden" name="fevent" id="fevent" value="">
  187. <INPUT type="hidden" name="site_code" >
  188. <INPUT type="hidden" name="site_ac_unit_cd" >
  189. <INPUT type="hidden" name="site_ac_unit_nm" >
  190. <INPUT type="hidden" name="site_std_currency_cd" > <!-- 현장의 기준통화(2010.08.30 최기완) -->
  191. <INPUT type="hidden" name="site_local_currency_cd" > <!-- 현장의 현지통화(2010.09.08 최기완) -->
  192. <INPUT type="hidden" name="site_std_currency_digit" > <!-- 현장의 기준통화소수점(2010.09.08 최기완) -->
  193. <INPUT type="hidden" name="site_local_currency_digit" ><!-- 현장의 현지통화소수점(2010.09.08 최기완) -->
  194. <INPUT type="hidden" name="site_krw_currency_digit" > <!-- 현장의 원화통화소수점(2010.09.08 최기완) -->
  195. <INPUT type="hidden" name="IN_DEPT_CD" >
  196. <INPUT type="hidden" name="nation" value="<%=ctx.get("nation") %>" >
  197. <INPUT type="hidden" name="ntype" value="<%=ctx.get("ntype") %>" >
  198. <%-- <INPUT type="hidden" name="prp_key" value="<%=params.get("prp_key") %>" > --%>
  199. <INPUT type="hidden" name="prp_key" value="Y" >
  200. <INPUT type="hidden" name="rtnVal0" value="" >
  201. <INPUT type="hidden" name="rtnVal1" value="" >
  202. <INPUT type="hidden" name="rtnVal2" value="" >
  203. <INPUT type="hidden" name="rtnVal3" value="" >
  204. <INPUT type="hidden" name="rtnVal4" value="" >
  205. <INPUT type="hidden" name="rtnVal5" value="" >
  206. <INPUT type="hidden" name="rtnVal6" value="" >
  207. <INPUT type="hidden" name="rtnVal7" value="" >
  208. <INPUT type="hidden" name="deadflg_value" value="" >
  209. <INPUT type="text" value="auto summit for disable" size="0" style="display:none;">
  210. <!-- 검색조건 시작 -->
  211. <table id="search-table" class="search-form-table">
  212. <colgroup>
  213. <col width="100" />
  214. <col width="*" />
  215. <col width="150" />
  216. </colgroup>
  217. <tr>
  218. <th>현장명</th>
  219. <td>
  220. <INPUT class="input" type="text" name="dept_nm" size="48" maxlength="50" value="" onKeyPress="prcKeyPress()" style="IME-MODE : active;">
  221. </td>
  222. <td class="button" rowspan="3">
  223. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  224. <span class="btnSearch center"><a href="javascript:void(0);" id="btnClose">닫기</a></span>
  225. </td>
  226. </tr>
  227. <tr>
  228. <th>사업부</th>
  229. <td>
  230. <%= HTMLMaker.getSelectTag( DivisionRowSet, "DETAILCD", "DETAILNM", "ac_unit_cd", "width:190px;height=18px;","","",10,"","onChange=jQuery(\'#btnSearch\').click();" ) %>&nbsp;
  231. </td>
  232. </tr>
  233. <tr>
  234. <th>진행구분</th>
  235. <td>
  236. <LABEL for="deadflg_0"><INPUT id="deadflg_0" type="radio" name="deadflg" value="" onClick="jQuery('#btnSearch').click();">전체</LABEL>
  237. <LABEL for="deadflg_1"><INPUT id="deadflg_1" type="radio" name="deadflg" value="0" onClick="jQuery('#btnSearch').click();" checked>진행</LABEL>
  238. <LABEL for="deadflg_2"><INPUT id="deadflg_2" type="radio" name="deadflg" value="1" onClick="jQuery('#btnSearch').click();">완료</LABEL>
  239. </td>
  240. </tr>
  241. </table>
  242. <!-- 검색조건 종료 -->
  243. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 320px; overflow: auto;">
  244. <script>createIBSheet('sheet1','100%', '320px');</script>
  245. </div>
  246. <IFRAME width="0" height="0" name='worker_set' style="display: none;"></IFRAME>
  247. </FORM>
  248. </BODY>