/**
 * 溯源供方请求接口
 */
import request from '../index'
const prefix = '/meter'

// 列表查询
export function getSoucreList(data: object) {
  return request({
    url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 数据删除
export function getSoucreListDelete(data: object) {
  return request({
    url: `${prefix}/supplier/delete`,
    method: 'post',
    data,
  })
}

// 查看详情
export function getSoucreListDetail(data: object) {
  return request({
    url: `${prefix}/supplier/detail`,
    method: 'post',
    data,
  })
}

// 省级联动
export function getSoucreListlevelType(pid: string) {
  return request({
    url: `/sys/area/list?pid=${pid}`,
    method: 'get',
  })
}

// 新增数据
export function getSoucreListAdd(data: object) {
  return request({
    url: `${prefix}/supplier/add`,
    method: 'post',
    data,
  })
}
// 更新数据
export function getSoucreLisUpdate(data: object) {
  return request({
    url: `${prefix}/supplier/update`,
    method: 'post',
    data,
  })
}
// 导出详情
export function getSoucreLisListExport(data: object) {
  return request({
    url: `${prefix}/supplier/listExport`,
    method: 'post',
    responseType: 'blob',
    data,
  })
}
