/* 经销商授权信息管理 */

import request from '@/utils/request';


// 经销商授权信息列表
const list = (params) => {
  return request({
    url: `/dealer/list`,
    method: 'get',
    params,
  })
}

// 经销商授权信息新增接口
const insert = (data) => {
  return request({
    url: `/dealer/insert`,
    method: 'post',
    data,
  })
}

// 经销商授权信息列表
const remove = (params) => {
  // ?id=${params.id}
  return request({
    url: `/dealer/delete`,
    method: 'get',
    params,
  })
}

// 经销商授权信息新增接口
const update = (data) => {
  return request({
    url: `/dealer/update`,
    method: 'post',
    data,
  })
}

// 提交OA
const submitOA = (data) => {
  return request({
    url: `/dealer/OA`,
    method: 'post',
    data,
  })
}

// 下载授权书
const download = (data) => {
  return request({
    url: `/dealer/download`,
    method: 'post',
    data,
    responseType: "blob",
    headers: {
      'Content-Type': 'application/json; application/octet-stream'
    },
  })
}


export default {
  list,
  insert,
  remove,
  update,
  submitOA,
  download,
}