Files
wace_plm/WebContent/WEB-INF/view/eo/eoDetailViewPopup.jsp

450 lines
14 KiB
Plaintext
Raw Normal View History

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.pms.common.utils.*"%>
<%@ page import="java.util.*" %>
<%@include file= "/init.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
<c:set var="actionType" value="${param.actionType}" />
<c:set var="objId" value="${empty eoInfo.OBJID ? '' : eoInfo.OBJID}" />
<c:set var="status" value="${empty eoInfo.STATUS ? '' : eoInfo.STATUS}" />
<c:set var="eoNo" value="${empty eoInfo.EO_NO ? '' : eoInfo.EO_NO}" />
<c:set var="eoIssueDate" value="${empty eoInfo.EO_ISSUE_DATE ? '' : eoInfo.EO_ISSUE_DATE}" />
<c:set var="hkmcDistributeDate" value="${empty eoInfo.HKMC_DISTRIBUTE_DATE ? '' : eoInfo.HKMC_DISTRIBUTE_DATE}" />
<c:set var="oemObjId" value="${empty eoInfo.OEM_OBJID ? '' : eoInfo.OEM_OBJID}" />
<c:set var="carObjId" value="${empty eoInfo.CAR_OBJID ? '' : eoInfo.CAR_OBJID}" />
<c:set var="writer" value="${eoInfo.WRITER_ORG}" />
<c:set var="isAdminFlag" value="${'' eq isAdmin ? 'false' : 'true'}" />
<c:set var="isWriterFlag" value="${'' eq isWriter ? 'false' : 'true'}" />
<c:set var="isAppLineUserFlag" value="${'' eq isAppLineUser ? 'false' : 'true'}" />
<script type="text/javascript">
$(function(){
$(document).ready(function(){
$('#btn_close').click(function(){
self.close();
});
$("#allChk").click(function(){
if($(this).prop("checked")){
$("input[type=checkbox]").prop("checked", true);
}else{
$("input[type=checkbox]").prop("checked", false);
}
});
fn_fileCallback();
getConnectPartList('drawPart','draw');
//상신 시 수정불가
if("release" == "${status}"){
$("#btn_modify").hide();
}else{
var authCount = 0;
if("true" == "${isAdminFlag}"){
authCount++;
$("#btn_modify").show();
}else if("true" == "${isWriterFlag}"){
authCount++;
$("#btn_modify").show();
}else if("true" == "${isAppLineUserFlag}"){
authCount++;
}
if(authCount == 0){
Swal.fire("권한이 없습니다.");
self.close();
}
}
});
});
function openEOFormPopup(){
if(confirm("수정하시겠습니까?")){
var form = document.form1;
form.action = "/eo/eoFormPopup.do";
form.submit();
}
}
function fn_fileCallback(){
var objid = $("#objId").val();
if("" != objid){
$.ajax({
url:"/common/getFileList.do",
type:"POST",
data:{"targetObjId":objid, "docType":"EO_PDF"},
dataType:"json",
async:false,
success:function(data){
if(0 < data.length){
$("#eoAttachDefault").hide();
$("#eoAttachFileList").show();
$("#uploadedFileArea").remove();
$.each(data, function(i){
var appendText = "";
appendText+= "<tr>";
appendText+= " <td title='"+data[i].REAL_FILE_NAME+"'><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'>"+data[i].REAL_FILE_NAME+"</a></td>";
appendText+= "</tr>";
$("#uploadedFileAreaTable").append(appendText);
});
}else{
$("#eoAttachDefault").show();
$("#uploadedFileArea").remove();
}
},
error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}else{
$("#eoAttachDefault").show();
$("#uploadedFileArea").remove();
}
}
//연결된 part의 목록을 가져온다.
function getConnectPartList(targetId,type){
var eoObjId = $("#objId").val();
$("#totalPart").attr("class","inActivation");
$("#drawPart").attr("class","inActivation");
$("#shownOnPart").attr("class","inActivation");
$("#"+targetId).attr("class","activation");
$.ajax({
url:"/eo/getConnectPartList.do",
type:"POST",
data:{"objId":eoObjId,"drawingType":type},
dataType:"json",
async:false,
success:function(result){
if(null != result){
$("#connectedPartList").empty();
if(0 < result.length){
$("#partListDefault").hide();
for(var i=0;i<result.length;i++){
var attachText = "";
attachText+= "<tr style='text-align:center;'>";
attachText+= " <td>"+result[i].RNUM+"</td>";
attachText+= " <input type='hidden' name='partFileCnt_"+result[i].OBJID+"' id='partFileCnt_"+result[i].OBJID+"' value='"+result[i].ATTACH_FILE_CNT+"'>";
attachText+= " <td><input type='checkBox' name='connectedPart' value='"+result[i].OBJID+"'></td>";
attachText+= " <td><a href=\"#\" onclick=\"openPartFormPopup('view','"+result[i].OBJID+"')\">"+result[i].PART_NO+"</a></td>";
attachText+= " <td><a href=\"#\" onclick=\"openPartFormPopup('view','"+result[i].OBJID+"')\">"+result[i].PART_NAME+"</a></td>";
attachText+= " <td>"+fnc_checkNull(result[i].CHANGE_ITEM_TITLE)+"</td>";
attachText+= " <td>"+fnc_checkNull(result[i].REV)+"</td>";
attachText+= " <td>";
if(null != result[i].ECD_OBJID){
attachText+= "<a href=\"javascript:fnc_downloadFile('";
attachText+= result[i].ECD_OBJID;
attachText+= "')\">Y</a>";
}else{
attachText+= "N";
}
attachText+= " </td>";
attachText+= " <td>";
if(null != result[i].MNG_ITEM_FILE_OBJID){
attachText+= "<a href=\"javascript:fnc_downloadFile('";
attachText+= result[i].MNG_ITEM_FILE_OBJID;
attachText+= "')\">Y</a>";
}else{
attachText+= "N";
}
attachText+= " </td>";
attachText+= " <td>"+fnc_checkNull(result[i].APPLY_POINT_NAME);
attachText+= " </td>";
attachText+= "</tr>";
$("#connectedPartList").append(attachText);
}
}else{
$("#partListDefault").show();
}
}
},
error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}
//형상 이미지 팝업
function openShapeImgPopUp(url){
var shapeImg = new Image();
shapeImg.src = url;
var imgWidth = shapeImg.width;
var windowWidth = imgWidth+15;
var imgHeight = shapeImg.height;
var windowHeight = imgHeight+30;
var shapeImgWindow = window.open('','_blank','width='+windowWidth+',height='+windowHeight);
shapeImgWindow.document.write("<style>body{margin:0px;}</style><img src='"+url+"' width='"+imgWidth+"' height='"+imgHeight+"'>");
}
//파일 일괄 다운로드
function packgeingPartFile(type){
var form = document.form1
var flag = false;
var attachFileTotalCnt = 0;
$("input[name=connectedPart]").each(function(){
if(this.checked){
flag = true;
attachFileTotalCnt += Number($("#partFileCnt_"+this.value).val());
}
});
if(flag){
if(Number(attachFileTotalCnt) == 0){
Swal.fire("선택된 파트에 첨부파일이 없습니다.");
return false;
}else{
if(confirm("파일을 일괄다운로드 하시겠습니까?")){
form.fileType.value = type;
form.action = "/eo/packgeingPartFile.do";
form.submit();
}
}
}else{
Swal.fire("선택된 Part 정보가 없습니다.");
}
}
function selfRefreshPopUp(){
var form = document.form1;
form.action = "/eo/eoDetailViewPopup.do";
form.submit();
}
//전체 체크
function fn_allChk(obj){
var checked = $(obj).is(":checked");
$("input[name=connectedPart]").each(function(){
if(checked) this.checked = true;
else this.checked = false;
});
}
function openPartFormPopup(actionType,objid){
var form = document.form1;
var url = "/part/partDetailViewPopup.do";
var target = "tempPartListPopup";
window.open(url,target,"width=700, height=930");
form.action = url;
form.actionType.value = actionType;
form.objid.value = objid;
form.target = target;
form.submit();
}
//결재 완료된 EO를 다시 배포한다.
function fn_releaseEO(){
$.ajax({
url:"/eo/releaseEO.do",
type:"POST",
data:$().serialize,
dataType:"json",
async:false,
success:function(result){
},
error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}
</script>
</head>
<body class="backcolor">
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="objid" id="objid">
<input type="hidden" name="objId" id="objId" value="${objId}">
<input type="hidden" name="targetObjId" id="targetObjId">
<input type="hidden" name="targetType" id="targetType">
<input type="hidden" name="fileType" id="fileType">
<input type="hidden" name="actionType" id="actionType">
<input type="hidden" name="callbackFnc" id="callbackFnc">
<div class="">
<div class="plm_menu_name">
<h2>
<span>ECO 상세</span>
</h2>
</div>
<div id="eoPopup">
<div class="color_eoback">
<div id="eoPopupTtWrap">
<p id="eoPopupTt">engineering change order(ECO)갑지</p>
<table id="approvalTable" style="width:300px;">
<tr>
<td>SEQ</td>
<td>부서</td>
<td>이름</td>
<td>결재일</td>
</tr>
<c:choose>
<c:when test="${empty eoApprovalList}">
<tr>
<td colspan="4">결재내역이 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="item" items="${eoApprovalList}" varStatus="varStatus">
<tr>
<td>${item.SEQ}</td>
<td>${item.DEPT_NAME}</td>
<td>${item.USER_NAME}</td>
<td>${item.PROC_DATE_TITLE}</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</table>
</div>
<table id="eoPopuoSearchZon">
<tr>
<td><label for="" class="black_label">고객사</label></td>
<td><p>${eoInfo.OEM_NAME}${empty eoInfo.OEM_CODE ? '' : '('}${eoInfo.OEM_CODE}${empty eoInfo.OEM_CODE ? '':')'}</p></td>
<td><label for="" class="black_label">차종</label></td>
<td><p>${eoInfo.CAR_CODE}</p></td>
<td><label for="" class="black_label">ECO종류</label></td>
<td><p>${eoInfo.EO_TYPE_STR}</p></td>
<td><label for="" class="black_label">고객사 설계팀</label></td>
<td><p>${eoInfo.DESIGN_TEAM}</p></td>
</tr>
<tr>
<td><label for="" class="black_label">ECO No</label></td>
<td><p>${eoInfo.EO_NO}</p></td>
<td><label for="" class="black_label">ECO Date</label></td>
<td><p>${eoInfo.EO_ISSUE_DATE}</p></td>
<td><label for="" class="black_label">긴급도</label></td>
<td><p>${eoInfo.URGENT_DEGREE_STR}</p></td>
<td><label for="" class="black_label">구매배포일</label></td>
<td><p>${eoInfo.HKMC_DISTRIBUTE_DATE}</p></td>
</tr>
</table>
</div>
<div style="float:right; width:50%;">
<div id="eoPopupFile" style="width:60%;">
<label for="" class="orange_label">첨부</label>
<div id="fileDnDWrap">
<div id="eoAttachFileList">
<table id="uploadedFileAreaTable" class="spec_data_in_table">
<tr id="eoAttachDefault">
<td>첨부된 파일이 없습니다.</td>
</tr>
<tbody id="uploadedFileArea">
</tbody>
</table>
</div>
</div>
</div>
<div id="pdmSearchBtnWrap" style="float: left; margin-top: 10px;">
<input type="button" value="DATA 일괄 Down" class="plm_btns" onclick="packgeingPartFile('data');">
<input type="button" value="첨부파일 일괄 Down" class="plm_btns" onclick="packgeingPartFile('etc');">
</div>
</div>
<div class="eo_table_side_margin">
<div>
<div id="eoPopupListTabWrap">
<div id="drawPart" name="partTypeTab" onclick="getConnectPartList('drawPart','draw');" class="inActivation">D<!-- 출도도면 --></div>
<div id="shownOnPart" name="partTypeTab" onclick="getConnectPartList('shownOnPart','shownOn');" class="inActivation">S<!-- 비출도 --></div>
<div id="totalPart" name="partTypeTab" onclick="getConnectPartList('totalPart','');" class="activation">전체</div>
</div>
<div>
<div class="plm_table_wrap">
<div style="overflow-y:scroll;">
<table class="plm_table" style="width:100%;">
<colgroup>
<col width="3%" />
<col width="2%" />
<col width="*" />
<col width="*" />
<col width="*%" />
<col width="3%" />
<col width="3%" />
<col width="4%" />
<col width="8%" />
</colgroup>
<thead>
<tr class="plm_thead">
<td>No</td>
<td><input type="checkbox" name="allCheck" id="allCheck" onclick="fn_allChk(this);"></td>
<td>품번</td>
<td>품명</td>
<td>변경내용</td>
<td>Rev</td>
<td>ECD</td>
<td>관리항목</td>
<td>설계적용시점</td>
</tr>
</thead>
</table>
</div>
<div class="plm_scroll_table" style="width:100%; height:300px;">
<table class="plm_table">
<colgroup>
<col width="3%" />
<col width="2%" />
<col width="*" />
<col width="*" />
<col width="*%" />
<col width="3%" />
<col width="3%" />
<col width="4%" />
<col width="8%" />
</colgroup>
<tr style="text-align: center;" id="partListDefault">
<td align="center" colspan="9">연결된 파트가 없습니다.</td>
</tr>
<tbody id="connectedPartList">
</tbody>
</table>
</div>
</div>
</div>
<div class="eo_pop_btn_w">
<div class="eo_pop_btn_po">
<p id="dismen">배포처</p>
<p id="distribution_men">
<c:choose>
<c:when test="${empty releaseMemberList}">
차종에 지정된 배포처가 없습니다.
</c:when>
<c:otherwise>
<c:forEach var="item" items="${releaseMemberList}" varStatus="varStatus">
<c:if test="${!varStatus.last}">${item.DEPT_NAME} ${item.USER_NAME}, </c:if>
<c:if test="${varStatus.last}">${item.DEPT_NAME} ${item.USER_NAME}</c:if>
</c:forEach>
</c:otherwise>
</c:choose>
</p>
</div>
</div>
<div class="btn_wrap" style="clear:both; margin-top:60px;">
<div class="plm_btn_wrap_center">
<input type="button" value="수정" id="btn_modify" class="plm_btns" onclick="openEOFormPopup();">
<input type="button" value="닫기" name="" id="btn_close" class="plm_btns">
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</body>
</html>