import request from '@/utils/request';
import { baseURL } from '@/config';
//水质申请分页查询
export function getWaterApply(data) {
  var param =
    '?page=' +
    data.page +
    '&size=' +
    data.size +
    '&projectId=' +
    data.projectId;
  if (data.deviceName != '') {
    param += '&deviceName=' + data.deviceName;
  }
  if (data.signUser != '') {
    param += '&signUser=' + data.signUser;
  }
  if (data.date != '') {
    param += '&date=' + data.date;
  }
  return request({
    url: '/waterApply/list' + param,
    method: 'get',
    data,
  });
}

//相关字典数据查询
export function getDictData(data) {
  return request({
    url: '/waterApply/dict',
    method: 'get',
    data,
  });
}
//水质申请删除
export function doDelete(data) {
  return request({
    url: '/waterApply/remove',
    method: 'post',
    data,
  });
}
//水质申请添加
export function doAdd(data) {
  return request({
    url: '/waterApply/add',
    method: 'post',
    data,
  });
}
//水质申请修改
export function doEdit(data) {
  return request({
    url: '/waterApply/update',
    method: 'post',
    data,
  });
}
//导出
export function exportWaterApply(data) {
  var param = '?projectId=' + data.projectId;
  if (data.signUser != '') {
    param += '&signUser=' + data.signUser;
  }
  if (data.deviceName != '') {
    param += '&deviceName=' + data.deviceName;
  }
  if (data.date != '') {
    param += '&date=' + data.date;
  }
  return baseURL + 'waterApplyReport/export' + param;
}
