import request from '@/utils/request'
import qs from 'qs'
import { UPCLOUD_RDC_TMS_MAINDATA_SERVICE } from '@/config/serviceSettings.js'
const serviceName = UPCLOUD_RDC_TMS_MAINDATA_SERVICE

// 主表地址
export const listRemoteUrl = {
  url: serviceName + '/line/query',
  method: 'post',
}

// 启用/停用
export const updateStatus = data => {
  return request({
    url: serviceName + '/line/remove',
    method: 'post',
    data,
  })
};

// 查看
export const View = data => {
  return request({
    url: serviceName + '/line/view',
    method: 'post',
    data,
  })
};


// 新增
export const Save = data => {
  return request({
    url: serviceName + '/line/save',
    method: 'post',
    data,
  })
};

// 修改
export const Update = data => {
  return request({
    url: serviceName + '/line/update',
    method: 'post',
    data,
  })
};

//导入url
export const importUrl = serviceName + '/line/batch_import'
export const downUrl = serviceName + '/line/download_template_line'

export const carrier_importUrl = serviceName + '/line/batch_import_carrier'
export const carrier_downUrl = serviceName + '/line/download_template_line_carrier'

export const consignee_importUrl = serviceName + '/line/batch_import_consignee'
export const consignee_downUrl = serviceName + '/line/download_template_line_consignee'

export const shipper_importUrl = serviceName + '/line/batch_import_shipper'
export const shipper_downUrl = serviceName + '/line/download_template_line_shipper'

// 发货方地址
export const shipper_listRemoteUrl = {
  url: serviceName + '/line/shipper-page',
  method: 'post',
}

// 收货方地址
export const consignee_listRemoteUrl = {
  url: serviceName + '/line/tmsArriverPage',
  method: 'post',
}

// 承运方地址
export const carrier_listRemoteUrl = {
  url: serviceName + '/line/tmsCarrierPage',
  method: 'post',
}

// 行政区域
export const getByPid = data => {
  return request({
    url: serviceName + '/zone/get-by-pid',
    method: 'post',
    data,
  })
};

// 查询线路可用日期
export const dateQuery = data => {
  return request({
    url: serviceName + '/line/dateQuery',
    method: 'post',
    data,
  })
};

// 保存线路可用日期
export const dateSave = data => {
  return request({
    url: serviceName + '/line/dateSave',
    method: 'post',
    data,
  })
};

// 查看途径点
export const waypoint_listRemoteUrl = {
  url: serviceName + '/line/way_site',
  method: 'post',
}

// 查看途径点
export const way_site = data => {
  return request({
    url: serviceName + '/line/way_site',
    method: 'post',
    data,
  })
};

// 查询仓库
export const queryBranchPopup = data => {
  return request({
    url: serviceName + '/tmsBaseBranch/queryBranchPopup',
    method: 'post',
    data,
  })
};

// 查看地图
export const new_selectMap = data => {
  return request({
    url: serviceName + '/line/new_selectMap',
    method: 'post',
    data,
  })
};

// 线路点移动
export const Move = data => {
  return request({
    url: serviceName + '/line/move',
    method: 'post',
    data,
  })
};

// 线路点保存
export const new_saveMap = data => {
  return request({
    url: serviceName + '/line/new-saveMap',
    method: 'post',
    data,
  })
};