/**
 * 客户关系-投诉建议请求接口
 */
import request from '../index'
import type { IAdviceQuery } from '@/views/customer/advice/advice_interface'
const prefix = '/meter'

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

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

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

// 新增数据
export function addAdvice(data: object) {
  return request({
    url: '/meter/supplier/submit',
    method: 'post',
    data,
  })
}
// 编辑数据
export function updateAdvice(data: object) {
  return request({
    url: `${prefix}/supplier/update`,
    method: 'post',
    data,
  })
}

// 导出列表
export function exportAdviceList(data: Omit<IAdviceQuery, 'limit' | 'offset'>) {
  return request({
    url: `${prefix}/supplier/listExport`,
    method: 'post',
    responseType: 'blob',
    data,
  })
}

