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

//  客户列表  分页
export const custList = (params) => {
  const url = `/cust/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  客户列表  不分页
export const custAllList = (params) => {
  return axios({
    url: `/cust/queryList`,
    data: {},
    method: 'post'
  })
}
// 新增/编辑客户
export const custSave = params => {
  return axios({
    url: '/cust/save',
    data: params,
    method: 'post'
  })
}

// 根据sn修改客户信息
export const updateByCustomerSn = params => {
  return axios({
    url: '/cust/updateByCustomerSn',
    data: params,
    method: 'post'
  })
}

// 客户详情
export const custFindById = params => {
  return axios({
    url: `/cust/findById/${params.id}`,
    data: {},
    method: 'get'
  })
}

// 删除客户
export const custDel = params => {
  return axios({
    url: `/cust/delete/${params.id}`,
    data: {},
    method: 'get'
  })
}
//  收款方式  下拉
export const settleStyleFindAllList = (params) => {
  return axios({
    url: `/settleStyle/findAll`,
    data: {},
    method: 'post'
  })
}

// 启用禁用
export const updateEnableStatus = params => {
  return axios({
    url: `/cust/enable/${params.id}/${params.flag}`,
    data: {},
    method: 'get'
  })
}
