import {upcloud_base_wh,upcloud_base_common} from "@/config/serviceSettings";
//
export const warehouse = {
  remoteUrl: { url: upcloud_base_wh+'/warehouse/page', method: 'get' },

  items: [
    { hidden: true, type: 'input', name: 'warehouseId', label: '仓库ID', value: '' },
    { hidden: true, type: 'input', name: 'warehouseCode', label: '仓库编码', value: '' }
  ],

  // seach-modal配置
  defSearchConfig: {
    name: 'warehouseName',
    label: '仓库名称',
    title: '仓库名称',
    value: '',
    rowKey: 'warehouseId',
    destroyOnClose: true,
    targetClick: true,
    targetValueKey: 'warehouseName'
  },

  // modal的搜索栏
  defToolBar: {
    items: [
      {
        type: 'input',
        name: 'warehouseName',
        label: '仓库名称'
      },
      {
        type: 'input',
        name: 'warehouseCode',
        label: '仓库编码'
      }
    ]
  },

  // modal的table配置
  defTableCol: [
    { dataIndex: 'warehouseId', title: '仓库ID', hidden: true },
    { dataIndex: 'warehouseName', title: '仓库名称' },
    { dataIndex: 'warehouseCode', title: '仓库编码' },
    {
      dataIndex: 'warehouseType', title: '仓库类型',
      remoteUrl: { url: upcloud_base_common+'/dict/listbytype?dicttypeCodes=WH_TYPE', method: 'post' },
      replaceFields: {
        value: 'dictCode',
        label: 'dictName'
      }
    },
    { dataIndex: 'dcName', title: '所属仓配中心' }
  ],

}
