<script setup>
import CreditReport from '@/components/CreditReport/index.vue'
import request, {download} from "@/utils/request.js";
const dialogVisible = ref(false);
const closeDialog = ()=>{
  dialogVisible.value = false;
}
const testReport = async ()=>{
  await download('/report/downloadReport',{uniCode:'91431227344727289C'},"信用报告.docx")
}

</script>

<template>
  <div>
    <el-row>
      <el-col :span="24">
        <el-button type="primary" @click="dialogVisible = true" >下载性与暴力报告</el-button>
        <el-button type="primary" @click="testReport">从后端生成性与暴力报告</el-button>
      </el-col>
    </el-row>
    <el-dialog v-model="dialogVisible" width="860px" destroy-on-close>
      <template #header>
        <span class="dialog-title">下载与暴力报告11</span>
      </template>
      <template #default>
        <CreditReport :credit-code="'91431227MABTBX5Y3B'" :closeDialog="closeDialog" />
      </template>
      <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
      </template>
    </el-dialog>
  </div>
</template>

<style scoped lang="scss">

</style>