55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
|
|
$(document).on('click', '#addBtn', function (){
|
||
|
|
getCiaSaftyDemandEditModal(null);
|
||
|
|
})
|
||
|
|
|
||
|
|
function getCiaSaftyDemandEditModal(ciKey){
|
||
|
|
$.ajax({
|
||
|
|
url: '/counterIntelligence/ciaSaftyDemandEditModal',
|
||
|
|
data: {ciKey: ciKey},
|
||
|
|
type: 'GET',
|
||
|
|
dataType:"html",
|
||
|
|
success: function(html){
|
||
|
|
$("#ciaSaftyDemandEditModalContent").empty().append(html)
|
||
|
|
setUploadDiv();
|
||
|
|
$("#ciaSaftyDemandEditModal").modal('show');
|
||
|
|
},
|
||
|
|
error:function(){
|
||
|
|
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
$(document).on('click', '#saveBtn', function (){
|
||
|
|
if(confirm("저장하시겠습니까?")){
|
||
|
|
const formData = new FormData($("#ciaSaftyDemandEditForm")[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"));
|
||
|
|
})
|
||
|
|
$.ajax({
|
||
|
|
type : 'POST',
|
||
|
|
data : formData,
|
||
|
|
url : "/counterIntelligence/saveCiActivity",
|
||
|
|
processData: false,
|
||
|
|
contentType: false,
|
||
|
|
success : function(result) {
|
||
|
|
alert("저장되었습니다.");
|
||
|
|
contentFade("out");
|
||
|
|
location.reload();
|
||
|
|
},
|
||
|
|
error : function(xhr, status) {
|
||
|
|
alert("저장에 실패하였습니다.")
|
||
|
|
contentFade("out");
|
||
|
|
}
|
||
|
|
})
|
||
|
|
|
||
|
|
}
|
||
|
|
})
|
||
|
|
|
||
|
|
$(document).on('click', '.sdiTr', function (){
|
||
|
|
getCiaSaftyDemandEditModal($(this).find(".ciKey").val());
|
||
|
|
})
|