SubconPayGuarList.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <%--
  2. - Author(s) : Kim Myung Ho
  3. - Date : 2014.08.11
  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. <%@ page import="kr.co.hsnc.common.config.WAFConfig %>
  14. <%
  15. String guarUrl = WAFConfig.get("waf.guar.url");
  16. ctx.init(request, response);
  17. HandlerStorage storage = ctx.getHandlerStorage();
  18. ValueObject params = storage.getParams();
  19. ValueObject user = storage.getUser();
  20. %>
  21. <SCRIPT language="JavaScript">
  22. /*예약함수*/
  23. var sheet1 = new ibsheetObject();
  24. var sheet3 = new ibsheetObject();
  25. var sheet1Row;
  26. var sheet1PageNo = 1;
  27. var pageLastRowIndex = 1;
  28. var validationResult = false;
  29. var filterShow = false;
  30. function _onReady(){
  31. /**
  32. * IBSheet object initialize
  33. */
  34. grid1Init(sheet1);
  35. grid3Init(sheet3);
  36. /**
  37. * Application Initialize
  38. */
  39. $("#btnSearch").click(function() {
  40. jQuery("#fevent").val("SHEET_SELECT");
  41. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/SubconPayGuarList_sheet.screen";
  42. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  43. jQuery("#fevent").val("SHEET_EXCEL");
  44. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/SubconPayGuarList_sheet.screen";
  45. Modular.view.IBSheet7.doSearch(sheet3, url, jQuery("#form1"), 30, "");
  46. });
  47. $("#btnExcel").click(function() {
  48. if(sheet3.RowCount() == 0) {
  49. alert("내역이 없습니다.");
  50. return;
  51. }
  52. var params = { FileName : "SubconPayGuarList.xls", SheetName : "ContTargetList", SheetDesign:0, Merge:1, DownCols:"DEPT_NAME|OUT_ITEM|BUILD_NAME|CONT_NAME|CON_AMT|WARR_AMT|DUR_DATE|WARR_DATE", TitleText:"외주_하도급대금 지급보증 수수료", UserMerge:"0,0,1,8", AutoSizeColumn:1 } ;
  53. sheet3.Down2Excel(params);
  54. });
  55. $("#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("");}});
  56. $("#p_cont_status").change(function(){$("#btnSearch").click();});
  57. $("#p_build_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == 13)$("#btnSearch").click();});
  58. $("#p_dealer_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == 13)$("#btnSearch").click();});
  59. //$("#btnSearch").click(); 2015.9.17 Default조회 제외.
  60. $("#dataClear").click(function(){$("#ContFromDt").val("");$("#ContToDt").val("");});
  61. auto1Resize();
  62. }
  63. /**
  64. * IBSheet object initialize
  65. */
  66. function grid1Init(sheetName){
  67. var init_sheet = {};
  68. init_sheet.Cfg = {SearchMode:2, Page:100};
  69. init_sheet.Cols = [
  70. {Header:'현장명', Type:"Text", SaveName:"DEPT_NAME", Width:200, Align:"Left" , Edit:"false"},
  71. {Header:'☞계약명', Type:"Text", SaveName:"BUILD_NAME", Width:200, Align:"Left" , Edit:"false"},
  72. {Header:'업체명', Type:"Text", SaveName:"MEMBER_NAME", Width:80, Align:"Left" , Edit:"false"},
  73. {Header:'공사기간', Type:"Text", SaveName:"WORK_START_END_DATE", Width:80, Align:"Center", Edit:"false"},
  74. {Header:'계약금액', Type:"Text", SaveName:"CON_AMT", Width:80, Align:"right", Edit:"false"},
  75. {Header:'☞계약번호', Type:"Text", SaveName:"CON_DOC_NO", Width:120, Align:"Left", Edit:"false", Cursor:"pointer"},
  76. {Header:'자료', Type:"Image", SaveName:"IMG_GB", Width:50, Align:"Center" , Edit:"false", Cursor:"pointer"},
  77. {Header:'변경차수', Type:"Text", SaveName:"MOD_NO", Width:50, Align:"Center", Hidden:"True"},
  78. {Header:'계약일자', Type:"Text", SaveName:"CON_DATE", Width:80, Align:"Center" , Edit:"false"},
  79. {Header:'상태', Type:"Combo", SaveName:"STATUS_CD", Width:80, Align:"center", Edit:"false", ComboText:"계약완료", ComboCode:"50", Hidden:"True"},
  80. {Header:'발급여부', Type:"Text", SaveName:"WARR_STATUS", Width:80, Align:"Left", Edit:"false"},
  81. {Header:'변경구분', Type:"Text", SaveName:"CAUSECODE_NM", Width:80, Align:"Left", Edit:"false"},
  82. {Header:'PUR_CONT_MOD_ID', Type:"Text", SaveName:"PUR_CONT_MOD_ID", Width:0, Align:"Center", Hidden:"True"},
  83. {Header:'PUR_CONT_ID', Type:"Text", SaveName:"PUR_CONT_ID", Width:0, Align:"Center", Hidden:"True"},
  84. ];
  85. init_sheet.HeaderMode = {Sort:1};
  86. IBS_InitSheet(sheetName, init_sheet);
  87. sheetName.SetDataAutoTrim(0);
  88. sheetName.SetImageList(0,"/img/buyer/button/bt_search_right.gif");
  89. sheetName.SetActionMenu("ExcelDown");
  90. setGrid1Size();
  91. }
  92. /**
  93. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  94. */
  95. function sheet1_OnSearchEnd(code, message) {
  96. if(code == 0) {
  97. setGrid1Size();
  98. sheet1.SetColFontColor("CON_DOC_NO", "#0000ff");
  99. //2017.07.11 SetImageList로 왜 대체가 안됨.
  100. for(i=1; i <= sheet1.RowCount(); i++){
  101. sheet1.SetCellImage(i, "IMG_GB", 0);
  102. }
  103. } else {
  104. //조회 에러 수행
  105. alert(message);
  106. }
  107. }
  108. /**
  109. * IBSheet Event: Click
  110. */
  111. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  112. if ((sheet1.ColSaveName(Col) == "CON_DOC_NO") && ("<%= user.get("RIGHT_NAME")%>" == "PURCHASE" || "<%= user.get("RIGHT_NAME")%>" == "ADMIN NEW") ) {
  113. var f = document.form1;
  114. f.isSubmit = false;
  115. $("#PUR_CONT_MOD_ID").val(sheet1.GetCellValue(Row, "PUR_CONT_MOD_ID"));
  116. $("#PUR_CONT_ID").val(sheet1.GetCellValue(Row, "PUR_CONT_ID"));
  117. $("#MOD_NO").val(sheet1.GetCellValue(Row, "MOD_NO"));
  118. if (sheet1.GetCellValue(Row,"WARR_STATUS") == "미신청"){
  119. $("#fevent").val("INSERT_DATA");
  120. }else{
  121. $("#fevent").val("UPDATE_DATA");
  122. }
  123. $("#form1").attr("action", "/cont/purchase/SubconPayGuarDetail.screen");
  124. $("#form1").attr("target", "_self");
  125. $("#form1").attr("method", "post");
  126. $("#form1").submit();
  127. }else if(sheet1.ColSaveName(Col) == "IMG_GB"){
  128. var job_div = "P";
  129. var popUrl = "/payment/purchase/PayItemPurDashBoardPop.screen?job_div="+job_div+"&sModule=LM&purContId="+sheet1.GetCellValue(Row, "PUR_CONT_ID")+"&job_auth=<%= user.get("RIGHT_NAME")%>";
  130. var popOption = "width=800, height=600, resizable=no, scrollbars=yes, status=no;";
  131. window.open(popUrl,"",popOption);
  132. }
  133. }
  134. function grid3Init(sheetName){
  135. var init_sheet = {};
  136. init_sheet.Cfg = {SearchMode:2, Page:100};
  137. init_sheet.Cols = [
  138. {Header:'현장명', Type:"Text", SaveName:"DEPT_NAME", Width:150, Align:"Left" , Edit:"false"},
  139. {Header:'공종명', Type:"Text", SaveName:"OUT_ITEM", Width:150, Align:"Left" , Edit:"false"},
  140. {Header:'계약명', Type:"Text", SaveName:"BUILD_NAME", Width:100, Align:"Left", Edit:"false"},
  141. {Header:'업체명', Type:"Text", SaveName:"CONT_NAME", Width:100, Align:"Left", Edit:"false"},
  142. {Header:'계약금액(VAT포함)', Type:"Text", SaveName:"CON_AMT", Width:100, Align:"right", Edit:"false"},
  143. {Header:'수수료금액', Type:"Text", SaveName:"WARR_AMT", Width:150, Align:"right", Edit:"false"},
  144. {Header:'계약기간', Type:"Text", SaveName:"DUR_DATE", Width:180, Align:"Center", Edit:"false"},
  145. {Header:'발행날짜', Type:"Text", SaveName:"WARR_DATE", Width:80, Align:"Center" , Edit:"false"},
  146. ];
  147. init_sheet.HeaderMode = {Sort:1};
  148. IBS_InitSheet(sheetName, init_sheet);
  149. sheetName.SetDataAutoTrim(0);
  150. setGrid3Size();
  151. }
  152. function sheet3_OnSearchEnd(code, message) {
  153. if(code == 0) {
  154. } else {
  155. //조회 에러 수행
  156. alert("상세조회 실패");
  157. }
  158. }
  159. function setGrid3Size() {sheet3.FitColWidth();}
  160. function sheet3_OnSmartResize(Width, Height) {
  161. sheet3.FitColWidth();
  162. }
  163. function auto3Resize(){
  164. var t1_height = document.getElementById("t1").scrollHeight + 10;
  165. var iframeHeight= document.body.scrollHeight - t1_height;
  166. var iframeWidth= document.body.scrollWidth;
  167. sheet3.SetSheetHeight(iframeHeight);
  168. }
  169. /**
  170. * IBSheet size setting
  171. */
  172. function setGrid1Size() {sheet1.FitColWidth();}
  173. function sheet1_OnSmartResize(Width, Height) {
  174. sheet1.FitColWidth();
  175. //auto1Resize();
  176. }
  177. function auto1Resize(){
  178. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight+ 24;
  179. var iframeHeight= document.body.scrollHeight - t1_height;
  180. var iframeWidth= document.body.scrollWidth;
  181. sheet1.SetSheetHeight(iframeHeight);
  182. }
  183. //자동로그인 기능
  184. function f_gologin(login_id,login_pw){
  185. var f = document.form1;
  186. if('<%= user.get("ACCT_TYPE_CODE")%>' != "ADMIN"){
  187. dlgAlert("User who logged in as administrator only can do automatic log-in.");
  188. return;
  189. }
  190. f.login_id.value = login_id;
  191. f.login_pw.value = login_pw;
  192. if( !submitXmlRequest("/sign_on_check", "", document.form1) ) {
  193. alert("Log-in is being processed.");
  194. };
  195. }
  196. function doAttachFilePop(obj, No, fObj, fileGB, fileDir) {
  197. var editFile = "";
  198. if(obj==''){
  199. alert("After you have saved, you can attach a file.");
  200. }
  201. else if(obj != ''){
  202. if(fObj.guarStatus.value != "02"){editFile="Y";}else{editFile="Y";}
  203. if(No=="1"){
  204. viewFileListNew(fileGB, obj.value, fObj.p_AttachFileGuar1, editFile, fileDir, "subconPayOutOffPopup");
  205. }else{
  206. viewFileListNew(fileGB, obj.value, fObj.p_AttachFileGuar2, editFile, fileDir, "subconPayOutOffPopup");
  207. }
  208. }
  209. }
  210. //보증정보팝업 호출
  211. function popContWarr(wG, wSeq, wCauseCd, wOnOff, wGStatus, wOffid, wConRefNo) {
  212. var win_id = "subconPayOutOffPopup";
  213. var param = "";
  214. var param = "?purContModId=" + jQuery("#PUR_CONT_MOD_ID").val();
  215. var param = param + "&warrGubun=" + wG;
  216. var param = param + "&warrSeq=" + wSeq;
  217. var param = param + "&causeCode=" + wCauseCd;
  218. var param = param + "&viewDiv=SUBCONPAY";
  219. var param = param + "&pop_win_id=" + win_id;
  220. var url = "";
  221. if (wOnOff == ""){
  222. alert("발급구분을 선택해 주세요.");return;
  223. }
  224. if(wOnOff=="N"){
  225. var param = param + "&fevent=WARR_OFF";
  226. url = "/portal/guar/subconPayOutOffPopup.screen"+param;
  227. fLayerPop(win_id, url, 560,500, '','', 'YES');
  228. }else if(wOnOff=="Y"){
  229. if((wGStatus=="08") || (wGStatus=="09")){
  230. var sGuarKind = wG; //보증서종류
  231. var sGuarSeq = wSeq; //일련번호
  232. var sGuarOnoffYn = wOnOff; //온오프여부
  233. var sGuarStatus = wGStatus; //보증진행상태
  234. var sChgNo = jQuery("#MOD_NO").val(); //계약차수
  235. var style = "";
  236. var src = "";
  237. var sGrtType = "006"; // 보증종목구분 : 지급
  238. //검토대기나 완료일경우
  239. if(sGuarOnoffYn == "Y" && sGuarStatus.length > 0 && (sGuarStatus == "08" || sGuarStatus == "09")){
  240. var sOffId = wOffid; // 수신기관 ID
  241. var conRefNo = wConRefNo; // 계약번호
  242. var sGrtSeq = wSeq; // 보증차수
  243. var sMsgFuncCode = "53"; // 문서기능
  244. var sModule = "EB"; // 모듈구분코드
  245. if(sChgNo == "")
  246. sChgNo = "00";
  247. else if(sChgNo.length == 1)
  248. sChgNo = "0" + sChgNo;
  249. if(sGrtSeq.length == 1)
  250. sGrtSeq = "0" + sGrtSeq;
  251. //parameter 확인 요함
  252. src = "<%=guarUrl%>/transure/view/KSCFCView.jsp?offID="+sOffId+"&conRefNo="+conRefNo+"&conSeqNo="+sChgNo+"&grtSeq="+sGrtSeq+"&grtType="+sGrtType+"&msgFuncCode="+sMsgFuncCode+"&module="+sModule;
  253. style = "width=720,height=800, loactionbar=visible, menubar=visible, scrollbars=no";
  254. }
  255. //alert(src);
  256. var id = "WARR";
  257. var clNew = window.open(src,id,style);
  258. if(clNew == null){
  259. alert(" ▒【보증신청】페이지는 팝업창으로 구성되어 있습니다. ▒\n\n\n'팝업이 차단되었습니다. 팝업 또는 추가 옵션을 보려면 여기를 클릭하십시오.' 라는\n\n 메세지가 보일경우에는 그 메세지를 클릭하셔서 '현재 사이트의 팝업을 항상 허용'이나\n\n'임시로 팝업허용'으로 설정해주시기 바랍니다.");
  260. }else{
  261. clNew.focus();
  262. }
  263. }else{ //온라인 처음 등록
  264. var param = param + "&fevent=WARR_ON";
  265. var param = param + "&PUR_CONT_ID=" + jQuery("#PUR_CONT_ID").val();
  266. var param = param + "&MOD_NO=" + jQuery("#MOD_NO").val();
  267. url = "/portal/guar/subconPayOutOnPopup.screen"+param;
  268. fLayerPop(win_id, url, 800,700, '','', 'YES');
  269. }
  270. }
  271. }
  272. //보증정보팝업 종료후 액션
  273. function popContWarrClose(returnValue){
  274. if(returnValue == null){
  275. fLayerPopClose('subconPayOutOffPopup');
  276. }else{
  277. if(returnValue[0] == 0){
  278. fLayerPopClose('subconPayOutOffPopup');
  279. var f = document.form1;
  280. f.isSubmit = false;
  281. $("#PUR_CONT_MOD_ID").val(returnValue[2]);
  282. jQuery("#fevent").val("SHEET_WARR");
  283. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/SubconPayGuarList_sheet.screen";
  284. Modular.view.IBSheet7.doSearch(sheet2, url, jQuery("#form1"), 10, "");
  285. }
  286. }
  287. }
  288. document.body.onresize = addEvent( document.body.onresize, "auto1Resize()");
  289. </SCRIPT>
  290. <modular:search id="form1">
  291. <modular:key id="fevent" />
  292. </modular:search>
  293. <form id="form1" name="form1" method="post" modular:type="search">
  294. <INPUT type="hidden" name="fevent" id="fevent" value="">
  295. <INPUT type="hidden" name="PUR_CONT_MOD_ID" value="">
  296. <INPUT type="hidden" name="PUR_CONT_ID" value="">
  297. <INPUT type="hidden" name="MOD_NO" value="">
  298. <INPUT type='hidden' name="acct_id" value="<%= params.get("acct_id") %>">
  299. <INPUT type='hidden' name="p_cont_status" value="50">
  300. <div align="left" id="title">
  301. <ul>
  302. <li><%= storage.getPgmName() %></li>
  303. </ul>
  304. </div>
  305. <!-- 검색조건 시작 -->
  306. <table id="search-table" class="search-form-table">
  307. <colgroup>
  308. <col width="100" />
  309. <col width="*" />
  310. <col width="100" />
  311. <col width="*" />
  312. <col width="100" />
  313. </colgroup>
  314. <tr height="25">
  315. <th>현장</th>
  316. <td>
  317. <%=InputText.getSiteCodeNew("p_dept_cd", "p_dept_nm", "", user, params.get("p_dept_cd"), params.get("p_dept_nm"))%>
  318. </td>
  319. <th>계약명</th>
  320. <td>
  321. <INPUT type="text" name="p_build_nm" class="input" value="<%= params.get("p_build_nm") %>" style="width:90%">
  322. </td>
  323. <td class="button" rowspan="2">
  324. <span class="btnSearch center" id="btnSearch"><a href="javascript:void(0);">검색</a></span>
  325. <span class="btnSearch center" id="btnExcel"><a href="javascript:void(0);">엑셀</a></span>
  326. </td>
  327. </tr>
  328. <tr>
  329. <th>업체명</th>
  330. <td>
  331. <INPUT type="text" name="p_dealer_nm" class="input" value="<%= params.get("p_dealer_nm") %>" style="width:90%">
  332. </td>
  333. <th>계약기간</th>
  334. <td>
  335. <%= InputText.get("ContFromDt", params.get("ContFromDt"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  336. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('ContFromDt');">
  337. ~
  338. <%= InputText.get("ContToDt", params.get("ContToDt"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  339. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('ContToDt');">
  340. <IMG name="dataClear" id="dataClear" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
  341. </td>
  342. </tr>
  343. </table>
  344. </form>
  345. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 315px; overflow: auto;">
  346. <script>createIBSheet('sheet1','100%', '300px');</script>
  347. </div>
  348. <div id="sheet3_div" style="padding-top:5px; height: auto; min-height: 130px; overflow: auto; display:none;">
  349. <script>createIBSheet('sheet3','100%', '130px');</script>
  350. </div>