<template>
  <div>
    <el-popover
      placement="bottom"
      trigger="hover">
      <div slot="title">合同类型</div>
      <div style="display:flex;flex-direction:column">
        <el-button type="text" size="mini" @click="addBtn(1)">经销商合作协议</el-button>
        <el-button type="text" size="mini">经销项目协议</el-button>
        <el-button type="text" size="mini">直销项目协议</el-button>
        <el-button type="text" size="mini">工具使用协议</el-button>
        <el-button type="text" size="mini">居间协议</el-button>

      </div>
      <el-button slot="reference" size="mini" type="primary">新 建</el-button>
    </el-popover>
      <el-drawer
        title="新建合同"
        :visible.sync="drawer"
        size="80%"
        direction="rtl"
        append-to-body>
        <component :is="getComponent"></component>
    </el-drawer>
  </div>
</template>

<script>
export default {
  components:{
    addContractAgent: () => '@/HDrpManagement/contractManage/components/addContract'
  },
  computed: {
    getComponent () {
      if (this.type == 1) {
        return () => import('@/HDrpManagement/contractManage/components/addContract')
      }
    }
  },
  data () {
    return {
      form:{

      },
      arealist:[],
      rules:{
        sys_enterpriseid: [
          { required: true, message: '请选择企业名称', trigger: 'blur' },
        ],
      },
      type:'',
      drawer:false
    }
  },
  methods:{
    addBtn () {
      this.type = 1
      this.drawer = true
      // return this.tool.dispatchFun('normalTable','upData',this)
      
      // this.$store.dispatch('changeDetailDrawer',true)
      // this.$router.push('/addContract')
    }
  },
  created() {
  },
  mounted () {
  }
}

</script>
<style scoped>
/deep/.el-select {
  width: 100%!important;
}
</style>