<template>
  <div>
    <component :is="componentsName"
               ref="componentRef"
               :taskDefinitionKey="taskDefinitionKey"
               :businessId="businessId"
               :permissionType="permissionType"/>
  </div>

</template>


<script>


export default {
  name: "addAccountDialog",
  props: {
    taskDefinitionKey: {
      type: String,
      default: 'starter',
    },
    businessId: {
      type: String,
      default: ''
    }
  },
  components: {
    page: () => import('./page.vue')
  },

  data() {
    return {
      dialogType: 'add',
      componentsName: 'page',
      tabOptions: [
        {key: 'starter', permissionType: 'view', name: '发起人申请'},
        {key: 'deptLeader', permissionType: 'view', name: '销售主管审批'},
        {key: 'financeLeader', permissionType: 'view', name: '财务主管审核'},
        {key: 'leader', permissionType: 'view', name: '分管副总审批'},
        {key: 'uploadReceipt', permissionType: 'view', name: '上传回执'},
      ],
      permissionType: 'view',
    }
  },
  computed: {},
  created() {
    console.log('taskDefinitionKey~~~', this.taskDefinitionKey)
    this.permissionType = this.tabOptions.find(item => item.key == this.taskDefinitionKey).permissionType
  },
  mounted() {

  },
  methods: {
    getTableValue() {
      return this.$refs.componentRef.getTableValue()
    },
  }
}
</script>
<style scoped lang="scss">

</style>











