<!-- 搜索表单 -->
<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';

    const emit = defineEmits(['search']);

    const formItems = computed(() => {
        return [
            { type: 'input', label: '退回编号', prop: 'refundOrderId' },
            { type: 'input', label: '回收订单', prop: 'originOrderId' },
            { type: 'input', label: '物流单号', prop: 'waybillCode' },
            { type: 'input', label: '收件人姓名', prop: 'receiveName' },
            { type: 'input', label: '收件人手机', prop: 'receiveMobile' },
            { type: 'input', label: '收货地址', prop: 'receiveAddress' },
            {
                type: 'dictSelect',
                label: '全部订单',
                prop: 'status',
                props: {
                    code: 'refund_status'
                }
            },
            {
                type: 'dictSelect',
                label: '是否首单',
                prop: 'firstOrder',
                props: {
                    code: 'is_first_order'
                }
            },
            {
                type: 'dictSelect',
                label: '是否推送',
                prop: 'checkStatus',
                props: {
                    code: 'is_push'
                }
            }
        ];
    });

    const initKeys = reactive({
        name: '',
        nickName: '',
        openId: '',
        phone: '',
        status: ''
    });

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