import request from '@/utils/request'


enum API {
  SAVE_SELF_REPORT = '/owSelfReporting/save',
}
export interface SelfReportResponseData{
  contactInformation:string,
  contacts:string,
  enterpriseName:string,
  unifiedSocialCreditCode:string,
  complainantIdNumber:string,
  files:FileType[]
}
export interface SelfReportResponse extends AxiosResponse{
  data: SelfReportResponseData
}

export const saveSelfReport = (selfReportData:SelfReportResponseData)=>{
  const {contactInformation,contacts,complainantIdNumber,enterpriseName,unifiedSocialCreditCode,files} = selfReportData;
  return request.post<any,SelfReportResponse>(API.SAVE_SELF_REPORT,{
    contactInformation,
    contacts,
    complainantIdNumber,
    enterpriseName,
    unifiedSocialCreditCode,
    files
  })
}

//删除图片
export const delImgById = (id:number) => {
  return request.get<any,any>('/commonFile/deleteFileById',{
    params:{
      id
    }
  });
}

//根据unicode查询企业明细
export const getCompanyDetailByUnicode = (unicode:string)=>{
  return request.get<any,any>('/owSelfReporting/checkInformationByUnicode',{
    params:{
      unicode
    }
  });
}