<template>
    <fieldset>
        <legend>
            <el-tag type="info">按需操作</el-tag>
        </legend>
        <div class="op-header">
            <div class="left-panel">
                <el-button type="primary" icon="el-icon-refresh" @click="refresh_print">重启打印</el-button>
            </div>
        </div>
    </fieldset>
</template>

<script>
export default {
    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: {
        refresh_print(){
            this.$confirm(`重启打印前请确认打印机正常在线，重启操作后等待1-2分钟打印机会自动开始工作`, '提示', {
                type: 'warning'
            }).then(async () => {
                var resp = await this.$API.order.print_refresh.post();
                if (resp.code == 0) {
                    return this.$message.error(resp.msg)
                }
                this.$message.success(resp.msg);
                this.$emit("success");
            }).catch(() => {

            })
        },
        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>