<template>
  <div class="container">
    <!-- 选择图片的弹框 -->
    <el-dialog title="路演申请" :visible.sync="isRadshowApplyShow" width="50%" :before-close="handleClose" draggable :close-on-click-modal="false" :modal-append-to-body="false" center>
      <div>
        <el-table :data="tableData" style="width: 100%; margin-bottom: 20px" border>
          <el-table-column prop="SubjectName" align="center" label="申请标的"></el-table-column>
          <el-table-column prop="RealName" align="center" label="申请人"></el-table-column>
          <el-table-column prop="CompanyName" align="center" label="公司名称"></el-table-column>
          <el-table-column prop="SellerName" align="center" label="所属销售"></el-table-column>
          <el-table-column width="160" prop="CreateTime" align="center" label="申请时间"></el-table-column>
        </el-table>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { raiInterface } from "@/api/api.js";

export default {
  name: "",
  components: {},
  props: {
    isRadshowApplyShow: {
      type: Boolean,
      default: false,
    },
    radshowApplyId: {
      type: Number,
      default: 0,
    },
  },
  data() {
    return {
      tableData: [],
    };
  },
  computed: {},
  watch: {
    isRadshowApplyShow: {
      handler(newVal) {
        newVal && this.getTableList();
      },
    },
  },
  created() {},
  mounted() {},
  methods: {
    // 关闭弹框
    handleClose() {
      this.$emit("update:isRadshowApplyShow", false);
      this.$emit("update:radshowApplyId", 0);
    },
    // 获取表格数据
    async getTableList() {
      const res = await raiInterface.reportSelectionTarryList({
        ArticleId: this.radshowApplyId,
      });
      if (res.Ret === 200) {
        this.tableData = res.Data.List || [];
      }
    },
  },
};
</script>
<style scoped lang="scss"></style>
