import { axios } from '@/utils/request'

// 清运管理--网点清运记录

// 列表
export const cleanRecordList = (params) => {
  const url = `cleanStationDevice/queryCountByStation/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 总计
export const getCleanStationTotal = (params) => {
  const url = `cleanStationDevice/getCleanStationDeviceTotal`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}

// 详情
export const networkDetail = (params) => {
  const url = `cleanStationDevice/querycleanStationParticular/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 清运明细
// 列表
export const cleanDetailsList = (params) => {
  const url = `cleanStationDevice/queryCleanStationDeviceByDevice/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 总计
export const getCleanDetailsTotal = (params) => {
  const url = `cleanStationDevice/getCleanStationDeviceTotal`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}

// 详情
export const getCleanDetails = (params) => {
  const url = `cleanLog/queryCleanStationDeviceParticular`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}

// 操作人
export const cleanUserList = (params) => {
  const url = `zxyj/user/queryCleanUserList`
  return axios.request({
    url: url,
    data: {},
    method: 'post'
  })
}

// 待清运列表
export const netWorkCleanRecordList = (params) => {
  const url = `cleanStationDevice/waitToClean/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 总计
export const getCleanStationSum = (params) => {
  const url = `cleanStationDevice/waitToClean/sum`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}

// 立即清运
export const cleanByDevice = params => {
  return axios({
    url: `cleanStationDevice/cleanByDevice`,
    data: params,
    method: 'POST'
  })
}

// 司机管理
// 重置密码
export const resetPSD = params => {
  return axios({
    url: `zxyj/user/resetPwd`,
    data: params,
    method: 'POST'
  })
}

// 获取列表数据
export const getDriverList = params => {
  const url = `/driver/queryLike/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'POST'
  })
}

// 清运司机  全部
export const driverQueryList = (params) => {
  const url = `driver/queryDriverList`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}

// 查司机
export const findDriverName = params => {
  return axios({
    url: `driver/findById/${params.id}`,
    data: params,
    method: 'get'
  })
}

// 删除用户接口
export const delectDriver = params => {
  return axios({
    url: `driver/delete/${params.id}`,
    data: params,
    method: 'get'
  })
}

// 新增/编辑保存接口
export const saveDriver = params => {
  return axios({
    url: '/driver/save',
    data: params,
    method: 'POST'
  })
}

// 编辑查详情
export const driverDetails = (params) => {
  const url = `driver/findById/${params.id}`
  return axios({
    url: url,
    data: params,
    method: 'get'
  })
}

// 清运管理  统计报表
export const getCleanReport = (params) => {
  const url = `cleanReport/getReport`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}

// 各回收物类型清运数据总计
export const findTotalGroupRubbi = (params) => {
  const url = `cleanReport/findTotalGroupRubbishType`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}

// 各清运司机占比
export const findTotalGroupUser = (params) => {
  const url = `cleanReport/findTotalGroupUser`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
// 清运量趋势
export const findTotalGroupDate = (params) => {
  const url = `cleanReport/findTotalGroupDate`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
// 各回收物类型清运数据柱状图
export const findTotalGroupDateAndRubbishType = (params) => {
  const url = `cleanReport/findTotalGroupDateAndRubbishType`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
