185 lines
5.3 KiB
Plaintext
185 lines
5.3 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+"DefaultRow").length){
|
|
$("#"+areaId+"DefaultRow").hide();
|
|
}
|
|
|
|
$.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 += "<colgroup>";
|
|
appendText +=" <col width='10%''>";
|
|
appendText +=" <col width='*'>";
|
|
appendText +=" <col width='20%'>";
|
|
appendText +=" </colgroup>";
|
|
appendText+= "<tr>";
|
|
appendText+= " <td>"+[i+1]+"</td>";
|
|
appendText+= " <td class='align_l'><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'> "+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+= "</td>";
|
|
appendText+= " <td>"+data[i].REGDATE+"</td>";
|
|
appendText+= "</tr>";
|
|
$("#"+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 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}");
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
</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%;">
|
|
<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="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> |