$(document).on('click', '#addBtn', function (){ getCiaForeignerEditModal(null); }) function getCiaForeignerEditModal(ciKey){ $.ajax({ url: '/counterIntelligence/ciaForeignerEditModal', data: {ciKey: ciKey}, type: 'GET', dataType:"html", success: function(html){ $("#ciaForeignerEditModalContent").empty().append(html); $("#fixDate").datepicker({ format: "yyyy-mm-dd", language: "ko", autoclose: true }); setUploadDiv(); setEditor('editor', '400'); $("#ciaForeignerEditModal").modal('show'); }, error:function(){ } }); } $(document).on('click', '#saveBtn', function (){ if(confirm("저장하시겠습니까?")){ const formData = new FormData($("#ciaManageCompanyEditForm")[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', '.mciTr', function (){ getCiaManageCompanyViewModal($(this).find(".ciKey").val()); }) function getCiaManageCompanyViewModal(ciKey){ $.ajax({ url: '/counterIntelligence/ciaManageCompanyViewModal', data: {ciKey: ciKey}, type: 'GET', dataType:"html", success: function(html){ $("#ciaManageCompanyViewModalBody").empty().append(html) $("#ciaManageCompanyViewModal").modal('show'); }, error:function(){ } }); } $(document).on('click', '#editBtn', function (){ $("#ciaManageCompanyViewModal").modal('hide'); getCiaManageCompanyEditModal($(this).attr("data-cikey")); })