ContractClose.jsp 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <%--
  2. - FileName : ContractClose.jsp
  3. - Author : gyeongmo an
  4. - Date : 2014.08.05
  5. - Copyright : Copyright (c) 2014 www.udapsoft.co.kr, Inc.
  6. - All rights reserved.
  7. - Description: 계획물량관리
  8. --%>
  9. <%@ page contentType="text/html; charset=utf-8" %>
  10. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  11. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  12. <%@ page import="com.udapsoft.waf.common.ui.InitCombo" %>
  13. <%@ page import="kr.co.udapsoft.common.code.*" %>
  14. <%@ page import="kr.co.udapsoft.common.code.CommCodeManager" %>
  15. <%@ page import="kr.co.hsnc.common.util.*"%>
  16. <%@ page import="kr.co.hsnc.common.sql.*" %>
  17. <%@ include file="/jsp/work/taglib.jsp" %>
  18. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  19. <%
  20. ctx.init(request, response);
  21. HandlerStorage storage = ctx.getHandlerStorage();
  22. ValueObject params = storage.getParams();
  23. ValueObject user = storage.getUser();
  24. String event = storage.getEvent();
  25. //공통코드
  26. CommCodeManager commCodeManager = new CommCodeManager();
  27. InitCombo initCombo = new InitCombo();
  28. initCombo.makeComboData(commCodeManager.getCodeRowSet("PUR_CONT_STATUS"), "CODE", "NAME");
  29. String statusSheetComboListText = initCombo.getCode();
  30. String statusSheetComboListValue = initCombo.getCodeName();
  31. %>
  32. <SCRIPT language="JavaScript">
  33. /*예약함수*/
  34. var sheet1;
  35. var sheet1Row;
  36. var sheet1PageNo = 1;
  37. var pageLastRowIndex = 1;
  38. var validationResult = false;
  39. var filterShow = false;
  40. function _onReady(){
  41. gridInit(sheet1);
  42. jQuery("#btnSearch").click(function() {
  43. jQuery("#fevent").val("GET_DATA_LIST");
  44. var url = Modular.model.PageContext.CONTEXT_ROOT + "/warehouse/purchase/ContractClose_sheet.screen";
  45. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 10, "");
  46. });
  47. jQuery("#btnSave").click(function() {
  48. if(!sheet1.IsDataModified()) {
  49. alert("수정된 내역이 없습니다.");
  50. return;
  51. } else {
  52. jQuery("#fevent").val("UPDATE_DATA");
  53. var url = Modular.model.PageContext.CONTEXT_ROOT + "/warehouse/purchase/ContractClose_sheet.screen";
  54. var result = Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), false);
  55. }
  56. });
  57. jQuery("#btnExcel").click(function() {
  58. if(sheet1.RowCount() == 0) {
  59. alert("내역이 없습니다.");
  60. return;
  61. }
  62. var params = { FileName : "ContractClose.xls", SheetName : "ContractClose", SheetDesign:0, Merge:1,
  63. DownCols:"dept_name|ord_doc_no|cst_doc_name|ord_con_date|item_qty|item_price|item_amt|stock_qty|stock_pri|stock_amt|ent_cls_status|pur_cont_close_remark"
  64. , TitleText:"계약 물량 관리", UserMerge:"0,0,1,12", AutoSizeColumn:1 } ;
  65. sheet1.Down2Excel(params);
  66. });
  67. $("#dataClear2").click(function(){$("#sYmdSt").val("");$("#sYmdEd").val("");});
  68. sheet1.SetActionMenu("ExcelDown");
  69. jQuery("#btnSearch").click();
  70. autoResize();
  71. }
  72. function gridInit(sheetName){
  73. var init_sheet = {};
  74. init_sheet.Cfg = {SearchMode:2, Page:10, MergeSheet:msPrevColumnMerge + msHeaderOnly};
  75. init_sheet.Cols = [
  76. {Header:'상태|상태', Type:"Status", SaveName:"status", Width:0, Align:"Center", Hidden:"True"},
  77. {Header:'현장|현장', Type:"Text", SaveName:"dept_name", Width:100, Align:"Left", Edit:"false"},
  78. {Header:'계약번호|계약번호', Type:"Text", SaveName:"ord_doc_no", Width:100, Align:"Left", Edit:"false"},
  79. {Header:'계약명|계약명', Type:"Text", SaveName:"cst_doc_name", Width:250, Align:"Left", Edit:"false"},
  80. {Header:'계약일자|계약일자', Type:"Date", SaveName:"ord_con_date", Width:70, Align:"Center", Edit:"false"},
  81. {Header:'계약|수량', Type:"Float", SaveName:"item_qty", Width:70, Align:"Right", Edit:"false", Format:"Float", EditLen:14, PointCount:2},
  82. {Header:'계약|단가', Type:"Int", SaveName:"item_price", Width:70, Align:"Right", Edit:"false", EditLen:14, PointCount:2},
  83. {Header:'계약|금액', Type:"Int", SaveName:"item_amt", Width:70, Align:"Right", Edit:"false", EditLen:14, PointCount:2},
  84. {Header:'납품|수량', Type:"Float", SaveName:"stock_qty", Width:70, Align:"Right", Edit:"false", Format:"Float", EditLen:14, PointCount:2},
  85. {Header:'납품|단가', Type:"Int", SaveName:"stock_pri", Width:70, Align:"Right", Edit:"false", EditLen:14, PointCount:2},
  86. {Header:'납품|금액', Type:"Int", SaveName:"stock_amt", Width:70, Align:"Right", Edit:"false", EditLen:14, PointCount:2},
  87. {Header:'진행상태|진행상태', Type:"Combo", SaveName:"ent_cls_status", Width:70, Align:"Center", ComboText:"<%=statusSheetComboListText%>", ComboCode:"<%=statusSheetComboListValue%>"},
  88. {Header:'강제종결사유|강제종결사유', Type:"Text", SaveName:"pur_cont_close_remark", Width:60, Align:"Left", EditLen:100},
  89. {Header:'H_발주계약ID|H_발주계약ID', Type:"Text", SaveName:"pur_cont_id", Width:0, Align:"Center", Hidden:"True"}
  90. ];
  91. init_sheet.HeaderMode = {Sort:1};
  92. IBS_InitSheet(sheetName, init_sheet);
  93. sheetName.SetDataAutoTrim(0);
  94. //sheetName.SetEditable(false);
  95. setGridSize();
  96. }
  97. function sheet1_OnSearchEnd(code, message) {
  98. if(code == 0) {
  99. setGridSize();
  100. } else {
  101. alert(message);
  102. }
  103. }
  104. function sheet1_OnSaveEnd(code, msg) {
  105. if(code >= 0) {
  106. alert("저장했습니다.");
  107. } else {
  108. alert(msg);
  109. }
  110. jQuery("#btnSearch").click();
  111. }
  112. /**
  113. * IBSheet size setting
  114. */
  115. function setGridSize() {
  116. sheet1.FitColWidth();
  117. }
  118. function sheet1_OnSelectMenu(Text, Code) {
  119. switch(Text) {
  120. case "ExcelDown":
  121. jQuery("#btnExcel").click();
  122. break;
  123. }
  124. }
  125. function sheet1_OnSmartResize(Width, Height) {
  126. sheet1.FitColWidth();
  127. autoResize();
  128. }
  129. function autoResize(){
  130. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  131. var iframeHeight= document.body.scrollHeight - t1_height;
  132. var iframeWidth= document.body.scrollWidth;
  133. sheet1.SetSheetHeight(iframeHeight);
  134. }
  135. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  136. </SCRIPT>
  137. <modular:search id="form1">
  138. <modular:key id="fevent" />
  139. </modular:search>
  140. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  141. <INPUT type="hidden" name="fevent" id="fevent" value="">
  142. <div align="left" id="title">
  143. <ul>
  144. <li>계약물량관리</li>
  145. </ul>
  146. </div>
  147. <!-- 검색조건 시작 -->
  148. <table id="search-table" class="search-form-table">
  149. <colgroup>
  150. <col width="100" />
  151. <col width="350" />
  152. <col width="100" />
  153. <col width="350" />
  154. <col width="100" />
  155. <col width="*" />
  156. <col width="200" />
  157. </colgroup>
  158. <tr>
  159. <th>현장</th>
  160. <td>
  161. <%=InputText.getSiteCodeNew("dept_cd", "dept_nm", "", user, params.get("dept_cd"), params.get("dept_nm"))%>
  162. </td>
  163. <th>기간</th>
  164. <td>
  165. <%= InputText.get("sYmdSt", params.get("sYmdSt"), 10, 50, "hangule,center, desc=기간,ReadOnly") %>
  166. <IMG name="sYmdSt_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('sYmdSt');">
  167. ~
  168. <%= InputText.get("sYmdEd", params.get("sYmdEd"), 10, 50, "hangule,center, desc=기간,ReadOnly") %>
  169. <IMG name="sYmdEd_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('sYmdEd');">
  170. <IMG name="dataClear2" id="dataClear2" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
  171. </td>
  172. <th>진행상태</th>
  173. <td>
  174. <%= CommCodeManager.getSelectCodeList("PUR_CONT_STATUS", "s_pur_cont_status", "width:90px;height=18px;", "<OPTION value=''>-- 전체 --</OPTION>", params.get("pur_cont_status"), "") %>
  175. </td>
  176. <td class="button">
  177. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  178. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSave">저장</a></span>
  179. <span class="btnSearch center"><a href="javascript:void(0);" id="btnExcel">엑셀</a></span>
  180. </td>
  181. </tr>
  182. </table>
  183. <!-- 검색조건 종료 -->
  184. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 400px; overflow: auto;">
  185. <script>createIBSheet('sheet1','100%', '400px');</script>
  186. </div>
  187. </FORM>