import moment from "moment";
import {upcloud_base_inventory} from "@/config/serviceSettings";

export const locatorCode = {
    remoteUrl: {
        url: upcloud_base_inventory+'/stock/v1/qty/avl', method: 'get',
        headers: {
            'content-type': 'application/x-www-form-urlencoded'
        }
    },
    // 组件用于form组件时，隐藏表单项含id code
    items: [
        // { hidden: true, type: 'input', name: 'bldgId', label: 'ID', value: '' },
        // { hidden: true, type: 'input', name: 'bldgCode', label: '编码', value: '' },
    ],

    // seach-modal配置
    defSearchConfig: {
        name: 'locatorName', label: '商品货位', title: '商品货位', value: '',
        rowKey: 'locatorId', destroyOnClose: true, /* targetClick: true, */
        targetValueKey: 'locatorName',
    },

    // modal的搜索栏
    defToolBar: {
        items: []
    },

    // modal的table配置
    defTableCol: [
        { dataIndex: 'batchId', title: '批次ID', hidden: true, },
        { dataIndex: 'locatorId', title: '货位编码', hidden: true, },
        { dataIndex: 'locatorCode', title: '货位编号',ellipsis:true  },
        { dataIndex: 'locatorName', title: '货位名称',ellipsis:true  },
        { dataIndex: 'quantity', title: '数量',ellipsis:true  },
        { dataIndex: 'manufacturerLotNum', title: '批号',ellipsis:true  },
        // { dataIndex: 'showProductionDate', title: '显示生产日期' },
        // { dataIndex: 'showExpiredDate', title: '显示有效期至' },
        {
            dataIndex: 'batchProductionDate', title: '生产日期',ellipsis:true , customRender(text) {
                return moment(text).format('YYYY-MM-DD');
            }
        },
        {
            dataIndex: 'batchExpiredDate', title: '有效期至',ellipsis:true , customRender(text) {
                return moment(text).format('YYYY-MM-DD');
            }
        },
        { title: '质检报告单号', dataIndex: 'rqcReportNo', key: 'rqcReportNo',ellipsis:true },

    ]

};

