<template>
  <div>
    <el-dialog
      :visible.sync="dialogTableVisible"
      :show-close="false"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
      :append-to-body="true"
      @closed="closed"
    >
      <div>[{{name}}] 在Excel中存在但未勾选,是否勾选?</div>
      <div slot="footer" class="dialog-footer">
        <el-checkbox v-model="skip">为之后的冲突执行此操作</el-checkbox>
        <el-button @click="stop">终 止</el-button>
        <el-button type="primary" @click="add">勾 选</el-button>
        <el-button type="primary" @click="ignore">跳 过</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dialogTableVisible: false,
      done: null,
      rollback: null,
      skip: false,
      name: "",
      value: undefined
    };
  },
  mounted() {},
  methods: {
    show(done, rollback, row) {
      this.dialogTableVisible = true;
      this.name = row["姓名"];
      this.done = done;
      this.rollback = rollback;
    },
    stop() {
      this.dialogTableVisible = false;
      this.rollback();
    },
    ignore() {
      this.dialogTableVisible = false;
      this.done(false, this.skip);
    },
    add() {
      this.dialogTableVisible = false;
      this.done(true, this.skip);
    },
    closed() {
      this.name = "";
    }
  },
  computed: {},
  watch: {
    dialogTableVisible(val) {
      if (val) {
        this.skip = false;
        this.value = undefined;
      }
    }
  }
};
</script>

<style scoped>
</style>
