<template>
    <el-container class="flex-column">
        <div class="table-search">
            <search @success="handleSuccess" status="3"></search>
            <el-alert type="warning" show-icon title="栏目提醒" description="该栏目订单为自助打印失败数据，未开通自动打印商家该栏目不会有任何信息" :closable="false" style="margin-bottom: 10px;"></el-alert>
            <optionBtn @success="handleSuccess" :dataSelect="dataSelect" :dataSelectFull="dataSelectFull" status="3" name="已核销订单" :searchKey="searchKey"></optionBtn>
        </div>
        <el-main class="nopadding">
            <div class="table-container">
                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull" status="3"></tablePage>
            </div>
        </el-main>
    </el-container>  
</template>

<script>
import search from './components/search';
import optionBtn from './components/option';
import tablePage from './components/table';
export default {
    components: {
        search,tablePage,optionBtn
    },
    data(){
        return {
            searchKey:{
                auto:3
            },
            dataSelect:[],
            dataSelectFull:[],
        }
    },
    methods: {
        tableHandle(data){
            this.dataSelect = data;
        },
        tableHandleFull(data){
            this.dataSelectFull = data;
        },
        handleSuccess(data){
            this.searchKey = data;
            this.$refs.tablePage.upData(data)
        },
        handleClick(name){
            this.activeName = name;
            this.searchKey.type = name;
            this.$refs.tablePage.upData(this.searchKey)
        }
    }
}
</script>