Files
wace_plm/WebContent/WEB-INF/view/ecr/ecrMngFormPopUp.jsp
chpark da06c4684c Initial commit: WACE PLM with database initialization features
- Add Docker Compose configurations for dev, prod, and standalone environments
- Add database initialization scripts (init-db.sh, init-db-docker.sh)
- Add enhanced start-docker-linux.sh with DB init support
- Add comprehensive database initialization guide
- Support for automatic dbexport.pgsql import on first run
- Include safety checks for production environment
2025-08-29 15:46:08 +09:00

439 lines
14 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(){
if("${ecrInfo.PART_OBJID}"!=""){
fnc_getProductUPGPARTList("0","part_objid", "${ecrInfo.PART_OBJID}");
$("#part_name").text($("#part_objid option:selected").attr("id"));
}else{
fnc_getProductUPGPARTList("0","part_objid", "");
}
$("#btnClose").click(function(){
self.close(0);
});
$("#btnSave").click(function(){
fn_save();
});
$("#btnComplete").click(function(){
fn_complete();
});
fnc_setFileDropZone("ecrDropZone", "${ecrInfo.OBJID}", "ECR_ATTACH_01", "ECR이미지01", "fileAreaDraw",false,null,null);
fnc_setFileDropZone("ecr1DropZone", "${ecrInfo.OBJID}", "ECR_ATTACH_02", "ECR이미지02", "fileAreaDraw",false,null,null);
fileAreaDraw();
//fn_getApprovalLine();
$('.select2').select2();
$("#product_objid").change(function(){
//$("#part_objid").empty();
//$("#part_name").text("");
//fnc_productUPGNEWList(this.value,"","upg_no", "");
});
$("#upg_no").change(function(){
//fnc_getProductUPGPARTList(this.value,"part_objid", "");
});
$("#part_objid").change(function(){
$("#part_name").text("");
$("#part_name").text($("#part_objid option:selected").attr("id"));
});
/* if("${ecrInfo.PRODUCT_OBJID}"!=""){
fnc_productUPGNEWList("${ecrInfo.PRODUCT_OBJID}","","upg_no", "");
$("#upg_no").val("${ecrInfo.UPG_NO}");
//fnc_getProductUPGPARTList("${ecrInfo.UPG_NO}","part_objid", "");
$("#part_objid").val("${ecrInfo.PART_OBJID}");
$("#part_name").text("");
$("#part_name").text($("#part_objid option:selected").attr("id"));
} */
});
</script>
<script>
//결재정보를 가져온다.
function fn_getApprovalLine(){
var scheduleList = new Array();
<c:forEach items="${approvalList}" var="approvalItem">
var seq = "${approvalItem.SEQ}";
var targetUserName = "${approvalItem.TARGET_USER_NAME}";
var procDate = "${approvalItem.PROC_DATE}";
if(1 == seq){
$("#reviewerName").append(targetUserName);
$("#reviewerDate").append(procDate);
}
if(2 == seq){
$("#confirmName").append(targetUserName);
$("#confirmDate").append(procDate);
}
</c:forEach>
}
function fileAreaDraw(){
fn_Img_fileCallback("ecrAttach","ECR_ATTACH_01");
fn_Img_fileCallback("ecrAttach1","ECR_ATTACH_02");
}
//첨부파일 목록을 가져온다.
function fn_Img_fileCallback(areaId,fileType){
$.ajax({
url:"/common/getFileList.do",
type:"POST",
data:{"targetObjId":"${ecrInfo.OBJID}", "docType":fileType},
dataType:"json",
async:false,
success:function(data){
if(0 < data.length){
//첨부파일 목록 영역 show
$("#"+areaId+"FileArea").empty();
if(0 < $("#"+areaId+"DefaultRow").length){
$("#"+areaId+"DefaultRow").hide();
}
$.each(data, function(i){
var appendText = "";
if("ecrAttach" == areaId){
var path = data[i].FILE_PATH;
var fileName = data[i].SAVED_FILE_NAME;
var fileExt = data[i].UPPER_FILE_EXT;
var srcLocation = encodeURI("/common/viewImage.do?realFileName="+data[i].REAL_FILE_NAME+"&savedFileName="+data[i].SAVED_FILE_NAME+"&attDir="+data[i].FILE_PATH);
appendText+= "<img src='"+srcLocation+"' style='width:98% !important; height:235px; margin:0;padding:0;' onclick=\"openImagePopUp(this.src)\" style='cursor:pointer;' />";
appendText+= " <div class='align_l'><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>
appendText+= "</div>";
$("#ecrDropZone").hide();
} else if("ecrAttach1" == areaId){
var path = data[i].FILE_PATH;
var fileName = data[i].SAVED_FILE_NAME;
var fileExt = data[i].UPPER_FILE_EXT;
var srcLocation = encodeURI("/common/viewImage.do?realFileName="+data[i].REAL_FILE_NAME+"&savedFileName="+data[i].SAVED_FILE_NAME+"&attDir="+data[i].FILE_PATH);
appendText+= "<img src='"+srcLocation+"' style='width:98% !important; height:235px; margin:0;padding:0;' onclick=\"openImagePopUp(this.src)\" style='cursor:pointer;' />";
appendText+= " <div class='align_l'><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>
appendText+= "</div>";
$("#ecr1DropZone").hide();
}
$("#"+areaId+"FileArea").append(appendText);
});
}else{
$("#"+areaId+"DropZone").show();
$("#"+areaId+"AttachFileList").hide();
$("#"+areaId+"FileArea").empty();
/* var appendText = "";
appendText += "<tr>";
appendText += "<td>첨부 파일이 없습니다.</td>";
appendText +="</tr>";
$("#"+areaId+"FileArea").append(appendText); */
}
},
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_complete(){
if(fnc_validate('form1')){
if($("#after_contents").val()==""){
Swal.fire('조치내역을 입력해주세요');
return;
}
if(confirm("조치완료 하시겠습니까?")){
$.ajax({
url:"/ecr/completeecr.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
async:false,
success:function(data){
Swal.fire(data.message);
opener.fn_search();
self.close();
},
error: function(jqxhr, status, error){
}
});
}
}
}
function fn_save(){
if(fnc_validate('form1')){
<c:if test="${actionType eq 'regist'}">
if(confirm("저장하시겠습니까?")){
</c:if>
<c:if test="${actionType ne 'regist'}">
if(confirm("수정하시겠습니까?")){
</c:if>
var request_codeArr = new Array();
$('input:checkbox[name="request_code"]').each(function() {
if(this.checked){//checked 처리된 항목의 값
request_codeArr.push(this.value);
}
});
$("#request_codeArr").val(request_codeArr);
/* Swal.fire(request_codeArr);
return; */
$.ajax({
url:"/ecr/saveecr.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
async:false,
success:function(data){
Swal.fire(data.message);
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="${ecrInfo.OBJID}">
<input type="hidden" name="request_codeArr" id="request_codeArr">
<section>
<div class="plm_menu_name" style="display:flex;">
<h2 style="width:100%;height:80px;text-align:center;margin-top:5px;">
<span style="font-size:25px;">설계변경요청서<BR></span>
<span style="font-size:15px;">(Engineering Change Request)</span>
</h2>
<%-- <table class="pmsPopupForm" style="width:50%;background:white;">
<colgroup>
<col width="20%">
<col width="20%">
<col width="20%">
<col width="20%">
</colgroup>
<tr style="border-spacing: 0;border-bottom:1px solid #ccc;border-left:1px solid #ccc;">
<td class="input_title" rowspan="3" style="text-align:center;">
<label>결재</label>
</td>
<td class="input_title" style="text-align:center;">
<label>작성자</label>
</td>
<td class="input_title" style="text-align:center;">
<label>검토</label>
</td>
<td class="input_title" style="text-align:center;">
<label>승인</label>
</td>
</tr>
<tr style="border-spacing: 0;border-bottom:1px solid #ccc;">
<td class="input_sub_title" style="text-align:center;">
${ecrInfo.WRITER}<!-- 작성자이름 -->
</td>
<td class="input_sub_title" style="text-align:center;" id="reviewerName"></td>
<td class="input_sub_title" style="text-align:center;" id="confirmName"></td>
</tr>
<tr style="border-spacing: 0;border-bottom:1px solid #ccc;border-left:1px solid #ccc;">
<td class="input_sub_title" style="text-align:center;">
${ecrInfo.REG_DATE}<!-- 작성일자 -->
</td>
<td class="input_sub_title" style="text-align:center;" id="reviewerDate"></td>
<td class="input_sub_title" style="text-align:center;" id="confirmDate"></td>
</tr>
</table> --%>
</div>
<div id="businessPopupFormWrap">
<table class="pmsPopupForm">
<colgroup>
<col width="15%">
<col width="15%">
<col width="15%">
<col width="15%">
<col width="15%">
<col width="15%">
<col width="15%">
<col width="15%">
</colgroup>
<tr>
<td class="input_title">
<label for="">기종(모델)</label>
</td>
<td class="input_sub_title" >
<select name="product_objid" id="product_objid" required reqTitle="기종(모델)" type="select" class="select2">
<option value="">전체</option>
${code_map.product_code}
</select>
</td>
<td class="input_title">
<label for="">품번</label>
</td>
<td class="input_sub_title" >
<select name="part_objid" id="part_objid" class="select2" required reqTitle="품번" type="select">
<option value="">전체</option>
</select>
</td>
<td class="input_title">
<label for="">품명</label>
</td>
<td class="input_sub_title" id="part_name">
</td>
<td class="input_title">
<label for="">ECR NO</label>
</td>
<td colspan="7" class="input_sub_title" >
${ecrInfo.ECR_NO}
</td>
</tr>
<tr>
<td class="input_title">
<label for="">설변요청</label>
</td>
<td class="input_sub_title" colspan="7" style="text-align: left; word-spacing: 15px; padding-left:10px;">
${code_map.request_code}
</td>
</tr>
<tr>
<td class="input_title">
<label for="">제목</label>
</td>
<td class="input_sub_title" colspan="7">
<input type="text" name="title" id="title" value="${ecrInfo.TITLE}">
</td>
</tr>
</table>
<table class="pmsPopupForm" style="border:3px solid #000000;">
<tr>
<td colspan="2" style="border-right:1px solid #000000;text-align:center;"><span>[요청사항]</span></td>
<td colspan="2" style="border-right:1px solid #000000;text-align:center;"><span>[조치내역]</span></td>
</tr>
<tr>
<td style="border-right:1px solid #000000;text-align:center;" >
<textarea placeholder="요청사항" id="before_contents" name="before_contents" style="border:3px solid #ccc; width:100%; height:250px;">${ecrInfo.BEFORE_CONTENTS}</textarea>
</td>
<td style="border-right:1px solid #000000;text-align:center;" >
<div id="ecrDropZone" class="dropzone"style="width:98% !important; height:235px; margin:0;padding:0; line-height: 250px;">Drag & Drop Files Here</div>
<div id="ecrAttachFileArea"></div>
</td>
<td style="border-right:1px solid #000000;text-align:center;" >
<textarea placeholder="조치내역" id="after_contents" name="after_contents" style="border:3px solid #ccc; width:100%; height:250px;">${ecrInfo.AFTER_CONTENTS}</textarea>
</td>
<td style="border-right:1px solid #000000;text-align:center;">
<div id="ecr1DropZone" class="dropzone"style="width:98% !important; height:235px; margin:0;padding:0; line-height: 250px;">Drag & Drop Files Here</div>
<div id="ecrAttach1FileArea"></div>
</td>
</tr>
</table>
</div>
<div class="btn_wrap">
<div class="plm_btn_wrap_center">
<c:choose>
<c:when test="${actionType eq 'regist'}">
<input type="button" value="저장" id="btnSave" class="plm_btns create">
</c:when>
<c:otherwise>
<c:if test="${info.WRITER eq connectUserId or 'plm_admin' eq connectUserId}">
<input type="button" value="수정" id="btnSave" class="plm_btns create">
</c:if>
<c:if test="${info.WRITER ne connectUserId or 'plm_admin' eq connectUserId}">
<input type="button" value="조치" id="btnComplete" class="plm_btns create">
</c:if>
</c:otherwise>
</c:choose>
<input type="button" value="닫기" id="btnClose" class="plm_btns">
</div>
</div>
</section>
</form>
</body>
</html>