import request from '@/utils/request'

export function getEntWritsList(data) {
  return request({
    url: '/writ/getEntWritsList',
    method: 'post',
    data
  })
}
/**
 * 根据文书类型获取文书模板内容
 */
export function getContentsWithWritstype(writsType) {
  const form = new FormData()
  form.append('writsType', writsType)
  return request({
    url: '/tswritscontent/getContentsWithWritstype',
    method: 'post',
    data: form
  })
}
/**
 * 业务中调整文书内容
 */
export function modifyContentWithBizseq(data) {
  return request({
    url: '/tswritscontent/modifyContentWithBizseq',
    method: 'post',
    data
  })
}
/**
 * 业务中调整文书内容
 */
export function saveOrUpdateContent(data) {
  return request({
    url: '/tswritscontent/saveOrUpdateContent',
    method: 'post',
    data
  })
}
/**
 * 根据业务号及文书类型获取文书模板内容
 */
export function getContentsWithBizseq(data) {
  return request({
    url: '/tswritscontent/getContentsWithBizseq',
    method: 'post',
    data
  })
}
/**
 * 获取信用修复决定书
 */
export function getCreditRepairDecision(bizSeq) {
  return request({
    url: '/tswrittemplate/getCreditRepairDecision?bizSeq=' + bizSeq,
    method: 'get'
  })
}
/**
 * 获取经营异常信用修复决定书
 */
export function getAbnRepairDecision(bizSeq) {
  return request({
    url: '/tswrittemplate/getAbnRepairDecision?bizSeq=' + bizSeq,
    method: 'get'
  })
}

export function downloadTSWrits(writsid) {
  const form = new FormData()
  form.append('writsid', writsid)
  return request({
    url: '/writ/downloadTSWrits',
    method: 'post',
    data: form,
    responseType: 'blob'
  })
}
