123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- <%--
- - FileName : StockList.jsp
- - Author : gyeongmo an
- - Date : 2014.07.15
- - Copyright : Copyright (c) 2014 www.udapsoft.co.kr, Inc.
- - All rights reserved.
- - Description: 입고현황
- --%>
- <%@ page contentType="text/html; charset=utf-8" %>
- <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
- <%@ page import="com.udapsoft.waf.common.ui.*" %>
- <%@ page import="kr.co.udapsoft.common.code.*" %>
- <%@ page import="kr.co.hsnc.common.util.*"%>
- <%@ page import="kr.co.hsnc.common.sql.*" %>
- <%@ include file="/jsp/work/taglib.jsp" %>
- <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
- <%
- ctx.init(request, response);
- HandlerStorage storage = ctx.getHandlerStorage();
- ValueObject params = storage.getParams();
- ValueObject user = storage.getUser();
- String fevent = storage.getEvent();
-
- RowSet materialKindCodeLv1 = storage.getRowSet("materialKindCodeLv1");
- RowSet materialKindCodeLv2 = new RowSetImpl();
- RowSet materialKindCodeLv3 = new RowSetImpl();
- %>
- <SCRIPT language="JavaScript">
- /*예약함수*/
- var sheet1;
- var sheet1Row;
- var sheet1PageNo = 1;
- var pageLastRowIndex = 1;
- var validationResult = false;
- var filterShow = false;
-
- $(function(){
-
- $("#material_Kind_Code_Lv1").change(function(){
-
- var f = document.form1;
- if($("#material_Kind_Code_Lv1").val().trim() == "")
- {
- $("#material_Kind_Code_Lv2").empty().data("options");
- $("#material_Kind_Code_Lv2").append("<option value=''>-- 전체 --</option>");
-
- $("#material_Kind_Code_Lv3").empty().data("options");
- $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
- }
- else
- {
- $("#fevent").val("GET_MATL_KIND_CODE_LV2");
-
- $("#materiallevel").val("2");
- $("#materialgroup").val($("#material_Kind_Code_Lv1").val());
-
- $("#material_Kind_Code_Lv3").empty().data("options");
- $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
- submitXmlRequest("/cont/purchase/ContPriceSearch_form.screen", "GET_MATL_KIND_CODE_LV2", f, "ROWSET");
- }
- });
-
- $("#material_Kind_Code_Lv2").change(function(){
-
- var f = document.form1;
-
- if($("#material_Kind_Code_Lv2").val().trim() == "")
- {
- $("#material_Kind_Code_Lv3").empty().data("options");
- $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
-
- $.searchList();
- }
- else
- {
- $("#fevent").val("GET_MATL_KIND_CODE_LV3");
-
- $("#materiallevel").val("3");
- $("#materialgroup").val($("#material_Kind_Code_Lv2").val());
-
- submitXmlRequest("/cont/purchase/ContPriceSearch_form.screen", "GET_MATL_KIND_CODE_LV3", f, "ROWSET");
- }
- });
-
-
- $("#material_Kind_Code_Lv3").change(function(){
- //jQuery("#btnSearch").click();
- });
-
- });
-
- function _onReady(){
- gridInit(sheet1);
- var f = document.form1;
-
- jQuery("#btnSearch").click(function() {
- jQuery("#fevent").val("GET_DATA_LIST");
- var url = Modular.model.PageContext.CONTEXT_ROOT + "/warehouse/purchase/StockList_sheet.screen";
- Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 10, "");
- });
-
- jQuery("#btnExcel").click(function() {
- if(sheet1.RowCount() == 0) {
- alert("내역이 없습니다.");
- return;
- }
- var params = { FileName : "StockList.xls", SheetName : "StockList", SheetDesign:0, Merge:1, DownCols:"dept_nm|vendor_name|pay_item|pay_item_desc|cst_doc_name|material_cd|material_name|"+
- "material_spec|unit_kind_name|stock_date|stock_qty|remarks", TitleText:"입고 현황", UserMerge:"0,0,1,12", AutoSizeColumn:1 } ;
- sheet1.Down2Excel(params);
- });
- $("#dataClear2").click(function(){$("#sYmdSt").val("");$("#sYmdEd").val("");});
-
- jQuery("#btnSearch").click();
-
- autoResize();
- }
-
- function gridInit(sheetName){
- var init_sheet = {};
- init_sheet.Cfg = {SearchMode:2, Page:10};
- init_sheet.Cols = [
- {Header:'현장', Type:"Text", SaveName:"dept_nm", Width:150, Align:"Left"},
- {Header:'거래처', Type:"Text", SaveName:"vendor_name", Width:150, Align:"Left"},
- {Header:'Pay Item', Type:"Text", SaveName:"pay_item", Width:100, Align:"Center"},
- {Header:'Pay Desc', Type:"Text", SaveName:"pay_item_desc", Width:100, Align:"Center"},
- {Header:'계약명', Type:"Text", SaveName:"cst_doc_name", Width:150, Align:"Left"},
- {Header:'자재코드', Type:"Text", SaveName:"material_cd", Width:90, Align:"Center"},
- {Header:'자재명', Type:"Text", SaveName:"material_name", Width:120, Align:"Left"},
- {Header:'규격', Type:"Text", SaveName:"material_spec", Width:50, Align:"Left"},
- {Header:'단위', Type:"Text", SaveName:"unit_kind_name", Width:50, Align:"Center"},
- {Header:'일자', Type:"Date", SaveName:"stock_date", Width:90, Align:"Center"},
- {Header:'수량', Type:"AutoSum", SaveName:"stock_qty", Width:50, Align:"Right"},
- {Header:'비고', Type:"Text", SaveName:"remarks", Width:150, Align:"Left"},
- {Header:'H_입고ID', Type:"Text", SaveName:"stock_id", Width:100, Align:"Center", Hidden:"True"},
- {Header:'H_현장코드', Type:"Text", SaveName:"dept_cd", Width:100, Align:"Center", Hidden:"True"},
- {Header:'H_거래처코드', Type:"Text", SaveName:"vendor_cd", Width:100, Align:"Center", Hidden:"True"}
- ];
-
- init_sheet.HeaderMode = {Sort:1};
- IBS_InitSheet(sheetName, init_sheet);
- sheetName.SetDataAutoTrim(0);
- sheetName.SetEditable(false);
-
- var info = [{StdCol:"dept_nm", SumCols:"stock_qty", CaptionCol:"dept_nm"}];
- sheet1.ShowSubSum(info);
-
- sheet1.SetActionMenu("ExcelDown");
-
- setGridSize();
- }
-
- function sheet1_OnSearchEnd(code, message) {
- if(code == 0) {
-
- //소계 머지
- var str = "";
- for(var i=1; i<sheet1.LastRow(); i++) {
- str = sheet1.GetCellText(i, "dept_nm");
- if(str.indexOf("소계:") > -1) {
- sheet1.SetCellAlign(i,0,"Center");
- sheet1.SetCellText(i, "dept_nm", "소 계 : ");
- sheet1.SetMergeCell(i,0,1,10);
- }
- }
-
- //합계 머지
- sheet1.SetCellText(sheet1.LastRow(), "dept_nm", "합 계");
- sheet1.SetMergeCell(sheet1.LastRow(), 0, 1, 10);
- sheet1.SetCellAlign(sheet1.LastRow(), 0, "Center");
-
- setGridSize();
- } else {
- alert(message);
- }
- }
-
- function setGridSize() {
- sheet1.FitColWidth();
- }
-
- function doKeyPress() {
- if( event.keyCode == 13 ) {
- jQuery("#btnSearch").click();
- }
- }
-
- function sheet1_OnSmartResize(Width, Height) {
- sheet1.FitColWidth();
- autoResize();
-
- }
- function autoResize(){
- var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
- var iframeHeight= document.body.scrollHeight - t1_height;
- var iframeWidth= document.body.scrollWidth;
-
- sheet1.SetSheetHeight(iframeHeight);
- }
-
- function suppChoicePop(){
- var win_id = "corp";
- var link = "/common/corp/SuppChoicePop.screen";
- fLayerPop(win_id, link, 800,400, '', '', 'NO');
- }
-
- $.test = function(resultVal)
- {
- var f=document.form1;
- f.corp_id.value = resultVal[0][0];
- f.corp_name.value = resultVal[2][0];
- };
-
- function doSearchMaterialCode() {
- var win_id = "_search_material_cd";
- var link = "/lib/dlgSearchMaterialCd.screen";
- link += "?pop_win_id="+win_id;
- fLayerPop(win_id, link, 800,400, '', '', 'NO');
- }
-
- function doSearchMaterialCodeClose(resultValue) {
- var f=document.form1;
- if(resultValue == null) {
- f.material_cd.value = "";
- f.material_nm.value = "";
- } else {
- f.material_cd.value = resultValue[0];
- f.material_nm.value = resultValue[1];
- }
-
- fLayerPopClose('_search_material_cd');
- }
-
- function sheet1_OnSelectMenu(Text, Code) {
- switch(Text) {
- case "ExcelDown":
- jQuery("#btnExcel").click();
- break;
- }
- }
- function doResult(resultObj) {
- try {
- if ( resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV2" )
- {
- if ( resultObj.getSuccess() == true )
- {
- var rowSet = resultObj.getRowSet();
- $("#material_Kind_Code_Lv2").empty().data("options");
- $("#material_Kind_Code_Lv2").append("<option value=''>-- 전체 --</option>");
-
- for ( var i = 0; i < rowSet.getRowSize(); i++ )
- {
- $("#material_Kind_Code_Lv2").append("<option value='"+rowSet.getColValue( i, 0 )+"'>"+rowSet.getColValue( i, 1 ) + "</option>");
- }
- document.form1.isSubmit = false;
-
- var material_Kind_Code_Lv2 = "<%=params.get("material_Kind_Code_Lv2")%>";
-
- if(material_Kind_Code_Lv2.trim() != "")
- {
- $("#material_Kind_Code_Lv2").val(material_Kind_Code_Lv2).attr("selected", "selected");
- $("#material_Kind_Code_Lv2").change();
- }
-
- //$.searchList();
-
- } else {
- dlgErrorMsg(resultObj);
- }
- }
- else if ( resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV3" )
- {
- if ( resultObj.getSuccess() == true )
- {
- var rowSet = resultObj.getRowSet();
-
- $("#material_Kind_Code_Lv3").empty().data("options");
- $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
-
- for ( var i = 0; i < rowSet.getRowSize(); i++ )
- {
- $("#material_Kind_Code_Lv3").append("<option value='"+rowSet.getColValue( i, 0)+"'>"+rowSet.getColValue( i, 1 ) + "</option>");
- }
-
- document.form1.isSubmit = false;
-
- var material_Kind_Code_Lv3 = "<%=params.get("material_Kind_Code_Lv3")%>";
-
- if(material_Kind_Code_Lv3.trim() != "")
- {
- $("#material_Kind_Code_Lv3").val(material_Kind_Code_Lv3).attr("selected", "selected");
- }
-
- //$.searchList();
- }
- else if(resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV3")
- {
- dlgErrorMsg(resultObj);
- }
- }
- }
- catch(errorObject) {
- showErrorDlg("doResult()", errorObject);
- }
- }
-
- document.body.onresize = addEvent( document.body.onresize, "autoResize()");
- </SCRIPT>
- <modular:search id="form1">
- <modular:key id="fevent" />
- </modular:search>
- <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
- <INPUT type="hidden" name="fevent">
- <div align="left" id="title">
- <ul>
- <li>입고 현황</li>
- </ul>
- </div>
- <!-- 검색조건 시작 -->
- <table id="search-table" class="search-form-table">
- <colgroup>
- <col width="100" />
- <col width="350" />
- <col width="100" />
- <col width="*" />
- <col width="200" />
- </colgroup>
- <tr>
- <th>현장</th>
- <td>
- <%=InputText.getSiteCodeNew("dept_cd", "dept_name", "", user, params.get("dept_cd"), params.get("dept_name"))%>
- </td>
- <th>입고일자</th>
- <td>
- <%= InputText.get("sYmdSt", params.get("sYmdSt"), 10, 50, "hangule,center, desc=기간,ReadOnly") %>
- <IMG name="sYmdSt_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('sYmdSt');">
- ~
- <%= InputText.get("sYmdEd", params.get("sYmdEd"), 10, 50, "hangule,center, desc=기간,ReadOnly") %>
- <IMG name="sYmdEd_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('sYmdEd');">
- <IMG name="dataClear2" id="dataClear2" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
- </td>
- <td class="button" rowspan="3">
- <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btnExcel">엑셀</a></span>
- </td>
- </tr>
- <tr>
- <th>계약명</th>
- <td>
- <input type='text' id="cst_doc_name" name="cst_doc_name" class="input" style="width:90%" onkeypress="doKeyPress()">
- </td>
- <th>거래처</th>
- <td>
- <%= InputText.get("corp_name", params.get("corp_name"), 50, 50, "hangule,left, desc=거래처") %>
- </td>
- </tr>
- <tr>
- <th>자재분류</th>
- <td>
- <%= HTMLMaker.getSelectTag(materialKindCodeLv1, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv1", "style='width:28%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", params.get("material_Kind_Code_Lv1"), 0) %>
- <%= HTMLMaker.getSelectTag(materialKindCodeLv2, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv2", "style='width:28%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", params.get("material_Kind_Code_Lv2"), 0) %>
- <%= HTMLMaker.getSelectTag(materialKindCodeLv3, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv3", "style='width:28%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", params.get("material_Kind_Code_Lv3"), 0) %>
- </td>
- <th>자재명</th>
- <td>
- <%= InputText.get("material_cd", "","", 15, 255, "class=input byteChk, perSize", "onkeypress=\"doKeyPress();\" onClick=\"\"") %>
- <%= InputText.get("material_nm", "","", 45, 255, "class=input byteChk, perSize", "onkeypress=\"doKeyPress();\" onClick=\"\"") %>
- <IMG id='search_spot_button' onClick="doSearchMaterialCode();" src='/img/buyer/button/bt_search_right.gif' border='0' align='absmiddle' alt='[자재코드]' style='cursor:pointer;'>
- </td>
- </tr>
- </table>
- <!-- 검색조건 종료 -->
-
- <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
- <script>createIBSheet('sheet1','100%', '350px');</script>
- </div>
- </FORM>
|