주요사건처리현황 임시저장수정
parent
98ee5f5630
commit
16b827ddb4
|
|
@ -6,6 +6,41 @@ $("#jqueryBtn").click(function(){
|
|||
});
|
||||
|
||||
|
||||
|
||||
$(document).on('click', '#saveBtn', function (){
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
if($('#contentTitle').val() == ''){
|
||||
alert("제목을 입력해주세요.");
|
||||
$('#contentTitle').focus();
|
||||
return false;
|
||||
}
|
||||
if($('#majorType').val() == ''){
|
||||
alert("종류를 선택해주세요.");
|
||||
$('#majorType').focus();
|
||||
return false;
|
||||
}
|
||||
saveContent('DST007');
|
||||
}
|
||||
})
|
||||
|
||||
$(document).on('click', '#saveTempBtn', function (){
|
||||
if(confirm("임시저장 하시겠습니까?")){
|
||||
if($('#contentTitle').val() == ''){
|
||||
alert("제목을 입력해주세요.");
|
||||
$('#contentTitle').focus();
|
||||
return false;
|
||||
}
|
||||
if($('#majorType').val() == ''){
|
||||
alert("종류를 선택해주세요.");
|
||||
$('#majorType').focus();
|
||||
return false;
|
||||
}
|
||||
saveContent('DST001');
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
$(document).on('click', '#addMajorBtn', function (){
|
||||
getEditModal(null)
|
||||
})
|
||||
|
|
@ -16,17 +51,10 @@ $(document).on('click', '.tr', function (){
|
|||
getViewModal(Number($(this).find(".majorKey").val()));
|
||||
})
|
||||
|
||||
// $(document).on('click', '.tr', function (event){
|
||||
// const target = event.target;
|
||||
// if(!(target.className === "cpChk" ||$(target).parents("td").length>0)){
|
||||
// const phoneKey = (Number($(this).find(".phoneKey").val()));
|
||||
// showModal(phoneKey);
|
||||
// }
|
||||
// });
|
||||
|
||||
$(document).on('click', '#saveBtn', function (){
|
||||
saveContent("MajorEditForm")
|
||||
})
|
||||
// $(document).on('click', '#saveBtn', function (){
|
||||
// saveContent("MajorEditForm")
|
||||
// })
|
||||
|
||||
$(document).on('click', '#editBtn', function (){
|
||||
$("#MajorViewModal").modal('hide')
|
||||
|
|
@ -72,37 +100,7 @@ $(document).on('click', '#deleteMajorBtn', function (){
|
|||
}
|
||||
})
|
||||
|
||||
// $(document).on('click', '#delectMajorBtn', function (){
|
||||
// if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
|
||||
// const checkArr = [];
|
||||
// $('input:checkbox[name=equChk]:checked').each(function (idx, el){
|
||||
// checkArr.push({});
|
||||
// const target = $(el);
|
||||
// checkArr[idx].equKey = Number(target.parents('tr').find('.majorKey').val());
|
||||
// })
|
||||
// deleteMajor(checkArr);
|
||||
//
|
||||
// }
|
||||
// })
|
||||
|
||||
// function deleteMajor(checkArr){
|
||||
// $.ajax({
|
||||
// type : 'POST',
|
||||
// url : "/ivsgt/deleteContent",
|
||||
// data : JSON.stringify(checkArr),
|
||||
// contentType: 'application/json',
|
||||
// beforeSend: function (xhr){
|
||||
// xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
||||
// },
|
||||
// success : function() {
|
||||
// alert("삭제처리 되었습니다.");
|
||||
// location.reload();
|
||||
// },
|
||||
// error : function(xhr, status) {
|
||||
// alert("삭제처리에 실패하였습니다");
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
function getEditModal(majorKey){
|
||||
$.ajax({
|
||||
|
|
@ -140,45 +138,74 @@ function getViewModal(majorKey){
|
|||
}
|
||||
|
||||
function saveContent(contentStatus){
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
let flag = true;
|
||||
if(contentStatus === "DST007"){
|
||||
flag = contentCheck();
|
||||
}
|
||||
if(flag){
|
||||
contentFade("in");
|
||||
const MajorEditForm = $("#MajorEditForm");
|
||||
MajorEditForm.find("contentStatus").val(contentStatus);
|
||||
const formData = new FormData(MajorEditForm[0]);
|
||||
for(const file of files) {
|
||||
if(!file.isDelete)
|
||||
formData.append('uploadFiles', file, file.name);
|
||||
}
|
||||
$(".text-decoration-line-through").each(function (idx, el){
|
||||
formData.append('fileSeq', $(el).attr("data-fileseq"));
|
||||
})
|
||||
formData.append('contentInfo', CrossEditor.GetBodyValue());
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
url : "/ivsgt/saveContent",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success : function(result) {
|
||||
alert("저장되었습니다.");
|
||||
contentFade("out");
|
||||
$("#MajorEditModal").modal('hide');
|
||||
getViewModal(result);
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("저장에 실패하였습니다.")
|
||||
contentFade("out");
|
||||
}
|
||||
})
|
||||
}
|
||||
const formData = new FormData($("#MajorEditForm")[0]);
|
||||
for(const file of files) {
|
||||
if(!file.isDelete)
|
||||
formData.append('uploadFiles', file, file.name);
|
||||
}
|
||||
$(".text-decoration-line-through").each(function (idx, el){
|
||||
formData.append('fileSeq', $(el).attr("data-fileseq"));
|
||||
})
|
||||
formData.append('contentStatus', contentStatus);
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
url : "/ivsgt/saveContent",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success : function(result) {
|
||||
alert("저장되었습니다.");
|
||||
contentFade("out");
|
||||
location.reload();
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("저장에 실패하였습니다.")
|
||||
contentFade("out");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// function saveContent(contentStatus){
|
||||
// if(confirm("저장하시겠습니까?")){
|
||||
// let flag = true;
|
||||
// if(contentStatus === "DST007"){
|
||||
// flag = contentCheck();
|
||||
// }
|
||||
// if(flag){
|
||||
// contentFade("in");
|
||||
// const MajorEditForm = $("#MajorEditForm");
|
||||
// MajorEditForm.find("contentStatus").val(contentStatus);
|
||||
// const formData = new FormData(MajorEditForm[0]);
|
||||
// for(const file of files) {
|
||||
// if(!file.isDelete)
|
||||
// formData.append('uploadFiles', file, file.name);
|
||||
// }
|
||||
// $(".text-decoration-line-through").each(function (idx, el){
|
||||
// formData.append('fileSeq', $(el).attr("data-fileseq"));
|
||||
// })
|
||||
// formData.append('contentInfo', CrossEditor.GetBodyValue());
|
||||
// $.ajax({
|
||||
// type : 'POST',
|
||||
// data : formData,
|
||||
// url : "/ivsgt/saveContent",
|
||||
// processData: false,
|
||||
// contentType: false,
|
||||
// success : function(result) {
|
||||
// alert("저장되었습니다.");
|
||||
// contentFade("out");
|
||||
// $("#MajorEditModal").modal('hide');
|
||||
// getViewModal(result);
|
||||
// },
|
||||
// error : function(xhr, status) {
|
||||
// alert("저장에 실패하였습니다.")
|
||||
// contentFade("out");
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
function contentCheck(formId){
|
||||
let flag = true;
|
||||
if(!$("#contentTitle").val()){
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
<input type="hidden" name="wrtUserSeq" th:value="${majorStatus.wrtUserSeq}">
|
||||
<input type="hidden" name="wrtUserGrd" th:value="${majorStatus.wrtUserGrd}">
|
||||
<input type="hidden" name="wrtUserNm" th:value="${majorStatus.wrtUserNm}">
|
||||
<input type="hidden" name="contentStatus" id="contentStatus" th:value="${majorStatus.contentStatus}">
|
||||
<div class="row mb-1">
|
||||
<label for="wrtUserNm" class="col-sm-2 col-form-label col-form-label-sm text-center">작성자</label>
|
||||
<div class="col-sm-2">
|
||||
|
|
@ -75,7 +74,7 @@
|
|||
</form>
|
||||
</div>
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="button" class="btn btn-warning" id="saveTempBtn" data-ContentStatus="DST001">임시저장</button>
|
||||
<button type="button" class="btn btn-warning" id="saveTempBtn" data-contentStatus="DST001">임시저장</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-primary" id="saveBtn">저장</button>
|
||||
</div>
|
||||
|
|
@ -79,7 +79,9 @@
|
|||
<tr class="tr" th:each="major:${majorList}">
|
||||
<input type="hidden" class="majorKey" th:value="${major.majorKey}">
|
||||
<!-- <td><input type="checkbox" class="trChkBox"></td>-->
|
||||
<td th:text="${major.majorType}"></td>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('MST')}">
|
||||
<td th:if="${major.majorType eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
|
||||
</th:block>
|
||||
<td th:text="|${major.contentStatus eq 'DST001'?'[임시]':''}${major.contentTitle}|"></td>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
|
||||
<td th:if="${major.wrtOrgan eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
|
||||
|
|
|
|||
Loading…
Reference in New Issue