관리자 기소유예 - 첨부파일기능, 관할청 공통코드 추가
This commit is contained in:
parent
79c001f4b6
commit
b6e4effa14
@ -1697,6 +1697,8 @@ public class EgovLoginController {
|
||||
return "redirect:/web/main/mainPage.do";
|
||||
} else if ("ROLE_VISIT".equals(user.getAuthority())) {
|
||||
return "redirect:/cmm/main/mainPage.do";
|
||||
} else if ("ROLE_ADR_JRSDC".equals(user.getAuthority())) {
|
||||
return "redirect:/kccadr/oprtn/cndtnSspnIdtmt/trgtList.do";
|
||||
} else if ("ROLE_USER_MEMBER".equals(user.getAuthority())) {
|
||||
System.out.println("비정상적인 사용자 redirect 임");
|
||||
return "redirect:/web/main/mainPage.do";
|
||||
|
||||
@ -38,6 +38,7 @@ public class CndtnTrgtMngVO extends ComDefaultVO implements Serializable {
|
||||
private String prsctrNm; // 검사성명
|
||||
private String reqStateCd; // 의뢰상태코드
|
||||
private String prcsAplctPrdOrdCmplt;// 중복확인을 위한 신청강의 PK
|
||||
private String atchFileId;// 첨부파일 ID
|
||||
|
||||
|
||||
|
||||
@ -183,6 +184,12 @@ public class CndtnTrgtMngVO extends ComDefaultVO implements Serializable {
|
||||
public void setPrcsAplctPrdOrdCmplt(String prcsAplctPrdOrdCmplt) {
|
||||
this.prcsAplctPrdOrdCmplt = prcsAplctPrdOrdCmplt;
|
||||
}
|
||||
public String getAtchFileId() {
|
||||
return atchFileId;
|
||||
}
|
||||
public void setAtchFileId(String atchFileId) {
|
||||
this.atchFileId = atchFileId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -13,12 +13,16 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import kcc.com.cmm.LoginVO;
|
||||
import kcc.com.cmm.service.EgovFileMngService;
|
||||
import kcc.com.cmm.service.FileVO;
|
||||
import kcc.com.cmm.util.StringUtil;
|
||||
import kcc.com.utl.user.service.CheckFileUtil;
|
||||
import kcc.com.utl.user.service.CheckLoginUtil;
|
||||
import kcc.let.uat.uia.service.SsoLoginVO;
|
||||
import kcc.ve.instr.tngrVisitEdu.prcsInfo.service.VEPrcsAplctPrdService;
|
||||
@ -85,6 +89,18 @@ public class CndtnTrgtMngController {
|
||||
//과정차시 관리
|
||||
@Resource(name = "vEPrcsAplctPrdService")
|
||||
private VEPrcsAplctPrdService vEPrcsAplctPrdService;
|
||||
|
||||
|
||||
//파일 체크 util
|
||||
@Resource(name = "checkFileUtil")
|
||||
private CheckFileUtil checkFileUtil;
|
||||
|
||||
|
||||
//파일정보의 관리
|
||||
@Resource(name = "EgovFileMngService")
|
||||
private EgovFileMngService fileService;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
// 교육신청 서비스단
|
||||
@ -283,8 +299,8 @@ public class CndtnTrgtMngController {
|
||||
public ModelAndView cndtnEduPrcsMngRegAjax(
|
||||
@ModelAttribute("cndtnTrgtInfoMngVO") CndtnTrgtMngVO cndtnTrgtInfoMngVO
|
||||
, ModelMap model
|
||||
//, RedirectAttributes redirectAttributes
|
||||
, HttpServletRequest request
|
||||
, final MultipartHttpServletRequest multiRequest
|
||||
) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
@ -305,7 +321,28 @@ public class CndtnTrgtMngController {
|
||||
SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기
|
||||
|
||||
|
||||
//step2.파일 처리====================================
|
||||
//파일 정상 처리 여부와 첨부 파일 정보
|
||||
//String atchFileId = this.takeFile(multiRequest, modelAndView, bmVO);
|
||||
//파일 제한 수량 가져오기, 없으면 기본값 사용
|
||||
int i_file_limit = checkFileUtil.getLimitCount(request); // file count
|
||||
int i_limit_size = checkFileUtil.getLimitSize(request); // file MB
|
||||
String s_file_exts = checkFileUtil.getS_exts(); // file exts
|
||||
|
||||
String s_scholSealAtchFileId = checkFileUtil.fileValCheckNdbInsert(
|
||||
multiRequest, modelAndView
|
||||
, "APLCT_" //file_name_prefix
|
||||
, s_file_exts
|
||||
, i_limit_size
|
||||
, i_file_limit
|
||||
); //EXT, MB size and ea
|
||||
|
||||
if ("ERROR".equals(s_scholSealAtchFileId)) return modelAndView;
|
||||
System.out.println("s_scholSealAtchFileId :: "+ s_scholSealAtchFileId);
|
||||
|
||||
|
||||
cndtnTrgtInfoMngVO.setSspnIdtmtTrgtOrd(trgtOrdService.getNextStringId());
|
||||
cndtnTrgtInfoMngVO.setAtchFileId(s_scholSealAtchFileId); //학교장직인 첨부파일
|
||||
cndtnTrgtInfoMngVO.setFrstRegisterId(loginVO.getUniqId()); //esntl_id
|
||||
// vEPrcsDetailVO.setPrcsOrd(prcsOrd);
|
||||
// vEPrcsDetailVO.setLctrDivCd("60"); //강의구분코드 VE0011 10-청소년강의, 20-성인강의, 30-체험, 50-기반강화, 60-조건부
|
||||
@ -331,6 +368,7 @@ public class CndtnTrgtMngController {
|
||||
, ModelMap model
|
||||
//, RedirectAttributes redirectAttributes
|
||||
, HttpServletRequest request
|
||||
, final MultipartHttpServletRequest multiRequest
|
||||
) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
@ -351,6 +389,56 @@ public class CndtnTrgtMngController {
|
||||
SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기
|
||||
|
||||
|
||||
//step2.첨부파일 체크 후 저장 하기
|
||||
String s_scholSealAtchFileId = "";
|
||||
s_scholSealAtchFileId = cndtnTrgtInfoMngVO.getAtchFileId();
|
||||
|
||||
//DB에서 실제 첨부파일 존재 여부 확인
|
||||
FileVO fileVO = new FileVO();
|
||||
fileVO.setAtchFileId(s_scholSealAtchFileId);
|
||||
List<FileVO> result = fileService.selectFileInfs(fileVO);
|
||||
if (result.size()<=0) {
|
||||
s_scholSealAtchFileId = "";
|
||||
}
|
||||
|
||||
|
||||
//step3.파일 처리====================================
|
||||
//파일 정상 처리 여부와 첨부 파일 정보
|
||||
//String atchFileId = this.takeFile(multiRequest, modelAndView, bmVO);
|
||||
//파일 제한 수량 가져오기, 없으면 기본값 사용
|
||||
int i_file_limit = checkFileUtil.getLimitCount(request); // file count
|
||||
int i_limit_size = checkFileUtil.getLimitSize(request); // file MB
|
||||
String s_file_exts = checkFileUtil.getS_exts(); // file exts
|
||||
|
||||
|
||||
//기존 파일 존재 여부에 따라서 insert or update 처리
|
||||
if ("".equals(s_scholSealAtchFileId)) {
|
||||
//atchFileId = this.fileValCheckNdbInsert(multiRequest, modelAndView, checkFileUtil.getS_exts(), i_limit_size, i_file_limit); //EXT, MB size and ea
|
||||
s_scholSealAtchFileId = checkFileUtil.fileValCheckNdbInsert(
|
||||
multiRequest, modelAndView
|
||||
, "APLCT_"
|
||||
, s_file_exts
|
||||
, i_limit_size
|
||||
, i_file_limit
|
||||
); //EXT, MB size and ea
|
||||
cndtnTrgtInfoMngVO.setAtchFileId(s_scholSealAtchFileId);
|
||||
}else {
|
||||
//atchFileId = this.fileValCheckNdbUpdate(multiRequest, modelAndView, checkFileUtil.getS_exts(), i_limit_size, i_file_limit, atchFileId); //EXT, MB size and ea
|
||||
s_scholSealAtchFileId = checkFileUtil.fileValCheckNdbUpdate(
|
||||
multiRequest, modelAndView
|
||||
, "APLCT_"
|
||||
, s_file_exts
|
||||
, i_limit_size
|
||||
, i_file_limit
|
||||
, s_scholSealAtchFileId
|
||||
); //EXT, MB size and ea
|
||||
}
|
||||
|
||||
if ("ERROR".equals(s_scholSealAtchFileId)) return modelAndView;
|
||||
|
||||
|
||||
|
||||
|
||||
cndtnTrgtInfoMngVO.setLastUpdusrId(loginVO.getUniqId()); //esntl_id
|
||||
cndtnTrgtInfoMngService.update(cndtnTrgtInfoMngVO);
|
||||
|
||||
@ -383,7 +471,14 @@ public class CndtnTrgtMngController {
|
||||
//과정 조회
|
||||
CndtnTrgtMngVO cndtnTrgtInfoVO = cndtnTrgtInfoMngService.selectDetail(cndtnTrgtInfoMngVO);
|
||||
model.addAttribute("info", cndtnTrgtInfoVO);
|
||||
//세부과정 목록 조회
|
||||
|
||||
|
||||
//파일 정보 가져오기
|
||||
FileVO fileVO = new FileVO();
|
||||
fileVO.setAtchFileId(cndtnTrgtInfoVO.getAtchFileId());
|
||||
List<FileVO> result = fileService.selectFileInfs(fileVO);
|
||||
model.addAttribute("fileList", result);
|
||||
model.addAttribute("fileListCnt", result.size());
|
||||
|
||||
return "oprtn/cndtnSspnIdtmt/trgtDetail";
|
||||
}
|
||||
@ -449,6 +544,14 @@ public class CndtnTrgtMngController {
|
||||
CndtnTrgtMngVO cndtnTrgtInfoVO = cndtnTrgtInfoMngService.selectDetail(cndtnTrgtInfoMngVO);
|
||||
model.addAttribute("info", cndtnTrgtInfoVO);
|
||||
|
||||
|
||||
//파일 정보 가져오기
|
||||
FileVO fileVO = new FileVO();
|
||||
fileVO.setAtchFileId(cndtnTrgtInfoVO.getAtchFileId());
|
||||
List<FileVO> result = fileService.selectFileInfs(fileVO);
|
||||
model.addAttribute("fileList", result);
|
||||
model.addAttribute("fileListCnt", result.size());
|
||||
|
||||
return "oprtn/cndtnSspnIdtmt/trgtMdfy";
|
||||
}
|
||||
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
, req_nmbr
|
||||
, prsctr_nm
|
||||
, req_state_cd
|
||||
, atch_file_id
|
||||
</sql>
|
||||
|
||||
<!-- 조회용 공통 컬럼 명 -->
|
||||
@ -62,6 +63,7 @@
|
||||
, a.req_nmbr AS reqNmbr
|
||||
, a.prsctr_nm AS prsctrNm
|
||||
, a.req_state_cd AS reqStateCd
|
||||
, a.atch_file_id AS atchFileId
|
||||
</sql>
|
||||
|
||||
|
||||
@ -93,6 +95,7 @@
|
||||
, #reqNmbr#
|
||||
, #prsctrNm#
|
||||
, #reqStateCd#
|
||||
, #atchFileId#
|
||||
)
|
||||
</insert>
|
||||
|
||||
@ -132,6 +135,7 @@
|
||||
, req_nmbr = #reqNmbr#
|
||||
, prsctr_nm = #prsctrNm#
|
||||
, req_state_cd = #reqStateCd#
|
||||
, atch_file_id = #atchFileId#
|
||||
WHERE
|
||||
sspn_idtmt_trgt_ord = #sspnIdtmtTrgtOrd#
|
||||
</update>
|
||||
|
||||
@ -107,7 +107,7 @@
|
||||
<tr>
|
||||
<th scope="row">관할청</th>
|
||||
<td>
|
||||
<c:out value="${info.cmptntAthrt }" />
|
||||
<ve:code codeId="VEA008" code="${info.cmptntAthrt }"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -170,6 +170,17 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<p>첨부파일</p>
|
||||
</th>
|
||||
<td>
|
||||
<c:import url="/cmm/fms/selectBBSFileInfs.do" charEncoding="utf-8">
|
||||
<c:param name="param_atchFileId" value="${info.atchFileId}" />
|
||||
<c:param name="pdf_view" value="Y" />
|
||||
</c:import>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -303,7 +303,7 @@
|
||||
<c:out value="${list.vntYear }" />형제<c:out value="${list.vntNmbr }" />
|
||||
</td>
|
||||
<td>
|
||||
<c:out value="${list.cmptntAthrt }" />
|
||||
<ve:code codeId="VEA008" code="${list.cmptntAthrt }"/>
|
||||
</td>
|
||||
<td>
|
||||
<c:out value="${list.dBirth }" />
|
||||
|
||||
@ -29,7 +29,16 @@
|
||||
<title>교육과정관리</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<script type="text/javascript">
|
||||
//세부과정 추가 버튼 클릭 시 세부과정 추가
|
||||
$(document).ready(function() {
|
||||
//파일첨부관련 설정들===============================================
|
||||
$(".btn_type01").on('click', function(){
|
||||
$("#file_temp").click();
|
||||
});
|
||||
|
||||
//파일첨부관련 설정들===============================================
|
||||
});
|
||||
|
||||
|
||||
function addPro() {
|
||||
var addQuest = $(".addPro_wrap");
|
||||
var questLen = addQuest.children("div").length;
|
||||
@ -105,28 +114,36 @@
|
||||
}
|
||||
|
||||
var data = new FormData(document.getElementById("createForm"));
|
||||
if(confirm("수정하시겠습니까?")){
|
||||
var url = "<c:url value='/kccadr/oprtn/cndtnSspnIdtmt/trgtMdfyAjax.do'/>";
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: url,
|
||||
data: data,
|
||||
dataType:'json',
|
||||
async: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
success:function(returnData){
|
||||
if(returnData.result == "success"){
|
||||
alert("수정되었습니다.");
|
||||
fncGoList();
|
||||
}
|
||||
},
|
||||
error:function(request , status, error){
|
||||
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
|
||||
|
||||
//첨부파일 등록 처리-step2
|
||||
_fileForm2.forEach(function(obj, idx) {
|
||||
if (obj) data.append("file"+idx, obj.fileObj);
|
||||
});
|
||||
|
||||
if(confirm("수정하시겠습니까?")){
|
||||
var url = "<c:url value='/kccadr/oprtn/cndtnSspnIdtmt/trgtMdfyAjax.do'/>";
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
enctype: 'multipart/form-data',
|
||||
url: url,
|
||||
data: data,
|
||||
dataType:'json',
|
||||
async: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
success:function(returnData){
|
||||
if(returnData.result == "success"){
|
||||
alert("수정되었습니다.");
|
||||
fncGoList();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error:function(request , status, error){
|
||||
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -147,7 +164,7 @@
|
||||
}
|
||||
|
||||
// 관할청 검사
|
||||
if($("input[name='cmptntAthrt']").val().trim() == ""){
|
||||
if($("input[name='cmptntAthrt']").val()){
|
||||
alert("관할청을 입력해주세요.");
|
||||
$("input[name='cmptntAthrt']").focus();
|
||||
return true;
|
||||
@ -181,11 +198,11 @@
|
||||
}
|
||||
|
||||
// 의뢰상태 검사
|
||||
if($("#reqStateCd").val().trim() == ""){
|
||||
/* if($("#reqStateCd").val().trim() == ""){
|
||||
alert("의뢰상태를 입력해주세요.");
|
||||
$("input[name='reqStateCd']").focus();
|
||||
return true;
|
||||
}
|
||||
} */
|
||||
|
||||
// 교육상태 검사
|
||||
/* if($("input[name='eduStateCd']").val().trim() == ""){
|
||||
@ -219,6 +236,39 @@
|
||||
listForm.submit();
|
||||
}
|
||||
|
||||
/* 파일등록 */
|
||||
var _fileIdx = 0;
|
||||
var _fileForm2 = new Array();
|
||||
function handleFileUpload(files,obj) //업로드 function
|
||||
{
|
||||
var limitsize = 20*1024*1024; //파일 제한 체크(1개, 20MB)
|
||||
for (var i = 0; i < files.length; i++){
|
||||
if(files[i].size > limitsize){
|
||||
alert(files[i].name+"파일 사이즈가"+getStrFileSize(files[i].size)+"로 20MB이하만 업로드 가능합니다.");
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < files.length; i++)
|
||||
{
|
||||
var fd = new FormData();
|
||||
fd.append('file', files[i]);
|
||||
var tmpObj = new Object();
|
||||
tmpObj.name = "file_" + _fileIdx;
|
||||
tmpObj.fileObj = files[i];
|
||||
|
||||
_fileForm2.push(tmpObj);
|
||||
sendFileToServer(fd, obj, files[i], _fileIdx);
|
||||
_fileIdx++;
|
||||
|
||||
var totalfileSize = 0;
|
||||
$('.totalfileCount').text($('.item_file_size').length) ;
|
||||
$('.item_file_size').each(function(){
|
||||
totalfileSize += $(this).val()*1 ;
|
||||
});
|
||||
$('.totalfileSize').text(getStrFileSize(totalfileSize)) ;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
@ -227,6 +277,7 @@
|
||||
</form:form>
|
||||
<form:form id="createForm" name="createForm" commandName="vEPrcsDetailVO" method="post">
|
||||
<input type="hidden" name="sspnIdtmtTrgtOrd" value="<c:out value='${info.sspnIdtmtTrgtOrd}' />"/>
|
||||
<input type="hidden" name="atchFileId" value="<c:out value='${info.atchFileId}' />" />
|
||||
<!-- cont -->
|
||||
<div class="cont_wrap">
|
||||
<div class="box">
|
||||
@ -281,7 +332,10 @@
|
||||
<tr>
|
||||
<th scope="row">관할청</th>
|
||||
<td>
|
||||
<input type="text" name="cmptntAthrt" value="<c:out value="${info.cmptntAthrt }" />" />
|
||||
<ve:select codeId="VEA008" name="cmptntAthrt" id="cmptntAthrt" css="class='sel_type1'"
|
||||
selectedText="${info.cmptntAthrt }" defaultValue=""
|
||||
defaultText='선택'
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -358,6 +412,87 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<p class="req_text"><span>필수입력 항목</span>*</p>
|
||||
<p>첨부파일</p>
|
||||
</th>
|
||||
<td class="upload_area" colspan="3">
|
||||
<!-- <input type="text" id="fileNm" size="30" class="file_input" readonly> --><!-- <button type="button" class="btnType01 btn_add_file">파일 첨부하기</button> -->
|
||||
<input type="file" id="file_temp" name="file_temp" class="uploadFile" style="display:none"/>
|
||||
<button type="button" id="filebutton" class="btn_type01">파일 첨부하기</button>
|
||||
<p style="padding-left:30px;">첨부파일 가능 용량은 20MB입니다. </p><p style="color:red;font-weight:500">업로드 순서는 1.신청서 2.안내문 입니다.</p>
|
||||
<div class="file_wrap file_upload_box no_img_box">
|
||||
<table class="tbType02">
|
||||
<caption>첨부파일 리스트 : 파일명, 종류, 크기, 삭제</caption>
|
||||
<colgroup>
|
||||
<col style="width: 60%;">
|
||||
<col style="width: auto;">
|
||||
<col style="width: 20%;">
|
||||
<col style="width: 10%;">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<!-- <th>
|
||||
<input type="checkbox" id="all_check"><label for="all_check"></label>
|
||||
</th> -->
|
||||
<th scope="col">파일 명</th>
|
||||
<th scope="col">종류</th>
|
||||
<th scope="col">크기</th>
|
||||
<th scope="col">삭제</th>
|
||||
</thead>
|
||||
<tbody class="tb_file_before">
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<p>첨부하실 파일을 <span>마우스로 끌어서</span> 넣어주세요.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="file_wrap fileAfter file_list_div">
|
||||
<table class="tbType02">
|
||||
<caption>첨부파일 리스트 : 파일명, 종류, 크기, 삭제</caption>
|
||||
<colgroup>
|
||||
<col style="width: 60%">
|
||||
<col style="width: 10%">
|
||||
<col style="width: 20%">
|
||||
<col style="width: 10%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<!-- <th>
|
||||
<input type="checkbox" id="all_check"><label for="all_check"></label>
|
||||
</th> -->
|
||||
<th scope="col">파일 명</th>
|
||||
<th scope="col">종류</th>
|
||||
<th scope="col">크기</th>
|
||||
<th scope="col">삭제</th>
|
||||
</thead>
|
||||
<tbody id="tbody_fiielist" class="tb_file_after">
|
||||
<c:forEach var="fileList" items="${fileList}" varStatus="status">
|
||||
<tr class="item_<c:out value='${fileList.atchFileId}' />_<c:out value='${fileList.fileSn}' /> uploaded_obj">
|
||||
<input type="hidden" name="fileSize" class="item_file_size" value="${fileList.fileSize}">
|
||||
<td class="td_filename">
|
||||
<!-- <img src="/direct/img/upload_hwp_img.png" alt="" /> -->
|
||||
<span class="file_name_text"><c:out value='${fileList.orignlFileNm}' /></span>
|
||||
</td>
|
||||
<td class="td_filesort">
|
||||
<span class="file_filesort_text" value="<c:out value="${fileList.fileExtsn}"/>"><c:out value="${fileList.fileExtsn}"/></span>
|
||||
</td>
|
||||
<td class="td_filesize">
|
||||
<span class="file_size_text" value="<c:out value="${fileList.fileMg}"/>"><c:out value="${fileList.fileMg}"/></span>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn_del" onclick="delAtchFile('<c:out value='${fileList.atchFileId}' />', '<c:out value='${fileList.fileSn}' />'); return false;" title="파일삭제"><i></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -31,22 +31,9 @@
|
||||
<script type="text/javascript">
|
||||
//세부과정 추가 버튼 클릭 시 세부과정 추가
|
||||
$(document).ready(function() {
|
||||
/* $('#dBirth').on('input', function() {
|
||||
var input = $(this).val();
|
||||
var length = input.length;
|
||||
var lastChar = input.charAt(length - 1);
|
||||
|
||||
// 숫자만 입력되도록 검사
|
||||
if (!lastChar.match(/[0-9]/)) {
|
||||
$(this).val(input.substring(0, length - 1));
|
||||
return;
|
||||
}
|
||||
|
||||
// 포맷 적용
|
||||
if (length === 4 || length === 7) {
|
||||
$(this).val(input + '-');
|
||||
}
|
||||
}); */
|
||||
$(".btn_type01").on('click', function(){
|
||||
$("#file_temp").click();
|
||||
});
|
||||
});
|
||||
|
||||
function fncSave(){
|
||||
@ -57,29 +44,40 @@
|
||||
}
|
||||
|
||||
var data = new FormData(document.getElementById("createForm"));
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
var url = "${pageContext.request.contextPath}/kccadr/oprtn/cndtnSspnIdtmt/trgtRegAjax.do";
|
||||
console.log(data);
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: url,
|
||||
data: data,
|
||||
dataType:'json',
|
||||
async: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
success:function(returnData){
|
||||
if(returnData.result == "success"){
|
||||
alert("저장되었습니다.");
|
||||
fncGoList();
|
||||
}
|
||||
},
|
||||
error:function(request , status, error){
|
||||
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
|
||||
|
||||
//첨부파일 등록 처리-step2
|
||||
_fileForm2.forEach(function(obj, idx) {
|
||||
if (obj) data.append("file"+idx, obj.fileObj);
|
||||
|
||||
});
|
||||
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
var url = "${pageContext.request.contextPath}/kccadr/oprtn/cndtnSspnIdtmt/trgtRegAjax.do";
|
||||
console.log(data);
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
enctype: 'multipart/form-data',
|
||||
url: url,
|
||||
data: data,
|
||||
dataType:'json',
|
||||
async: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
success:function(returnData){
|
||||
console.log('returnData :: ', returnData);
|
||||
if(returnData.result == "success"){
|
||||
alert("저장되었습니다.");
|
||||
fncGoList();
|
||||
}else if(returnData.result == "fail"){
|
||||
alert(returnData.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error:function(request , status, error){
|
||||
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -107,7 +105,7 @@
|
||||
}
|
||||
|
||||
// 관할청 검사
|
||||
if($("input[name='cmptntAthrt']").val().trim() == ""){
|
||||
if($("input[name='cmptntAthrt']").val()){
|
||||
alert("관할청을 입력해주세요.");
|
||||
$("input[name='cmptntAthrt']").focus();
|
||||
return true;
|
||||
@ -179,6 +177,40 @@
|
||||
listForm.submit();
|
||||
}
|
||||
|
||||
/* 파일등록 */
|
||||
var _fileIdx = 0;
|
||||
var _fileForm2 = new Array();
|
||||
function handleFileUpload(files,obj) //업로드 function
|
||||
{
|
||||
console.log('files', files);
|
||||
var limitsize = 20*1024*1024; //파일 제한 체크(1개, 20MB)
|
||||
for (var i = 0; i < files.length; i++){
|
||||
if(files[i].size > limitsize){
|
||||
alert(files[i].name+"파일 사이즈가"+getStrFileSize(files[i].size)+"로 20MB이하만 업로드 가능합니다.");
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < files.length; i++)
|
||||
{
|
||||
var fd = new FormData();
|
||||
fd.append('file', files[i]);
|
||||
var tmpObj = new Object();
|
||||
tmpObj.name = "file_" + _fileIdx;
|
||||
tmpObj.fileObj = files[i];
|
||||
|
||||
_fileForm2.push(tmpObj);
|
||||
sendFileToServer(fd, obj, files[i], _fileIdx);
|
||||
_fileIdx++;
|
||||
|
||||
var totalfileSize = 0;
|
||||
$('.totalfileCount').text($('.item_file_size').length) ;
|
||||
$('.item_file_size').each(function(){
|
||||
totalfileSize += $(this).val()*1 ;
|
||||
});
|
||||
$('.totalfileSize').text(getStrFileSize(totalfileSize)) ;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
@ -239,7 +271,10 @@
|
||||
<tr>
|
||||
<th scope="row">관할청</th>
|
||||
<td>
|
||||
<input type="text" name="cmptntAthrt" />
|
||||
<ve:select codeId="VEA008" name="cmptntAthrt" id="cmptntAthrt" css="class='sel_type1'"
|
||||
selectedText="" defaultValue=""
|
||||
defaultText='선택'
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -316,6 +351,88 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<p class="req_text"><span>필수입력 항목</span>*</p>
|
||||
<p>첨부파일</p>
|
||||
</th>
|
||||
<td class="upload_area" colspan="3">
|
||||
<!-- <input type="text" id="fileNm" size="30" class="file_input" readonly> --><!-- <button type="button" class="btnType01 btn_add_file">파일 첨부하기</button> -->
|
||||
<input type="file" id="file_temp" name="file_temp" class="uploadFile" style="display:none"/>
|
||||
<button type="button" id="filebutton" class="btn_type01">파일 첨부하기</button>
|
||||
<p style="padding-left:30px;">첨부파일 가능 용량은 20MB입니다. </p><!-- <p style="color:red;font-weight:500">업로드 순서는 1.신청서 2.안내문 입니다.</p> -->
|
||||
<div class="file_wrap file_upload_box no_img_box">
|
||||
<table class="tbType02">
|
||||
<caption>첨부파일 리스트 : 파일명, 종류, 크기, 삭제</caption>
|
||||
<colgroup>
|
||||
<col style="width: 60%;">
|
||||
<col style="width: auto;">
|
||||
<col style="width: 20%;">
|
||||
<col style="width: 10%;">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<!-- <th>
|
||||
<input type="checkbox" id="all_check"><label for="all_check"></label>
|
||||
</th> -->
|
||||
<th scope="col">파일 명</th>
|
||||
<th scope="col">종류</th>
|
||||
<th scope="col">크기</th>
|
||||
<th scope="col">삭제</th>
|
||||
</thead>
|
||||
<tbody class="tb_file_before">
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<p>첨부하실 파일을 <span>마우스로 끌어서</span> 넣어주세요.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="file_wrap fileAfter file_list_div">
|
||||
<table class="tbType02">
|
||||
<caption>첨부파일 리스트 : 파일명, 종류, 크기, 삭제</caption>
|
||||
<colgroup>
|
||||
<col style="width: 60%">
|
||||
<col style="width: 10%">
|
||||
<col style="width: 20%">
|
||||
<col style="width: 10%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<!-- <th>
|
||||
<input type="checkbox" id="all_check"><label for="all_check"></label>
|
||||
</th> -->
|
||||
<th scope="col">파일 명</th>
|
||||
<th scope="col">종류</th>
|
||||
<th scope="col">크기</th>
|
||||
<th scope="col">삭제</th>
|
||||
</thead>
|
||||
<tbody id="tbody_fiielist" class="tb_file_after">
|
||||
<c:forEach var="fileList" items="${fileList}" varStatus="status">
|
||||
<tr class="item_<c:out value='${fileList.atchFileId}' />_<c:out value='${fileList.fileSn}' /> uploaded_obj">
|
||||
<input type="hidden" name="fileSize" class="item_file_size" value="${fileList.fileSize}">
|
||||
<td class="td_filename">
|
||||
<!-- <img src="/direct/img/upload_hwp_img.png" alt="" /> -->
|
||||
<span class="file_name_text"><c:out value='${fileList.orignlFileNm}' /></span>
|
||||
</td>
|
||||
<td class="td_filesort">
|
||||
<span class="file_filesort_text" value="<c:out value="${fileList.fileExtsn}"/>"><c:out value="${fileList.fileExtsn}"/></span>
|
||||
</td>
|
||||
<td class="td_filesize">
|
||||
<span class="file_size_text" value="<c:out value="${fileList.fileMg}"/>"><c:out value="${fileList.fileMg}"/></span>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn_del" onclick="delAtchFile('<c:out value='${fileList.atchFileId}' />', '<c:out value='${fileList.fileSn}' />'); return false;" title="파일삭제"><i></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user