<template>
    <fieldset>
        <legend>
            <el-tag type="info">按需操作</el-tag>
        </legend>
        <div class="op-header">
            <div class="left-panel">
                <sc-file-export :apiObj="$API.orderlife.export" :data="searchKey" :fileName="'来客订单_'+(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: {
        type: { type: String, default: "1" },
        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>