ERP-node/WebContent/WEB-INF/view/partMng/partMngFormPopUp2.jsp

614 lines
19 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.pms.common.utils.*"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page import="java.util.*" %>
<%@include file= "/init.jsp" %>
<%
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
String userId = CommonUtils.checkNull(person.getUserId());
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
</head>
<script>
$(document).ready(function(){
$("#btnClose").click(function(){
self.close(0);
});
$("#btnSave").click(function(){
fn_save();
});
$("#CUSTOMER").change(function(){
$("#CAR_TYPE").empty();
$("#DESIGN_APPLY_POINT").empty();
if("" != this.value){
fnc_getCarList("", this.value, "CAR_TYPE","${resultMap.CAR_TYPE}");
fnc_getMilestoneList(this.value, "DESIGN_APPLY_POINT", "${resultMap.DESIGN_APPLY_POINT}");
}
});
$("#PRODUCT_GROUP").change(function(){
$("#PRODUCT").empty();
if("" != this.value){
fnc_getCodeListAppend(this.value,"PRODUCT","${resultMap.PRODUCT}");
}
});
$("input[name=DRAWING_TYPE]").change(function(){
$("#SHOW_ON").empty();
if("shownOn" == this.value){
$("#SHOW_ON").attr("disabled",false);
fnc_getPartMngList("", "${resultMap.SHOW_ON}", "", "release", "SHOW_ON", "${resultMap.SHOW_ON}");
}else{
$("#SHOW_ON").attr("disabled",true);
}
});
$("input[name=MOLD_DEV]").change(function(){
$("#CARRY_OVER_CAR").empty();
if("carryOver" == this.value){
$("#CARRY_OVER_CAR").attr("disabled",false);
fnc_getCarList("", "", "CARRY_OVER_CAR","${resultMap.CARRY_OVER_CAR}");
}else{
$("#CARRY_OVER_CAR").attr("disabled",true);
}
});
$("#SPEC_TYPE").change(function(){
$("#SPEC_NO").empty();
fnc_getSpecNoList(this.value, "SPEC_NO", "");
});
fnc_setFileDropZone("shapeDropZone", "${resultMap.OBJID}", "PART_SHAPE_IMG", "Part 형상", "fileAreaDraw",true,null,null,null);
fnc_setFileDropZone("ecdDropZone", "${resultMap.OBJID}", "ECD_DOC", "ECD 첨부파일", "fileAreaDraw",true,null,null,null);
fnc_setFileDropZone("3dCadDropZone", "${resultMap.OBJID}", "3D_CAD", "3D CAD 첨부파일", "fileAreaDraw",true,null,null,null);
fnc_setFileDropZone("2dDrawingCadDropZone", "${resultMap.OBJID}", "2D_DRAWING_CAD", "2D(Drawing) CAD 첨부파일", "fileAreaDraw",true,null,null,null);
fnc_setFileDropZone("2dPDFCadDropZone", "${resultMap.OBJID}", "2D_PDF_CAD", "2D(PDF) CAD 첨부파일", "fileAreaDraw",true,null,null,null);
fileAreaDraw();
fnc_datepick();
fnc_getOEMList("CUSTOMER", "${resultMap.CUSTOMER}");
if("" != "${resultMap.CUSTOMER}"){
fnc_getCarList("", "${resultMap.CUSTOMER}", "CAR_TYPE","${resultMap.CAR_TYPE}");
fnc_getMilestoneList("${resultMap.CUSTOMER}", "DESIGN_APPLY_POINT", "${resultMap.DESIGN_APPLY_POINT}");
}else{
$("#CAR_TYPE").empty();
$("#DESIGN_APPLY_POINT").empty();
}
if("" != "${resultMap.PRODUCT_GROUP}"){
fnc_getCodeListAppend("${resultMap.PRODUCT_GROUP}","PRODUCT","${resultMap.PRODUCT}");
}else{
$("#PRODUCT").empty();
}
$("#SHOW_ON").empty();
if("shownOn" == "${resultMap.DRAWING_TYPE}"){
$("#SHOW_ON").attr("disabled",false);
fnc_getPartMngList("", "${resultMap.SHOW_ON}", "", "release", "SHOW_ON", "${resultMap.SHOW_ON}");
}else{
$("#SHOW_ON").attr("disabled",true);
}
if("carryOver" == "${resultMap.MOLD_DEV}"){
$("#CARRY_OVER_CAR").attr("disabled",false);
fnc_getCarList("", "", "CARRY_OVER_CAR","${resultMap.CARRY_OVER_CAR}");
}else{
$("#CARRY_OVER_CAR").attr("disabled",true);
}
fnc_getPartMngList("", "${resultMap.PART_NO}", "", "release", "RH_PART", "${resultMap.RH_PART}");
fnc_getCodeListAppend("<%=Constants.PRODUCT_GROUP_CODE%>","PRODUCT_GROUP","${resultMap.PRODUCT_GROUP}");
fnc_getCodeListAppend("<%=Constants.MATERIAL_CODE%>","MATERIAL","${resultMap.MATERIAL}");
// fnc_getCodeListAppend("<%=Constants.SPEC_NO_CODE%>","SPEC_NO","${resultMap.SPEC_NO}");
$("input:radio[name='RELEASE_TYPE']:radio[value='${resultMap.RELEASE_TYPE}']").prop('checked', true);
$("input:radio[name='PART_TYPE']:radio[value='${resultMap.PART_TYPE}']").prop('checked', true);
$("input:radio[name='DRAWING_TYPE']:radio[value='${resultMap.DRAWING_TYPE}']").prop('checked', true);
$("input:radio[name='MOLD_DEV']:radio[value='${resultMap.MOLD_DEV}']").prop('checked', true);
$("input:radio[name='CHANGE_OPTION']:radio[value='${resultMap.CHANGE_OPTION}']").prop('checked', true);
$("input:radio[name='MANAGEMENT_ITEM']:radio[value='${resultMap.MANAGEMENT_ITEM}']").prop('checked', true);
$('.select2').select2();
window.resizeTo(620,750);
});
</script>
<script>
//codeId를 부모로 사용하는 코드의 정보목록을 가져온다.
function fn_getCodeListAppend(codeId,selectboxId,selectedVal){
var resultList = fnc_getCodeList(codeId);
if(0 < resultList.length){
$("#"+selectboxId).empty();
$("#"+selectboxId).append("<option value=''>선택</option>");
for (var i = 0; i < resultList.length; i++) {
var commonCodeId = resultList[i].CODE_ID;
var commonCodeName = resultList[i].CODE_NAME;
var appendText = "";
if(commonCodeName == "결재중" || commonCodeName == "반려" || commonCodeName == "결재완료"){
appendText = "disabled";
}
$("#"+selectboxId).append("<option value='"+commonCodeId+"' "+appendText+">"+commonCodeName+"</option>");
}
$("#"+selectboxId).val(selectedVal);
}
}
function fileAreaDraw(){
fn_fileCallback("shape","PART_SHAPE_IMG");
fn_fileCallback2("ecd","ECD_DOC");
fn_fileCallback2("3dCad","3D_CAD");
fn_fileCallback2("2dDrawingCad","2D_DRAWING_CAD");
fn_fileCallback2("2dPDFCad","2D_PDF_CAD");
}
//첨부파일 목록을 가져온다.
function fn_fileCallback(areaId,fileType){
$.ajax({
url:"/common/getFileList.do",
type:"POST",
data:{"targetObjId":"${resultMap.OBJID}", "docType":fileType},
dataType:"json",
async:false,
success:function(data){
if(0 < data.length){
//첨부파일 목록 영역 show
$("#"+areaId+"FileArea").empty();
if(0 < $("#"+areaId+"DropZone").length){
$("#"+areaId+"DropZone").hide();
$("#"+areaId+"FileArea").show();
}
$.each(data, function(i){
var realFileName = data[i].REAL_FILE_NAME;
var srcLocation = encodeURI("/common/viewImage.do?realFileName="+realFileName+"&savedFileName="+data[i].SAVED_FILE_NAME+"&attDir="+data[i].FILE_PATH);
var appendText = "";
var appendImgText = ""
appendText+= "<a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'>&nbsp;"+data[i].REAL_FILE_NAME+"</a>";
appendText+= "<a href='javascript:fileDelete(\""+data[i].OBJID+"\",\""+areaId+"\")'><div class='delete_btn'></div></a>";
appendImgText = "<img src='"+srcLocation+"' height='85px' width='99%' onclick='openImagePopUp(this.src)' style='cursor:pointer;' />"
$("#"+areaId+"FileArea").append(appendImgText+appendText);
});
}else{
$("#"+areaId+"DropZone").show();
$("#"+areaId+"FileArea").empty();
$("#"+areaId+"FileArea").hide();
}
},
error: function(jqxhr, status, error){
}
});
}//파일 첨부 END
function fn_fileCallback2(areaId,fileType){
$.ajax({
url:"/common/getFileList.do",
type:"POST",
data:{"targetObjId":"${resultMap.OBJID}", "docType":fileType},
dataType:"json",
async:false,
success:function(data){
if(0 < data.length){
if(0 < $("#"+areaId+"DropZone").length){
$("#"+areaId+"DropZone").hide();
$("#"+areaId+"FileArea").show();
}
//첨부파일 목록 영역 show
$("#"+areaId+"FileArea").empty();
$.each(data, function(i){
var appendText = "";
var path = data[i].FILE_PATH;
var fileName = data[i].SAVED_FILE_NAME;
var fileExt = data[i].UPPER_FILE_EXT;
appendText+= "<a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'>&nbsp;&nbsp;"+data[i].REAL_FILE_NAME+"</a>";
<c:if test="${param.actionType eq 'regist' or info.WRITER eq connectUserId or 'plm_admin' eq connectUserId}">
appendText+= "<a href='javascript:fileDelete(\""+data[i].OBJID+"\",\""+areaId+"\")'><div class='delete_btn'></div></a>";
</c:if>
$("#"+areaId+"FileArea").append(appendText);
});
}else{
$("#"+areaId+"DropZone").show();
$("#"+areaId+"FileArea").empty();
$("#"+areaId+"FileArea").hide();
}
},
error: function(jqxhr, status, error){
}
});
}//파일 첨부 END
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,"problemImgPopUp","width="+img_width+",height="+height+", menubars=no, scrollbars=yes'");
}
/*첨부 파일 삭제 */
function fileDelete(fileObjId,areaId){
var type =areaId;
if(confirm("파일을 삭제하시겠습니까?")){
$.ajax({
url:"/common/deleteFileInfo.do",
type:"POST",
data:{"objId":fileObjId},
dataType:"json",
async:true,
success:function(data){
fileAreaDraw();
},
error: function(jqxhr, status, error){
}
});
}
}
function fn_save(){
console.log($("#form1").serialize());
console.log($("input[name=MOLD_DEV]").val());
if(fnc_validate('form1')){
if(confirm("저장하시겠습니까?")){
$.ajax({
url:"/partMng/savePartMng.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
async:false,
success:function(data){
Swal.fire(data.msg);
opener.fn_search();
self.close();
},
error: function(jqxhr, status, error){
}
});
}
}
}
</script>
<style>
.input_title {border-left:1px solid #ccc;}
.input_sub_title {border-left:1px solid #ccc;}
.pmsPopupForm tr:last-child td{border-bottom:1px solid #ccc;}
</style>
<body>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="OBJID" id="OBJID" value="${resultMap.OBJID}">
<input type="hidden" name="STATUS" id="STATUS" value="${resultMap.STATUS}">
<input type="hidden" name="IS_LAST" id="IS_LAST" value="${resultMap.IS_LAST}">
<section>
<div class="plm_menu_name" style="display:flex;">
<h2>
<span>Part 등록</span>
</h2>
</div>
<div id="businessPopupFormWrap">
<!-- <div class="form_popup_title">&nbsp;&nbsp;&nbsp;영업활동 등록</div> -->
<table class="pmsPopupForm">
<colgroup>
<col width="15%">
<col width="37%">
<col width="15%">
<col width="*">
</colgroup>
<tr>
<td class="input_title">
<label for="">고객사</label>
</td>
<td class="input_sub_title" >
<select name="CUSTOMER" id="CUSTOMER"></select>
</td>
<td class="input_title">
<label for="">차종</label>
</td>
<td class="input_sub_title" >
<select name="CAR_TYPE" id="CAR_TYPE" class="select2"></select>
</td>
</tr>
<tr>
<td class="input_title">
<label for="">제품군</label>
</td>
<td class="input_sub_title" >
<select name="PRODUCT_GROUP" id="PRODUCT_GROUP" class="select2"></select>
</td>
<td class="input_title">
<label for="">제품</label>
</td>
<td class="input_sub_title" >
<select name="PRODUCT" id="PRODUCT" class="select2"></select>
</td>
</tr>
<tr>
<td class="input_title">
<label for="">품번</label>
</td>
<td class="input_sub_title" >
<input type="text" name="PART_NO" id="PART_NO" value="${resultMap.PART_NO}">
</td>
<td class="input_title">
<label for="">자사 품번</label>
</td>
<td class="input_sub_title" >
<input type="text" name="MY_PART_NO" id="MY_PART_NO" value="${resultMap.MY_PART_NO}">
</td>
</tr>
<tr>
<td class="input_title">
<label for="">품명</label>
</td>
<td class="input_sub_title" colspan="3">
<input type="text" name="PART_NAME" id="PART_NAME" value="${resultMap.PART_NAME}">
</td>
</tr>
<tr>
<td class="input_title">
<label for="">EO No.</label>
</td>
<td class="input_sub_title" >
<input type="hidden" name="EO" id="EO" value="${resultMap.EO}">
${resultMap.EO_NO}
</td>
<td class="input_title">
<label for="">EO Date</label>
</td>
<td class="input_sub_title" >${resultMap.EO_DATE_TITLE}</td>
</tr>
<tr>
<td class="input_title">
<label for="">Revision</label>
</td>
<td class="input_sub_title" >
<input type="hidden" name="REVISION" id="REVISION" value="${resultMap.REVISION}">
${resultMap.REVISION}
</td>
<td class="input_title">
<label for="">RH No.</label>
</td>
<td class="input_sub_title" >
<select name="RH_PART" id="RH_PART" class="select2"></select>
</td>
</tr>
<tr>
<td class="input_title">
<label for="">출도구분</label>
</td>
<td class="input_sub_title">
<input type="radio" name="RELEASE_TYPE" value="dev"> 개발
<input type="radio" name="RELEASE_TYPE" value="produce"> 양산
</td>
<td class="input_title">
<label for="">부품구분</label>
</td>
<td class="input_sub_title" >
<input type="radio" name="PART_TYPE" value="unique"> Unique
<input type="radio" name="PART_TYPE" value="standard"> 표준품
</td>
</tr>
<tr>
<td class="input_title">
<label for="">도면구분</label>
</td>
<td class="input_sub_title" >
<input type="radio" name="DRAWING_TYPE" value="drawing"> D
<input type="radio" name="DRAWING_TYPE" value="shownOn"> S
</td>
<td class="input_title">
<label for="">Show-on No.</label>
</td>
<td class="input_sub_title">
<select name="SHOW_ON" id="SHOW_ON" class="select2" disabled></select>
</td>
</tr>
<tr>
<td class="input_title">
<label for="">수량</label>
</td>
<td class="input_sub_title" >
<input type="text" name="QTY" id="QTY" value="${resultMap.QTY}">
</td>
<td class="input_title">
<label for="">재질</label>
</td>
<td class="input_sub_title" >
<select name="MATERIAL" id="MATERIAL"></select>
</td>
</tr>
<tr>
<td class="input_title">
<label for="">중량</label>
</td>
<td class="input_sub_title" >
<input type="text" name="WEIGHT" id="WEIGHT" value="${resultMap.WEIGHT}">
</td>
<td class="input_title">
<label for="">SIZE</label>
</td>
<td class="input_sub_title" >
<input type="text" name="SIZE" id="SIZE" value="${resultMap.SIZE}">
</td>
</tr>
<tr>
<td class="input_title">
<label for="">금형개발</label>
</td>
<td class="input_sub_title" >
<input type="radio" name="MOLD_DEV" value="new"> 신규
<input type="radio" name="MOLD_DEV" value="carryOver"> C/O
</td>
<td class="input_title">
<label for="">C/O 차종</label>
</td>
<td class="input_sub_title" >
<select name="CARRY_OVER_CAR" id="CARRY_OVER_CAR" class="select2"></select>
</td>
</tr>
<tr>
<td class="input_title">
<label for="">표면처리</label>
</td>
<td class="input_sub_title" >
<input type="text" name="SURFACE_TREATMENT" id="SURFACE_TREATMENT" value="${resultMap.SURFACE_TREATMENT}">
</td>
<td class="input_title">
<label for="">ECD</label>
</td>
<td class="input_sub_title">
<div id="ecdDropZone" class="dropzone" style="width:99%;height:90%;border: 2px dotted rgb(130, 150, 194);">Drag & Drop Files Here</div>
<div id="ecdFileArea" style="display:none;"></div>
</td>
</tr>
<tr>
<td class="input_title" rowspan="3">
<label for="">기변항목</label>
</td>
<td class="input_sub_title">
<input type="radio" name="CHANGE_OPTION" value="changeModel"> 형상변경
<input type="radio" name="CHANGE_OPTION" value="changeMaterial"> 재질변경
</td>
<td class="input_title" rowspan="3">
<label for="">형상</label>
</td>
<td class="input_sub_title" rowspan="3">
<div id="shapeDropZone" class="dropzone" style="width:99%;height:100px;border: 2px dotted rgb(130, 150, 194);">Drag & Drop Image Files Here</div>
<div id="shapeFileArea" style="display:none;"></div>
</td>
</tr>
<tr>
<td class="input_sub_title">
<input type="radio" name="CHANGE_OPTION" value="changeAdd"> 추가변경
<input type="radio" name="CHANGE_OPTION" value="changePakege"> 구성변경
</td>
</tr>
<tr>
<td class="input_sub_title">
<input type="radio" name="CHANGE_OPTION" value="first"> 초도
<input type="radio" name="CHANGE_OPTION" value="etc"> 기타
</td>
</tr>
<tr>
<td class="input_title">
<label for="">설계적용시점</label>
</td>
<td class="input_sub_title">
<select name="DESIGN_APPLY_POINT" id="DESIGN_APPLY_POINT"></select>
</td>
<td class="input_title">
<label for="">관리항목</label>
</td>
<td class="input_sub_title">
<input type="radio" name="MANAGEMENT_ITEM" value="exist"> 유
<input type="radio" name="MANAGEMENT_ITEM" value="notExist"> 무
</td>
</tr>
<tr>
<td class="input_title">
<label for="">SPEC 구분.</label>
</td>
<td class="input_sub_title" >
<select name="SPEC_TYPE" id="SPEC_TYPE" style="">
<option value="">선택</option>
<option value="MS SPEC">MS</option>
<option value="ES SPEC">ES</option>
</select>
</td>
<td class="input_title">
<label for="">SPEC No.</label>
</td>
<td class="input_sub_title" >
<select name="SPEC_NO" id="SPEC_NO" style=""></select>
</td>
</tr>
</table>
<table class="pmsPopupForm" style="margin-top:10px;">
<colgroup>
<col width="15%">
<col width="20%">
<col width="15%">
<col width="*">
</colgroup>
<tr>
<td class="input_title" rowspan="3">
<label for="">CAD Data</label>
</td>
<td class="input_sub_title" >
3D
</td>
<td colspan="2">
<div id="3dCadDropZone" class="dropzone"style="width:99% !important;">Drag & Drop Files Here</div>
<div id="3dCadFileArea" style="display:none;"></div>
</td>
</tr>
<tr>
<td class="input_sub_title" >
2D(Drawing)
</td>
<td colspan="2">
<div id="2dDrawingCadDropZone" class="dropzone"style="width:99% !important;">Drag & Drop Files Here</div>
<div id="2dDrawingCadFileArea" style="display:none;"></div>
</td>
</tr>
<tr>
<td class="input_sub_title" >
2D(PDF)
</td>
<td colspan="2">
<div id="2dPDFCadDropZone" class="dropzone"style="width:99% !important;">Drag & Drop Files Here</div>
<div id="2dPDFCadFileArea" style="display:none;"></div>
</td>
</tr>
</table>
</div>
<div class="btn_wrap">
<div class="plm_btn_wrap_center">
<c:choose>
<c:when test="${resultMap.WRITER eq connectUserId or 'plm_admin' eq connectUserId}">
<input type="button" value="저장" id="btnSave" class="plm_btns create">
</c:when>
<c:otherwise></c:otherwise>
</c:choose>
<input type="button" value="닫기" id="btnClose" class="plm_btns">
</div>
</div>
</section>
</form>
</body>
</html>