<template>
  <div>
    <el-dialog
        title="选择人员"
        :visible.sync="dialogVisible"
        width="700px"
        :before-close="handleClose"
        :append-to-body="true" 
        :close-on-click-modal="false"
        >
        <div>
            <client-table :personIds="personIds" :persons="persons" @getPersonIds="getPersonIds"></client-table>
        </div>
    </el-dialog>
  </div>
</template>

<script>
import ClientTable from './ClientTable.vue';
export default {
  components: {
    ClientTable
  },
  props: {},
  data() {
    return {
        dialogVisible:false,
        personIds:[],
        persons:[]
    };
  },
  watch: {},
  computed: {},
  created() {},
  mounted() {
    
  },
  methods: {
    //关闭弹窗
    handleClose(){
        this.dialogVisible = false
        this.$emit('getPersonIds',{personIds:this.personIds,persons:this.persons})
    },
    //打开弹窗
    open(personIds,persons){
        this.personIds = personIds || []
        this.persons = persons || []
        this.dialogVisible = true
    },
    getPersonIds({personIds,persons}){
        this.personIds = personIds
        this.persons = persons
        this.handleClose()
    }
  },
    
};
</script>
<style lang="scss" scoped>
</style>