<template>
  <el-dialog
    title="风险防控清单"
    :visible.sync="dialogVisible"
    width="70%"
  >
    <div class="common-form-table-pagination-layout dialog-risk-prevent-list-wrapper">

      <div class="common-form-table-pagination-layout__header"></div>

      <div class="common-form-table-pagination-layout__content">

        <div class="table-wrapper">
          <el-table
            :data="tableData1"
            border
            stripe
          >
            <el-table-column type="index" label="序号" align="center"></el-table-column>
            <el-table-column prop="description" label="风险描述" align="center"></el-table-column>
            <el-table-column prop="category" label="涉及税种" align="center"></el-table-column>
          </el-table>
        </div>

        <el-divider></el-divider>

        <div class="table-wrapper">
          <el-table
            :data="tableData2"
            border
            stripe
          >
            <el-table-column type="index" label="序号" align="center"></el-table-column>
            <el-table-column prop="level" label="风险等级" align="center"></el-table-column>
            <el-table-column prop="type" label="风险应对" align="center"></el-table-column>
            <el-table-column prop="way" label="表现形式" align="center"></el-table-column>
          </el-table>
        </div>
      </div>
      
    </div>
  
    <div slot="footer" class="common-el-dialog-footer">
      <el-button @click="dialogVisible = false">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { getRiskPreventList1, getRiskPreventList2 } from '@/api/utils'

export default {
  name: 'DialogRiskPreventList',

  data() {
    return {
      dialogVisible: false,
      tableData1: [],
      tableData2: [],
    }
  },

  methods: {
    open() {
      this.dialogVisible = true
      this.getTableData1()
      this.getTableData2()
    },

    async getTableData1() {
      const { code, msg, data } = (await getRiskPreventList1())
      // console.log({ code, msg, data });
      this.tableData1 = data
    },
    async getTableData2() {
      const { code, msg, data } = (await getRiskPreventList2())
      // console.log({ code, msg, data });
      this.tableData2 = data
    },
  }
}
</script>

<style lang="scss" scoped>
.dialog-risk-prevent-list-wrapper {
  
}
</style>