purchaseRequestList.jsp 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <%--
  2. - FileName : purchaseRequestList.jsp
  3. - Author(s) : ok
  4. - Date : 2014.07.28
  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.hsnc.common.util.*"%>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <%@ page import="kr.co.hsnc.common.util.Formatter"%>
  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. //검색조건 현장 설정
  23. String initSearchDeptCd = params.get("searchDeptCd");
  24. String initSearchDeptNm = params.get("searchDeptNm");
  25. //검색조건 작성일
  26. //String initSearchDateStart = params.get("searchDateStart");
  27. //String initSearchDateEnd = params.get("searchDateEnd");
  28. String pageDiv = params.get("pageDiv"); //1:조달 2:포탈
  29. %>
  30. <SCRIPT language="JavaScript">
  31. /*예약함수*/
  32. var sheet1;
  33. var sheet1Row;
  34. var sheet1PageNo = 1;
  35. var pageLastRowIndex = 1;
  36. var validationResult = false;
  37. var filterShow = false;
  38. function _onReady(){
  39. /**
  40. * IBSheet object initialize
  41. */
  42. gridInit(sheet1);
  43. /**
  44. * Application Initialize
  45. */
  46. jQuery("#btnCreate").click(function() {
  47. if(sheet1.RowCount("U") == 0){
  48. alert("신규생성할 대금대상건을 선택하세요.");
  49. return;
  50. }
  51. if (confirm("대금 정보를 생성 하시겠습니까?")) {
  52. jQuery("#fevent").val("SAVE_DATA");
  53. var url = Modular.model.PageContext.CONTEXT_ROOT + "/payment/purchase/PurchaseRequestList_sheet.screen";
  54. var result = Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), false);
  55. }
  56. });
  57. jQuery("#btnClose").click(function() {
  58. //setTimeout(function(){parent.searchAccDeptClose(null);},100);
  59. parent.PurchaseRequestPopupClose();
  60. });
  61. jQuery("#btnSearch").click(function() {
  62. searchData();
  63. });
  64. pageinit();
  65. }
  66. function pageinit(){
  67. //검색조건의 작성일 일자 설정
  68. setSearchDate();
  69. //데이터 조회
  70. searchData();
  71. //1:조달, 2:포탈
  72. if(jQuery("#pageDiv").val() == "2"){
  73. sheet1.SetColHidden(5, 1); //업체명 숨김
  74. }
  75. }
  76. /**
  77. * IBSheet object initialize
  78. */
  79. function gridInit(sheetName){
  80. var init_sheet = {};
  81. init_sheet.Cfg = {SearchMode:2, Page:30, MergeSheet:msHeaderOnly};
  82. init_sheet.Cols = [
  83. {Header:'상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  84. {Header:'선택', Type:"CheckBox", SaveName:"CHECKBOX", Width:40, Align:"Center"},
  85. {Header:'현장코드', Type:"Text", SaveName:"DEPT_CD", Width:50, Align:"Left", Hidden:"True"},
  86. {Header:'현장명', Type:"Text", SaveName:"DEPT_NAME", Width:110, Align:"Left"},
  87. {Header:'계약명', Type:"Text", SaveName:"CST_DOC_NAME", Width:110, Align:"Left"},
  88. {Header:'업체명', Type:"Text", SaveName:"CORP_KOR", Width:110, Align:"Left"},
  89. {Header:'통화', Type:"Text", SaveName:"CURRENCY_GB", Width:40, Align:"Center"},
  90. {Header:'지급차수', Type:"Text", SaveName:"DEPOSIT_SEQ", Width:40, Align:"Center"},
  91. {Header:'계약금액', Type:"Int", SaveName:"ORD_SUPPLY_AMT", Width:80, Align:"Right", Format:"#,##0"},
  92. {Header:'금회청구액', Type:"Int", SaveName:"CUR_ACMP_APPLYAMT", Width:80, Align:"Right", Format:"#,##0"},
  93. {Header:'청구잔액', Type:"Int", SaveName:"REMAINDER_ACMP_SUPPLYAMT", Width:80, Align:"Right", Format:"#,##0"},
  94. {Header:'지급율', Type:"Int", SaveName:"CUR_ACMP_PERCENT", Width:40, Align:"Right", Format:"##0.0"},
  95. {Header:'PUR_CONT_ID', Type:"Text", SaveName:"PUR_CONT_ID", Width:80, Align:"Center", Hidden:"True"},
  96. {Header:'PUR_CONT_MOD_ID', Type:"Text", SaveName:"PUR_CONT_MOD_ID", Width:80, Align:"Center", Hidden:"True"},
  97. {Header:'DIV', Type:"Text", SaveName:"DIV", Width:80, Align:"Center", Hidden:"True"} //1:토건, 2:플랜트, 3:설치
  98. ];
  99. init_sheet.HeaderMode = {Sort:1};
  100. IBS_InitSheet(sheetName, init_sheet);
  101. sheetName.SetDataAutoTrim(0);
  102. sheetName.SetEditable(true);
  103. sheetName.SetActionMenu("ExcelDown");
  104. setGridSize();
  105. }
  106. function sheet1_OnSelectMenu(Text, Code) {
  107. // text 또는 code값으로 Action수행
  108. switch(Text) {
  109. case "ExcelDown":
  110. sheetExcelDown(sheet1,$('li').html());
  111. break;
  112. }
  113. }
  114. /**
  115. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  116. */
  117. function sheet1_OnSearchEnd(code, message) {
  118. if(code == 0) {
  119. setGridSize();
  120. } else {
  121. //조회 에러 수행
  122. alert(message);
  123. }
  124. }
  125. /**
  126. * IBSheet Event: Save End(IBSheet 데이터 저장 CallBack)
  127. */
  128. function sheet1_OnSaveEnd(code, msg) {
  129. if(code >= 0) {
  130. //alert("신규로 대금건이 생성되었습니다. \n\n 외주_기성현황에서 확인 하실수 있습니다.");
  131. alert("신규 대금건이 생성되었습니다.");
  132. } else {
  133. alert("생성실패 하였습니다.");
  134. }
  135. //searchData();
  136. searchClose();
  137. }
  138. /**
  139. * IBSheet Event: Click
  140. */
  141. function sheet1_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  142. //masterSheetRow = Row;
  143. }
  144. /**
  145. * IBSheet size setting
  146. */
  147. function setGridSize() {
  148. sheet1.FitColWidth();
  149. }
  150. /**
  151. * IBSheet Event: DBLCLICK
  152. */
  153. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  154. }
  155. function doKeyPress() {
  156. if( event.keyCode == 13 ) {
  157. jQuery("#btnSearch").click();
  158. }
  159. }
  160. function calendar(thisDayObj){
  161. dlgCalendar(thisDayObj);
  162. }
  163. function searchData(){
  164. jQuery("#fevent").val("GET_LIST");
  165. var url = Modular.model.PageContext.CONTEXT_ROOT + "/payment/purchase/PurchaseRequestList_sheet.screen";
  166. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  167. }
  168. function searchClose(){
  169. parent.PurchaseRequestPopupClose();
  170. }
  171. function sheet1_OnSmartResize(Width, Height) {
  172. sheet1.FitColWidth();
  173. }
  174. //검색 조건에 작성일 일자 설정
  175. function setSearchDate(){
  176. /* //검색조건 시작일
  177. var startDate = get_year() +'-'+ get_month() +'-'+ '01';
  178. if(jQuery('#searchDateStart').val() == ""){
  179. jQuery('#searchDateStart').val(startDate);
  180. }
  181. //검색조건 종료일
  182. var nowYearMonth = new Date( get_year(), get_month(), "");
  183. var lastDay = nowYearMonth.getDate();
  184. var endDate = get_year() +'-'+ get_month() +'-'+ lastDay;
  185. if(jQuery('#searchDateEnd').val() == ""){
  186. jQuery('#searchDateEnd').val(endDate);
  187. } */
  188. }
  189. </SCRIPT>
  190. <modular:search id="form1">
  191. <modular:key id="fevent" />
  192. </modular:search>
  193. <BODY>
  194. <form id="form1" name="form1" method="post" modular:type="search">
  195. <INPUT type="hidden" name="fevent" id="fevent" value="">
  196. <INPUT type="hidden" name="pageDiv" id="pageDiv" value="<%=params.get("pageDiv")%>"> <!-- //1:조달 2:포탈 -->
  197. <INPUT type="hidden" name="userCorpId" id="userCorpId" value="<%=user.get("CORP_ID")%>">
  198. <!-- 프로그램 제목 -->
  199. <!-- <div align="left" id="title">
  200. <ul>
  201. <li>대금 신청대상</li>
  202. </ul>
  203. </div> -->
  204. <!-- 검색조건 영역 : 시작 -->
  205. <table class="search-form-table" style="width: 100%">
  206. <colgroup>
  207. <col width="8%" />
  208. <col width="35%" />
  209. <col width="8%" />
  210. <col width="*" />
  211. <col width="25%" />
  212. </colgroup>
  213. <TR height="25">
  214. <!-- 검색조건 타이틀 1 -->
  215. <%
  216. if(pageDiv.equals("1")){ //1:조달
  217. %>
  218. <th>현장</th>
  219. <td colspan="3">
  220. <%=InputText.getSiteCode("searchDeptCd", "searchDeptNm", "", user, initSearchDeptCd, initSearchDeptNm)%>
  221. </td>
  222. <%
  223. }else{
  224. %>
  225. <th>계약명</th>
  226. <td colspan="3">
  227. <input name="searchCstNm" class="input" id="searchCstNm" type="text" style="width: 50%; value=""/>
  228. </td>
  229. <%
  230. }
  231. %>
  232. <%-- <td>
  233. <%= InputText.get("searchDateStart", initSearchDateStart, 28, 10, "Center, date, PerSize, readonly", "date", "") %>
  234. <a href="JavaScript:calendar('searchDateStart');"><img src="/img/supplier/template/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
  235. &nbsp;~&nbsp;
  236. <%= InputText.get("searchDateEnd", initSearchDateEnd, 29, 10, "Center, date, PerSize, readonly", "date", "") %>
  237. <a href="JavaScript:calendar('searchDateEnd');"><img src="/img/supplier/template/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
  238. </td> --%>
  239. <TD class="button">
  240. <!-- 검색버튼 영역 : 시작 -->
  241. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  242. <span class="btnSearch center"><a href="javascript:void(0);" id="btnCreate">신규대금생성</a></span>
  243. <!-- <span class="btnSearch center"><a href="javascript:void(0);" id="btnClose">닫기</a></span> -->
  244. <!-- 검색버튼 영역 : 종료 -->
  245. </TD>
  246. </TR>
  247. </TABLE>
  248. <!-- 검색조건 영역 : 종료 -->
  249. <div id="sheet1_div" style="width: 100%; padding-top:5px; height: auto; min-height: 360px; overflow: auto;">
  250. <script>createIBSheet('sheet1','100%', '360px');</script>
  251. </div>
  252. </FORM>
  253. </body>