PayGuarList.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <%--
  2. - Author(s) : Kim Myung Ho
  3. - Date : 2014.11.20
  4. - Description: 하도급 대금지급 보증 책인 소멸 / 확인 목록
  5. --%>
  6. <%@ page contentType="text/html; charset=utf-8" %>
  7. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  8. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  9. <%@ page import="kr.co.hsnc.common.util.*"%>
  10. <%@ page import="kr.co.hsnc.common.sql.*" %>
  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. HandlerStorage storage = ctx.getHandlerStorage();
  16. ValueObject params = storage.getParams();
  17. ValueObject user = storage.getUser();
  18. RowSet template_list = storage.getRowSet("TEMPLATE_LIST");
  19. String template_cds="";
  20. String template_names="미작성";
  21. for(int i=0;i<template_list.size();i++){
  22. template_cds = template_cds+"|"+(template_list.getRow(i).get("TEMPLATE_CD"));
  23. template_names = template_names+"|"+(template_list.getRow(i).get("TEMPLATE_NAME"));
  24. }
  25. %>
  26. <SCRIPT language="JavaScript">
  27. /*예약함수*/
  28. var sheet1 = new ibsheetObject();
  29. var sheet1Row;
  30. var sheet1PageNo = 1;
  31. var pageLastRowIndex = 1;
  32. var validationResult = false;
  33. var filterShow = false;
  34. function _onReady(){
  35. /**
  36. * IBSheet object initialize
  37. */
  38. gridInit(sheet1);
  39. /**
  40. * Application Initialize
  41. */
  42. $("#btnSearch").click(function() {
  43. jQuery("#fevent").val("SHEET_SELECT");
  44. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/outside/PayGuarList_sheet.screen";
  45. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  46. });
  47. $("#p_dept_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which); if(keycode == 8){$("#p_dept_cd").val("");$("#p_dept_nm").val("");}});
  48. $("#p_cont_status").change(function(){$("#btnSearch").click();});
  49. $("#p_build_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == 13)$("#btnSearch").click();});
  50. $("#p_dealer_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == 13)$("#btnSearch").click();});
  51. $("#btnSearch").click();
  52. $("#dataClear").click(function(){$("#ContFromDt").val("");$("#ContToDt").val("");});
  53. jQuery("#btnExcel").click(function() {
  54. if(sheet1.RowCount() == 0) {
  55. alert("내역이 없습니다.");
  56. return;
  57. }
  58. var params = { FileName : "PayGuarList.xls", SheetName : "PayGuarList", SheetDesign:0, Merge:1, DownCols:"SUB_CONT_MOD_ID|DEPT_NAME|CON_DOC_NO|MOD_NO|BUILD_NAME|CON_SUPPLY_AMT|CON_CUR_CD|MEMBER_NAME"+
  59. "|CON_DATE|WORK_START_END_DATE|TEMPLATE_CD|CAUSECODE_NM", TitleText:"외주_계약대상", UserMerge:"0,0,1,12", AutoSizeColumn:1 } ;
  60. sheet1.Down2Excel(params);
  61. });
  62. jQuery("#btnPageWrite").click(function() {
  63. fnPageWrite();
  64. });
  65. autoResize();
  66. }
  67. /**
  68. * IBSheet object initialize
  69. */
  70. function gridInit(sheetName){
  71. var init_sheet = {};
  72. init_sheet.Cfg = {SearchMode:2, Page:100};
  73. init_sheet.Cols = [
  74. {Header:'Del', Type:"DelCheck", SaveName:"DEL_CHECK", Width:0, Align:"Center", Hidden:"True"},
  75. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  76. {Header:'선택', Type:"Radio", SaveName:"", Width:50, Align:"Center", Hidden:"false"},
  77. {Header:'계약번호', Type:"Text", SaveName:"SUB_CONT_MOD_ID", Width:0, Align:"Center", Hidden:"True"},
  78. {Header:'현장명', Type:"Text", SaveName:"DEPT_NAME", Width:200, Align:"Left" , Edit:"false"},
  79. {Header:'계약번호', Type:"Text", SaveName:"CON_DOC_NO", Width:120, Align:"Left", Edit:"false"},
  80. {Header:'변경차수', Type:"Text", SaveName:"MOD_NO", Width:50, Align:"Center" , Edit:"false" <%=params.get("ChgCont").equals("N") ? ", Hidden:'True'":""%>},
  81. {Header:'☞계약명', Type:"Text", SaveName:"BUILD_NAME", Width:200, Align:"Left" , Edit:"false", Cursor:"pointer"},
  82. {Header:'계약금액(VAT별도)', Type:"Text", SaveName:"CON_SUPPLY_AMT", Width:80, Align:"right", Edit:"false"},
  83. {Header:'업체명', Type:"Text", SaveName:"MEMBER_NAME", Width:100, Align:"Left" , Edit:"false"},
  84. {Header:'계약일자', Type:"Text", SaveName:"CON_DATE", Width:80, Align:"Center" , Edit:"false"},
  85. {Header:'계약기간', Type:"Text", SaveName:"WORK_START_END_DATE", Width:80, Align:"Center", Edit:"false"},
  86. {Header:'변경구분', Type:"Text", SaveName:"CAUSECODE_NM", Width:80, Align:"center", Edit:"false"},
  87. {Header:'상태', Type:"Text", SaveName:"STATUS_CD_NM", Width:80, Align:"center", Edit:"false"},
  88. {Header:'서식종류', Type:"Combo", SaveName:"TEMPLATE_CD", Width:100, Align:"Left", Edit:"false", ComboText:"<%=template_names%>", ComboCode:"<%=template_cds%>"},
  89. {Header:'보증일련번호', Type:"Text", SaveName:"WARR_SEQ", Width:0, Align:"Center", Hidden:"True"},
  90. {Header:'서식일련번호', Type:"Text", SaveName:"PAGE_SEQ", Width:50, Align:"Center", Hidden:"True"},
  91. ];
  92. init_sheet.HeaderMode = {Sort:1};
  93. IBS_InitSheet(sheetName, init_sheet);
  94. sheetName.SetDataAutoTrim(0);
  95. // sheetName.SetImageList(1,"/img/buyer/btn/btn_write.gif");
  96. sheetName.SetActionMenu("ExcelDown");
  97. setGridSize();
  98. }
  99. /*
  100. IBSheet Event : Mouse Right Menu
  101. */
  102. function sheet1_OnSelectMenu(Text, Code) {
  103. // text 또는 code값으로 Action수행
  104. switch(Text) {
  105. case "ExcelDown":
  106. jQuery("#btnExcel").click();
  107. break;
  108. }
  109. }
  110. /**
  111. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  112. */
  113. function sheet1_OnSearchEnd(code, message) {
  114. if(code == 0) {
  115. setGridSize();
  116. sheet1.SetColFontColor("BUILD_NAME", "#0000ff");
  117. // for(var i=1; i<=sheet1.RowCount(); i++){
  118. //alert(sheet1.GetCellValue(i,"BTN"));
  119. // alert(sheet1.GetCellValue(i,"TEMPLATE_CD"));
  120. // if((sheet1.GetCellValue(i,"BTN")!="") && (sheet1.GetCellValue(i,"TEMPLATE_CD")!="12")){
  121. // sheet1.SetCellEditable(i,"TEMPLATE_CD",0);
  122. // }
  123. // }
  124. } else {
  125. //조회 에러 수행
  126. alert(message);
  127. }
  128. }
  129. /**
  130. * IBSheet Event: Click
  131. */
  132. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  133. if(Row == 0)return;
  134. if (sheet1.ColSaveName(Col) == "BUILD_NAME") {
  135. var status = sheet1.GetCellValue(Row,8);
  136. if(sheet1.GetCellValue(Row, "TEMPLATE_CD")== "" ){
  137. alert("작성된 서식이 없습니다.\n\n계약을 선택 후 작성 버튼을 클릭 해주세요.");
  138. return;
  139. }
  140. $("#SUB_CONT_MOD_ID").val(sheet1.GetCellValue(Row, "SUB_CONT_MOD_ID"));
  141. $("#TEMPLATE_CD").val(sheet1.GetCellValue(Row, "TEMPLATE_CD"));
  142. $("#WARR_SEQ").val(sheet1.GetCellValue(Row, "WARR_SEQ"));
  143. $("#PAGE_SEQ").val(sheet1.GetCellValue(Row, "PAGE_SEQ"));
  144. $("#fevent").val("FORM_SELECT");
  145. $("#form1").attr("action", "/cont/outside/PayGuarDetail.screen");
  146. $("#form1").attr("target", "_self");
  147. $("#form1").attr("method", "get");
  148. $("#form1").submit();
  149. }
  150. }
  151. /**
  152. * IBSheet Event Change
  153. */
  154. function sheet1_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
  155. $("#SUB_CONT_MOD_ID").val(sheet1.GetCellValue(Row, "SUB_CONT_MOD_ID"));
  156. $("#TEMPLATE_CD").val(sheet1.GetCellValue(Row, "TEMPLATE_CD"));
  157. $("#WARR_SEQ").val(sheet1.GetCellValue(Row, "WARR_SEQ"));
  158. }
  159. /**
  160. * IBSheet size setting
  161. */
  162. function setGridSize() {sheet1.FitColWidth();}
  163. function fnPageWrite(){
  164. if($("#TEMPLATE_CD").val()== "" ){
  165. alert("서식 종류를 선택 해 주세요.");
  166. return;
  167. }
  168. if($("#SUB_CONT_MOD_ID").val()== "" ){
  169. alert("작성 할 계약을 선택해 주세요.");
  170. return;
  171. }
  172. $("#PAGE_SEQ").val();
  173. $("#fevent").val("FORM_SELECT");
  174. $("#form1").attr("action", "/cont/outside/PayGuarDetail.screen");
  175. $("#form1").attr("target", "_self");
  176. $("#form1").attr("method", "post");
  177. $("#form1").submit();
  178. }
  179. //자동로그인 기능
  180. function f_gologin(login_id,login_pw){
  181. var f = document.form1;
  182. if('<%= user.get("ACCT_TYPE_CODE")%>' != "ADMIN"){
  183. dlgAlert("User who logged in as administrator only can do automatic log-in.");
  184. return;
  185. }
  186. f.login_id.value = login_id;
  187. f.login_pw.value = login_pw;
  188. if( !submitXmlRequest("/sign_on_check", "", document.form1) ) {
  189. alert("Log-in is being processed.");
  190. };
  191. }
  192. function sheet1_OnSmartResize(Width, Height) {
  193. sheet1.FitColWidth();
  194. autoResize();
  195. }
  196. function autoResize(){
  197. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 70;
  198. var iframeHeight= document.body.scrollHeight - t1_height;
  199. var iframeWidth= document.body.scrollWidth;
  200. sheet1.SetSheetHeight(iframeHeight);
  201. }
  202. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  203. </SCRIPT>
  204. <modular:search id="form1">
  205. <modular:key id="fevent" />
  206. </modular:search>
  207. <form id="form1" name="form1" method="post" modular:type="search">
  208. <INPUT type="hidden" name="fevent" id="fevent" value="">
  209. <INPUT type="hidden" name="SUB_CONT_MOD_ID" value="">
  210. <INPUT type='hidden' name="WARR_SEQ">
  211. <INPUT type='hidden' name="PAGE_SEQ">
  212. <INPUT type='hidden' name="acct_id" value="<%= params.get("acct_id") %>">
  213. <INPUT type='hidden' name="p_cont_status" value="00">
  214. <div align="left" id="title">
  215. <ul>
  216. <li>외주_하도급 대금 지급 소멸/수령확인</li>
  217. </ul>
  218. </div>
  219. <!-- 검색조건 시작 -->
  220. <table id="search-table" class="search-form-table">
  221. <colgroup>
  222. <col width="100" />
  223. <col width="*" />
  224. <col width="100" />
  225. <col width="*" />
  226. <col width="100" />
  227. </colgroup>
  228. <tr height="25">
  229. <th>현장</th>
  230. <td>
  231. <%=InputText.getSiteCodeNew("p_dept_cd", "p_dept_nm", "", user, params.get("p_dept_cd"), params.get("p_dept_nm"))%>
  232. </td>
  233. <th>계약명</th>
  234. <td>
  235. <INPUT type="text" name="p_build_nm" class="input" value="<%= params.get("p_build_nm") %>" style="width:90%">
  236. </td>
  237. <td class="button" rowspan="2">
  238. <span class="btnSearch center" id="btnSearch"><a href="javascript:void(0);">검색</a></span>
  239. <span class="btnSearch center" id="btnExcel"><a href="javascript:void(0);">엑셀</a></span>
  240. </td>
  241. </tr>
  242. <tr>
  243. <th>업체명</th>
  244. <td>
  245. <INPUT type="text" name="p_dealer_nm" class="input" value="<%= params.get("p_dealer_nm") %>" style="width:90%">
  246. </td>
  247. <th>계약기간</th>
  248. <td>
  249. <%= InputText.get("ContFromDt", params.get("ContFromDt"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  250. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('ContFromDt');">
  251. ~
  252. <%= InputText.get("ContToDt", params.get("ContToDt"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  253. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('ContToDt');">
  254. <IMG name="dataClear" id="dataClear" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
  255. </td>
  256. </tr>
  257. </table>
  258. <table id="search-table" class="search-form-table" style="margin-top:10px;margin-bottom:10px;">
  259. <colgroup>
  260. <col width="100" />
  261. <col width="*" />
  262. <col width="100" />
  263. </colgroup>
  264. <tr height="25">
  265. <th>서식작성</th>
  266. <td>
  267. <%= HTMLMaker.getSelectTag(template_list, "TEMPLATE_CD", "TEMPLATE_NAME", "TEMPLATE_CD", "width:150px;height=18;", "<option value=''>선택</option>") %>
  268. </td>
  269. <td class="button">
  270. <span class="btnSearch center" id="btnPageWrite"><a href="javascript:void(0);">작성</a></span>
  271. </td>
  272. </tr>
  273. </table>
  274. </form>
  275. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
  276. <script>createIBSheet('sheet1','100%', '350px');</script>
  277. </div>