201 lines
5.9 KiB
Plaintext
201 lines
5.9 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>
|
|
<style type="text/css">
|
|
.pmsPopupForm tr:last-child td{border-bottom:1px solid #ccc;}
|
|
</style>
|
|
</head>
|
|
<script>
|
|
$(document).ready(function(){
|
|
$("#btnClose").click(function(){
|
|
self.close(0);
|
|
});
|
|
|
|
fnc_setFileDropZone("usedMngDropZone", "${param.OBJID}", "${param.DOC_TYPE}", "${param.TITLE}", "usedMngAreaDraw",false,null,null);
|
|
|
|
usedMngAreaDraw();
|
|
|
|
$("#usedMngDropZone").hide();
|
|
if("${resultMap.WRITER eq connectUserId and resultMap.STATUS_TITLE ne '결재중'}"){
|
|
$("#usedMngDropZone").show();
|
|
}
|
|
});
|
|
|
|
</script>
|
|
<script>
|
|
//형상 영역을 display 한다.
|
|
function usedMngAreaDraw(){
|
|
fn_fileCallback("usedMng","${param.DOC_TYPE}");
|
|
}
|
|
|
|
//첨부파일 목록을 가져온다.
|
|
function fn_fileCallback(areaId,fileType){
|
|
$.ajax({
|
|
url:"/common/getFileList.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${param.OBJID}", "docType":fileType},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
|
|
if(0 < data.length){
|
|
|
|
//첨부파일 목록 영역 show
|
|
$("#"+areaId+"FileArea").empty();
|
|
|
|
if(0 < $("#"+areaId+"DropZone").length){
|
|
$("#"+areaId+"FileArea").show();
|
|
}
|
|
|
|
$.each(data, function(i){
|
|
var appendText = "";
|
|
var path = data[i].FILE_PATH;
|
|
var fileName = data[i].SAVED_FILE_NAME;
|
|
var realFileName = data[i].REAL_FILE_NAME;
|
|
|
|
var srcLocation = encodeURI("/common/viewImage.do?realFileName="+realFileName+"&savedFileName="+fileName+"&attDir="+path);
|
|
|
|
appendText+="<colgroup>";
|
|
appendText+=" <col width='*'>";
|
|
appendText+="</colgroup>";
|
|
appendText+= "<tr>";
|
|
appendText+= " <td>";
|
|
appendText = " <img src='"+srcLocation+"' height='210px' width='99%' onclick='openImagePopUp(this.src)' style='cursor:pointer;' />"
|
|
appendText+= " <a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'> "+data[i].REAL_FILE_NAME+"</a>";
|
|
<c:if test="${param.actionType eq 'regist' or resultMap.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+= " </td>";
|
|
appendText+= "</tr>";
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
});
|
|
}else{
|
|
$("#"+areaId+"DropZone").show();
|
|
$("#"+areaId+"FileArea").empty();
|
|
var appendText = "";
|
|
appendText += "<tr>";
|
|
appendText += "<td>첨부 파일이 없습니다.</td>";
|
|
appendText +="</tr>";
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
}
|
|
|
|
opener.fn_getUsedMngFormPopUpFileInfo();
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}//파일 첨부 END
|
|
|
|
|
|
/*첨부 파일 삭제 */
|
|
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){
|
|
fn_fileCallback("usedMng","${param.DOC_TYPE}");
|
|
|
|
opener.fn_getUsedMngFormPopUpFileInfo();
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
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'");
|
|
}
|
|
|
|
</script>
|
|
<body>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="objId" id="objId" value="${param.OBJID}">
|
|
<section>
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>${param.TITLE}</span>
|
|
</h2>
|
|
</div>
|
|
<div id="businessPopupFormWrap" >
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="*">
|
|
</colgroup>
|
|
<tr>
|
|
<td>
|
|
<div id="usedMngDropZone" class="dropzone"style="width:99% !important;">Drag & Drop Files Here</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="project_form_in_table"style="width:100%" id="usedMngFileAreaTable" >
|
|
<div style="overflow-y:scroll;">
|
|
<table class="" style="width:100%;${param.DOC_TYPE eq 'USED_MNG_IMAGE' ? 'display:none' : ''}">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="20%">
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td>No</td>
|
|
<td>첨부파일명</td>
|
|
<td>등록일</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div class="plm_scroll_table" style="${param.DOC_TYPE eq 'USED_MNG_IMAGE' ? 'height:330px' : 'height:75px'};">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="20%">
|
|
</colgroup>
|
|
</table>
|
|
<table id="usedMngFileArea" class="fileListscrollTbody">
|
|
<tr>
|
|
<td colspan="3">첨부 파일이 없습니다.</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |