ERP-node/WebContent/WEB-INF/view/board/notice/noticeMainDetailPopUp.jsp

206 lines
5.8 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"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
<script type="text/javascript">
$(document).ready(function(){
fnc_setFileDropZone("dropzone", "${boardInfo.OBJID}", "${NOTICE_ATTACH_CODE}", "${NOTICE_ATTACH_NAME}", "fn_fileCallback",false);
fn_fileCallback();
$("#closeBtn").click(function(){
closeWin();
});
});
function save(){
if(confirm("저장하시겠습니까?")){
$.ajax({
type : "POST",
url : "/notice/saveNotice.do",
data:$("#form1").serialize(),
dataType:"JSON",
async:false,
error: function(jqxhr, status, error){
},
success: function(result){
Swal.fire(result.message);
opener.fn_search();
self.close();
}
});
}
}
function fn_fileCallback(){
$.ajax({
url:"/common/getFileList.do",
type:"POST",
data:{"targetObjId":"${boardInfo.OBJID}", "docType":"${NOTICE_ATTACH_CODE}"},
dataType:"json",
async:true,
success:function(data){
if(0 < data.length){
//파일드롭다운 영역 hide
$("#uploadedFileAreaDefault").hide();
//첨부파일 목록 영역 show
$("#specAttachFileList").show();
$("#uploadedFileArea").empty();
$.each(data, function(i){
var appendText = "";
appendText+= "<tr>";
appendText+= " <td><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'>"+data[i].REAL_FILE_NAME+"</a></td>";
appendText+= "</tr>";
$("#uploadedFileArea").append(appendText);
});
}else{
$("#uploadedFileAreaDefault").show();
$("#specAttachFileList").show();
$("#uploadedFileArea").empty();
}
},
error: function(jqxhr, status, error){
}
});
}
function openSpecDataPopUp(objid){
window.open("","specDataPopUp","width=900 height=780 menubar=no status=no");
var hiddenForm = document.form1;
var url = "/specData/specDataDetailViewPopup.do";
hiddenForm.objid.value = objid;
hiddenForm.target = "specDataPopUp";
hiddenForm.action = url;
hiddenForm.submit();
}
function setCookie( name, value, expiredays ){
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function closeWin(){
if ( document.form1.event.checked ){
setCookie("memo", "no" , 1); // 1일 간 쿠키적용
}
self.close();
}
</script>
</head>
<body class="backcolor_light_blue">
<form name="form1" id="form1" method="post">
<input type="hidden" name="objid" id="objid">
<input type="hidden" name="objId" id="objId" value="${boardInfo.OBJID}">
<input type="hidden" name="systemType" id="systemType" value="${empty boardInfo.SYSTEM_TYPE? systemType:boardInfo.SYSTEM_TYPE}">
<input type="hidden" name="boardType" id="boardType" value="notice">
<input type="hidden" name="actionType" id="actionType" value="${param.actionType}">
<div class="plm_menu_name">
<h2>
<span>공지사항_QnA</span>
</h2>
</div>
<div id="businessPopupFormWrap">
<table class="pmsPopupForm">
<colgroup>
<col width="8%">
<col width="77%">
<col width="5%">
<col width="3%">
</colgroup>
<tr>
<td class=input_title style="text-align:center;"><label for="" class="">구분</label></td>
<td colspan="3">
<select disabled style="border-top:0;border: 1px solid #ccc;">
<option>선택</option>
<option ${'notice' eq boardInfo.BOARD_TYPE ? 'selected' : ''}>공지사항</option>
<option ${'qna' eq boardInfo.BOARD_TYPE ? 'selected' : ''}>QnA</option>
</select>
</td>
</tr>
<tr>
<td class="input_title" style="text-align:center;"><label for="" class="">제목</label></td>
<td class="tr_data_border_bottom">
${boardInfo.TITLE}
</td>
<td class="" style="text-align:center;"><label for="">중요</label></td>
<td>
<input type="checkbox" name="important" id="important" ${!empty boardInfo.IMPORTANT? 'checked': ''} value="checked" disabled>
</td>
</tr>
<tr>
<td class="input_title" style="text-align:center;"><label for="">내용</label></td>
<td colspan="3">
<c:choose>
<c:when test="${'specRevision' eq boardInfo.REQ_CATEGORY}">
<a href="#" onclick="openSpecDataPopUp('${boardInfo.REQ_CONTENTS}');">바로가기</a>
</c:when>
<c:otherwise>
<textarea class="" style="width:100%;" rows="20" readonly name="reqContents" id="reqContents" placeholder="내용을 입력하세요." readonly>${boardInfo.REQ_CONTENTS}</textarea>
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<td class="input_title" rowspan="2" style="text-align:center;">
<label for="">첨부파일</label>
</td>
<td colspan="3">
<div id="specAttachFileList" style="height:110px;">
<table id="uploadedFileAreaTable" class="spec_data_in_table">
<colgroup>
<col width="*">
</colgroup>
<tbody id="uploadedFileAreaDefault">
<tr>
<td colspan="2">첨부된 파일이 없습니다.</td>
</tr>
</tbody>
<tbody id="uploadedFileArea">
</tbody>
</table>
</div>
</td>
</tr>
<tr>
</tr>
<tr>
<td class="" colspan="3" style="text-align:right; padding:2px 5px 0px 0px;"><label for="event">하루동안 열지않기</label></td>
<td >
<input type="checkbox" name="event" id="event">
</td>
</tr>
</table>
</div>
<div class="btnCenterWrap">
<center class="center_btns_wrap">
<input type="button" id="closeBtn" value="닫기" class="plm_btns">
</center>
</div>
</form>
</body>
</html>