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

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

// 配载运单地址
export const waybillListRemoteUrl = {
  url: serviceName + '/trailer/trailer_page_detail',
  method: 'post',
}

// 商品表地址
export const goodsListRemoteUrl = {
  url: serviceName + '/trailer/trailer_item_detail',
  method: 'post',
}

// 包裹表地址
export const packListRemoteUrl = {
  url: serviceName + '/trailer/trailer_package_detail',
  method: 'post',
}

// 审核
export const Audit = (data) => {
  return axios.post(serviceName + '/trailer/trailer_audit', data)
}

// 撤销
export const Revoke = (data) => {
  return axios.post(serviceName + '/trailer/trailer_undo', data)
}

// 查询运单明细
export const viewUrl = (data) => {
  return axios.post(serviceName + '/trailer/trailer_view_loadingbillid', qs.stringify(data), {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

// 配载运单添加
export const trailer_add_detail = (data) => {
  return axios.post(serviceName + '/trailer/trailer_add_detail', data)
}

// 配载运单剔除
export const trailer_delete_detail = (data) => {
  return axios.post(serviceName + '/trailer/trailer_delete_detail', data)
}

// 配载运单移动
export const trailer_mobile_detail = (data) => {
  return axios.post(serviceName + '/trailer/trailer_mobile_detail', data)
}

// 修改保存
export const trailer_update = (data) => {
  return axios.post(serviceName + '/trailer/trailer_update', data)
}
