import {upcloud_base_wh,upcloud_base_common} from "@/config/serviceSettings";
// 库房 ——> 依赖 建筑物

export const warehouseRoom = {

    remoteUrl: { url: upcloud_base_wh+'/baseWmsWarehouseRoomMst/page2', method: 'get' },
    // 组件用于form组件时，隐藏表单项含id code
    items: [
        { hidden: true, type: 'input', name: 'warehouseRoomId', label: 'ID', value: '' },
        { hidden: true, type: 'input', name: 'warehouseRoomCode', label: '编码', value: '' },
    ],

    // seach-modal配置
    defSearchConfig: {
        name: 'warehouseRoomName',
        label: '库房',
        title: '库房',
        value: '',
        rowKey: 'warehouseRoomId',
        destroyOnClose: true,
        targetClick: true,
        targetValueKey: 'warehouseRoomName',
    },

    // modal的搜索栏
    defToolBar: {
        items: [
            { type: 'input', name: 'warehouseRoomName', label: '库房名称', value: '' },
            { type: 'input', name: 'warehouseRoomCode', label: '库房编码', value: '' }
        ]
    },

    // modal的table配置
    defTableCol: [
        { dataIndex: 'warehouseRoomId', title: 'ID', hidden: true },
        { dataIndex: 'warehouseRoomName', title: '库房名称' },
        { dataIndex: 'warehouseRoomCode', title: '库房编码' },
        {
            dataIndex: 'warehouseRoomType', title: '库房类型',
            remoteUrl: { url: upcloud_base_common+'/dict/listbytype?dicttypeCodes=wms_storeroom', method: 'post' },
            replaceFields: {
                value: 'dictCode',
                label: 'dictName'
            }
        }
    ]

};

