import request from '@/utils/request'

/**
 * 获取基础数据
 * @param {String} codeId 分类编码Id
 * @author Lee
 */
export function getConstant(codeId) {
  return request({
    url: `/constant/${codeId}`,
    method: 'get'
  })
}

/**
 * 广州市监部门常量获取接口
 * @author Lee
 */
export function getAllDepts() {
  return request({
    url: `/constant/getAllDepts`,
    method: 'get'
  })
}
/**
 * 通过统一码/注册号获取主体详情
 * @param {String} code 统一码/注册号
 * @author Lee
 */
export function getEBAseInfo(code) {
  return request({
    url: `/psnFillin/getEBAseInfo?code=` + code,
    method: 'get'
  })
}
/**
 * 获取涉嫌冒用他人身份取得登记信息列表
 * @param {data} 分页参数
 */
export function getOperregdecList(data) {
  return request({
    url: '/eSusnateOperreg/getOperregdecList',
    method: 'post',
    data
  })
}
/**
 * 获取涉嫌冒用他人身份取得登记信息列表
 * @param {data} 分页参数
 */
export function tFraudEntList(data) {
  return request({
    url: '/fraudReg/tFraudEnt/list',
    method: 'post',
    data
  })
}
/**
 * 更新保存 涉嫌冒用他人身份取得登记信息
 * @param {data}
 */
export function saveOperregdec(data) {
  const form = new FormData()
  for (const key in data) {
    form.append(key, data[key])
  }
  return request({
    url: '/eSusnateOperreg/saveOperregdec',
    method: 'post',
    data: form
  })
}

/**
 * 更新保存 涉嫌冒用他人身份取得登记信息
 * @param {data}
 */
export function startTask(data) {
  return request({
    url: '/fraudReg/process/startTask',
    method: 'post',
    data
  })
}

/**
 * 通过冒用id 获取责任人详情
 * @param {personateid} 冒用id
 */
export function getEFalperInfo(personateid) {
  return request({
    url: '/eSusnateOperreg/getEFalperInfo?personateid=' + personateid,
    method: 'get'
  })
}

// 创建待办
export function createTask(bizSeq) {
  const form = new FormData()
  form.append('bizSeq', bizSeq)
  return request({
    url: '/eSusnateOperreg/createTask',
    method: 'post',
    data: form
  })
}

/**
 * 下一个异常名录录入流程节点
 * @param {object}} data 数据
 * @author lroyia
 * @since 2021年2月8日 14:03:18
 */
export function saveCancelReg(data) {
  const form = new FormData()
  for (const key in data) {
    form.append(key, data[key])
  }
  return request({
    url: '/tsbizserder/saveCancelReg',
    method: 'post',
    data: form
  })
}
/**
 * 获取业务投诉信息
 * @param {String} bizseq  业务号
 */
export function getTsbizserderByBizseq(bizseq) {
  return request({
    url: '/tsbizserder/getTsbizserderByBizseq?bizseq=' + bizseq,
    method: 'get'
  })
}

/**
 * 获取业务投诉信息
 * @param {String} bizseq  业务号
 */
export function getBusFraudInfo(params) {
  return request({
    url: '/fraudReg/process/getBusFraudInfo',
    method: 'get',
    params
  })
}
// 创建待办
export function validBeforeCreateTask(pripid) {
  const form = new FormData()
  form.append('pripid', pripid)
  return request({
    url: '/eSusnateOperreg/validBeforeCreateTask',
    method: 'post',
    data: form
  })
}

export function getEntBaseInfoByCode(params) {
  return request({
    url: '/eBaseinfo/getEntBaseInfoByCode',
    method: 'get',
    params
  })
}

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

export function processControl(data) {
  return request({
    url: '/fraudReg/process/processControl',
    method: 'post',
    data
  })
}

export function tFraudCheckList(data) {
  return request({
    url: '/fraudreg/tFraudCheck/list',
    method: 'post',
    data
  })
}

export function getSupOrg(params) {
  return request({
    url: '/fraudreg/tFraudCheck/getSupOrg',
    method: 'get',
    params
  })
}

export function updateFraudCheckList(data) {
  return request({
    url: '/fraudreg/tFraudCheck/update',
    method: 'post',
    data
  })
}

export function batchUpdateTFraudCheck(data) {
  return request({
    url: '/fraudreg/tFraudCheck/batchUpdate',
    method: 'post',
    data
  })
}

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

export function getTempInfo(bizseq,module,flow) {
  const form = new FormData()
  form.append('bizseq', bizseq)
  form.append('module', module)
  form.append('flow', flow)
  return request({
    url: '/temporarySave/getInfo',
    method: 'post',
    data: form
  })
}

export function getSteps(params) {
  return request({
    url: '/fraudreg/tFraudCheck/getSteps',
    method: 'get',
    params
  })
}

export function ebaseinfoPage(data) {
  return request({
    url: '/fraudreg/resultEntry/ebaseinfoPage',
    method: 'post',
    data
  })
}

export function ebaseinfoTFraudCheck(uscc, entName) {
  const form = new FormData()
  form.append('uscc', uscc)
  form.append('entName', entName)
  return request({
    url: '/fraudreg/resultEntry/ebaseinfoTFraudCheck',
    method: 'post',
    data: form
  })
}

export function startTaskEasyTFraud(uscc, entName) {
  const form = new FormData()
  form.append('uscc', uscc)
  form.append('entName', entName)
  return request({
    url: '/fraudreg/resultEntry/startTaskEasyTFraud',
    method: 'post',
    data: form
  })
}

export function processControlEasyTFraud(data) {
  return request({
    url: '/fraudreg/resultEntry/processControlEasyTFraud',
    method: 'post',
    data
  })
}

export function overTfraudPage(data) {
  return request({
    url: '/fraudreg/resultEntry/overTfraudPage',
    method: 'post',
    data
  })
}

export function startTaskRevokeTFraud(uscc, bizSeq) {
  const form = new FormData()
  form.append('uscc', uscc)
  form.append('bizSeq', bizSeq)
  return request({
    url: '/fraudreg/resultEntry/startTaskRevokeTFraud',
    method: 'post',
    data: form
  })
}

/**
 * 获取业务投诉信息
 * @param {String} bizseq  业务号
 */
export function getCxBusFraudInfo(params) {
  return request({
    url: '/fraudreg/resultEntry/getCxBusFraudInfo',
    method: 'get',
    params
  })
}

export function processControlrevokeTFraud(data) {
  return request({
    url: '/fraudreg/resultEntry/processControlrevokeTFraud',
    method: 'post',
    data
  })
}

export function ebaseinfoRevokeTFraudCheck(uscc, bizSeq) {
  const form = new FormData()
  form.append('uscc', uscc)
  form.append('bizSeq', bizSeq)
  return request({
    url: '/fraudreg/resultEntry/ebaseinfoRevokeTFraudCheck',
    method: 'post',
    data: form
  })
}

/**
 * 获取涉嫌冒用他人身份取得登记信息列表
 * @param {data} 分页参数
 */
export function getFraudEntBybizSeq(params) {
  return request({
    url: '/fraudReg/tFraudEnt/getBybizSeq',
    method: 'get',
    params
  })
}
