<template>
    <fieldset>
        <legend>
            <el-tag type="info">条件筛选</el-tag>
        </legend>
        <el-form class="lv-form-inline" ref="searchForm" :model="searchKey" label-position="right" label-width="100px">
            <div class="search-form">
                <div class="form-left">
                    <el-row :gutter="10">
                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
                            <el-input v-model="searchKey.order_sn" placeholder="订单编号" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
                                <template #prepend>订单编号</template>
                            </el-input>
                        </el-col>
                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
                            <el-input v-model="searchKey.out_order_no" placeholder="系统单号" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
                                <template #prepend>系统单号</template>
                            </el-input>
                        </el-col>
                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
                            <el-select v-model="searchKey.status" clearable placeholder="请选择状态" @change="searchForm" :style="{width: '100%'}" class="diy-select">
                                <el-option value="1" label="待支付"></el-option>
                                <el-option value="2" label="待使用"></el-option>
                                <el-option value="3" label="已完成"></el-option>
                                <el-option value="4" label="已退款"></el-option>
                                <el-option value="5" label="退款中"></el-option>
                                <el-option value="6" label="已关闭"></el-option>
                                <el-option value="7" label="部分退款"></el-option>
                                <template #prefix>订单状态</template>
                            </el-select>
                        </el-col>
                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
                            <el-select v-model="searchKey.express_status" clearable placeholder="请选择" @change="searchForm" :style="{width: '100%'}" class="diy-select">
                                <el-option value="1" label="待发货"></el-option>
                                <el-option value="2" label="已发货"></el-option>
                                <el-option value="3" label="已签收"></el-option>
                                <template #prefix>发货状态</template>
                            </el-select>
                        </el-col>
                        <el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="4">
                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
                        </el-col>
                    </el-row>
                </div>
                <div class="form-line"></div>
                <div class="form-right">
                    <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
                </div>
            </div>
        </el-form>
    </fieldset>
</template>

<script>
export default {
    data(){
        return {
            searchKey:{}
        }
    },
    methods: {
        searchForm(){
            this.$emit("success",this.searchKey);
        }
    }
}
</script>