// 各个不同页面的参数配置
import { UPCLOUD_RDC_TMS_MAINDATA_SERVICE, UPCLOUD_RDC_TMS_BUSINESS_SERVICE, UPCLOUD_RDC_TMS_BMS_SERVICE } from '@/config/serviceSettings.js'

export const configure = {
  consignor: {
    name: '货主',
    tebleKey: 'cargoOwnerId',
    tablename: 'cargoOwnerName',
    searchUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/cargo_owner/byIds',
    saveUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/cargo_owner/geocoding',
  },

  supplier: {
    name: '供应商',
    tebleKey: 'id',
    tablename: 'name',
    searchUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/provider/byIds',
    saveUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/provider/geocoding',
    tableColumn: [
      {
        dataIndex: 'cargoOwnerName',
        title: '货主名称',
      },
      {
        dataIndex: 'name',
        title: '供应商名称',
      },
      {
        dataIndex: 'address',
        title: '供应商地址',
      },
      {
        dataIndex: 'longitude',
        title: '经度',
      },
      {
        dataIndex: 'latitude',
        title: '纬度',
      },
    ],

    queryFrom: [
      {
        label: '供应商名称',
        name: 'search',
      },
      {
        label: '货主名称',
        name: 'cargoOwnerName',
      },
    ],
  },

  shipper: {
    name: '发货方',
    tebleKey: 'id',
    tablename: 'name',
    searchUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/provider/byShipperIds',
    saveUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/provider/modify_shipper',
  },
  shipbill: {
    name: '订单',
    tebleKey: 'shipbillId',
    tablename: 'shipbillName',
    searchUrl: UPCLOUD_RDC_TMS_BUSINESS_SERVICE + '/provider/byShipperIds',
    saveUrl: UPCLOUD_RDC_TMS_BUSINESS_SERVICE + '/shipbill/parse_address',
  },
  branch: {
    name: '仓库',
    tebleKey: 'id',
    tablename: 'name',
    searchUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/tmsBaseBranch/queryBranchForAddress',
    saveUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/tmsBaseBranch/updateBranch',
    queryFrom: [
      {
        label: '仓库编码',
        name: 'code',
      },
      {
        label: '仓库名称',
        name: 'name',
      },
    ],
  },
  customer: {
    name: '客户',
    tebleKey: 'id',
    tablename: 'name',
    searchUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/tmsBaseCustomer/queryCustomerForAddress',
    saveUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/tmsBaseCustomer/updateCustomer',
    queryFrom: [
      {
        label: '客户名称',
        name: 'name',
      },
    ],
  },
  consignee: {
    name: '收货方',
    tebleKey: 'id',
    tablename: 'name',
    searchUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/tmsBaseCustomer/queryCustomerReceiverForAddress',
    saveUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/tmsBaseCustomer/updateCustomerReceiver',
    queryFrom: [
      {
        label: '收货方名称',
        name: 'name',
      },
    ],
  },
  carrier: {
    name: '承运商',
    tebleKey: 'id',
    tablename: 'name',
    searchUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/carrier/page_by_id',
    saveUrl: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/carrier/modify',
    queryFrom: [
      {
        label: '承运商名称',
        name: 'name',
      },
    ],
  },
}

// 根据供应商ID集合分页查询
// maindata/provider/byIds
// 报文：
// {
// 	"providerIds": [
// 		{
// 			"providerId": "111111"
// 		},
// 		{
// 			"providerId": "2222222"
// 		}
// 	],
// 	"search":"",
// 	"pageNum": 1,
// 	"pageSize": 10
// }

// 根据供应商发货方ID集合分页查询
// maindata/provider/byShipperIds
// 报文：
// {
// 	"shipperIds": [
// 		{
// 			"id": "111111"
// 		},
// 		{
// 			"id": "2222222"
// 		}
// 	],
// 	"search":"",
// 	"pageNum": 1,
// 	"pageSize": 10
// }
