import request from '@/utils/request'

// 查询投诉列表
export function listComplain(query) {
  return request({
    url: '/crmComplain/findByPage',
    method: 'get',
    params: query
  })
}

// 查询投诉详细
export function getComplain(id) {
  return request({
    url: '/crmComplain/getById/' + id,
    method: 'get'
  })
}

// 新增投诉
export function addComplain(data) {
  return request({
    url: '/crmComplain/save',
    method: 'post',
    data: data
  })
}

// 修改投诉
export function updateComplain(data) {
  return request({
    url: '/crmComplain/updateById',
    method: 'post',
    data: data
  })
}

// 删除投诉
export function delComplain(a) {
  if(Array.isArray(a)){
    return request.post('/crmComplain/delete',a)
  }else {
    const aa = [];
    aa.push(a)
    return request.post('/crmComplain/delete',aa)
  }
}

//删除图片
export const delImgById = (id) => {
  return request.get('/commonFile/deleteFileById',{
    params:{
      id
    }
  });
}

//拿到字典信息
export const getDict = (dick) => {
  return request.get('/system/dict/data/type/'+dick,{
    params:{
      dick
    }
  })
}
