<template>
    <fieldset>
        <legend>
            <el-tag type="info">按需操作</el-tag>
        </legend>
        <div class="op-header">
            <div class="left-panel">
                <sc-file-export :apiObj="$API.storeOrder.export" :data="searchKey" :fileName="name+'_'+(new Date().getTime())" async>
                    <template #default="{ open }">
                        <el-button type="primary" icon="sc-icon-download" @click="open">导出</el-button>
                    </template>
                </sc-file-export>
            </div>
        </div>
    </fieldset>
</template>

<script>
import scFileExport from '@/components/scFileExport'
export default {
    components: {
        scFileExport
    },
    props: {
        status: { type: String, default: "1" },
        name: { type: String, default: "已预约订单" },
        dataSelect: { type: Array, default: () => [] },
        searchKey: { type: Object, default: () => {} },
        dataSelectFull: { type: Array, default: () => [] }
    },
    data(){
        return {

        }
    },
    methods: {
        table_export(){
            
        },
        async table_batch_status(status){
            if (this.dataSelect.length == 0) {
                return this.$message.error("请选择修改数据")
            }
            let submitData = {"id":this.dataSelect,"value":status,"field":"status","type":"batch"};
            var resp = await this.$API.merGoods.batch.post(submitData);
            if (resp.code == 0) {
                return this.$message.error(resp.msg);
            }
            this.$message.success(resp.msg);
            this.$emit("success");
        },
        handleSuccess(){
            this.$emit("success");
        },
    }
}
</script>