ERP-node/WebContent/WEB-INF/view/part/partList.jsp

451 lines
15 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="com.pms.common.utils.*"%>
<%@include file="/init.jsp"%>
<%
System.out.println("/part/partList.jsp");
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><%=Constants.SYSTEM_NAME%></title>
<c:set var="search_oem" value="${empty param.search_oem ? '' : param.search_oem}" />
<c:set var="search_car" value="${empty param.search_car ? '' : param.search_car}" />
<style type="text/css">
::-webkit-scrollbar-thumb {
background: linear-gradient(to bottom, #f5d78e, #f5d78e);
}
</style>
<script type="text/javascript">
$(function(){
$(document).ready(function(){
fnc_datepick();
getCarList("${search_oem}","${search_car}");
$("input[type=text]").keyup(function(e){
if(e.keyCode == 13) search();
});
//image src encoding
$("img").each(function(i){
var imgSrc = $(this).attr("data-SRC");
$(this).attr("src", encodeURI(imgSrc));
});
$(".btnRevision").click(function(){
var partNo = $(this).attr("data-PART_NO");
fn_openPartListPop(partNo);
});
});
getChangeProductList("search_product","${param.search_productFamily}","${param.search_product}");
});
function openPartFormPopup(actionType,objid){
var hiddenForm = document.hiddenForm;
var url = "/part/partFormPopup.do";
var target = "tempPartListPopup";
if("" != objid){
url = "/part/partDetailViewPopup.do";
target = objid;
}
window.open(url,target,"width=720, height=800, menubars=no, scrollbars=yes, resizable=yes");
hiddenForm.action = url;
hiddenForm.actionType.value = actionType;
hiddenForm.objid.value = objid;
hiddenForm.target = target;
hiddenForm.submit();
}
function search(){
var form = document.form1;
$("#search_partNo").val($.trim($("#search_partNo").val()));
$("#search_partName").val($.trim($("#search_partName").val()));
form.actionType.value = ""
form.target = "_self";
form.action = "/part/partList.do";
form.submit();
}
function excelExport(){
var form = document.form1;
form.target = "_self";
form.actionType.value = "excel"
form.action = "/part/partList.do";
form1.submit();
}
function getCarList(oemObjid,carObjid){
var carSelectObj = $("#car_objid");
$(carSelectObj).find("option").remove();
$(carSelectObj).append("<option value=''>선택</option>");
if("" == oemObjid || null == oemObjid){
return false;
}else{
$.ajax({
type : "POST",
url : "/admin/getOEMsCarList.do",
data:{ "status" : "active" , "oemObjId" : oemObjid},
dataType:"json",
async:false,
error: function(jqxhr, status, error){
//이거 풀면 404에러가 나오게 됩니다
/* Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText); */
},
success: function(result){
if(null != result){
for(var i=0;i<result.length;i++){
var objid = result[i].OBJID;
var carName = result[i].CAR_NAME;
var carCode = result[i].CAR_CODE;
$(carSelectObj).append("<option value='"+objid+"'>"+carCode+"</option>");
}
if("" != carObjid){
$(carSelectObj).val(carObjid);
}
}
}
});
}
}
function getChangeProductList(areaObjId,productGroupObjId,targetProductObjId){
$("#"+areaObjId).find("option").remove();
$("#"+areaObjId).append("<option value=''>선택</option>");
if("" != productGroupObjId && null != productGroupObjId){
$.ajax({
type : "POST",
/* url : "/common/getProductList_combo.do", */
url : "/specData/getProductList.do",
/* data:{"search_productGroupObjId" : productGroupObjId, "isJson":true}, */
data:{"productGroupObjid" : productGroupObjId , "status" : "active"},
dataType:"json",
async:false,
error: function(jqxhr, status, error){
//이거 풀면 404에러가 나오게 됩니다
/* Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText); */
},
success: function(result){
if(null != result){
for(var i=0;i<result.length;i++){
var resultAppendText = "";
var productName = result[i].PRODUCT_NAME;
var selectedFlag = "";
if(targetProductObjId == result[i].OBJID){
selectedFlag = "selected";
}
resultAppendText="<option value='"+result[i].OBJID+"' "+selectedFlag+">"+productName+"</option>";
$("#"+areaObjId).append(resultAppendText);
}
}
}
});
}
}
function openEOPopup(objId,actionType){
var hiddenForm = document.hiddenForm;
var target = "tempEoListPopup";
var url = "/eo/eoDetailViewPopup.do";
window.open("",target,"width=1500,height=700");
hiddenForm.objId.value = objId;
hiddenForm.actionType.value = actionType;
hiddenForm.action = url;
hiddenForm.target = target;
hiddenForm.submit();
}
function openImagePopUp(url){
var img=new Image();
img.src=url;
var img_width=img.width;
var img_height=img.height;
var win_width=img.width+25;
var height=img.height+30;
window.open(url,"partListShapeImgPopUp","width="+img_width+",height="+height+", menubars=no, scrollbars=yes, resizable=yes'");
}
//Revision 클릭 시 해당 파트의 모든 Revision을 보여준다.
function fn_openPartListPop(partNo){
window.open("/part/openRevisionPartPopUp.do?partNo="+partNo,"openPartListPop","width=1500 height=560 menubar=no status=no");
}
</script>
</head>
<body class="backcolor">
<form name="hiddenForm" id="hiddenForm" method="post">
<input type="hidden" name="actionType" id="actionType">
<input type="hidden" name="objId" id="objId">
<input type="hidden" name="objid" id="objid">
</form>
<form name="form1" id="form1" method="post">
<input type="hidden" name="actionType">
<section class="min_part_enroll" style="min-width:2000px;">
<div class="plm_menu_name">
<h2>
<span>Part 조회</span>
</h2>
</div>
<div id="plmSearchZon">
<table>
<tbody>
<tr>
<td class="align_r">
<label for="" class="">고객사</label>
</td>
<td>
<select name="search_oem" id="search_oem" onchange="getCarList(this.value,'${param.search_car}')">
<c:choose>
<c:when test="${empty oemList}">
<option value="">선택</option>
</c:when>
<c:otherwise>
<option value="">선택</option>
<c:forEach var="item" items="${oemList}" varStatus="varStatus">
<option value="${item.OBJID}" ${item.OBJID eq param.search_oem ? 'selected':''}>${item.OEM_NAME}(${item.OEM_CODE})</option>
</c:forEach>
</c:otherwise>
</c:choose>
</select>
</td>
<td class="align_r">
<label for="" class="">차종</label>
</td>
<td>
<select name="car_objid" id="car_objid">
<option value="">전체</option>
</select>
</td>
<td class="align_r">
<label for="" class="">제품군</label>
</td>
<td>
<select name="search_productFamily" id="search_productFamily" onchange="getChangeProductList('search_product',this.value,'${param.search_product}')">
<c:choose>
<c:when test="${empty productGroupList}">
<option value="">선택</option>
</c:when>
<c:otherwise>
<option value="">선택</option>
<c:forEach var="item" items="${productGroupList}" varStatus="varStatus">
<option value="${item.OBJID}" ${item.OBJID eq param.search_productFamily ? 'selected':''}>${item.PRODUCT_GROUP_NAME}</option>
</c:forEach>
</c:otherwise>
</c:choose>
</select>
</td>
<td class="align_r">
<label for="" class="">제품</label>
</td>
<td>
<select name="search_product" id="search_product">
<option value="">선택</option>
</select>
</td>
<td class="align_r">
<label for="" class="">품번</label>
</td>
<td>
<input type="text" name="search_partNo" id="search_partNo" value="${param.search_partNo}"/>
</td>
<td class="align_r">
<label for="" class="">품명</label>
</td>
<td colspan="3">
<input type="text" name="search_partName" id="search_partName" value="${param.search_partName}"/>
</td>
</tr>
<tr>
<td class="align_r">
<label for="" class="">재질</label>
</td>
<td>
<select name="search_material" id="search_material">
<c:choose>
<c:when test="${empty materialList}">
<option value="">선택</option>
</c:when>
<c:otherwise>
<option value="">선택</option>
<c:forEach var="item" items="${materialList}" varStatus="varStatus">
<option value="${item.OBJID}" ${item.OBJID eq param.search_material ? 'selected':''}>${item.MATERIAL_NAME}</option>
</c:forEach>
</c:otherwise>
</c:choose>
</select>
</td>
<td class="align_r">
<label for="" class="">ECO.No</label>
</td>
<td>
<input type="text" name="search_eoNo" id="search_eoNo" value="${param.search_eoNo}"/>
</td>
<td class="align_r">
<label for="" class="">출도구분</label>
</td>
<td>
<select name="search_drawReleaseType" id="search_drawReleaseType">
<option value="" ${'' eq param.search_drawReleaseType ? 'selected':''}>전체</option>
<option value="dev" ${'dev' eq param.search_drawReleaseType ? 'selected':''}>개발</option>
<option value="product" ${'product' eq param.search_drawReleaseType ? 'selected':''}>양산</option>
</select>
</td>
<td class="align_r">
<label for="" class="">Rev</label>
</td>
<td>
<select name="search_isLast" id="search_isLast">
<option value="current" ${'current' eq param.search_isLast ? 'selected':''}>Current</option>
<option value="all" ${'all' eq param.search_isLast ? 'selected':''}>All</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
<div class="contents_page_basic_margin">
<div style="float:left; line-height:49px"><font size="1.7px">총 <span>${fn:length(partList)}</span>건</font></div>
<div class="btn_wrap">
<div class="plm_btn_wrap">
<input type="button" value="조회" class="plm_btns" onclick="search();">
<input type="button" value="Excel Export" class="plm_btns" onclick="excelExport()">
</div>
</div>
<div class="plm_table_wrap">
<table class="plm_table" style="width:100%;">
<colgroup>
<col width="2%" />
<col width="5%" />
<col width="15%" />
<col width="7%" /> <!-- 형상 -->
<col width="5%" /> <!-- ECO -->
<col width="5%" />
<col width="2%" />
<col width="2%" />
<col width="3%" /> <!-- ERP -->
<col width="6%" />
<col width="5%" /> <!-- 차종 -->
<col width="12%" />
<col width="6%" /> <!-- 원소재사이즈 -->
<col width="12%" />
<col width="12%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
</colgroup>
<thead>
<tr class="plm_thead">
<td rowspan="2">No</td>
<td rowspan="2">품번</td>
<td rowspan="2">품명</td>
<td rowspan="2">형상</td>
<td colspan="4">ECO</td>
<td rowspan="2">ERP</td>
<td rowspan="2">고객사</td>
<td rowspan="2">차종</td>
<td rowspan="2">재질</td>
<td rowspan="2">원소재사이즈</td>
<!-- <td>도면구분</td>
<td>출도구분</td> -->
<td rowspan="2">도금</td>
<td rowspan="2">생산구분</td>
<td colspan="2">중량</td>
<td rowspan="2">관리항목</td>
</tr>
<tr class="plm_sub_thead">
<td>No</td>
<td>Date</td>
<td>REV</td>
<td>ECD</td>
<td>제품</td>
<td>스푸르</td>
</tr>
</thead>
<c:choose>
<c:when test="${empty partList}">
<tr style="text-align:center;">
<td align="center" colspan="19">조회된 데이터가 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="item" items="${partList}" varStatus="varStatus">
<tr>
<td>${item.RNUM}</td>
<td title="${item.PART_NO}"><a href="#" onclick="openPartFormPopup('','${item.OBJID}')">${item.PART_NO}</a></td>
<td title="${item.PART_NAME}"><a href="#" onclick="openPartFormPopup('','${item.OBJID}')">${item.PART_NAME}</a></td>
<td>
<c:if test="${!empty item.SAVED_FILE_NAME and !empty item.REAL_FILE_NAME and !empty item.FILE_PATH}">
<img src="#" height='85' width='85' onclick="openImagePopUp(this.src)" data-SRC="/common/viewImage.do?realFileName=${item.REAL_FILE_NAME}&savedFileName=${item.SAVED_FILE_NAME}&attDir=${item.FILE_PATH}"/>
</c:if>
</td>
<td title="${item.EO_NO}"><%-- <a href="#" onclick="openEOPopup('${item.EO_OBJID}','')"> --%>${item.EO_NO}</a></td>
<td title="${item.EO_ISSUE_DATE_TITLE}">${item.EO_ISSUE_DATE_TITLE}</td>
<td title="${item.REV}"><%-- <a href="#" class="btnRevision" data-PART_NO="${item.PART_NO}"> --%>${item.REV}</a></td>
<td>
<c:choose>
<c:when test="${empty item.ECD_OBJID}">N</c:when>
<c:otherwise>
<%-- <a href="javascript:fnc_downloadFile('${item.ECD_OBJID}')">Y</a> --%>
Y
</c:otherwise>
</c:choose>
</td>
<td title="${item.RH_PART_NO}">${item.RH_PART_NO}</td>
<td title="${item.OEM_NAME}">${item.OEM_NAME}</td>
<td title="${item.CAR_NAME}">${item.CAR_NAME}</td>
<td title="${item.MATERIAL_NAME}">${item.MATERIAL_NAME}</td>
<td title="${item.THICKNESS}">${item.THICKNESS}</td>
<%-- <td title="${item.DRAWING_TYPE_TITLE}">${item.DRAWING_TYPE_TITLE}</td>
<td title="${item.DRAWING_RELEASE_TYPE_TITLE}">${item.DRAWING_RELEASE_TYPE_TITLE}</td>
--%>
<td title="${item.PLATED}">${item.PLATED}</td>
<td title="${item.COMM_NAME}">${item.COMM_NAME}</td>
<td title="${item.WEIGHT}">${item.WEIGHT}</td>
<td title="${item.SPRUE}">${item.SPRUE}</td>
<td>
<c:choose>
<c:when test="${empty item.MNG_ITEM_FILE_OBJID}">N</c:when>
<c:otherwise>
<a href="javascript:fnc_downloadFile('${item.MNG_ITEM_FILE_OBJID}')">Y</a>
</c:otherwise>
</c:choose>
</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</table>
</div>
</div>
</section>
</form>
</body>
</html>