import request from '@/utils/request'

export function listAbnormalRecord(pripid) {
  return request({
    url: `/abnList/listAbnormalRecord?pripid=${pripid}`,
    method: 'get'
  })
}

export function queryEntLockDetails(pripid) {
  return request({
    url: `/entlock/queryEntlockOne?pripid=${pripid}`,
    method: 'get'
  })
}

export function queryTSAbnListDetails(pripid) {
  return request({
    url: `/abnList/queryAbnListOne?pripid=${pripid}`,
    method: 'get'
  })
}

export function queryEOtCaseDetails(pripid) {
  return request({
    url: `/eOtCase/queryEOtCaseOne?pripid=${pripid}`,
    method: 'get'
  })
}

export function queryCphStatistics(data) {
  return request({
    url: '/eBaseinfo/queryCphStatistics',
    method: 'post',
    data: data
  })
}

export function businessQuery(page) {
  return request({
    url: '/task/businessQuery',
    method: 'post',
    data: page
  })
}

export function tFraudEntStatistics() {
  return request({
    url: '/fraudReg/tBizFraud/statistics',
    method: 'get'
  })
}

export function entBlacklistStatistics(params) {
  return request({
    url: '/entBlacklist/statistics',
    method: 'get',
    params
  })
}

export function queryStatistics(params) {
  return request({
    url: '/abnStatistics/StatisticsForAbn',
    method: 'post',
    data: params
  })
}

export function getEntListByStatistics(data) {
  return request({
    url: '/abnStatistics/getEntListByStatistics',
    method: 'post',
    data
  })
}

/**
 * 经营异常主体信息列表导出
 * @param data
 */
export function exportEntListByStatistics(data) {
  return request({
    url: '/abnStatistics/exportEntListByStatistics',
    method: 'post',
    responseType: 'blob',
    data
  })
}

export function queryAllOrg() {
  return request({
    url: '/task/queryAllOrg',
    method: 'get'
  })
}

export function queryOldeBusness(page) {
  return request({
    url: '/task/queryOldeBusness',
    method: 'post',
    data: page
  })
}

export function queryAbnList(page) {
  return request({
    url: '/task/queryAbnList',
    method: 'post',
    data: page
  })
}

export function exportAbnListFile(data) {
  return request({
    url: '/task/exportAbnList',
    method: 'post',
    data,
    responseType: 'blob'
  })
}

export function queryEAlterByPripid(pripid) {
  const form = new FormData()
  form.append('pripid', pripid)
  return request({
    url: '/eBaseinfo/queryEAlterByPripid',
    method: 'post',
    data: form
  })
}

/**
 * 信用修复预警待办分析
 * @param data
 * @returns {AxiosPromise}
 */
export function repairTaskQuery(data) {
  return request({
    url: '/task/repairTaskQuery',
    method: 'post',
    data
  })
}

export function queryEAlterByEntNo(pripid) {
  const form = new FormData()
  form.append('pripid', pripid)
  return request({
    url: '/eBaseinfo/queryEAlterByEntNo',
    method: 'post',
    data: form
  })
}

export function queryContactByEntNo(pripid) {
  const form = new FormData()
  form.append('pripid', pripid)
  return request({
    url: '/eBaseinfo/queryContactByEntNo',
    method: 'post',
    data: form
  })
}

export function addContactLogByEntNo(pripid) {
  const form = new FormData()
  form.append('pripid', pripid)
  return request({
    url: '/eBaseinfo/addContactLogByEntNo',
    method: 'post',
    data: form
  })
}

export function queryEAlterTempByBizseq(bizseq) {
  const form = new FormData()
  form.append('bizseq', bizseq)
  return request({
    url: '/eBaseinfo/queryEAlterTempByBizseq',
    method: 'post',
    data: form
  })
}

export function queryxyxfCqList(page) {
  return request({
    url: '/task/queryxyxfCqList',
    method: 'post',
    data: page
  })
}

export function exportxyxfCqList(data) {
  return request({
    url: '/task/exportxyxfCqList',
    method: 'post',
    data,
    responseType: 'blob'
  })
}

export function queryqzzxEntList(data) {
  return request({
    url: '/eBaseinfo/queryForcedLogoutEntList',
    method: 'post',
    data
  })
}

export function exportqzzxList(data) {
  return request({
    url: '/eBaseinfo/exportqzzxList',
    method: 'post',
    data,
    responseType: 'blob'
  })
}
