import {upcloud_base_wh,upcloud_base_common} from "@/config/serviceSettings";
// 库区 ——> 依赖 库房（as 库别）

export const warehouseArea = {

    remoteUrl: { url: upcloud_base_wh+'/baseWmsWarehouseArea/page2', method: 'get' },

    // 组件用于form组件时，隐藏表单项含id code
    items: [
        { hidden: true, type: 'input', name: 'warehouseAreaId', label: 'ID', value: '' },
        { hidden: true, type: 'input', name: 'warehouseAreaCode', label: '名称', value: '' },
    ],

    // seach-modal配置
    defSearchConfig: {
        name: 'warehouseAreaName',
        label: '库区',
        title: '库区',
        value: '',
        rowKey: 'warehouseAreaId',
        destroyOnClose: true,
        targetClick: true,
        targetValueKey: 'warehouseAreaName',
    },

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

    // modal的table配置
    defTableCol: [
        { dataIndex: 'warehouseAreaId', title: 'ID', hidden: true },
        { dataIndex: 'warehouseAreaName', title: '库区名称' },
        { dataIndex: 'warehouseAreaCode', title: '库区编码' },
        {
            dataIndex: 'warehouseAreaType', title: '库区类型',
            remoteUrl: { url: upcloud_base_common+'/dict/listbytype?dicttypeCodes=areatype', method: 'post' },
            replaceFields: {
                value: 'dictCode',
                label: 'dictName'
            }
        }
    ]

};

