
import { UPCLOUD_RDC_TMS_MAINDATA_SERVICE, UPCLOUD_RDC_TMS_BUSINESS_SERVICE } from '@/config/serviceSettings.js'

export const queryBranchUrl = UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/tmsBaseBranch/queryBranchPopup' //仓库

/**
 * 仓库
 * */
 export const warehouseAttr = {
  label: '仓库',
  placeholder: '请选择仓库',
  targetClick: true,
  rowKey: 'id',
  targetValueKey: 'name',
  remoteUrl: { url: queryBranchUrl, method: 'post' },
   toolBar: {
    labelCol: { span: 8 },
    wrapperCol: { span: 16 },
    items: [
      { type: 'input', name: 'code', label: '仓库编码', value: '' },
      { type: 'input', name: 'name', label: '仓库名称', value: '' }
    ]
  },
  tableConfig: {
    columns: [
      { ellipsis: true, dataIndex: 'code', title: '仓库编码' },
      { ellipsis: true, dataIndex: 'name', title: '仓库名称' }
    ]
  }
 }

export const consignorAttr = {
  label: '货主',
  placeholder: '请选择货主',
  targetClick: true,
  targetValueKey: 'consignorName',
  remoteUrl: { url: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/cargo_owner/user/popup', method: 'post' },
  rowKey: 'id',
  toolBar: {
    labelCol: { span: 8 },
    wrapperCol: { span: 16 },
    items: [
      {
        type: 'input',
        name: 'consignorNoAndName',
        label: '查询条件',
        placeholder: '请输入货主编码/货主名称',
        value: '',
      },
    ],
  },
  tableConfig: {
    columns: [
      { ellipsis: true, dataIndex: 'consignorCode', title: '货主编码' },
      { ellipsis: true, dataIndex: 'consignorName', title: '货主名称' },
    ],
  },
}

/**
 * 客户
 * */
export const customerAttr = {
  label: '客户',
  placeholder: '请选择客户',
  targetClick: true,
  targetValueKey: 'customerName',
  remoteUrl: { url: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/tmsBaseCustomer/user/popup', method: 'post' },
  rowKey: 'id',
  toolBar: {
    labelCol: { span: 8 },
    wrapperCol: { span: 16 },
    items: [
      { type: 'input', name: 'customerCode', label: '客户编码', value: '' },
      { type: 'input', name: 'customerName', label: '客户名称', value: '' },
    ],
  },
  tableConfig: {
    columns: [
      { ellipsis: true, dataIndex: 'customerCode', title: '客户编码' },
      { ellipsis: true, dataIndex: 'customerName', title: '客户名称' },
    ],
  },
}
/**
 * 供应商
 * */
 export const supplierAttr = {
  label: '供应商',
  placeholder: '请选择供应商',
  targetClick: true,
  targetValueKey: 'supplierName',
  remoteUrl: { url: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/provider/user/popup', method: 'post' },
  rowKey: 'id',
   toolBar: {
    labelCol: { span: 8 },
    wrapperCol: { span: 16 },
    items: [
      {
        type: 'input',
        name: 'supplierNoName',
        label: '查询条件',
        placeholder: '请输入供应商编码/供应商名称',
        value: '',
      },
    ],
  },
  tableConfig: {
    columns: [
      { ellipsis: true, dataIndex: 'supplierCode', title: '供应商编码' },
      { ellipsis: true, dataIndex: 'supplierName', title: '供应商名称' },
    ],
  },
}
/**
 * 承运商
 * */
export const carrierAttr = {
  label: '承运商',
  placeholder: '请选择承运商',
  targetClick: true,
  targetValueKey: 'carrierName',
  remoteUrl: { url:UPCLOUD_RDC_TMS_MAINDATA_SERVICE  + '/carrier/user/popup', method: 'post' },
  rowKey: 'id',
  toolBar: {
    labelCol: { span: 8 },
    wrapperCol: { span: 16 },
    items: [
      { type: 'input', name: 'carrierCode', label: '承运商编码', value: '' },
      { type: 'input', name: 'carrierName', label: '承运商名称', value: '' },
    ],
  },
  tableConfig: {
    columns: [
      { ellipsis: true, dataIndex: 'carrierCode', title: '承运商编码' },
      { ellipsis: true, dataIndex: 'carrierName', title: '承运商名称' },
    ]
  },
}