ContResultList.jsp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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. <%@ page import="kr.co.hsnc.common.config.*"%>
  12. <%@ include file="/jsp/work/taglib.jsp" %>
  13. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  14. <%
  15. ctx.init(request, response);
  16. HandlerStorage storage = ctx.getHandlerStorage();
  17. ValueObject params = storage.getParams();
  18. ValueObject user = storage.getUser();
  19. %>
  20. <SCRIPT language="JavaScript">
  21. /*예약함수*/
  22. var sheet1;
  23. var sheet1Row;
  24. var sheet1PageNo = 1;
  25. var pageLastRowIndex = 1;
  26. var validationResult = false;
  27. var filterShow = false;
  28. function _onReady(){
  29. /**
  30. * IBSheet object initialize
  31. */
  32. gridInit(sheet1);
  33. /**
  34. * Application Initialize
  35. */
  36. $("#btnSearch").click(function() {
  37. //2018.3.5수정. 모든현장 권한자 업체명으로 선택할수 있게 수정
  38. //if ("<%=user.get("right_name")%>" != "PURCHASE" && "<%=user.get("right_name")%>" != "SITE_CONT2" && "<%=user.get("right_name")%>" != "ADMIN NEW" && "<%=user.get("right_name")%>" != "DEPT_RETRIEVE"
  39. // && ("<%=user.get("right_name")%>" == "SITE_CONT" && "<%=user.get("ACCT_TYPE_ID")%>" != "2")
  40. // && jQuery("#p_dept_cd").val() == "" ){
  41. // alert("현장을 선택하십시요.");
  42. // return;
  43. //}
  44. //2019.11.18 모든현장 권한자 조건없이 조회할 수 있도록 수정 요청(견적팀 김우진 과장)
  45. //if("<%=user.get("right_name")%>" != "PURCHASE" && jQuery("#p_dept_cd").val() == "" && jQuery("#p_dealer_nm").val() == "" ){
  46. // alert("현장또는 업체명을 입력하십시요.");
  47. // return;
  48. //}
  49. if(jQuery("#p_dept_cd").val() == "" && jQuery("#p_build_nm").val() == "" && jQuery("#p_dealer_nm").val() == ""
  50. && (jQuery("#ContFromDt").val() == "" || jQuery("#ContToDt").val() == "") && jQuery("#p_cont_no").val() == "" && jQuery("#p_mr_no").val() == ""){
  51. alert("검색조건을 최소 1개 이상 입력하십시요.");
  52. return;
  53. }
  54. jQuery("#fevent").val("SHEET_SELECT");
  55. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/ContResultList_sheet.screen";
  56. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  57. });
  58. $("#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("");}});
  59. $("#p_cont_status").change(function(){$("#btnSearch").click();});
  60. $("#p_build_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == 13)$("#btnSearch").click();});
  61. $("#p_dealer_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == 13)$("#btnSearch").click();});
  62. $("#dataClear").click(function(){$("#ContFromDt").val("");$("#ContToDt").val("");});
  63. jQuery("#btnExcel").click(function() {
  64. if(sheet1.RowCount() == 0) {
  65. alert("내역이 없습니다.");
  66. return;
  67. }
  68. var params = { FileName : "ContResultList.xls", SheetName : "ContResultList", SheetDesign:0, Merge:1, DownCols:"PUR_CONT_MOD_ID|DEPT_NAME|ORD_DOC_NO|MOD_NO|CST_DOC_NAME|ORD_CON_DATE|MEMBER_NAME|ORD_SUPPLY_AMT"+
  69. "|CURRENCY_GB|WORK_START_END_DATE|STATUS_CD|TEMPLATE_NAME", TitleText:"구매_계약결과", UserMerge:"0,0,1,12", AutoSizeColumn:1 } ;
  70. sheet1.Down2Excel(params);
  71. });
  72. autoResize();
  73. //2019.11.14 추가 - 상세에서 목록으로 왔을 경우 이전검색 조회되도록
  74. if($("#p_auto_search").val() == "1"){
  75. $("#p_auto_search").val("");
  76. $("#btnSearch").click();
  77. }
  78. }
  79. /**
  80. * IBSheet object initialize
  81. */
  82. function gridInit(sheetName){
  83. var init_sheet = {};
  84. init_sheet.Cfg = {SearchMode:2, Page:100};
  85. <%-- if("<%= user.get("RIGHT_NAME")%>" == "PURCHASE" || "<%= user.get("RIGHT_NAME")%>" == "ADMIN NEW" ){ --%>
  86. init_sheet.Cols = [
  87. {Header:'Del', Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center", Hidden:"True"},
  88. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  89. {Header:'계약번호', Type:"Text", SaveName:"PUR_CONT_MOD_ID", Width:0, Align:"Center", Hidden:"True"},
  90. {Header:'현장명', Type:"Text", SaveName:"DEPT_NAME", Width:200, Align:"Left" , Edit:"false"},
  91. {Header:'계약번호', Type:"Text", SaveName:"ORD_DOC_NO", Width:120, Align:"Left", Edit:"false"},
  92. {Header:'변경차수', Type:"Text", SaveName:"MOD_NO", Width:50, Align:"Center" , Edit:"false"},
  93. {Header:'☞계약명', Type:"Text", SaveName:"CST_DOC_NAME", Width:200, Align:"Left" , Edit:"false", Cursor:"pointer"},
  94. {Header:'계약일자', Type:"Text", SaveName:"ORD_CON_DATE", Width:80, Align:"Center" , Edit:"false"},
  95. {Header:'업체명', Type:"Text", SaveName:"MEMBER_NAME", Width:100, Align:"Left" , Edit:"false"},
  96. {Header:'계약금액', Type:"Text", SaveName:"ORD_SUPPLY_AMT", Width:80, Align:"right", Edit:"false"},
  97. {Header:'통화구분', Type:"Text", SaveName:"CURRENCY_GB", Width:50, Align:"Center" , Edit:"false"},
  98. {Header:'자료', Type:"Image", SaveName:"IMG_GB", Width:50, Align:"Center" , Edit:"false", Cursor:'pointer'},
  99. {Header:'계약id', Type:"Text", SaveName:"PUR_CONT_ID", Width:50, Align:"Center" , Hidden:"True"},
  100. {Header:'계약기간', Type:"Text", SaveName:"WORK_START_END_DATE", Width:120, Align:"Center", Edit:"false"},
  101. {Header:'상태', Type:"Combo", SaveName:"STATUS_CD", Width:80, Align:"center", Edit:"false", ComboText:"계약완료", ComboCode:"50", Hidden:"True"},
  102. {Header:'지급보증', Type:"Text", SaveName:"INSUR_YN1", Width:50, Align:"center", Edit:"false"},
  103. {Header:'고용보험', Type:"Text", SaveName:"INSUR_YN", Width:50, Align:"center", Edit:"false"},
  104. {Header:'계약서종류', Type:"Text", SaveName:"TEMPLATE_NAME", Width:100, Align:"Left", Edit:"false", Cursor:"pointer"},
  105. {Header:'계약서코드', Type:"Text", SaveName:"TEMPLATE_CD", Width:80, Align:"Center", Hidden:"True"},
  106. {Header:'계약서변경여부', Type:"Text", SaveName:"CHG_CONT_YN", Width:80, Align:"Center", Hidden:"True"},
  107. {Header:'계약구분', Type:"Text", SaveName:"PAY_DIV", Width:50, Align:"Center", Edit:"false"},
  108. ];
  109. /* }
  110. else{
  111. init_sheet.Cols = [
  112. {Header:'Del', Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center", Hidden:"True"},
  113. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  114. {Header:'계약번호', Type:"Text", SaveName:"PUR_CONT_MOD_ID", Width:0, Align:"Center", Hidden:"True"},
  115. {Header:'현장명', Type:"Text", SaveName:"DEPT_NAME", Width:200, Align:"Left" , Edit:"false"},
  116. {Header:'계약번호', Type:"Text", SaveName:"ORD_DOC_NO", Width:120, Align:"Left", Edit:"false"},
  117. {Header:'변경차수', Type:"Text", SaveName:"MOD_NO", Width:50, Align:"Center" , Edit:"false"},
  118. {Header:'☞계약명', Type:"Text", SaveName:"CST_DOC_NAME", Width:200, Align:"Left" , Edit:"false", Cursor:"pointer"},
  119. {Header:'계약일자', Type:"Text", SaveName:"ORD_CON_DATE", Width:80, Align:"Center" , Edit:"false"},
  120. {Header:'업체명', Type:"Text", SaveName:"MEMBER_NAME", Width:100, Align:"Left" , Edit:"false"},
  121. {Header:'계약금액', Type:"Text", SaveName:"ORD_SUPPLY_AMT", Width:80, Align:"right", Edit:"false"},
  122. {Header:'통화구분', Type:"Text", SaveName:"CURRENCY_GB", Width:50, Align:"Center" , Edit:"false"},
  123. {Header:'계약id', Type:"Text", SaveName:"PUR_CONT_ID", Width:50, Align:"Center" , Hidden:"True"},
  124. {Header:'계약기간', Type:"Text", SaveName:"WORK_START_END_DATE", Width:120, Align:"Center", Edit:"false"},
  125. {Header:'상태', Type:"Combo", SaveName:"STATUS_CD", Width:80, Align:"center", Edit:"false", ComboText:"계약완료", ComboCode:"50", Hidden:"True"},
  126. {Header:'계약서종류', Type:"Text", SaveName:"TEMPLATE_NAME", Width:100, Align:"Left", Edit:"false", Cursor:"pointer"},
  127. {Header:'계약서코드', Type:"Text", SaveName:"TEMPLATE_CD", Width:80, Align:"Center", Hidden:"True"},
  128. {Header:'계약서변경여부', Type:"Text", SaveName:"CHG_CONT_YN", Width:80, Align:"Center", Hidden:"True"},
  129. {Header:'계약구분', Type:"Text", SaveName:"PAY_DIV", Width:50, Align:"Center", Edit:"false"},
  130. ];
  131. } */
  132. init_sheet.HeaderMode = {Sort:1};
  133. IBS_InitSheet(sheetName, init_sheet);
  134. sheetName.SetDataAutoTrim(0);
  135. sheetName.SetImageList(1,"/img/buyer/button/bt_search_right.gif");
  136. sheetName.SetActionMenu("ExcelDown");
  137. setGridSize();
  138. }
  139. /*
  140. IBSheet Event : Mouse Right Menu
  141. */
  142. function sheet1_OnSelectMenu(Text, Code) {
  143. // text 또는 code값으로 Action수행
  144. switch(Text) {
  145. case "ExcelDown":
  146. jQuery("#btnExcel").click();
  147. break;
  148. }
  149. }
  150. /**
  151. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  152. */
  153. function sheet1_OnSearchEnd(code, message) {
  154. if(code == 0) {
  155. setGridSize();
  156. sheet1.SetColFontColor("CST_DOC_NAME", "#0000ff");
  157. } else {
  158. //조회 에러 수행
  159. alert(message);
  160. }
  161. }
  162. /**
  163. * IBSheet Event: Click
  164. */
  165. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  166. if(Row == 0)return;
  167. if ((sheet1.ColSaveName(Col) == "TEMPLATE_NAME") || (sheet1.ColSaveName(Col) == "CST_DOC_NAME")) {
  168. var status = sheet1.GetCellValue(Row,8);
  169. $("#PUR_CONT_MOD_ID").val(sheet1.GetCellValue(Row, "PUR_CONT_MOD_ID"));
  170. $("#TEMPLATE_CD").val(sheet1.GetCellValue(Row, "TEMPLATE_CD"));
  171. $("#ChgCont").val(sheet1.GetCellValue(Row, "CHG_CONT_YN"));
  172. $("#p_auto_search").val("1");
  173. $("#fevent").val("FORM_SELECT");
  174. $("#form1").attr("action", "/cont/purchase/ContResult.screen");
  175. $("#form1").attr("target", "_self");
  176. $("#form1").attr("method", "get");
  177. $("#form1").submit();
  178. }else if(sheet1.ColSaveName(Col) == "IMG_GB"){
  179. var job_div = "P";
  180. 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")%>";
  181. //CellValue(Row, "SUB_CONT_ID") = '7098';
  182. job_div = "P";
  183. var popOption = "width=800, height=600, resizable=no, scrollbars=yes, status=no;";
  184. window.open(popUrl,"",popOption);
  185. }
  186. }
  187. /**
  188. * IBSheet Event Change
  189. */
  190. function sheet1_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
  191. var comboValue = sheet1.GetCellValue(Row,12);
  192. if(comboValue != "" ){
  193. sheet1.SetCellImage(Row ,13, "/img/buyer/button/bt_save_item.gif");
  194. return;
  195. }
  196. }
  197. /**
  198. * IBSheet size setting
  199. */
  200. function setGridSize() {sheet1.FitColWidth();}
  201. //자동로그인 기능
  202. function f_gologin(login_id,login_pw){
  203. var f = document.form1;
  204. if('<%= user.get("ACCT_TYPE_CODE")%>' != "ADMIN"){
  205. dlgAlert("User who logged in as administrator only can do automatic log-in.");
  206. return;
  207. }
  208. f.login_id.value = login_id;
  209. f.login_pw.value = login_pw;
  210. if( !submitXmlRequest("/sign_on_check", "", document.form1) ) {
  211. alert("Log-in is being processed.");
  212. };
  213. }
  214. function sheet1_OnSmartResize(Width, Height) {
  215. sheet1.FitColWidth();
  216. autoResize();
  217. }
  218. function autoResize(){
  219. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  220. var iframeHeight= document.body.scrollHeight - t1_height;
  221. var iframeWidth= document.body.scrollWidth;
  222. sheet1.SetSheetHeight(iframeHeight);
  223. }
  224. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  225. </SCRIPT>
  226. <modular:search id="form1">
  227. <modular:key id="fevent" />
  228. </modular:search>
  229. <form id="form1" name="form1" method="post" modular:type="search">
  230. <INPUT type="hidden" name="fevent" id="fevent" value="">
  231. <INPUT type="hidden" name="PUR_CONT_MOD_ID" value="">
  232. <INPUT type="hidden" name="TEMPLATE_CD" value="">
  233. <INPUT type='hidden' name="ChgCont">
  234. <INPUT type='hidden' name="acct_id" value="<%= params.get("acct_id") %>">
  235. <INPUT type='hidden' name="p_cont_status" value="50">
  236. <INPUT type='hidden' name="p_auto_search" id="p_auto_search" value="<%= params.get("p_auto_search") %>">
  237. <div align="left" id="title">
  238. <ul>
  239. <li>구매_계약결과</li>
  240. </ul>
  241. </div>
  242. <!-- 검색조건 시작 -->
  243. <table id="search-table" class="search-form-table">
  244. <colgroup>
  245. <col width="100" />
  246. <col width="*" />
  247. <col width="100" />
  248. <col width="*" />
  249. <col width="100" />
  250. </colgroup>
  251. <tr height="25">
  252. <th>현장</th>
  253. <td>
  254. <%=InputText.getSiteCodeNew("p_dept_cd", "p_dept_nm", "", user, params.get("p_dept_cd"), params.get("p_dept_nm"))%>
  255. </td>
  256. <th>계약명</th>
  257. <td>
  258. <INPUT type="text" name="p_build_nm" class="input" value="<%= params.get("p_build_nm") %>" style="width:90%">
  259. </td>
  260. <td class="button" rowspan="3">
  261. <span class="btnSearch center" id="btnSearch"><a href="javascript:void(0);">검색</a></span>
  262. <span class="btnSearch center" id="btnExcel"><a href="javascript:void(0);">엑셀</a></span>
  263. </td>
  264. </tr>
  265. <tr>
  266. <th>업체명</th>
  267. <td>
  268. <INPUT type="text" name="p_dealer_nm" class="input" value="<%= params.get("p_dealer_nm") %>" style="width:90%">
  269. </td>
  270. <th>계약기간</th>
  271. <td>
  272. <%= InputText.get("ContFromDt", params.get("ContFromDt"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  273. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('ContFromDt');">
  274. ~
  275. <%= InputText.get("ContToDt", params.get("ContToDt"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  276. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('ContToDt');">
  277. <IMG name="dataClear" id="dataClear" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
  278. </td>
  279. </tr>
  280. <tr>
  281. <th>계약번호</th>
  282. <td>
  283. <INPUT type="text" name="p_cont_no" class="input" value="<%= params.get("p_cont_no") %>" style="width:90%">
  284. </td>
  285. <th>MR번호</th>
  286. <td>
  287. <INPUT type="text" name="p_mr_no" class="input" value="<%= params.get("p_mr_no") %>" style="width:90%">
  288. </td>
  289. </tr>
  290. </table>
  291. </form>
  292. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 400px; overflow: auto;">
  293. <script>createIBSheet('sheet1','100%', '400px');</script>
  294. </div>