ExceptionalUserList.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <%--
  2. - FileName : ExceptionalUserList.jsp
  3. - Author(s) : gyeongmo an
  4. - Date : 2014.06.22
  5. - Description: 예외 사용자 등록
  6. --%>
  7. <%@ page contentType="text/html; charset=utf-8" %>
  8. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  9. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  10. <%@ page import="kr.co.udapsoft.common.code.*" %>
  11. <%@ page import="kr.co.hsnc.common.util.*" %>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <%@ include file="/jsp/work/taglib.jsp" %>
  14. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  15. <%
  16. ctx.init(request, response);
  17. HandlerStorage storage = ctx.getHandlerStorage();
  18. ValueObject params = storage.getParams();
  19. String event = storage.getEvent();
  20. String selectText = (String)storage.getObject("selectText");
  21. String selectValue = (String)storage.getObject("selectValue");
  22. %>
  23. <SCRIPT language="JavaScript">
  24. /*예약함수*/
  25. var sheet1;
  26. var sheet1Row;
  27. var sheet1PageNo = 1;
  28. var pageLastRowIndex = 1;
  29. var validationResult = false;
  30. var filterShow = false;
  31. var clickRow;
  32. var gubun;
  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/security/ExceptionalUser_sheet.screen";
  38. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  39. });
  40. jQuery("#btnClear").click(function() {
  41. jQuery("#p_dept_cd").val("");
  42. jQuery("#p_dept_nm").val("");
  43. jQuery("#p_jumin").val("");
  44. jQuery("#p_sabun").val("");
  45. jQuery("#p_name").val("");
  46. });
  47. jQuery("#btnAdd").click(function() {
  48. var rowIndex = sheet1.DataInsert(-1);
  49. sheet1.SetCellEditable(rowIndex, "SABUN", true);
  50. sheet1.SetCellEditable(rowIndex, "NAME", true);
  51. sheet1.SetCellEditable(rowIndex, "JUMIN", true);
  52. sheet1.SetCellValue(rowIndex, "P_NAME1", sheet1.GetCellText(rowIndex, "P_CODE"));
  53. });
  54. jQuery("#btnSave").click(function() {
  55. if(confirm("저장하시겠습니까?")) {
  56. jQuery("#fevent").val("SAVE_USER_LIST");
  57. var url = Modular.model.PageContext.CONTEXT_ROOT + "/sycs/security/ExceptionalUser_sheet.screen";
  58. var result = Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), false);
  59. }
  60. });
  61. autoResize();
  62. }
  63. function gridInit(sheetName){
  64. var init_sheet = {};
  65. init_sheet.Cfg = {SearchMode:2, Page:30};
  66. init_sheet.Cols = [
  67. {Header:'번호', Type:"Seq", SaveName:"NO", Width:40, Align:"Center"},
  68. {Header:'상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  69. {Header:'사원번호', Type:"Text", SaveName:"SABUN", Width:70, Align:"Center", EditLen:"8", KeyField:"true"},
  70. {Header:'이름', Type:"Text", SaveName:"NAME", Width:75, Align:"Center", EditLen:"30", KeyField:"true"},
  71. {Header:'주민번호', Type:"Text", SaveName:"JUMIN", Width:100, Align:"Center", EditLen:"20" , Hidden:"True"},
  72. {Header:'재임여부', Type:"Combo", SaveName:"DUTYC", Width:60, Align:"Center", ComboText:"재직|퇴직", ComboCode:"10|99"},
  73. {Header:'직위', Type:"Combo", SaveName:"P_CODE", Width:60, Align:"Center", ComboText:"<%=selectValue%>", ComboCode:"<%=selectText%>"},
  74. {Header:'부서', Type:"Popup", SaveName:"DEPT_NAME", Width:150, Align:"Left", KeyField:"true"},
  75. {Header:'현장', Type:"Popup", SaveName:"DEPT_NM", Width:240, Align:"Left"},
  76. {Header:'전화번호', Type:"Text", SaveName:"TEL", Width:90, Align:"Center", EditLen:"20"},
  77. {Header:'휴대폰번호', Type:"Text", SaveName:"HPTEL", Width:90, Align:"Center", EditLen:"30"},
  78. {Header:'시작일자', Type:"Date", SaveName:"ENABLEFROM", Width:85, Align:"Center"},
  79. {Header:'종료일자', Type:"Date", SaveName:"ENABLETO", Width:85, Align:"Center"},
  80. {Header:'부서', Type:"Text", SaveName:"BUSEO", Width:0, Align:"Center", Hidden:"True"},
  81. {Header:'REAL DEPT CD', Type:"Text", SaveName:"REAL_DEPT_CD",Width:0, Align:"Center", Hidden:"True"},
  82. {Header:'직위코드', Type:"Text", SaveName:"P_NAME1", Width:0, Align:"Center", Hidden:"True"},
  83. {Header:'부서코드', Type:"Text", SaveName:"D_CODE", Width:0, Align:"Center", Hidden:"True"},
  84. {Header:'SEQ', Type:"Text", SaveName:"SEQ", Width:0, Align:"Center", Hidden:"True"}
  85. ];
  86. init_sheet.HeaderMode = {Sort:1};
  87. IBS_InitSheet(sheetName, init_sheet);
  88. sheetName.SetDataAutoTrim(0);
  89. setGridSize();
  90. }
  91. function setGridSize() {
  92. sheet1.FitColWidth();
  93. }
  94. function sheet1_OnSaveEnd(code, msg) {
  95. if(code >= 0) {
  96. alert("저장 성공!");
  97. jQuery("#btnSearch").click();
  98. }
  99. else {
  100. //alert(msg);
  101. alert("저장 실패");
  102. }
  103. }
  104. function searchAccDept(gubun2){
  105. gubun = gubun2;
  106. var win_id = "searchAccDept";
  107. var link = "/lib/dlgSearchAccDept.screen";
  108. link += "?pop_win_id="+win_id;
  109. fLayerPop(win_id, link, 600,400, '', '', 'NO');
  110. }
  111. function searchAccDeptClose(result) {
  112. var f = document.form1;
  113. if( result == null ){
  114. f.p_dept_cd.value = ""; //부서코드
  115. f.p_dept_nm.value = ""; //부서명
  116. }else{
  117. if(gubun != "sheet") {
  118. f.p_dept_cd.value = result[0]; //부서코드
  119. f.p_dept_nm.value = result[1]; //부서명
  120. } else {
  121. sheet1.SetCellValue(clickRow, "D_CODE", result[0]); //부서코드
  122. sheet1.SetCellValue(clickRow, "DEPT_NAME", result[1]); //부서명
  123. }
  124. }
  125. fLayerPopClose('searchAccDept');
  126. }
  127. function sheet1_OnSearchEnd(code, message) {
  128. if(code == 0) {
  129. for(var i=0; i<sheet1.RowCount(); i++) {
  130. sheet1.SetCellEditable(i+1, "NO", false);
  131. sheet1.SetCellEditable(i+1, "SABUN", false);
  132. sheet1.SetCellEditable(i+1, "NAME", false);
  133. sheet1.SetCellEditable(i+1, "JUMIN", false);
  134. }
  135. setGridSize();
  136. } else {
  137. alert(message);
  138. }
  139. }
  140. function sheet1_OnValidation(Row, Col, Value) {
  141. var sName = sheet1.ColSaveName(Col);
  142. switch(sName) {
  143. case "SABUN":
  144. if(Value==""){
  145. alert("사번을 입력해 주세요.");
  146. sheet1.ValidateFail(1);
  147. sheet1.SelectCell(Row, Col);
  148. }
  149. break;
  150. case "NAME":
  151. if(Value==""){
  152. alert("이름을 입력해 주세요.");
  153. sheet1.ValidateFail(1);
  154. sheet1.SelectCell(Row, Col);
  155. }
  156. break;
  157. /* case "JUMIN":
  158. if(Value==""){
  159. alert("주민번호를 입력해 주세요.");
  160. sheet1.ValidateFail(1);
  161. sheet1.SelectCell(Row, Col);
  162. }
  163. break; 2016.5.20 해제*/
  164. case "DEPT_NAME":
  165. if(Value==""){
  166. alert("부서를 입력해 주세요.");
  167. sheet1.ValidateFail(1);
  168. sheet1.SelectCell(Row, Col);
  169. }
  170. break;
  171. /*2016.5.20 case "DEPT_NM":
  172. if(Value==""){
  173. alert("현장을 입력해 주세요.");
  174. sheet1.ValidateFail(1);
  175. sheet1.SelectCell(Row, Col);
  176. }
  177. break; */
  178. }
  179. }
  180. function sheet1_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
  181. var sName = sheet1.ColSaveName(Col);
  182. if(sName=="TEL" || sName=="HPTEL"){
  183. if( !checkTelno(Value) ){
  184. alert("올바른 데이타를 입력해 주세요.");
  185. sheet1.ReturnCellData(Row,Col) ;
  186. }
  187. }
  188. if(sName == "P_CODE"){
  189. sheet1.SetCellValue(Row, "P_NAME1", sheet1.GetCellText(Row, "P_CODE"));
  190. }
  191. }
  192. function sheet1_OnPopupClick(Row, Col) {
  193. var sName = sheet1.ColSaveName(Col);
  194. if ( sName=="DEPT_NM" ) { // 현장
  195. var sColN = sheet1.SaveNameCol("BUSEO"); //BUSEO의 컬럽번호
  196. searchSite(Row, Col, sColN);
  197. } else if ( sName=="DEPT_NAME" ) { // 부서
  198. clickRow = Row;
  199. searchAccDept('sheet');
  200. }
  201. }
  202. function searchSite(Row, Col1, Col2) {
  203. clickRow = Row;
  204. var win_id = "searchSpotDept";
  205. var link = "/lib/dlgSearchSpotDept_Unitcd.screen";
  206. link += "?pop_win_id="+win_id+"&sheetOpenYn=Y&returnRow="+Row+"&returnCol1="+Col1+"&returnCol2="+Col2;
  207. fLayerPop(win_id, link, 550,540, '', '', 'NO');
  208. }
  209. function searchSiteClose(result, Row, Col1, Col2) {
  210. if( result == null ){
  211. //parent.sheet1.SetCellValue(Row, Col1, "");
  212. //parent.sheet1.SetCellValue(Row, Col2, "");
  213. }else{
  214. sheet1.SetCellValue(Row, Col1, result[1]);
  215. sheet1.SetCellValue(Row, Col2, result[0]);
  216. }
  217. fLayerPopClose('searchSpotDept');
  218. }
  219. function doKeyPressEvent() {
  220. }
  221. function sheet1_OnSmartResize(Width, Height) {
  222. sheet1.FitColWidth();
  223. autoResize();
  224. }
  225. function autoResize(){
  226. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  227. var iframeHeight= document.body.scrollHeight - t1_height;
  228. sheet1.SetSheetHeight(iframeHeight);
  229. }
  230. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  231. </SCRIPT>
  232. <modular:search id="form1">
  233. <modular:key id="fevent" />
  234. </modular:search>
  235. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  236. <INPUT type="hidden" name="fevent" value="">
  237. <div align="left" id="title">
  238. <ul>
  239. <li>예외 사용자 관리</li>
  240. </ul>
  241. </div>
  242. <!-- 검색조건 시작 -->
  243. <table id="search-table" class="search-form-table">
  244. <colgroup>
  245. <col width="100" />
  246. <col width="350" />
  247. <col width="100" />
  248. <col width="*" />
  249. <col width="250" />
  250. </colgroup>
  251. <tr>
  252. <th>부서</th>
  253. <td>
  254. <%= InputText.get("p_dept_cd", params.get("p_dept_cd"), 12, 10, "ID,ReadOnly,PerSize") %>
  255. <%= InputText.get("p_dept_nm", DeptCodeManager.getDeptName(params.get("p_dept_cd")), 57, 30, "ID,ReadOnly,PerSize") %>
  256. <IMG onclick="searchAccDept('search')" src="/img/buyer/button/bt_search_right.gif" alt="부서찾기" border="0" align="absmiddle" style="cursor:hand;">
  257. </td>
  258. <!-- <th>주민번호</th> -->
  259. <td colspan=2>
  260. &nbsp;<!--<%= InputText.get("p_jumin", params.get("p_jumin"), 60, 13, "number, PerSize") %>-->
  261. </td>
  262. <td class="button" rowspan="2">
  263. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  264. <span class="btnSearch center"><a href="javascript:void(0);" id="btnClear">초기화</a></span>
  265. <span class="btnSearch center"><a href="javascript:void(0);" id="btnAdd">추가</a></span>
  266. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSave">저장</a></span>
  267. </td>
  268. </tr>
  269. <tr>
  270. <th>사원번호</th>
  271. <td>
  272. <%= InputText.get("p_sabun", params.get("p_sabun"), 72, 13, "number, PerSize") %>
  273. </td>
  274. <th>이름</th>
  275. <td>
  276. <%= InputText.get("p_name", params.get("p_name"), 60, 13, "hangule, PerSize") %>
  277. </td>
  278. </tr>
  279. </table>
  280. <!-- 검색조건 종료 -->
  281. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
  282. <SCRIPT>
  283. createIBSheet('sheet1','100%', '350px');
  284. </SCRIPT>
  285. </div>
  286. </FORM>