QuotPjtCodeList.jsp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <%--
  2. - FileName : QuotPjtCodeList.jsp
  3. - Author : hoonseok choi
  4. - Date : 2023.01.10
  5. - Copyright : Copyright (c) www.udapsoft.co.kr, Inc.
  6. - All rights reserved.
  7. --%>
  8. <%@ page contentType="text/html; charset=utf-8" %>
  9. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  10. <%@ page import="kr.co.hsnc.common.util.ValueObject"%>
  11. <%@ include file="/jsp/work/taglib.jsp" %>
  12. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  13. <%
  14. ctx.init(request, response);
  15. ValueObject user = ctx.getUser();
  16. String USER_ID = user.get("ACCT_ID");
  17. HandlerStorage storage = ctx.getHandlerStorage();
  18. String url = request.getRequestURL().toString();
  19. url = url.substring(0, url.indexOf("/",7));
  20. //본부구분 코드 가져오기
  21. String hq_gubun = (String) storage.getObject("selectHqText");
  22. String hq_gubun_code = (String) storage.getObject("selectHqValue");
  23. System.out.println("hq_gubun : "+hq_gubun);
  24. System.out.println("hq_gubun_code : "+hq_gubun_code);
  25. hq_gubun = hq_gubun.substring(0, hq_gubun.lastIndexOf("|"));
  26. hq_gubun_code = hq_gubun_code.substring(0, hq_gubun_code.lastIndexOf("|"));
  27. %>
  28. <SCRIPT language="JavaScript">
  29. /*예약함수*/
  30. var sheet1;
  31. var sheet1Row;
  32. var sheet1PageNo = 1;
  33. var pageLastRowIndex = 1;
  34. var validationResult = false;
  35. var filterShow = false;
  36. function _onReady(){
  37. gridInit(sheet1);
  38. jQuery("#btnSearch").click(function() {
  39. var f = document.form1;
  40. f.isSubmit = false;
  41. jQuery("#fevent").val("GET_DEPT_LIST");
  42. var url = Modular.model.PageContext.CONTEXT_ROOT + "/quot/outside/getDept_sheet.screen";
  43. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 10, "");
  44. });
  45. jQuery("#btnAdd").click(function() {
  46. var rowIdx = sheet1.DataInsert(-1);
  47. sheet1.SetCellValue(rowIdx,"BASECD","QUOT_DEPT");
  48. });
  49. jQuery("#btnSave").click(function() {
  50. if (confirm("저장하시겠습니까?")) {
  51. jQuery("#fevent").val("SAVE_DEPT_LIST");
  52. var url = Modular.model.PageContext.CONTEXT_ROOT + "/quot/outside/saveDept_sheet.screen";
  53. var result = Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), false);
  54. }
  55. });
  56. autoResize();
  57. }
  58. function gridInit(sheetName){
  59. var init_sheet = {};
  60. init_sheet.Cfg = {SearchMode:2, Page:30};
  61. init_sheet.Cols = [
  62. {Header:'삭제', Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center"},
  63. {Header:'순번', Type:"Text", SaveName:"NO", Width:40, Align:"Center", Hidden:"True"},
  64. {Header:'상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  65. {Header:'공통코드', Type:"Text", SaveName:"BASECD", Width:0, Align:"Center", Hidden:"True"},
  66. {Header:'순번', Type:"Text", SaveName:"SORT_NO", Width:50, Align:"Center"},
  67. {Header:'현장코드', Type:"Text", SaveName:"DETAILCD", Width:80, Align:"Center", EditLen:10, KeyField:"True"},
  68. {Header:'현장명', Type:"Text", SaveName:"DETAILNM", Width:200, Align:"Left", EditLen:200, KeyField:"True"},
  69. {Header:"구분", Type:"Combo", SaveName:"CHG_CODE01", Width:150, Align:"Center", ComboText:"<%=hq_gubun%>", ComboCode:"<%=hq_gubun_code%>", KeyField:"True"},
  70. /* {Header:'구분', Type:"Combo", SaveName:"CHG_CODE01", Width:150, Align:"Center", Edit:"true", ComboText:"토건|플랜트" , ComboCode:"C|P"}, */
  71. {Header:'생성자', Type:"Text", SaveName:"CRE_NAME", Width:60, Align:"Center", Edit:"false"},
  72. {Header:'생성일자', Type:"Date", SaveName:"CRE_DATE", Width:100, Align:"Center", Edit:"false"}
  73. ];
  74. init_sheet.HeaderMode = {Sort:1};
  75. IBS_InitSheet(sheetName, init_sheet);
  76. sheetName.SetDataAutoTrim(0);
  77. setGridSize();
  78. }
  79. function sheet1_OnSearchEnd(code, message) {
  80. if(code == 0) {
  81. setGridSize();
  82. } else {
  83. //조회 에러 수행
  84. //alert(message);
  85. alert("조회 실패");
  86. }
  87. }
  88. function sheet1_OnSaveEnd(code, msg) {
  89. if(code >= 0) {
  90. alert("현장코드목록을 처리 완료했습니다.");
  91. } else {
  92. alert(msg);
  93. }
  94. jQuery("#btnSearch").click();
  95. }
  96. function setGridSize() {
  97. sheet1.FitColWidth();
  98. }
  99. function sheet1_OnSmartResize(Width, Height) {
  100. sheet1.FitColWidth();
  101. autoResize();
  102. }
  103. function sheet1_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
  104. if(sheet1.ColSaveName(0, Col) == "DETAILCD") {
  105. if(sheet1.GetCellValue(Row, "STATUS") != "I") {
  106. alert("현장코드는 수정할 수 없습니다.");
  107. sheet1.SetCellValue(Row, Col, OldValue, 0);
  108. return;
  109. }
  110. }
  111. }
  112. function autoResize(){
  113. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  114. var iframeHeight= document.body.scrollHeight - t1_height;
  115. sheet1.SetSheetHeight(iframeHeight);
  116. }
  117. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  118. </SCRIPT>
  119. <modular:search id="form1">
  120. <modular:key id="fevent" />
  121. </modular:search>
  122. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  123. <INPUT type="hidden" name="fevent" id="fevent" value="">
  124. <INPUT type="hidden" name="basecd" id="basecd" value="QUOT_DEPT">
  125. <div align="left" id="title">
  126. <ul>
  127. <li>견적용 현장코드 관리</li>
  128. </ul>
  129. </div>
  130. <!-- 검색조건 시작 -->
  131. <table id="search-table" class="search-form-table">
  132. <colgroup>
  133. <col width="*" />
  134. <col width="250" />
  135. </colgroup>
  136. <tr>
  137. <td>
  138. </td>
  139. <td class="button" >
  140. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  141. <span class="btnSearch center"><a href="javascript:void(0);" id="btnAdd">추가</a></span>
  142. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSave">저장</a></span>
  143. </td>
  144. </tr>
  145. </table>
  146. <!-- 검색조건 종료 -->
  147. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
  148. <script>createIBSheet('sheet1','100%', '350px');</script>
  149. </div>
  150. </FORM>