import axios from '@/common/services/axios-instance'

class AuditAccountService {
  // 获取项目信息
  getProjectInfoById(id) {
    return axios({
      url: `api/xcoa-mobile/v1/iamauditproject/getProjectInfoById?id=` + id,
    })
  }

  // 获取项目发现问题涉及金额信息
  getProblemAmount(id) {
    return axios({
      url: `api/xcoa-mobile/v1/iamauditreportfindmoney/getProblemAmount?projectId=` + id,
    })
  }

  // 新建前数据校验
  beforeCreateCheck(id) {
    return axios({
      url: `api/xcoa-mobile/v1/iamprojectaccount/beforeCreateCheck?projectId=` + id,
    })
  }

  // 获取对应工作底稿的流程id
  getGzdgInstId(id) {
    return axios({
      url: `api/xcoa-mobile/v1/audit-fact-confirm/find-instId?paperId=` + id,
    })
  }

  // 确认事实确认
  confirmFact(projectid, ids) {
    return axios({
      url:
        `api/xcoa-mobile/v1/audit-fact-confirm/confirm-button?projectId=` +
        projectid +
        '&ids=' +
        ids.join(','),
      method: 'post',
    })
  }

  // 获取数据字典配置
  getDictionary(id) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-law/dictionary?key=${id}`,
      method: 'get',
    })
  }

  // word单选导出
  wordExport(ids, projectid, type) {
    return axios({
      url:
        'api/xcoa-mobile/v1/audit-fact-confirm/word-exprot?ids=' +
        ids +
        '&projectId=' +
        projectid +
        '&type=' +
        type,
      method: 'post',
      responseType: 'blob',
    })
  }

  // 确认事实确认
  verifyDataPerms(id, projectid) {
    return axios({
      url:
        `api/xcoa-mobile/v1/audit-fact-confirm/verify-date-perms?id=` +
        id +
        '&projectId=' +
        projectid,
      method: 'post',
    })
  }
}

export default new AuditAccountService()
