UserList.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <%--
  2. - kName : UserList.jsp
  3. - Author(s) : gyeongmo an
  4. - Date : 2014.06.18
  5. - Copyright : Copyright (c) 2014 www.udapsoft.co.kr, Inc.
  6. - Description: 사용자 관리
  7. --%>
  8. <%@ page contentType="text/html; charset=utf-8" %>
  9. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  10. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  11. <%@ page import="kr.co.udapsoft.common.code.*" %>
  12. <%@ page import="kr.co.hsnc.common.util.*"%>
  13. <%@ page import="kr.co.hsnc.common.sql.*" %>
  14. <%@ include file="/jsp/work/taglib.jsp" %>
  15. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  16. <%
  17. ctx.init(request, response);
  18. HandlerStorage storage = ctx.getHandlerStorage();
  19. ValueObject params = storage.getParams();
  20. ValueObject user = storage.getUser();
  21. String event = storage.getEvent();
  22. RowSet rowSet = storage.getRowSet("ROWSET");
  23. RowSet acctTypeRowSet = storage.getRowSet("AcctTypeRowSet"); //계정 타입
  24. %>
  25. <SCRIPT language="JavaScript">
  26. /*예약함수*/
  27. var sheet1;
  28. var sheet1Row;
  29. var sheet1PageNo = 1;
  30. var pageLastRowIndex = 1;
  31. var validationResult = false;
  32. var filterShow = false;
  33. function _onReady(){
  34. gridInit(sheet1);
  35. jQuery("#btnSearch").click(function() {
  36. jQuery("#fevent").val("GET_USER_LIST");
  37. var url = Modular.model.PageContext.CONTEXT_ROOT + "/sycs/user/UserList_data.screen";
  38. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 10, "");
  39. });
  40. jQuery("#btnClear").click(function() {
  41. jQuery("#dept_cd2").val("");
  42. jQuery("#dept_nm2").val("");
  43. jQuery("#p_dept_cd").val("");
  44. jQuery("#p_dept_nm").val("");
  45. jQuery("#p_acct_type_id").val("");
  46. jQuery("#user_sabun").val("");
  47. jQuery("#user_name").val("");
  48. });
  49. jQuery("#btnAdd").click(function() {
  50. jQuery("#fevent").val("UserForm_Reg");
  51. jQuery("#form1").attr("action", "/sycs/user/UserForm.screen");
  52. jQuery("#form1").attr("target", "_self");
  53. jQuery("#form1").attr("method", "post");
  54. jQuery("#form1").submit();
  55. });
  56. jQuery("#btnSync").click(function() {
  57. if(confirm("EHR데이타를 동기화 하시겠습니까?")){
  58. submitXmlRequest("/sycs/user/UserList_form.screen", "GET_EHR_DATA", document.form1);
  59. }
  60. });
  61. jQuery("#btnExcel").click(function() {
  62. if(sheet1.RowCount() == 0) {
  63. alert("내역이 없습니다.");
  64. return;
  65. }
  66. var params = { FileName : "UserList.xls", SheetName : "UserList", SheetDesign:0, Merge:1, DownCols:"no|user_sabun|user_name|buseo_nm|assigned_dept|position_name"+
  67. "|right_name|tel_no|hand_tel_no|e_mail|cre_date", TitleText:"사용자 관리", UserMerge:"0,0,1,10", AutoSizeColumn:1 } ;
  68. sheet1.Down2Excel(params);
  69. });
  70. sheet1.SetActionMenu("ExcelDown");
  71. autoResize();
  72. }
  73. function gridInit(sheetName){
  74. var init_sheet = {};
  75. init_sheet.Cfg = {SearchMode:2, Page:10};
  76. init_sheet.Cols = [
  77. {Header:'삭제', Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center", Hidden:"True"},
  78. {Header:'상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  79. {Header:'번호', Type:"Seq", SaveName:"NO", Width:80, Align:"Center"},
  80. {Header:'☞사원번호', Type:"Text", SaveName:"user_sabun", Width:100, Align:"Center", Cursor:"Pointer"},
  81. {Header:'비밀번호', Type:"Text", SaveName:"user_pw", Width:0, Align:"Center", Hidden:"True"},
  82. {Header:'☞ 이름', Type:"Text", SaveName:"user_name", Width:120, Align:"Center", Cursor:"Pointer"},
  83. {Header:'부서', Type:"Text", SaveName:"buseo_nm", Width:120, Align:"Left"},
  84. {Header:'투입프로젝트', Type:"Text", SaveName:"assigned_dept", Width:150, Align:"Left"},
  85. {Header:'직위', Type:"Text", SaveName:"position_name", Width:100, Align:"Center"},
  86. {Header:'권한', Type:"Text", SaveName:"right_name", Width:120, Align:"Center"},
  87. {Header:'계정타입', Type:"Text", SaveName:"acct_type_name", Width:60, Align:"Center"},
  88. {Header:'전화번호', Type:"Text", SaveName:"tel_no", Width:100, Align:"Center"},
  89. {Header:'휴대폰번호', Type:"Text", SaveName:"hand_tel_no", Width:100, Align:"Center"},
  90. {Header:'E-mail', Type:"Text", SaveName:"e_mail", Width:120, Align:"Left"},
  91. {Header:'등록일자', Type:"Text", SaveName:"cre_date", Width:100, Align:"Center"},
  92. {Header:'계정ID', Type:"Text", SaveName:"acct_id", Width:0, Align:"Left", Hidden:"True"}
  93. ];
  94. init_sheet.HeaderMode = {Sort:1};
  95. IBS_InitSheet(sheetName, init_sheet);
  96. sheetName.SetDataAutoTrim(0);
  97. sheetName.SetEditable(false);
  98. setGridSize();
  99. }
  100. function sheet1_OnSearchEnd(code, message) {
  101. if(code == 0) {
  102. setGridSize();
  103. sheet1.SetColFontColor("user_sabun", "#0000ff");
  104. sheet1.SetColFontColor("user_name", "#0000ff");
  105. } else {
  106. alert(message);
  107. }
  108. }
  109. function setGridSize() {
  110. sheet1.FitColWidth();
  111. }
  112. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  113. if (sheet1.ColSaveName(Col) == "user_name") {
  114. jQuery("#acct_id").val(sheet1.GetCellValue(Row, "acct_id"));
  115. jQuery("#fevent").val("GET_USERFORM_LIST");
  116. jQuery("#form1").attr("action", "/sycs/user/UserForm.screen");
  117. jQuery("#form1").attr("target", "_self");
  118. jQuery("#form1").attr("method", "post");
  119. jQuery("#form1").submit();
  120. }
  121. else if(sheet1.ColSaveName(Col) =="user_sabun"){
  122. var user_sabun = sheet1.GetCellValue(Row, "user_sabun");
  123. var user_pw = sheet1.GetCellValue(Row, "user_pw");
  124. f_gologin(user_sabun, user_pw );
  125. }
  126. else{
  127. return;
  128. }
  129. }
  130. //인사 정보 호출
  131. function getEhr(){
  132. if ( confirm("EHR데이타를 동기화 하시겠습니까?") ) {
  133. submitXmlRequest("/sycs/user/UserList_form.screen", "GET_EHR_DATA", document.form1);
  134. }
  135. }
  136. //자동로그인 기능
  137. function f_gologin(login_id,login_pw){
  138. var f = document.form1;
  139. if('<%= user.get("ACCT_TYPE_CODE")%>' != "ADMIN"){
  140. alert("관리자로 로그인한 사용자만 자동로그인 할수있습니다.");
  141. return;
  142. }
  143. f.login_id.value = login_id;
  144. f.login_pw.value = login_pw;
  145. if( !submitXmlRequest("/sign_on_check", "", f) ) {
  146. alert("로그인중입니다..");
  147. };
  148. }
  149. function doResult(resultObj) {
  150. try {
  151. if( resultObj.getRequestEvent() == "" ) {
  152. if( resultObj.getSuccess() ) {
  153. var f = document.form1;
  154. f.action = "/index.screen";
  155. f.target = "_parent";
  156. f.submit();
  157. }
  158. else {
  159. dlgErrorMsg(resultObj);
  160. }
  161. document.form1.isSubmit = false;
  162. }else if( resultObj.getRequestEvent() == "GET_EHR_DATA" ) {
  163. document.form1.isSubmit = false;
  164. if( resultObj.getSuccess() ) {
  165. alert("EHR데이타를 동기화 하였습니다.");
  166. jQuery("#btnSearch").click();
  167. }
  168. else {
  169. dlgErrorMsg(resultObj);
  170. }
  171. }
  172. }
  173. catch(errorObject) {
  174. showErrorDlg("doResult()", errorObject);
  175. }
  176. }
  177. function searchAccDept(p_dept_cd, p_dept_nm){
  178. var win_id = "_searchDept";
  179. var link = "/lib/dlgSearchAccDept.screen";
  180. link += "?pop_win_id="+win_id;
  181. fLayerPop(win_id, link, 600,400, '', '', 'NO');
  182. //flayerPopX(win_id, link, 600,400, '', '', 'NO');
  183. }
  184. function searchAccDeptClose(result){
  185. if( result == null ){
  186. document.form1.p_dept_cd.value = ""; //부서코드
  187. document.form1.p_dept_nm.value = ""; //부서명
  188. }else{
  189. document.form1.p_dept_cd.value = result[0]; //부서코드
  190. document.form1.p_dept_nm.value = result[1]; //부서명
  191. }
  192. fLayerPopClose('_searchDept');
  193. }
  194. function doKeyPress() {
  195. if( event.keyCode == 13 ) {
  196. jQuery("#btnSearch").click();
  197. }
  198. }
  199. function sheet1_OnSelectMenu(Text, Code) {
  200. switch(Text) {
  201. case "ExcelDown":
  202. jQuery("#btnExcel").click();
  203. break;
  204. }
  205. }
  206. function sheet1_OnSmartResize(Width, Height) {
  207. sheet1.FitColWidth();
  208. autoResize();
  209. }
  210. function autoResize(){
  211. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  212. var iframeHeight= document.body.scrollHeight - t1_height;
  213. var iframeWidth= document.body.scrollWidth;
  214. sheet1.SetSheetHeight(iframeHeight);
  215. }
  216. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  217. </SCRIPT>
  218. <modular:search id="form1">
  219. <modular:key id="fevent" />
  220. </modular:search>
  221. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  222. <INPUT type="hidden" name="fevent" id="fevent" value="">
  223. <INPUT type="hidden" name="p_user_pw" value="">
  224. <INPUT type="hidden" name="p_buseo_nm" value="">
  225. <INPUT type="hidden" name="p_job_dscr" value="">
  226. <INPUT type="hidden" name="p_tel_no" value="">
  227. <INPUT type="hidden" name="p_hand_tel_no" value="">
  228. <INPUT type="hidden" name="p_e_mail" value="">
  229. <INPUT type="hidden" name="acct_id" value="">
  230. <INPUT type="hidden" name="j_usertype" value="head">
  231. <input type='hidden' name='login_id' >
  232. <input type='hidden' name='login_pw' >
  233. <INPUT type="hidden" name="j_admin_login_gb" value="Y">
  234. <!-- <div id='element_to_pop_up' style='display:none;'>
  235. <span class='button b-close' style='border-radius:7px 7px 7px 7px;box-shadow:none;font:bold 131% sans-serif;padding:0 6px 2px;position:absolute;right:-7px;top:-7px; background-color:#2b91af; color:#fff; cursor: pointer; display: inline-block; text-align: center;'><span>X</span></span> 닫기 버튼 (스타일은 알아서 지정)
  236. <div class='divcontent'></div> 컨텐츠가 들어갈 영역 지정 (이미지, html 등.. 여러가지를 동적으로 부를수 있다.
  237. </div> -->
  238. <div align="left" id="title">
  239. <ul>
  240. <li>사용자관리</li>
  241. </ul>
  242. </div>
  243. <!-- 검색조건 시작 -->
  244. <table id="search-table" class="search-form-table">
  245. <colgroup>
  246. <col width="100" />
  247. <col width="350" />
  248. <col width="100" />
  249. <col width="150" />
  250. <col width="100" />
  251. <col width="*" />
  252. <col width="300" />
  253. </colgroup>
  254. <tr>
  255. <th>부서</th>
  256. <td>
  257. <%= InputText.get("p_dept_cd", params.get("p_dept_cd"), 12, 10, "ID,ReadOnly,PerSize") %>
  258. <%= InputText.get("p_dept_nm", params.get("p_dept_nm"), 32, 30, "ID,ReadOnly") %>
  259. <IMG onclick="searchAccDept(document.form1.p_dept_cd, document.form1.p_dept_nm)" src="/img/buyer/button/bt_search_right.gif" alt="부서찾기" border="0" align="absmiddle" style="cursor:hand;">
  260. </td>
  261. <th>계정타입</th>
  262. <td>
  263. <%= HTMLMaker.getSelectTag(acctTypeRowSet, "ACCT_TYPE_ID", "ACCT_TYPE_NAME", "p_acct_type_id", "width:70%;height=18;", "<option value=''>--선택--</option>", params.get("p_acct_type_id")) %>
  264. </td>
  265. <th>사원번호</th>
  266. <td>
  267. <%= InputText.get("p_user_sabun", params.get("p_user_sabun"), 80, 50, "hangule, desc=사번, PerSize") %>
  268. </td>
  269. <td class="button" rowspan="2">
  270. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  271. <span class="btnSearch center"><a href="javascript:void(0);" id="btnAdd">추가</a></span>
  272. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSync">EHR Sync</a></span>
  273. <span class="btnSearch center"><a href="javascript:void(0);" id="btnClear">초기화</a></span>
  274. <span class="btnSearch center"><a href="javascript:void(0);" id="btnExcel">엑셀</a></span>
  275. </td>
  276. </tr>
  277. <tr>
  278. <th>현장</th>
  279. <td>
  280. <%=InputText.getSiteCodeNew("dept_cd2", "dept_nm2", "", user, params.get("dept_cd2"), params.get("dept_nm2"))%>
  281. </td>
  282. <th>이름</th>
  283. <td>
  284. <INPUT type="text" name="p_user_name" value="<%=params.get("p_user_name") %>" maxlength="50" class="input" style="IME-MODE : active;width:80%;" desc='성명' onKeyPress="doKeyPress();">
  285. </td>
  286. <th>재직여부</th>
  287. <td>
  288. <SELECT name="p_status">
  289. <OPTION value="">전체</OPTION>
  290. <OPTION value="Y">퇴직</OPTION>
  291. <OPTION value="N" selected>재직</OPTION>
  292. </SELECT>
  293. </td>
  294. </tr>
  295. </table>
  296. <!-- 검색조건 종료 -->
  297. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
  298. <script>createIBSheet('sheet1','100%', '350px');</script>
  299. </div>
  300. </FORM>