177 lines
5.3 KiB
Plaintext
177 lines
5.3 KiB
Plaintext
<%@ 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>
|
|
</head>
|
|
<script>
|
|
var isAdmin = "${isAdmin}";
|
|
$(document).ready(function(){
|
|
$("#btn_close").click(function(){
|
|
self.close(0);
|
|
});
|
|
//첨부 파일 기능
|
|
fnc_setFileDropZone("fileDropZone","${param.targetObjId}","${docType}","${docTypeName}","fileAreaDraw",false,null,null);
|
|
|
|
fileAreaDraw();
|
|
|
|
$("#btnUpload").click(function(){
|
|
var files = $("#file1")[0].files;
|
|
if(files.length > 0){
|
|
fnc_fileMultiUpload(files, null, "${param.targetObjId}", "${docType}", "${docTypeName}", null, "fileAreaDraw");
|
|
//file객체 초기화
|
|
$("#file1").val("");
|
|
}else{
|
|
Swal.fire("선택된 File이 없습니다.");
|
|
}
|
|
});
|
|
|
|
$(document).on("click", ".btnDeleteFile", function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
//Swal.fire("objId : "+objId+", isAdmin : "+isAdmin);
|
|
fileDelete(objId, "fn_fileCallback", true);
|
|
});
|
|
|
|
});
|
|
</script>
|
|
<script>
|
|
function refeshAttachFileArea(){
|
|
fileAreaDraw();
|
|
}
|
|
//형상 영역을 display 한다.
|
|
function fileAreaDraw(){
|
|
fn_fileCallback("${docType}");
|
|
}
|
|
//첨부파일 목록을 가져온다.
|
|
function fn_fileCallback(fileType){
|
|
//Swal.fire("fromDate : ${param.search_fromDate}, toDate : ${param.search_toDate}");
|
|
fileType = fnc_checkNull(fileType);
|
|
if(fileType == "") fileType = $("#docType").val();
|
|
$.ajax({
|
|
url:"/common/getFileList.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${param.targetObjId}", "docType":fileType, "search_fromDate":"${param.search_fromDate}", "search_toDate":"${param.search_toDate}"},
|
|
dataType:"json",
|
|
success:function(data){
|
|
if(0 <data.length){
|
|
|
|
$("#fileArea").empty();
|
|
|
|
$.each(data, function(i){
|
|
var appendText ="";
|
|
|
|
appendText +="<colgroup>";
|
|
appendText +=" <col width='10%''>";
|
|
appendText +=" <col width='*'>";
|
|
appendText +=" <col width='15%'>";
|
|
appendText +=" <col width='15%'>";
|
|
appendText +=" <col width='15%''>";
|
|
appendText +="</colgroup>";
|
|
appendText += "<tr>";
|
|
appendText += " <td>"+[i+1]+"</td>";
|
|
appendText += "<td class='align_l'>";
|
|
appendText += "<a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'> "+data[i].REAL_FILE_NAME+"</a>";
|
|
if(isAdmin){
|
|
appendText += " <input type='button' class='date_delete btnDeleteFile' value='x' data-OBJID='"+data[i].OBJID+"'>";
|
|
}
|
|
appendText += "</td>";
|
|
appendText += " <td>"+data[i].DEPT_NAME+"</td>"
|
|
appendText += " <td>"+data[i].USER_NAME+"</td>"
|
|
appendText += " <td>"+data[i].REGDATE+"</td>"
|
|
appendText += "</tr>";
|
|
|
|
$("#fileArea").append(appendText);
|
|
});
|
|
}else{
|
|
$("#fileArea").empty();
|
|
var appendText = "";
|
|
appendText += "<tr>";
|
|
appendText += "<td colspan='5'>첨부 파일이 없습니다.</td>";
|
|
appendText +="</tr>";
|
|
$("#fileArea").append(appendText);
|
|
}
|
|
},
|
|
error: function(jqxhr,status,error){
|
|
}
|
|
});
|
|
}//파일 첨부 END
|
|
//첨부 파일 삭제
|
|
function fileDelete(fileObjId, callbackFnc, confirmFlag){
|
|
if(confirmFlag){
|
|
fnc_deleteFile(fileObjId,callbackFnc);
|
|
}else{
|
|
$.ajax({
|
|
url:"/common/deleteFileInfo.do",
|
|
type:"POST",
|
|
data:{"objId":fileObjId},
|
|
dataType:"json",
|
|
async :true,
|
|
success:function(data){
|
|
eval(callbackFnc+"();");
|
|
},
|
|
error: function(jqxhr,status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
</script>
|
|
<body>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="docType" id="docType" value="${docType}" />
|
|
<section class="business_staff_popup_min_width">
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>${docTypeName}</span>
|
|
</h2>
|
|
</div>
|
|
<div id="businessPopupFormWrap">
|
|
<div class="form_popup_title"> ${docTypeName} 자료등록</div>
|
|
<table class="pmsPopupForm">
|
|
<tr>
|
|
<td rowspan="2" class="input_title align_c">파일첨부</td>
|
|
<td colspan="5">
|
|
<div id="fileDropZone" class="dropZone">Drag & Drop Files Here</div>
|
|
<div id="fileAreaTable" class="spec_data_in_table">
|
|
<input type="file" name="file1" id="file1" multiple>
|
|
<input type="button" id="btnUpload" value="Upload" class="upload_btns">
|
|
<div style="overflow-y:scroll;">
|
|
<table id="" class="fileListscrollThead" style="width: 100% !important;">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
</colgroup>
|
|
<tr>
|
|
<td>No</td>
|
|
<td>파일명</td>
|
|
<td>팀명</td>
|
|
<td>등록자</td>
|
|
<td>등록일</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div style="width:100%; height: 90px; overflow-y: scroll; border-bottom: 2px solid #cacaca;">
|
|
<table id="fileArea" class="fileListscrollTbody">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="닫기" id="btn_close" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |