import request, { postBlob, getBlob, handleImport } from '@/utils/request'


export function freightListPageV2(data) {
  return request({
    url: `/freight/list/pageV2?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function freightPageExport(data, name) {
  return postBlob({
    url: '/freight/pageExport',
    data,
    name
  })
}

// 获取运费模板列表
export function getList(params) {
  return request({
    url: '/freight/list',
    method: 'get',
    params
  })
}

// 更改运费模板状态
export function changeFreightStatus(params) {
  return request({
    url: '/freight/status/update',
    method: 'post',
    params
  })
}

// 删除运费模板
export function deleteFreight(params) {
  return request({
    url: '/freight/delete',
    method: 'post',
    params
  })
}

// 新增/编辑运费模板
export function addOrEditFreight(params) {
  return request({
    url: '/freight/save',
    method: 'post',
    data: params
  })
}

// 获取运费模板详情
export function getFreightDetail(params) {
  return request({
    url: '/freight/detail',
    method: 'get',
    params
  })
}

// 获取地区树
export function getRegionTree(params) {
  return request({
    url: '/freight/region/tree',
    method: 'get',
    params
  })
}


