//已签文件回显
showOriginalFile($('.reviewFileList'),  $('.fileListBox'), 'onlyView')
//签署结论默认完成
if($('[name=approvalConclusion]:checked').val() == undefined){
  $('[name=approvalConclusion]').get(0).checked = true
}

//保存
function submitFunction(){
  var postdata = new FormData();
  postdata.append('approvalConclusion',$("[name=approvalConclusion]:checked").val());
  postdata.append('approvalComments',$("[name=approvalComments]").val());
  postdata.append('taskId',$("[name=taskId]").val());
  postdata.append('businessKey',$("[name=businessKey]").val());
  $.ajax({
      url:'/sign/confirmation/check',
      type:'post',
      data:postdata,
      processData:false,
      contentType:false,
      success:function(data){
          if( data.success ){
              new $.zui.Messager( '法务审核成功', {
                  type: 'success'
              }).show();
              $.get('/sign/confirmation/pendingList',function(data){
                  $(".yk_rightcontent").empty().append(data);
              });
          }else{
              new $.zui.Messager('法务审核失败:'+data.msg, {
                  type: 'danger'
              }).show();
          }
      },
      error:function(status){
          new $.zui.Messager('法务审核时发生错误:'+status, {
              type: 'danger'
          }).show();
      }
  });
  return false;
};

//提交按钮
$(".yk_addNewMsg .save").click(function () {
  submitFunction()
  return false
});

//关闭按钮
$(".yk_addNewMsg .btn-cancel, .newBackBtn").click(function(){
  $.get('/sign/confirmation/pendingList',function(data){
      $(".yk_rightcontent").empty().append(data);
  });
  return false;
});
