ContPriceSearch.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <%--
  2. - FileName : ContPriceSearch.jsp
  3. - Author(s) : lee mi kyoung
  4. - Date : 2016.6.24
  5. -
  6. - Description: 구매단가조회
  7. --%>
  8. <%@ page contentType="text/html; charset=utf-8" %>
  9. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  10. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  11. <%@ page import="kr.co.hsnc.common.util.*"%>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <%@ page import = "blowfishj.*"%>
  14. <%@ page import = "java.text.SimpleDateFormat"%>
  15. <%@ page import="com.udapsoft.waf.common.util.DateUtil"%>
  16. <%@ page import = "java.util.Date"%>
  17. <%@ page import = "java.util.*"%>
  18. <%@ include file="/jsp/work/taglib.jsp" %>
  19. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  20. <%
  21. ctx.init(request, response);
  22. HandlerStorage storage = ctx.getHandlerStorage();
  23. ValueObject params = storage.getParams();
  24. ValueObject user = storage.getUser();
  25. String event = storage.getEvent();
  26. RowSet materialKindCodeLv1 = storage.getRowSet("materialKindCodeLv1");
  27. RowSet materialKindCodeLv2 = new RowSetImpl();
  28. RowSet materialKindCodeLv3 = new RowSetImpl();
  29. //검색조건 작성일
  30. String initSearchDateStart = params.get("p_from_dt");
  31. String initSearchDateEnd = params.get("p_to_dt");
  32. ValueObject defaultDate = DateUtil.getDefaultPeriod();
  33. if("".equals(initSearchDateStart)){
  34. initSearchDateStart = defaultDate.get("START_DATE");
  35. }
  36. if("".equals(initSearchDateEnd)){
  37. initSearchDateEnd = defaultDate.get("END_DATE");
  38. }
  39. %>
  40. <script type="text/javascript" src="/js/creditEvaluationPop.js"></script>
  41. <script language="javascript">
  42. /*예약함수*/
  43. var sheet1 = new ibsheetObject();
  44. var sheet1Row;
  45. var sheet1PageNo = 1;
  46. var pageLastRowIndex = 1;
  47. var validationResult = false;
  48. var filterShow = false;
  49. $(document).on("keyup", "input:text", function(e) {
  50. if($(this).attr("numberOnly") == "true")
  51. {
  52. $(this).val( $(this).val().replace(/[^0-9]/gi,"") );
  53. }
  54. if (e.keyCode == 13)
  55. {
  56. $.searchList();
  57. }
  58. });
  59. $.gridInit = function(sheetName)
  60. {
  61. var init_sheet = {};
  62. init_sheet.Cfg = {SearchMode:2, MergeSheet:msHeaderOnly, Page:100};
  63. init_sheet.Cols = [
  64. {Header:'Del', Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center", Hidden:"True"},
  65. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Edit:"false", Hidden:"True"},
  66. {Header:'자재코드', Type:"Text", SaveName:"MATERIAL_CD", Width:80, Align:"Left", Edit:"false"},
  67. {Header:'자재명', Type:"Text", SaveName:"ITEM_NAME", Width:150, Align:"Left", Edit:"false"},
  68. {Header:'규격', Type:"Text", SaveName:"ITEM_SPEC", Width:80, Align:"Left", Edit:"false"},
  69. {Header:'단위', Type:"Text", SaveName:"ITEM_UNIT", Width:80, Align:"Left", Edit:"false",Hidden:"True"},
  70. {Header:'계약명', Type:"Text", SaveName:"CST_DOC_NAME", Width:200, Align:"Left", Edit:"false"},
  71. {Header:'통화', Type:"Text", SaveName:"CURRENCY_GB", Width:40, Align:"Center", Edit:"false"},
  72. {Header:'단가', Type:"Text", SaveName:"ITEM_PRICE", Width:80, Align:"Right", Edit:"false"},
  73. {Header:'단가(KRW)', Type:"Text", SaveName:"ITEM_PRICE_KRW", Width:80, Align:"Right", Edit:"false"},
  74. {Header:'업체명', Type:"Text", SaveName:"MEMBER_NAME", Width:150, Align:"Left", Edit:"false"},
  75. {Header:'현장', Type:"Text", SaveName:"DEPT_NAME", Width:150, Align:"Left", Edit:"false"},
  76. {Header:'계약일', Type:"Text", SaveName:"ORD_CON_DATE", Width:70, Align:"Center", Edit:"false"},
  77. {Header:'계약번호', Type:"Text", SaveName:"ORD_DOC_NO", Width:100, Align:"Center", Edit:"false",Hidden:"True"},
  78. {Header:'변경차수', Type:"Text", SaveName:"MOD_NO", Width:70, Align:"Center", Edit:"false"},
  79. {Header:'PUR_CONT_ID', Type:"Text", SaveName:"PUR_CONT_ID", Width:150, Align:"Center", Edit:"false",Hidden:"True"},
  80. {Header:'PUR_CONT_MOD_ID', Type:"Text", SaveName:"PUR_CONT_MOD_ID", Width:150, Align:"Center", Edit:"false",Hidden:"True"}
  81. ];
  82. init_sheet.HeaderMode = {Sort:1};
  83. IBS_InitSheet(sheetName, init_sheet);
  84. sheetName.SetDataAutoTrim(0);
  85. sheetName.SetActionMenu("ExcelDown");
  86. setGridSize();
  87. }
  88. $(function(){
  89. $("#btn_search").click(function(){
  90. $.searchList();
  91. });
  92. $("#btn_excel").click(function(){
  93. var params = {FileName:"계약단가현황.xls",SheetName:"계약단가현황",Merge:1,SheetDesign:1, HiddenColumn:1};
  94. sheet1.Down2Excel (params);
  95. });
  96. $.searchList = function()
  97. {
  98. $("#fevent").val("SHEET_SELECT");
  99. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/ContPriceSearch_sheet.screen";
  100. Modular.view.IBSheet7.doSearch(sheet1, url, $("#form1"), 30, "");
  101. }
  102. $("#material_Kind_Code_Lv1").change(function(){
  103. var f = document.form1;
  104. if($("#material_Kind_Code_Lv1").val().trim() == "")
  105. {
  106. $("#material_Kind_Code_Lv2").empty().data("options");
  107. $("#material_Kind_Code_Lv2").append("<option value=''>-- 전체 --</option>");
  108. $("#material_Kind_Code_Lv3").empty().data("options");
  109. $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
  110. }
  111. else
  112. {
  113. $("#fevent").val("GET_MATL_KIND_CODE_LV2");
  114. $("#materiallevel").val("2");
  115. $("#materialgroup").val($("#material_Kind_Code_Lv1").val());
  116. $("#material_Kind_Code_Lv3").empty().data("options");
  117. $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
  118. submitXmlRequest("/cont/purchase/ContPriceSearch_form.screen", "GET_MATL_KIND_CODE_LV2", f, "ROWSET");
  119. }
  120. });
  121. $("#material_Kind_Code_Lv2").change(function(){
  122. var f = document.form1;
  123. if($("#material_Kind_Code_Lv2").val().trim() == "")
  124. {
  125. $("#material_Kind_Code_Lv3").empty().data("options");
  126. $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
  127. $.searchList();
  128. }
  129. else
  130. {
  131. $("#fevent").val("GET_MATL_KIND_CODE_LV3");
  132. $("#materiallevel").val("3");
  133. $("#materialgroup").val($("#material_Kind_Code_Lv2").val());
  134. submitXmlRequest("/cont/purchase/ContPriceSearch_form.screen", "GET_MATL_KIND_CODE_LV3", f, "ROWSET");
  135. }
  136. });
  137. $("#material_Kind_Code_Lv3").change(function(){
  138. $.searchList();
  139. });
  140. });
  141. $(document).ready(function(){
  142. $.gridInit(sheet1);
  143. autoResize();
  144. var material_Kind_Code_Lv1 = "<%=params.get("material_Kind_Code_Lv1")%>";
  145. if(material_Kind_Code_Lv1.trim() != "")
  146. {
  147. $("#material_Kind_Code_Lv1").change();
  148. }
  149. else
  150. {
  151. //$.searchList();
  152. }
  153. });
  154. function calendar(thisDayObj){
  155. dlgCalendar(thisDayObj);
  156. }
  157. function setGridSize() {sheet1.FitColWidth();}
  158. function sheet1_OnSelectMenu(Text, Code) {
  159. // text 또는 code값으로 Action수행
  160. switch(Text) {
  161. case "ExcelDown":
  162. excelDown();
  163. break;
  164. }
  165. }
  166. function excelDown() {
  167. if(sheet1.RowCount() == 0) {
  168. alert("내역이 없습니다.");
  169. return;
  170. }
  171. var params = { FileName : "ContPriceSearch.xls", SheetName : "ContPriceSearch", SheetDesign:0, Merge:1, DownCols:"MATERIAL_CD|ITEM_NAME|ITEM_SPEC|ITEM_UNIT|CST_DOC_NAME|CURRENCY_GB|ITEM_PRICE"+
  172. "|ITEM_PRICE_KRW|MEMBER_NAME|DEPT_NAME|ORD_CON_DATE|ORD_DOC_NO|MOD_NO|PUR_CONT_ID|PUR_CONT_MOD_ID", TitleText:"구매단가조회", UserMerge:"0,0,1,15", AutoSizeColumn:1 } ;
  173. sheet1.Down2Excel(params);
  174. }
  175. function autoResize(){
  176. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  177. var iframeHeight= document.body.scrollHeight - t1_height;
  178. var iframeWidth= document.body.scrollWidth;
  179. sheet1.SetSheetHeight(iframeHeight);
  180. }
  181. function doResult(resultObj) {
  182. try {
  183. if ( resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV2" )
  184. {
  185. if ( resultObj.getSuccess() == true )
  186. {
  187. var rowSet = resultObj.getRowSet();
  188. $("#material_Kind_Code_Lv2").empty().data("options");
  189. $("#material_Kind_Code_Lv2").append("<option value=''>-- 전체 --</option>");
  190. for ( var i = 0; i < rowSet.getRowSize(); i++ )
  191. {
  192. $("#material_Kind_Code_Lv2").append("<option value='"+rowSet.getColValue( i, 0 )+"'>"+rowSet.getColValue( i, 1 ) + "</option>");
  193. }
  194. document.form1.isSubmit = false;
  195. var material_Kind_Code_Lv2 = "<%=params.get("material_Kind_Code_Lv2")%>";
  196. if(material_Kind_Code_Lv2.trim() != "")
  197. {
  198. $("#material_Kind_Code_Lv2").val(material_Kind_Code_Lv2).attr("selected", "selected");
  199. $("#material_Kind_Code_Lv2").change();
  200. }
  201. //$.searchList();
  202. } else {
  203. dlgErrorMsg(resultObj);
  204. }
  205. }
  206. else if ( resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV3" )
  207. {
  208. if ( resultObj.getSuccess() == true )
  209. {
  210. var rowSet = resultObj.getRowSet();
  211. $("#material_Kind_Code_Lv3").empty().data("options");
  212. $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
  213. for ( var i = 0; i < rowSet.getRowSize(); i++ )
  214. {
  215. $("#material_Kind_Code_Lv3").append("<option value='"+rowSet.getColValue( i, 0)+"'>"+rowSet.getColValue( i, 1 ) + "</option>");
  216. }
  217. document.form1.isSubmit = false;
  218. var material_Kind_Code_Lv3 = "<%=params.get("material_Kind_Code_Lv3")%>";
  219. if(material_Kind_Code_Lv3.trim() != "")
  220. {
  221. $("#material_Kind_Code_Lv3").val(material_Kind_Code_Lv3).attr("selected", "selected");
  222. }
  223. //$.searchList();
  224. }
  225. else if(resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV3")
  226. {
  227. dlgErrorMsg(resultObj);
  228. }
  229. }
  230. }
  231. catch(errorObject) {
  232. showErrorDlg("doResult()", errorObject);
  233. }
  234. }
  235. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  236. </script>
  237. <modular:search id="form1">
  238. <modular:key id="fevent" />
  239. </modular:search>
  240. <form id="form1" name="form1" method="post" modular:type="search">
  241. <input type="hidden" name="fevent" id="fevent" value="">
  242. <input type="hidden" name="materialgroup" id="materialgroup" value=""/>
  243. <div align="left" id="title">
  244. <ul>
  245. <li>계약단가조회</li>
  246. </ul>
  247. </div>
  248. <!-- 검색조건 시작 -->
  249. <table id="search-table" class="search-form-table">
  250. <colgroup>
  251. <col width="100" />
  252. <col width="480" />
  253. <col width="100" />
  254. <col width="*" />
  255. <col width="100" />
  256. </colgroup>
  257. <tr height="25">
  258. <th>현장</th>
  259. <td>
  260. <%=InputText.getSiteCodeNew("p_dept_cd", "p_dept_nm", "", user, params.get("p_dept_cd"), params.get("p_dept_nm"))%>
  261. </td>
  262. <th>계약명</th>
  263. <td>
  264. <INPUT type="text" name="p_cst_doc_name" class="input" value="<%= params.get("p_cst_doc_name") %>" style="width:90%">
  265. </td>
  266. <td class="button" rowspan="3">
  267. <span class="btnSearch center" id="btn_search"><a href="javascript:void(0);">검색</a></span>
  268. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_excel">엑셀</a></span>
  269. </td>
  270. </tr>
  271. <tr>
  272. <th>계약일</th>
  273. <td>
  274. <%= InputText.get("p_from_dt", initSearchDateStart, 15, 50, "Center, date, PerSize, readonly", "date", "") %>
  275. <a href="JavaScript:calendar('p_from_dt');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
  276. &nbsp;~&nbsp;
  277. <%= InputText.get("p_to_dt", initSearchDateEnd, 15, 50, "Center, date, PerSize, readonly", "date", "") %>
  278. <a href="JavaScript:calendar('p_to_dt');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
  279. </td>
  280. <th>업체명</th>
  281. <td>
  282. <INPUT type="text" name="p_member_name" class="input" value="<%= params.get("p_member_name") %>" style="width:90%">
  283. </td>
  284. </tr>
  285. <tr>
  286. <th>자재분류</th>
  287. <td>
  288. <%= HTMLMaker.getSelectTag(materialKindCodeLv1, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv1", "style='width:28%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", params.get("material_Kind_Code_Lv1"), 0) %>
  289. <%= HTMLMaker.getSelectTag(materialKindCodeLv2, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv2", "style='width:28%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", params.get("material_Kind_Code_Lv2"), 0) %>
  290. <%= HTMLMaker.getSelectTag(materialKindCodeLv3, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv3", "style='width:28%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", params.get("material_Kind_Code_Lv3"), 0) %>
  291. </td>
  292. <th>자재명/규격</th>
  293. <td>
  294. <INPUT type="text" name="p_item_name" class="input" value="<%= params.get("p_item_name") %>" style="width:65%">
  295. <INPUT type="text" name="p_item_spec" class="input" value="<%= params.get("p_item_spec") %>" style="width:25%">
  296. </td>
  297. </tr>
  298. </table>
  299. </form>
  300. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 400px; overflow: auto;">
  301. <script>createIBSheet('sheet1','100%', '400px');</script>
  302. </div>