ERP-node/WebContent/WEB-INF/view/salesMng/salesBomReportList_back.jsp

221 lines
11 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page import="com.pms.common.utils.*"%>
<%@ page import="java.util.*" %>
<%@include file="/init_jqGrid.jsp"%><%--Expression Language ::: ${fn:escapeXml(str1)} --%>
<c:set var="now" value="<%=new java.util.Date() %>"/>
<c:set var="sysYear"><fmt:formatDate value="${now}" pattern="yyyy" /></c:set>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
</head>
<script type="text/javascript">
$(document).ready(function(){
fnc_changePaginationAndTotalCountArea();
$('.select2').select2();
fnc_datepick();
$("#customer_cd").change(function(){
//fnc_productUPGNEWList(this.value,"","upg_no", "");
fn_projectNameList(this.value, "project_name", "");
});
$("#project_name").change(function(){
fn_UnitCodeList(this.value, "unit_code", "");
});
if("${param.customer_cd}"!=""){
fn_projectNameList("${param.customer_cd}", "project_name","");
$("#project_name").val("${param.project_name}");
}
//조회
$("#btnSearch").click(function(){
$("#page").val("1");
fn_search();
});
grid1 = $("#grid1").jqGrid({
url: ""
,datatype: "local"
,data : $.parseJSON($("#grid1Data").val())
,colNames: ["OBJID"/* ,"년도","고객사","고객사 프로젝트명","진행사항","구분","요청납기","입고지","셋업지","설비방향","설비대수","설비타입","설비길이","제작넘버" */
,"SBR_OBJID"
,"당사프로젝트번호","요청납기","계약납기","수주회사","수주일","PO계약 No"
,"유닛명","E-BOM","배포일","설계담당자","구매BOM","작성일","구매담당자"]
,colModel: [
{name:"OBJID" , index:"", width: 0, align:"center", hidden: true, sortable:false, editable:false}
,{name:"SBR_OBJID", hidden:true, }
/* ,{name:"CM_YEAR" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"CUSTOMER_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"CUSTOMER_PROJECT_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"STATUS_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"CATEGORY_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"DUE_DATE" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"LOCATION" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"SETUP" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"FACILITY_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"FACILITY_QTY" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"FACILITY_TYPE" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"FACILITY_DEPTH" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"PRODUCTION_NO" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false} */
//프로젝트정보
,{name:"PROJECT_NO" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"REQ_DEL_DATE" , index:"", width:80, align:"center", hidden:false, sortable:false, editable:false}
,{name:"CONTRACT_DEL_DATE" , index:"", width:80, align:"center", hidden:false, sortable:false, editable:false}
,{name:"CONTRACT_COMPANY_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"CONTRACT_DATE" , index:"", width:80, align:"center", hidden:false, sortable:false, editable:false}
,{name:"PO_NO" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
//구매BOM
,{name:"UNIT_NAME" , index:"", width:160, align:"left", hidden:false, sortable:false, editable:false}
,{name:"BOM_CNT" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"DEPLOY_DATE" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"WRITER1_NAME", index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"SALES_PART_CNT" , index:"", width:80, align:"center", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"REGDATE2" , index:"", width:80, align:"center", hidden:false, sortable:false, editable:false}
,{name:"WRITER2_NAME", index:"", width:80, align:"center", hidden:false, sortable:false, editable:false}
]
,ignoreCase : true //로컬 검색 및 정렬이 대,소문자를 구분하지 않도록 하려면true
,rownumbers : true //row번호 표시
,viewrecords : true //pager가 있을경우 표시되는 record number
,autowidth : true //그리드 너비가 자동으로 부모 요소의 너비로 다시 계산
,sortable : false //마우스로 열을 끌어다 놓아 열을 재정렬
,shrinkToFit : true //모든 열은 너비에 비례하여 크기가 조정
,forceFit : false //컬럼의 width를 변화시킬때 그리드의 width를 고정 여부
,multiselect : false //선택가능. 체크박스표시
,height : 560
/* ,rowNum : "${countPerPage}" */
,rowNum : 90000
,jsonReader : {repeatitems: false}
,mtype :"POST"
,footerrow : false //바닥합계
,userDataOnFooter: true //바닥합계
//,caption :"제목"
//,pager :"#grid1Pager"
,loadComplete: function(data){ //모든 서버 요청 직후에 실행
var gid = $(this).attr("id");
var grid_wrap_div = $("#gbox_"+gid);
setTimeout("fn_jqGrid_init($('#"+gid+"'), true);", 50); //윈도우크기 비례 자동조절
//footer 커스텀..
}
});
//그리드 헤더 그룹처리
var optJson = {
useColSpanStyle: true
,groupHeaders:[
/* {startColumnName: 'CM_YEAR' , numberOfColumns:13, titleText: '<center>수주정보</center>'}, */
{startColumnName: 'PROJECT_NO', numberOfColumns: 6, titleText: '<center>프로젝트정보</center>'},
{startColumnName: 'UNIT_NAME' , numberOfColumns: 7, titleText: '<center>구매BOM</center>'}
]
};
fn_jqGrid_setGroupHeaders(grid1, optJson);
});
function fn_search(){
document.form1.action = "/salesMng/salesBomReportList.do";
document.form1.submit();
}
/*
Custom Formatter Parameters Description
◆ cellvalue: value to be formatted
◆ options : { rowId: rid, colModel: {name: , index, width, align, ...}}
◆ rowObject : row data
*/
function col_custom_fmt(cellvalue, options, rowObject) {
//console.log("rid : "+ options.rowId + " colModel["+JSON.stringify(options.colModel)+"]");
var return_fmt = "";
cellvalue = fnc_checkNull(cellvalue);
if(options.colModel.name == "BOM_CNT" ){ //E-BOM
//var url = "/partMng/setStructurePopupMainFS.do?objId="+rowObject.OBJID;
var url = "/partMng/structurePopupLeft.do?objId="+rowObject.OBJID;
var empty = ($.isNumeric(cellvalue) && Number(cellvalue) > 0) ? "" : "empty_";
return_fmt = '<a href="#" class="File file_'+empty+'icon" onclick="javascript:fn_centerPopup(800, 800, \''+url+'\', \'partBomReportFormPopup\');"></a>';
}else if(options.colModel.name == "SBR_OBJID" ){ //구매BOM
var url = "/salesMng/salesBomReportFormPopup.do?objId="+cellvalue+"&parent_objId="+rowObject.OBJID;
var empty = (fnc_checkNull(cellvalue)=="") ? "empty_" : "";
return_fmt = '<a href="#" class="File file_'+empty+'icon" onclick="javascript:fn_centerPopup(1900, 900, \''+url+'\', \'salesBomReportFormPopup\');"></a>';
}else if(options.colModel.name == "SALES_PART_CNT" ){ //구매BOM
var salesMngReportObjId = fnc_checkNull(rowObject.SBR_OBJID);
var url = "/salesMng/salesBomReportFormPopup.do?objId="+salesMngReportObjId+"&parent_objId="+rowObject.OBJID;
var empty = (fnc_checkNull(cellvalue)=="") ? "empty_" : "";
return_fmt = '<a href="#" class="File file_'+empty+'icon" onclick="javascript:fn_centerPopup(1900, 900, \''+url+'\', \'salesBomReportFormPopup\');"></a>';
}else{
return_fmt = cellvalue;
}
return return_fmt;
}
/**
unFormatter : grid1.getRowData(), getCell(n,colname) 에서 값만 나오게하는 함수
*/
function col_custom_fmt_un(cellvalue, options, cell) {
return cellvalue;
}
</script>
<body>
<form name="hiddenForm" id="hiddenForm" method="post">
<input type="hidden" name="objId" id="objId">
<input type="hidden" name="actionType" id="actionType">
<input type="hidden" name="objIds" id="objIds">
</form>
<form name="form1" id="form1" action="" method="post">
<div class="content-box">
<div class="content-box-s">
<div class="plm_menu_name">
<h2>
<span>구매관리_구매BOM관리</span>
</h2>
</div>
<div id="plmSearchZon">
<table>
<tr>
<td><label for="Year">년도</label></td>
<td>
<select name="Year" id="Year" class="select2" autocomplete="off">
<option value="">선택</option>
<c:forEach begin="${sysYear-4}" end="${sysYear}" var="req_year">
<option value="${req_year}"${param.Year eq req_year ? 'selected':'' }>${req_year}</option>
</c:forEach>
</select>
</td>
<td><label for="">고객사</label></td>
<td><select name="customer_cd" id="customer_cd" class="select2" autocomplete="off"><option value="">선택</option>${code_map.customer_cd}</select></td>
<td><label for="">당사프로젝트번호</label></td>
<td><select name="project_name" id="project_name" class="select2" style="" autocomplete="off"></td>
<td><label for="">구매담당자</label></td>
<td><select name="writer2_id" id="writer2_id" class="select2" autocomplete="off"><option value="">선택</option>${code_map.writer2_id}</select></td>
</tr>
</table>
</div>
<section class="contents_page_basic_margin">
<div class="btn_wrap">
<div class="plm_btn_wrap">
<input type="button" class="plm_btns" value="조회" id="btnSearch">
</div>
</div>
<div class="plm_table_wrap" style="overflow-x: auto;">
<table id="grid1"></table>
<!-- <div id="grid1Pager"></div> -->
<textarea style="width:0px; height:0px; visibility: hidden;" id="grid1Data">${LIST}<c:if test="${empty LIST}">[]</c:if></textarea><!-- [{},{},{}] -->
</div>
<div class="pdm_page">${PAGE_HTML}</div>
</section>
</div>
</div>
</form>
</body>
</html>