<!-- 搜索表单 -->
<template>
    <ele-card :body-style="{ paddingBottom: '8px' }">
        <ProSearch
            :items="formItems"
            ref="searchRef"
            @search="search"
            :initKeys="initKeys"
        />
    </ele-card>
</template>

<script setup>
    import { reactive, ref, defineEmits } from 'vue';
    import ProSearch from '@/components/CommonPage/ProSearch2.vue';

    let { proxy } = getCurrentInstance();
    const emit = defineEmits(['search']);

    const formItems = reactive([
        { type: 'input', label: '签收者', prop: 'signUserName' },
        { type: 'input', label: '物流单号', prop: 'deliveryCode' },
        { type: 'input', label: '物流CODE', prop: 'expressCode' },
        {
            type: 'datetime',
            label: '签收时间(开始时间)',
            prop: 'createTimeStart',
            props: {
                format: 'YYYY-MM-DD HH:mm:ss',
                valueFormat: 'YYYY-MM-DD HH:mm:ss'
            }
        },
        {
            type: 'datetime',
            label: '签收时间(结束时间)',
            prop: 'createTimeEnd',
            props: {
                format: 'YYYY-MM-DD HH:mm:ss',
                valueFormat: 'YYYY-MM-DD HH:mm:ss'
            }
        }
    ]);

    const initKeys = reactive({
        signUserName: '',
        deliveryCode: '',
        createTimeStart: '',
        createTimeEnd: '',
        finalExpress: ''
    });

    const searchRef = ref(null);
    /** 搜索 */
    const search = (data) => {
        emit('search', { ...data });
    };
</script>
