
$(document).on('click', '.planTr', function (){
  $(".trChkBox").prop("checked", false);
  $(this).find(".trChkBox").prop("checked", true);
  getViewModal(Number($(this).find(".planKey").val()));
})

$(document).on('click', '.apprvBtn', function (){
  $("#apprvFormPlanKey").val($("#viewModalPlanKey").val());
  $("#viewModalApprvValue").val($(this).attr("data-planstate"));
  if(confirm($(this).val()+"하시겠습니까?")){
    const formData = new FormData($("#apprvForm")[0]);
    contentFade("in")
    $.ajax({
      type : 'POST',
      data : formData,
      url : "/fpiMgt/planStateChange",
      processData: false,
      contentType: false,
      beforeSend: function (xhr){
        xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
      },
      success : function(result) {
        alert("저장되었습니다")
        contentFade("out");
      },
      error : function(xhr, status) {
        alert("저장에 실패하였습니다.");
        contentFade("out");
      }
    })
  }
})