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

//  仓库列表  有分页
export const serviceCenterList = (params) => {
  const url = `/serviceCenter/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('列表查询')
    }
  })
}

// 省仓新增
export const serviceCenterAdd = (params) => {
  return axios({
    url: '/serviceCenter/insert',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('新增')
    }
  })
}

// 启用禁用
export const provincialWarehouseEnable = (params) => {
  return axios({
    url: '/serviceCenter/enableflag',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent(params.enableFlag == 1 ? '启用' : '禁用')
    }
  })
}

// 关联经销商
export const serviceCenterBinding = (params) => {
  return axios({
    url: '/serviceCenter/binding',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('关联经销商')
    }
  })
}

// 省仓客户
export const queryServiceCenterDealerPage = (params) => {
  const url = `/serviceCenter/queryServiceCenterDealerPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('省仓客户')
    }
  })
}

// 省仓客户  解绑
export const serviceCenterUnbinding = (params) => {
  return axios({
    url: '/serviceCenter/unbinding',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('解绑省仓客户')
    }
  })
}
 
   
  
 
//省仓客户  导出
export const serviceCenterExport = (params) => {
  return axios({
    url: '/serviceCenter/excel',
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
      'module': encodeURIComponent('导出')
    }
  })
}