ContIngList.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <%--
  2. - Author(s) : Kim Myung Ho
  3. - Date : 2014.07.04
  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.udapsoft.common.code.CommCodeManager" %>
  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. //계약 상태 List
  20. RowSet statusRow = CommCodeManager.getCodeRowsetStatic("CONT_STATUS_CD", "CHG_CODE01", "2");
  21. %>
  22. <SCRIPT language="JavaScript">
  23. /*예약함수*/
  24. var sheet1;
  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. gridInit(sheet1);
  35. /**
  36. * Application Initialize
  37. */
  38. $("#btnSearch").click(function() {
  39. jQuery("#fevent").val("SHEET_SELECT");
  40. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/ContIngList_sheet.screen";
  41. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  42. });
  43. $("#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("");}});
  44. $("#p_cont_status").change(function(){$("#btnSearch").click();});
  45. $("#p_build_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == 13)$("#btnSearch").click();});
  46. $("#p_dealer_nm").keydown(function (event){var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == 13)$("#btnSearch").click();});
  47. $("#btnSearch").click();
  48. $("#dataClear").click(function(){$("#ContFromDt").val("");$("#ContToDt").val("");});
  49. jQuery("#btnExcel").click(function() {
  50. if(sheet1.RowCount() == 0) {
  51. alert("내역이 없습니다.");
  52. return;
  53. }
  54. var params = { FileName : "ContIngList.xls", SheetName : "ContIngList", 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"+
  55. "|CURRENCY_GB|WORK_START_END_DATE|TEMPLATE_NAME|STATUS_CD_NM", TitleText:"구매_계약현황", UserMerge:"0,0,1,12", AutoSizeColumn:1 } ;
  56. sheet1.Down2Excel(params);
  57. });
  58. $("#user_check").click(function() {
  59. if($("#user_check").is(":checked") == true){
  60. $("#user_check").val("true");
  61. }else{
  62. $("#user_check").val("false");
  63. }
  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:50, Align:"Center", Hidden:"True"},
  75. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  76. {Header:'계약번호', Type:"Text", SaveName:"PUR_CONT_MOD_ID", Width:0, Align:"Center", Hidden:"True"},
  77. {Header:'현장명', Type:"Text", SaveName:"DEPT_NAME", Width:200, Align:"Left" , Edit:"false"},
  78. {Header:'계약번호', Type:"Text", SaveName:"ORD_DOC_NO", Width:145, Align:"Left", Edit:"false"},
  79. {Header:'변경차수', Type:"Text", SaveName:"MOD_NO", Width:50, Align:"Center" , Edit:"false"},
  80. {Header:'☞계약명', Type:"Text", SaveName:"CST_DOC_NAME", Width:200, Align:"Left" , Edit:"false", Cursor:"pointer"},
  81. {Header:'계약일자', Type:"Text", SaveName:"ORD_CON_DATE", Width:70, Align:"Center" , Edit:"false"},
  82. {Header:'업체명', Type:"Text", SaveName:"MEMBER_NAME", Width:100, Align:"Left" , Edit:"false"},
  83. {Header:'계약금액', Type:"Text", SaveName:"ORD_SUPPLY_AMT", Width:80, Align:"right", Edit:"false"},
  84. {Header:'통화구분', Type:"Text", SaveName:"CURRENCY_GB", Width:50, Align:"Center" , Edit:"false"},
  85. {Header:'계약기간', Type:"Text", SaveName:"WORK_START_END_DATE", Width:130, Align:"Center", Edit:"false"},
  86. {Header:'전자계약\n여부', Type:"Combo", SaveName:"ELEC_CON_YN", Width:60, Align:"Center", Edit:"false", ComboText:"온라인|오프라인" , ComboCode:"Y|N"},
  87. {Header:'계약서종류', Type:"Text", SaveName:"TEMPLATE_NAME", Width:100, Align:"Left", Edit:"false", Cursor:"pointer"},
  88. {Header:'상태', Type:"Text", SaveName:"STATUS_CD_NM", Width:70, Align:"center", Edit:"false"},
  89. {Header:'계약서코드', Type:"Text", SaveName:"TEMPLATE_CD", Width:80, Align:"Center", Hidden:"True"},
  90. {Header:'계약서변경여부', Type:"Text", SaveName:"CHG_CONT_YN", Width:80, Align:"Center", Hidden:"True"},
  91. {Header:'지급구분', Type:"Text", SaveName:"PAY_DIV", Width:80, Align:"Center" },
  92. ];
  93. init_sheet.HeaderMode = {Sort:1};
  94. IBS_InitSheet(sheetName, init_sheet);
  95. sheetName.SetDataAutoTrim(0);
  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("CST_DOC_NAME", "#0000ff");
  117. } else {
  118. //조회 에러 수행
  119. alert(message);
  120. }
  121. }
  122. /**
  123. * IBSheet Event: Click
  124. */
  125. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  126. if(Row == 0)return;
  127. if ((sheet1.ColSaveName(Col) == "TEMPLATE_NAME") || (sheet1.ColSaveName(Col) == "CST_DOC_NAME")) {
  128. var status = sheet1.GetCellValue(Row,8);
  129. $("#PUR_CONT_MOD_ID").val(sheet1.GetCellValue(Row, "PUR_CONT_MOD_ID"));
  130. $("#TEMPLATE_CD").val(sheet1.GetCellValue(Row, "TEMPLATE_CD"));
  131. $("#ChgCont").val(sheet1.GetCellValue(Row, "CHG_CONT_YN"));
  132. $("#fevent").val("FORM_SELECT");
  133. $("#form1").attr("action", "/cont/purchase/ContDetail.screen");
  134. $("#form1").attr("target", "_self");
  135. $("#form1").attr("method", "get");
  136. $("#form1").submit();
  137. }
  138. }
  139. /**
  140. * IBSheet Event Change
  141. */
  142. function sheet1_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
  143. var comboValue = sheet1.GetCellValue(Row,12);
  144. if(comboValue != "" ){
  145. sheet1.SetCellImage(Row ,13, "/img/buyer/button/bt_save_item.gif");
  146. return;
  147. }
  148. }
  149. /**
  150. * IBSheet size setting
  151. */
  152. function setGridSize() {sheet1.FitColWidth();}
  153. //자동로그인 기능
  154. function f_gologin(login_id,login_pw){
  155. var f = document.form1;
  156. if('<%= user.get("ACCT_TYPE_CODE")%>' != "ADMIN"){
  157. dlgAlert("User who logged in as administrator only can do automatic log-in.");
  158. return;
  159. }
  160. f.login_id.value = login_id;
  161. f.login_pw.value = login_pw;
  162. if( !submitXmlRequest("/sign_on_check", "", document.form1) ) {
  163. alert("Log-in is being processed.");
  164. };
  165. }
  166. function sheet1_OnSmartResize(Width, Height) {
  167. sheet1.FitColWidth();
  168. autoResize();
  169. }
  170. function autoResize(){
  171. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  172. var iframeHeight= document.body.scrollHeight - t1_height;
  173. var iframeWidth= document.body.scrollWidth;
  174. sheet1.SetSheetHeight(iframeHeight);
  175. }
  176. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  177. </SCRIPT>
  178. <modular:search id="form1">
  179. <modular:key id="fevent" />
  180. </modular:search>
  181. <form id="form1" name="form1" method="post" modular:type="search">
  182. <INPUT type="hidden" name="fevent" id="fevent" value="">
  183. <INPUT type="hidden" name="PUR_CONT_MOD_ID" value="">
  184. <INPUT type="hidden" name="TEMPLATE_CD" value="">
  185. <INPUT type='hidden' name="ChgCont">
  186. <INPUT type='hidden' name="acct_id" value="<%= params.get("acct_id") %>">
  187. <div align="left" id="title">
  188. <ul>
  189. <li>구매_계약현황</li>
  190. </ul>
  191. </div>
  192. <!-- 검색조건 시작 -->
  193. <table id="search-table" class="search-form-table">
  194. <colgroup>
  195. <col width="100" />
  196. <col width="*" />
  197. <col width="100" />
  198. <col width="*" />
  199. <col width="100" />
  200. <col width="*" />
  201. <col width="100" />
  202. </colgroup>
  203. <tr height="25">
  204. <th>현장</th>
  205. <td>
  206. <%=InputText.getSiteCodeNew("p_dept_cd", "p_dept_nm", "", user, params.get("p_dept_cd"), params.get("p_dept_nm"))%>
  207. </td>
  208. <th>계약명</th>
  209. <td>
  210. <INPUT type="text" name="p_build_nm" class="input" value="<%= params.get("p_build_nm") %>" style="width:90%">
  211. </td>
  212. <th>상태</th>
  213. <td>
  214. <%= HTMLMaker.getSelectTag(statusRow, "DETAILCD", "DETAILNM", "p_cont_status", "width:150px;height=18;", "<option value='10,15,18,20,30,40,41'>전체</option>", params.get("p_cont_status")) %>
  215. </td>
  216. <td class="button" rowspan="2">
  217. <span class="btnSearch center" id="btnSearch"><a href="javascript:void(0);">검색</a></span>
  218. <span class="btnSearch center" id="btnExcel"><a href="javascript:void(0);">엑셀</a></span>
  219. </td>
  220. </tr>
  221. <tr>
  222. <th>업체명</th>
  223. <td>
  224. <INPUT type="text" name="p_dealer_nm" class="input" value="<%= params.get("p_dealer_nm") %>" style="width:90%">
  225. </td>
  226. <th>계약기간</th>
  227. <td>
  228. <%= InputText.get("ContFromDt", params.get("ContFromDt"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  229. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('ContFromDt');">
  230. ~
  231. <%= InputText.get("ContToDt", params.get("ContToDt"), 10, 50, "hangule,center, desc=계약일자,ReadOnly") %>
  232. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('ContToDt');">
  233. <IMG name="dataClear" id="dataClear" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
  234. </td>
  235. <th>전체조회</th>
  236. <td>
  237. <input type="checkbox" id="user_check" name="user_check" value="false">
  238. </td>
  239. </tr>
  240. </table>
  241. </form>
  242. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 400px; overflow: auto;">
  243. <script>createIBSheet('sheet1','100%', '400px');</script>
  244. </div>