StockSchedulePurchaseList.jsp 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <%--
  2. - FileName : StockSchedulePurchaseList.jsp
  3. - Author : gyeongmo an
  4. - Date : 2014.07.15
  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.util.*" %>
  13. <%@ page import="kr.co.udapsoft.common.util.*" %>
  14. <%@ page import="kr.co.udapsoft.common.code.*" %>
  15. <%@ page import="kr.co.hsnc.common.util.*"%>
  16. <%@ page import="kr.co.hsnc.common.sql.*" %>
  17. <%@ page import ="java.text.SimpleDateFormat" %>
  18. <%@ page import="com.udapsoft.waf.common.util.DateUtil" %>
  19. <%@ page import ="java.util.Date" %>
  20. <%@ include file="/jsp/work/taglib.jsp" %>
  21. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  22. <%
  23. ctx.init(request, response);
  24. HandlerStorage storage = ctx.getHandlerStorage();
  25. ValueObject user = ctx.getUser();
  26. ValueObject params = storage.getParams();
  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. var f = document.form1;
  39. jQuery("#btnSearch").click(function() {
  40. jQuery("#fevent").val("GET_SCHEDULE_LIST");
  41. var url = Modular.model.PageContext.CONTEXT_ROOT + "/warehouse/purchase/StockSchedulePurchaseList_sheet.screen";
  42. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 10, "");
  43. });
  44. jQuery("#btnCancel").click(function() {
  45. if (!sheet1.IsDataModified()){
  46. alert("취소할 내역이 없습니다.");
  47. return;
  48. }
  49. jQuery("#fevent").val("SAVE_SCHEDULE_LIST");
  50. var url = Modular.model.PageContext.CONTEXT_ROOT + "/warehouse/purchase/StockSchedulePurchaseList_form.screen";
  51. var result = Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), false);
  52. });
  53. jQuery("#btnExcel").click(function() {
  54. if(sheet1.RowCount() == 0) {
  55. alert("내역이 없습니다.");
  56. return;
  57. }
  58. var params = { FileName : "StockSchedulePurchaseList.xls", SheetName : "StockSchedulePurchaseList", SheetDesign:0, Merge:1, DownCols:"scheduleno|dept_nm|ord_doc_no|cst_doc_name|corp_nm|"+
  59. "material_cd|material_name|matl_spec|unit_kind|scheduledate|schedule_qty|item_qty|temp_qty|rmnr_qty|confirm_yn", TitleText:"입고계획관리", UserMerge:"0,0,1,15", AutoSizeColumn:1 } ;
  60. sheet1.Down2Excel(params);
  61. });
  62. $("#dataClear2").click(function(){$("#p_schedule_date").val("");});
  63. sheet1.SetActionMenu("ExcelDown");
  64. autoResize();
  65. jQuery("#btnSearch").click();
  66. }
  67. function gridInit(sheetName){
  68. var init_sheet = {};
  69. init_sheet.Cfg = {SearchMode:2, Page:10};
  70. init_sheet.Cols = [
  71. {Header:'상태', Type:"Status", SaveName:"status", Width:0, Align:"Center", Hidden:"True"},
  72. {Header:'계획번호2', Type:"Text", SaveName:"scheduleno2", Width:110, Align:"Center", Edit:"false", Hidden:"True"},
  73. {Header:'선택', Type:"CheckBox", SaveName:"check", Width:60, Align:"Center"},
  74. {Header:'계획번호', Type:"Text", SaveName:"scheduleno", Width:110, Align:"Center", Edit:"false"},
  75. {Header:'현장', Type:"Text", SaveName:"dept_nm", Width:150, Align:"Left", Edit:"false"},
  76. {Header:'계약번호', Type:"Text", SaveName:"ord_doc_no", Width:150, Align:"Left", Edit:"false"},
  77. {Header:'계약명', Type:"Text", SaveName:"cst_doc_name", Width:200, Align:"Left", Edit:"false"},
  78. {Header:'업체명', Type:"Text", SaveName:"corp_nm", Width:150, Align:"Left", Edit:"false"},
  79. {Header:'자재코드', Type:"Text", SaveName:"material_cd", Width:80, Align:"Center", Edit:"false"},
  80. {Header:'자재명', Type:"Text", SaveName:"material_name", Width:150, Align:"Left", Edit:"false"},
  81. {Header:'규격', Type:"Text", SaveName:"matl_spec", Width:150, Align:"Left", Edit:"false"},
  82. {Header:'단위', Type:"Text", SaveName:"unit_kind", Width:50, Align:"Center", Edit:"false"},
  83. {Header:'입고예정일', Type:"Date", SaveName:"scheduledate", Width:80, Align:"Center", Edit:"false"},
  84. {Header:'입고계획량', Type:"Float", SaveName:"schedule_qty", Width:80, Align:"Right", Edit:"false", PointCount:2},
  85. {Header:'계약수량', Type:"Float", SaveName:"item_qty", Width:80, Align:"Right", Edit:"false", PointCount:2},
  86. {Header:'기입고량', Type:"Float", SaveName:"temp_qty", Width:80, Align:"Right", Edit:"false", PointCount:2},
  87. {Header:'잔량', Type:"Float", SaveName:"rmnr_qty", Width:80, Align:"Right", Edit:"false", PointCount:2},
  88. {Header:'완료여부', Type:"Text", SaveName:"confirm_yn", Width:50, Align:"Center", Edit:"false"}
  89. ];
  90. init_sheet.HeaderMode = {Sort:1};
  91. IBS_InitSheet(sheetName, init_sheet);
  92. sheetName.SetDataAutoTrim(0);
  93. sheetName.SetMergeSheet(msPrevColumnMerge);
  94. //setGridSize();
  95. }
  96. function sheet1_OnSearchEnd(code, message) {
  97. if(code == 0) {
  98. setGridSize();
  99. } else {
  100. alert(message);
  101. }
  102. }
  103. function setGridSize() {
  104. sheet1.FitColWidth();
  105. }
  106. function sheet1_OnBeforeCheck(Row, Col) {
  107. var scheduleNo = sheet1.GetCellValue(Row, "scheduleno");
  108. var checkValue = 0;
  109. if(sheet1.GetCellValue(Row, "check") == 0){
  110. checkValue = 1;
  111. }else{
  112. checkValue = 0;
  113. }
  114. for(var i = 1; i <= sheet1.LastRow(); i++){
  115. if (i != Row){
  116. if(scheduleNo == sheet1.GetCellValue(i, "scheduleno")){
  117. sheet1.SetCellValue(i, "check", checkValue);
  118. }
  119. }
  120. }
  121. }
  122. function sheet1_OnSmartResize(Width, Height) {
  123. //sheet1.FitColWidth();
  124. autoResize();
  125. }
  126. function autoResize(){
  127. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 30;
  128. var iframeHeight= document.body.scrollHeight - t1_height;
  129. sheet1.SetSheetHeight(iframeHeight);
  130. }
  131. function sheet1_OnSaveEnd(code, msg) {
  132. /*
  133. if(code >= 0) {
  134. alert("취소 성공");
  135. document.form1.isSubmit = false;
  136. jQuery("#btnSearch").click();
  137. } else {
  138. alert("취소 실패");
  139. //alert(msg);
  140. }
  141. */
  142. if(code == -1) {
  143. alert("취소 성공");
  144. document.form1.isSubmit = false;
  145. jQuery("#btnSearch").click();
  146. } else {
  147. alert(msg);
  148. }
  149. }
  150. function sheet1_OnSelectMenu(Text, Code) {
  151. switch(Text) {
  152. case "ExcelDown":
  153. jQuery("#btnExcel").click();
  154. break;
  155. }
  156. }
  157. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  158. </script>
  159. <modular:search id="form1">
  160. <modular:key id="fevent" />
  161. </modular:search>
  162. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  163. <input type="hidden" name="fevent">
  164. <div align="left" id="title">
  165. <ul>
  166. <li>입고계획관리</li>
  167. </ul>
  168. </div>
  169. <!-- 검색조건 시작 -->
  170. <table id="search-table" class="search-form-table">
  171. <colgroup>
  172. <col width="100" />
  173. <col width="350" />
  174. <col width="100" />
  175. <col width="150" />
  176. <col width="100" />
  177. <col width="*" />
  178. <col width="250" />
  179. </colgroup>
  180. <tr>
  181. <th>현장</th>
  182. <td>
  183. <%=InputText.getSiteCodeNew("dept_cd", "dept_name", "", user, params.get("dept_cd"), params.get("dept_name"))%>
  184. </td>
  185. <th>계획월</th>
  186. <td>
  187. <%= InputText.get("p_schedule_date", DateUtil.formatDateTime(DateUtil.getToday(), "yyyyMMdd", "yyyy-MM"), 10, 50, "hangule,center, desc=입고년월,ReadOnly") %>
  188. <IMG name="p_schedule_date_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgMCalendar('p_schedule_date');">
  189. <IMG name="dataClear2" id="dataClear2" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
  190. </td>
  191. <th>완료여부</th>
  192. <td>
  193. <SELECT id='p_confirm_yn' name='p_confirm_yn' style='width:100px;height=18;'><OPTION value=''>-- 전체 --</OPTION><OPTION value='Y'>완료<OPTION value='N'>미완료</SELECT>
  194. </td>
  195. <td class="button">
  196. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  197. <span class="btnSearch center"><a href="javascript:void(0);" id="btnCancel">취소</a></span>
  198. <span class="btnSearch center"><a href="javascript:void(0);" id="btnExcel">엑셀</a></span>
  199. </td>
  200. </tr>
  201. </table>
  202. <!-- 검색조건 종료 -->
  203. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 400px; overflow: auto;">
  204. <script>createIBSheet('sheet1','100%', '400px');</script>
  205. </div>
  206. </FORM>