prepaymentsList.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <%--
  2. - FileName : prepaymentsList.jsp
  3. - Author(s) : ok
  4. - Date : 2014.08.20
  5. - Copyright : Copyright (c) 2013 www.udapsoft.co.kr, Inc.
  6. - Description: 전자조달 구매_선급금 현황
  7. --%>
  8. <%@page import="com.udapsoft.waf.common.util.DateUtil"%>
  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="kr.co.hsnc.common.util.*"%>
  13. <%@ page import="kr.co.hsnc.common.sql.*" %>
  14. <%@ page import="kr.co.hsnc.common.util.Formatter"%>
  15. <%@ include file="/jsp/work/taglib.jsp" %>
  16. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  17. <%
  18. ctx.init(request, response);
  19. HandlerStorage storage = ctx.getHandlerStorage();
  20. ValueObject params = storage.getParams();
  21. ValueObject user = storage.getUser();
  22. String event = storage.getEvent();
  23. RowSet statusComboList = storage.getRowSet("statusComboList"); //상태 ComboList Data
  24. //상태 sheetComboList Data
  25. String statusSheetComboListText = (String)storage.getObject("selectText");
  26. String statusSheetComboListValue = (String)storage.getObject("selectValue");
  27. //System.out.println(statusSheetComboListText);
  28. //System.out.println(statusSheetComboListValue);
  29. //신청구분
  30. String perpayReqDivComboListText = (String)storage.getObject("selectText1");
  31. String perpayReqDivComboListValue = (String)storage.getObject("selectValue1");
  32. //세금계산서 발행방법 구분
  33. String sTaxMethodComboListText = (String)storage.getObject("selectText2");
  34. String sTaxMethodComboListValue = (String)storage.getObject("selectValue2");
  35. //System.out.println(perpayReqDivComboListText);
  36. //System.out.println(perpayReqDivComboListValue);
  37. //초기 조회시 상태값을 신청대상 설정
  38. String initStatusCd = params.get("searchStatusCd");
  39. if(initStatusCd == null || initStatusCd == ""){
  40. initStatusCd = "";
  41. }
  42. String dept_cd = params.get("searchDeptCd");
  43. String dept_nm = params.get("searchDeptNm");
  44. String signDt_from = params.get("searchSignDt_from");
  45. String signDt_to = params.get("searchSignDt_to");
  46. ValueObject defaultDate = DateUtil.getDefaultPeriod();
  47. if("".equals(signDt_from)){
  48. //signDt_from = defaultDate.get("START_DATE");
  49. }
  50. if("".equals(signDt_to)){
  51. //signDt_to = defaultDate.get("END_DATE");
  52. }
  53. //조회 계약명
  54. String returnBuildName = params.get("searchBuildName");
  55. %>
  56. <SCRIPT language="JavaScript">
  57. /*예약함수*/
  58. var sheet1;
  59. var sheet1Row;
  60. var sheet1PageNo = 1;
  61. var pageLastRowIndex = 1;
  62. var validationResult = false;
  63. var filterShow = false;
  64. function _onReady(){
  65. /**
  66. * IBSheet object initialize
  67. */
  68. gridInit(sheet1);
  69. /**
  70. * Application Initialize
  71. */
  72. jQuery("#btnSearch").click(function() {
  73. jQuery("#fevent").val("GET_DATA");
  74. var url = Modular.model.PageContext.CONTEXT_ROOT + "/payment/purchase/PrepaymentsList_sheet.screen";
  75. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  76. });
  77. //신규등록
  78. jQuery("#btnCreate").click(function() {
  79. var win_id = "Prepayment";
  80. var link = "/payment/purchase/PrepayRequestList.screen";
  81. link += "?pop_win_id="+win_id;
  82. link += "&searchDeptCd=" + jQuery("#searchDeptCd").val();
  83. link += "&searchDeptNm=" + jQuery("#searchDeptNm").val();
  84. //link += "&searchDateStart=" + jQuery("#searchDateStart").val();
  85. //link += "&searchDateEnd=" + jQuery("#searchDateEnd").val();
  86. link += "&pageDiv=1"; //1:조달, 2:포탈
  87. fLayerPop(win_id, link, 980, 400, '', '', 'NO');
  88. });
  89. jQuery("#btnAdd").click(function() {
  90. var rowIdx = sheet1.DataInsert(-1);
  91. });
  92. jQuery("#dataClear1").click(function(){
  93. jQuery("#searchSignDt_from").val("");
  94. jQuery("#searchSignDt_to").val("");
  95. });
  96. autoResize();
  97. pageinit();
  98. }
  99. function pageinit(){
  100. jQuery("#btnSearch").click();
  101. }
  102. /**
  103. * IBSheet object initialize
  104. */
  105. function gridInit(sheetName){
  106. var init_sheet = {};
  107. init_sheet.Cfg = {SearchMode:2, Page:30};
  108. init_sheet.Cols = [
  109. {Header:'상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  110. {Header:'현장명', Type:"Text", SaveName:"DEPT_NAME", Width:120, Align:"Left"},
  111. {Header:'계약번호', Type:"Text", SaveName:"CON_DOC_NO", Width:80, Align:"Left"},
  112. {Header:'차수', Type:"Text", SaveName:"MOD_NO", Width:20, Align:"Center"},
  113. {Header:'☞계약명', Type:"Text", SaveName:"BUILD_NAME", Width:120, Align:"Left"},
  114. {Header:'업체명', Type:"Text", SaveName:"CORP_KOR", Width:80, Align:"Left"},
  115. {Header:'공사기간', Type:"Text", SaveName:"START_END_WORK_DATE", Width:80, Align:"Center"},
  116. {Header:'계약금액', Type:"Int", SaveName:"CON_AMT", Width:45, Align:"Right", Format:"#,##0"},
  117. {Header:'계약선급액', Type:"Int", SaveName:"ORG_AMT", Width:45, Align:"Right", Format:"#,##0"},
  118. {Header:'선급금액', Type:"Int", SaveName:"PREPAY_AMT", Width:45, Align:"Right", Format:"#,##0"},
  119. {Header:'신청금액', Type:"Int", SaveName:"REQ_PREPAY_AMT", Width:45, Align:"Right", Format:"#,##0"},
  120. {Header:'신청일자', Type:"Text", SaveName:"SIGN_DT", Width:45, Align:"Center", Format:"Ymd"},
  121. {Header:'신청구분', Type:"Combo", SaveName:"REQ_DIV_CD", Width:45, Align:"Center", ComboText:"<%=perpayReqDivComboListText%>", ComboCode:"<%=perpayReqDivComboListValue%>"},
  122. {Header:'세금계산서\n발행방법', Type:"Combo", SaveName:"TAX_METHOD_CD", Width:50, Align:"Center", ComboText:"<%=sTaxMethodComboListText%>", ComboCode:"<%=sTaxMethodComboListValue%>"},
  123. {Header:'상태', Type:"Combo", SaveName:"STATUS_CD", Width:50, Align:"Center", ComboText:"<%=statusSheetComboListText%>", ComboCode:"<%=statusSheetComboListValue%>"},
  124. {Header:'SUB_CONT_MOD_ID', Type:"Text", SaveName:"SUB_CONT_MOD_ID", Width:0, Align:"Center", Hidden:"True"},
  125. {Header:'CHG_DIV_CD', Type:"Text", SaveName:"CHG_DIV_CD", Width:0, Align:"Center", Hidden:"True"}
  126. ];
  127. init_sheet.HeaderMode = {Sort:1};
  128. IBS_InitSheet(sheetName, init_sheet);
  129. sheetName.SetDataAutoTrim(0);
  130. sheetName.SetEditable(false);
  131. sheetName.SetDataLinkMouse("BUILD_NAME", 1);
  132. sheetName.SetActionMenu("ExcelDown");
  133. setGridSize();
  134. }
  135. function sheet1_OnSelectMenu(Text, Code) {
  136. // text 또는 code값으로 Action수행
  137. switch(Text) {
  138. case "ExcelDown":
  139. sheetExcelDown(sheet1,$('li').html());
  140. break;
  141. }
  142. }
  143. /**
  144. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  145. */
  146. function sheet1_OnSearchEnd(code, message) {
  147. if(code == 0) {
  148. setGridSize();
  149. sheet1.SetColFontColor("BUILD_NAME", "#0000ff");
  150. for(var i=1; i<sheet1.RowCount()+1; i++) {
  151. if (sheet1.GetCellValue(i, "PREPAY_AMT") != sheet1.GetCellValue(i, "ORG_AMT")) {
  152. sheet1.SetCellFontColor(i,"PREPAY_AMT", "#EB1E00");
  153. }
  154. }
  155. } else {
  156. //조회 에러 수행
  157. alert(message);
  158. }
  159. }
  160. /**
  161. * IBSheet Event: Click
  162. */
  163. function sheet1_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  164. //masterSheetRow = Row;
  165. }
  166. /**
  167. * IBSheet size setting
  168. */
  169. function setGridSize() {
  170. sheet1.FitColWidth();
  171. }
  172. /**
  173. * IBSheet Event: DBLCLICK
  174. */
  175. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  176. if (sheet1.ColSaveName(Col) == "BUILD_NAME") { //계약명
  177. if(sheet1.GetCellValue(Row, "CHG_DIV_CD") == "Y"){
  178. jQuery("#selectSubContModId").val(sheet1.GetCellValue(Row, "SUB_CONT_MOD_ID"));
  179. jQuery("#fevent").val("");
  180. //jQuery("#form1").attr("action", "/payment/purchase/PrepaymentsAdd.screen");2018.07.27
  181. jQuery("#form1").attr("action", "/payment/purchase/Prepayments.screen");
  182. jQuery("#form1").attr("target", "_self");
  183. jQuery("#form1").attr("method", "post");
  184. jQuery("#form1").submit();
  185. }else{
  186. jQuery("#selectSubContModId").val(sheet1.GetCellValue(Row, "SUB_CONT_MOD_ID"));
  187. jQuery("#fevent").val("");
  188. jQuery("#form1").attr("action", "/payment/purchase/Prepayments.screen");
  189. jQuery("#form1").attr("target", "_self");
  190. jQuery("#form1").attr("method", "post");
  191. jQuery("#form1").submit();
  192. }
  193. }
  194. }
  195. function PurchaseRequestPopupClose(){
  196. //alert();
  197. setTimeout(function(){fLayerPopClose('Prepayment');},100);
  198. jQuery("#btnSearch").click();
  199. }
  200. function doKeyPress() {
  201. if( event.keyCode == 13 ) {
  202. jQuery("#btnSearch").click();
  203. }
  204. }
  205. function sheet1_OnSmartResize(Width, Height) {
  206. sheet1.FitColWidth();
  207. autoResize();
  208. }
  209. function autoResize(){
  210. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("bugase").scrollHeight + document.getElementById("title").scrollHeight + 24;
  211. var iframeHeight= document.body.scrollHeight - t1_height;
  212. var iframeWidth= document.body.scrollWidth;
  213. sheet1.SetSheetHeight(iframeHeight);
  214. }
  215. </SCRIPT>
  216. <modular:search id="form1">
  217. <modular:key id="fevent" />
  218. </modular:search>
  219. <BODY onresize="autoResize()" >
  220. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  221. <INPUT type="hidden" name="fevent" id="fevent" value="">
  222. <INPUT type="hidden" name="selectSubContModId" id="selectSubContModId" value="">
  223. <INPUT type="hidden" name="selectPrepayId" id="selectPrepayId" value="">
  224. <INPUT type="hidden" name="resultListDiv" id="resultListDiv" value="1">
  225. <!-- 프로그램 제목 -->
  226. <div align="left" id="title">
  227. <ul>
  228. <li>구매_선급금현황</li>
  229. </ul>
  230. </div>
  231. <!-- 검색조건 시작 -->
  232. <table id="search-table" class="search-form-table">
  233. <colgroup>
  234. <col width="100px">
  235. <col width="35%">
  236. <col width="100px">
  237. <col/>
  238. <col width="200px">
  239. </colgroup>
  240. <TR>
  241. <TH>현장</TH>
  242. <TD>
  243. <%-- <%=InputText.getSiteCode("searchDeptCd", "dept_nm", "", user, dept_cd, dept_nm)%> --%>
  244. <%=InputText.getSiteCodeNew("searchDeptCd", "searchDeptNm", "", user, dept_cd, dept_nm)%>
  245. </TD>
  246. <th>신청일자</th>
  247. <td>
  248. <%= InputText.get("searchSignDt_from", signDt_from, 10, 50, "hangule,center, desc=신청일,ReadOnly") %>
  249. <IMG name="start_img" id="calender_from" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('searchSignDt_from');">
  250. ~
  251. <%= InputText.get("searchSignDt_to", signDt_to, 10, 50, "hangule,center, desc=신청일,ReadOnly") %>
  252. <IMG name="start_img" id="calender_from" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('searchSignDt_to');">
  253. <IMG name="dataClear1" id="dataClear1" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
  254. </td>
  255. <TD class="button" rowspan="3">
  256. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  257. <span class="btnSearch center" id="spanBtnCreate" ><a href="javascript:void(0);" id="btnCreate">선급금 추가 생성</a></span>
  258. </TD>
  259. </TR>
  260. <TR>
  261. <TH>계약명</TH>
  262. <TD colspan="1">
  263. <INPUT type="text" id="searchBuildName" name="searchBuildName" value="<%=returnBuildName %>" maxlength="50" class="input" style="IME-MODE : active; width:90%;" desc='계약명' onKeyPress="doKeyPress();">
  264. </TD>
  265. <TH>상태</TH>
  266. <TD>
  267. <%=HTMLMaker.getSelectTag(statusComboList, "DETAILCD", "DETAILNM", "searchStatusCd", "width:30%;height=18;", "<option value=''>--전체--</option>", initStatusCd) %>
  268. </TD>
  269. </TR>
  270. <TR>
  271. <TH>업체명</TH>
  272. <TD colspan="3">
  273. <INPUT type="text" id="searchCorp" name="searchCorp" value="" maxlength="50" class="input" style="IME-MODE : active; width:42%;" desc='업체명' onKeyPress="doKeyPress();">
  274. </TD>
  275. </TR>
  276. </table>
  277. <!-- 검색조건 종료 -->
  278. <img src="/img/com/blank.gif" height="5px" />
  279. <div align="right" id="bugase">
  280. <ul>
  281. <li valign="bottom"><span style="color: red;">* 부가세별도</span></li>
  282. </ul>
  283. </div>
  284. <div id="sheet1_div" style="padding-top:0px; height: auto; min-height: 350px; overflow: auto;">
  285. <script>createIBSheet('sheet1','100%', '350px');</script>
  286. </div>
  287. </FORM>
  288. </body>