<script setup name='meetingDetail'>
import { ref, reactive, onMounted, h, getCurrentInstance, nextTick } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import {
  batchAppoint,
  confirmedRoster, convertToAppoint, expertConfirm,
  expertRelease,
  inviteExpertList,
  meetingBasicInfo,
  meetingCancel,
  meetingInviteRuleDetail, setUpHeadman, stopInvite,
  continueInvite, listReview, expertRemove, exportTable
} from '@/http/apis/expertManage/reviewMeeting'
import store from '@/store'
import addExpertDialog from '../addMeeting/components/addExpertDialog.vue'
import { districtList } from '@/http/apis/commonApi'
import { templatesById } from '@/http/apis/expertManage/expertReview'
import memberOpinion from '@/pages/expertManage/expertReview/components/memberOpinion.vue'
import LeaveDialog from '@/pages/expertManage/expertReview/components/leaveDialog.vue'

const { proxy } = getCurrentInstance(),
  router = useRouter(),
  route = useRoute(),
  { meetingTypeOptions } = store.dictStore.globalDicts || {},
  dialogVisible = ref(false),
  // 评审项目
  column = reactive([
    {
      label: '序号',
      type: 'index',
      width: '60'
    },
    {
      label: '项目名称',
      key: 'projectName',
      prop: 'projectName',
      minWidth: '150',
      showOverflowTooltip: true
    },
    {
      label: '申报单位',
      key: 'buildOrg',
      prop: 'buildOrg',
      minWidth: '80',
      showOverflowTooltip: true
    },
    {
      label: '项目类型',
      key: 'projectTypeName',
      prop: 'projectTypeName',
      width: '80'
    },
    {
      label: '申报金额（万元）',
      key: 'declareAmount',
      prop: 'declareAmount'
    },
    {
      label: '预算年度',
      key: 'projectYear',
      prop: 'projectYear'
    },
    {
      label: '评审结果',
      key: 'reviewResult',
      prop: 'reviewResult',
      render: row => h('span', row.reviewResult || '-')
    },
    {
      label: '操作',
      slot: 'action',
      width: '80',
      fixed: 'right'
    }
  ]),

  column2 = reactive([
    {
      label: '序号',
      type: 'index',
      width: '60'
    },
    {
      label: '规则',
      key: 'ruleId',
      slot: 'ruleId'
    },
    {
      label: '申请人数',
      key: 'inviteCnt',
      prop: 'inviteCnt'
    },
    {
      label: '已确认参会人数',
      key: 'agreeCnt',
      slot: 'agreeCnt'
    },
    {
      label: '实抽人数',
      key: 'noticedCnt',
      prop: 'noticedCnt'
    }
  ]),
  column3 = reactive([
    {
      label: '序号',
      type: 'index',
      width: '60'
    },
    {
      label: '专家姓名',
      key: 'name',
      prop: 'name',
      width: '140',
      render: row => h('span', `${row.name}${row.isHeadman ? '（组长）' : ''}`)
    },
    {
      label: '手机号码',
      key: 'contact',
      slot: 'contact',
      width: '120'
    },
    {
      label: '匹配规则',
      key: 'ruleId',
      slot: 'ruleId'
    },
    {
      label: '是否参加',
      key: 'confirmedAttend',
      prop: 'confirmedAttend',
      render: row => h('span', `${row.noticeStatus === '已通知' && row.confirmedAttend ? '确认参加' : row.noticeStatus === '已通知' && !row.confirmedAttend ? '拒绝参加' : '-'}`)
    },
    {
      label: '专家请假',
      key: 'leaved',
      slot: 'leaved'
    },
    {
      label: '语音通知状态',
      key: 'noticeStatus',
      prop: 'noticeStatus',
      width: '200'
    },
    {
      label: '语音通知时间',
      key: 'noticeTime',
      prop: 'noticeTime',
      width: '200'
    }
  ]),
  column4 = reactive([
    {
      type: 'radio',
      key: 'expertId',
      width: '60'
    },
    {
      label: '专家姓名',
      key: 'name',
      prop: 'name'
    },
    {
      label: '工作单位',
      key: 'company',
      prop: 'company',
      minWidth: '150',
      showOverflowTooltip: true
    },
    {
      label: '手机号码',
      key: 'mobile',
      slot: 'mobile'
    },
    {
      label: '专家类型',
      key: 'expertTypeName',
      prop: 'expertTypeName'
    }
  ]),
  column5 = reactive([
    {
      label: '专家姓名',
      key: 'name',
      prop: 'name',
      render: row => h('span', `${row.name}${row.isHeadman ? '（组长）' : ''}`)
    },
    {
      label: '手机号码',
      key: 'mobile',
      slot: 'mobile'
    },
    {
      label: '是否参会',
      key: 'status',
      prop: 'status',
      render: row => h('span', row.status === 3 ? '是' : row.status === 4 || row.status === 5 || row.status === 7 ? '否' : '-')
    },
    {
      label: '操作',
      slot: 'action',
      width: '180',
      fixed: 'right'
    }
  ]),
  // 获取会议详情
  basicInfo = ref({}),
  inviteRuleDetail = ref({}),
  isExpertConfirmed = ref(false),
  getDetail = async () => {
    const res = await meetingBasicInfo(route.query.id)
    isExpertConfirmed.value = res.data.confirmedRoster
    const res1 = await meetingInviteRuleDetail(route.query.id)
    basicInfo.value = res.data
    inviteRuleDetail.value = res1.data
  },
  // 抽取情况、通知情况
  inviteExpertListData = ref({}),
  getInviteExpertList = async () => {
    const res = await inviteExpertList(route.query.id)
    console.log(res.data)
    inviteExpertListData.value = res.data
  },
  // 查看规则
  ruleDialogData = reactive({
    visible: false,
    data: []
  }),
  viewRule = (id) => {
    ruleDialogData.visible = true
    ruleDialogData.data = inviteRuleDetail.value.randomRules.find(i => i.id === id)
  },
  // 取消会议
  cancelMeeting = () => {
    proxy.$messageBox
      .confirm('确认取消该会议吗?', '提示！', {
        type: 'warning'
      })
      .then(async () => {
        await meetingCancel({ meetingId: route.query.id * 1 })
        proxy.$message.success('取消会议成功！')
        onLoad()
      })
  },
  // 释放专家
  releaseExpert = () => {
    proxy.$messageBox
      .confirm('确认释放专家吗?', '提示！', {
        type: 'warning'
      })
      .then(async () => {
        await expertRelease({ meetingId: route.query.id * 1 })
        proxy.$message.success('释放专家成功！')
        onLoad()
      })
  },
  // 1重发短信、2、3确认召开会议
  reText = (type) => {
    let text = `${type === 1 ? '确认重发短信' : '确认召开会议'}`
    if (type === 3) {
      const data = inviteExpertListData.value.inviteStatistics?.filter(i => i.inviteCnt > i.agreeCnt).map(i => '规则' + (inviteRuleDetail.value?.randomRules?.findIndex(j => j.id === i.ruleId) + 1)).join('、')
      if (data) {
        text = `${data}人数不够，确认召开会议`
      }
    }
    proxy.$messageBox
      .confirm(`${text}吗?`, '提示！', {
        type: 'warning'
      })
      .then(async () => {
        await confirmedRoster({ meetingId: route.query.id * 1 })
        proxy.$message.success('操作成功！')
        onLoad()
      })
  },
  // 指定抽取-是否所有专家已参会或是不参会
  IsAllExpertAttend = () => {
    if (inviteExpertListData.value.inviteExpertList.filter(i => !i.status && i.inviteType !== 1)?.length) {
      return false
    }
    return true
  },
  // 终止抽取
  stopInvites = () => {
    proxy.$messageBox
      .confirm('确认终止抽取吗?', '提示！', {
        type: 'warning'
      })
      .then(async () => {
        await stopInvite(route.query.id * 1)
        proxy.$message.success('终止抽取成功！')
        onLoad()
      })
  },
  // 参会、不参会
  confirmExpert = (data, agreed) => {
    proxy.$messageBox
      .confirm(`确认${agreed ? '参会' : '不参会'}吗?`, '提示！', {
        type: 'warning'
      })
      .then(async () => {
        await expertConfirm({
          agreed,
          expertMeetingId: data.expertMeetingId,
          meetingId: route.query.id * 1
        })
        onLoad()
      })
  },
  // 指定抽取-移除
  removeExpert = async (row) => {
    await expertRemove({ expertMeetingId: row.expertMeetingId, meetingId: row.meetingId })
    proxy.$message.success('移除成功！')
    onLoad()
  },
  // 设置组长
  tableHeadListRef = ref(),
  headManData = ref(),
  radioChange = (val) => {
    headManData.value = val
  },
  showHeadManDialog = async () => {
    dialogVisible.value = true
    await nextTick() // 必须
    tableHeadListRef.value.setRadio(inviteExpertListData.value?.inviteExpertList?.find(i => i.isHeadman)?.expertId || '')
  },
  submitUpHeadman = async () => {
    dialogVisible.value = false
    await setUpHeadman({
      agreed: true,
      expertMeetingId: headManData.value.expertMeetingId,
      meetingId: route.query.id * 1
    })
    proxy.$message.success('设置组长成功！')
    onLoad()
  },
  // 指定专家-补充
  expertDialogData = reactive({
    visible: false,
    data: undefined
  }),
  regionTree = ref([]),
  showExpertDialog = () => {
    expertDialogData.visible = true
  },
  getExpertData = async (row) => {
    await batchAppoint({
      expertIdList: row.map(i => i.userId),
      meetingId: route.query.id * 1
    })
    expertDialogData.visible = false
    proxy.$message.success('添加成功！')
    onLoad()
  },
  // 转为指定抽取
  toAppointInvite = async () => {
    await convertToAppoint({ meetingId: route.query.id * 1 })
    proxy.$message.success('转为指定抽取成功！')
    onLoad()
  },
  // 刷新
  reloadLoaing = ref(false),
  onLoad = async (flag) => {
    reloadLoaing.value = !flag && true
    await getDetail()
    await getInviteExpertList()
    reloadLoaing.value = false
  },
  // 随机邀请人数是否足够
  getIsEnough = () => {
    if (inviteExpertListData.value.inviteStatistics.filter(i => i.agreeCnt !== i.inviteCnt)?.length) {
      return true
    }
    return false
  },
  // 续抽
  continueInvites = () => {
    proxy.$messageBox
      .confirm('续抽后，将重新通知已拒绝参会的专家们，确定继续吗?', '提示！', {
        type: 'warning'
      })
      .then(async () => {
        await continueInvite({ meetingId: route.query.id * 1 })
        proxy.$message.success('续抽成功！')
        onLoad()
      })
  },
  // 查看评审意见详情
  // 所有意见-抽屉
  drawerVisible = ref(false),
  templatesData = ref([]), // 模板数据
  memberOpinions = ref([]), // 所有意见
  showReviewDetail = async (data) => {
    const res = await listReview({ projectId: data.projectId, meetingId: route.query.id })
    const res1 = await templatesById({ templateIds: res.data.map(i => i.templateId).join(',') })
    templatesData.value = res1.data
    memberOpinions.value = res.data && res.data.map(i => {
      return {
        ...i,
        reviewTemplateOptions: i.reviewTemplateOptions && i.reviewTemplateOptions.map(temp => {
          const data = templatesData.value.find(j => i.templateId === j.templateId).templates
          return {
            ...temp,
            title: data.find(r => r.serialNo === temp.questionSerialNo)?.title,
            optionsValue: data.find(r => r.serialNo === temp.questionSerialNo)?.options.filter(j => temp.optionSerialNo.includes(j.serialNo)).map(j => j.option).join('、')
          }
        }) || []
      }
    }) || []
    drawerVisible.value = true
  },
  tableName = {
    1: '劳务费发放审批单',
    2: '专家费用单',
    3: '专家抽取表',
    4: '项目评审单'
  },
  handleCommand = async (command) => {
    const res = await exportTable(command, route.query.id)
    let suffix = 'docx'
    if (res.type === 'application/zip') {
      suffix = 'zip'
    }
    const url = URL.createObjectURL(res)
    const link = document.createElement('a')
    link.style.display = 'none'
    link.href = url
    link.download = `${tableName[command]}.${suffix}`
    document.body.appendChild(link)
    link.click()
    document.body.removeChild(link)
    window.URL.revokeObjectURL(url)
  },
  // 请假
  leaveDialogData = reactive({
    visible: false,
    data: undefined
  }),
  leave = (row) => {
    leaveDialogData.visible = true
    leaveDialogData.data = {
      expertId: row.expertId,
      meetingId: route.query.id
    }
  },
  closeLeaveDialog = (flag) => {
    leaveDialogData.visible = false
    flag && getInviteExpertList()
  }
onMounted(async () => {
  getDetail()
  getInviteExpertList()
  const res = await districtList()
  regionTree.value.push(res.data)
})
</script>

<template>
  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span>会议信息</span>
      </div>
    </template>
    <el-descriptions
      title=""
      :column="2"
      border
    >
      <el-descriptions-item label="会议名称">
        {{ basicInfo.meetingName }}
      </el-descriptions-item>
      <el-descriptions-item label="评审类型">
        {{ meetingTypeOptions[basicInfo.meetingType] }}
      </el-descriptions-item>
      <el-descriptions-item
        label="评审项目"
        :span="2"
      >
        <table-list
          ref="tableListRef"
          :column="column"
          :pagination="false"
          style="max-height: 200px;width:95%"
          :data="basicInfo.projects"
        >
          <template #action="{ scope }">
            <a v-if="scope.row.reviewResult" @click="showReviewDetail(scope.row)">详情</a>
          </template>
        </table-list>
      </el-descriptions-item>
      <el-descriptions-item label="评审时间">
        {{ basicInfo.startTime }}~{{ basicInfo.endTime }}
      </el-descriptions-item>
      <el-descriptions-item
        label="评审耗时"
      >
        {{ basicInfo.meetingUsageTime===1?'半天':'一天' }}
      </el-descriptions-item>
      <el-descriptions-item label="评审地点">
        {{ basicInfo.meetingAddress }}
      </el-descriptions-item>
      <el-descriptions-item label="评委到场时间">
        {{ basicInfo.judgesAttendanceTime }}
      </el-descriptions-item>
      <el-descriptions-item label="联系人">
        {{ basicInfo.connecter }}
      </el-descriptions-item>
      <el-descriptions-item label="联系方式">
        {{ basicInfo.contact }}
      </el-descriptions-item>
      <el-descriptions-item label="会议状态">
        <span :class="`dot mr-4 ${basicInfo.status === 1 ? 'bg-success' : 'bg-danger'}`"></span>
        <span :class="`${basicInfo.status === 1 ? 'text-success' : 'text-danger'}`">{{ basicInfo.status===1?'正常': '已取消' }}</span>
      </el-descriptions-item>
      <el-descriptions-item label="抽取方式">
        {{ basicInfo.inviteType === 1 ? '随机抽取' : basicInfo.inviteType === 2?'指定抽取':'-' }}
      </el-descriptions-item>
      <el-descriptions-item label="抽取状态">
        {{ basicInfo.invitedStopped?'抽取结束':!basicInfo.inviteStatus ? '抽取中' :'抽取结束' }}
      </el-descriptions-item>
      <el-descriptions-item label="专家名单确认状态">
        {{ basicInfo.confirmedRoster? '已确认' : '未确认' }}
      </el-descriptions-item>
      <template v-if="basicInfo.inviteType === 1">
        <el-descriptions-item label="部门、条线回避规则">
          {{ inviteRuleDetail.avoidInfo?.avoidType===2?'回避条线':inviteRuleDetail.avoidInfo?.avoidType===1?'回避单位':inviteRuleDetail.avoidInfo?.avoidType===3?'不回避':'-' }}
        </el-descriptions-item>
        <el-descriptions-item
          label="回避单位"
        > {{ inviteRuleDetail.avoidInfo?.avoidUnits?.map(i=>i).join('、')||"-" }}</el-descriptions-item>
        <el-descriptions-item label="回避专家">
          {{ inviteRuleDetail.avoidInfo?.experts?.map(i=>i.name).join('、')||"-" }}
        </el-descriptions-item>
        <el-descriptions-item label="回避条线">
          {{ inviteRuleDetail.avoidInfo?.avoidOrgs?.map(i=>i).join('、')||'-' }}
        </el-descriptions-item>
        <el-descriptions-item label="回避次数">
          {{ inviteRuleDetail.avoidInfo?.weekInviteCount||'-' }}
        </el-descriptions-item>
      </template>
      <el-descriptions-item
        v-else
        label="邀请理由"
        :span="2"
      >{{ basicInfo?.inviteRule?.appointRule?.inviteDesc||'-' }}</el-descriptions-item>
    </el-descriptions>
  </el-card>
  <!--  随机抽取-->
  <template v-if="basicInfo.inviteType === 1">
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span>抽取情况</span>
          <div>
            <el-button
              v-if="basicInfo.invitedStopped||basicInfo.inviteStatus"
              class="button"
              type="primary"
              plain
              @click="toAppointInvite"
            >转为指定抽取</el-button>
            <el-button
              v-if="basicInfo.status===1&&(basicInfo.invitedStopped||basicInfo.inviteStatus)&&getIsEnough()"
              class="button"
              type="primary"
              plain
              @click="continueInvites"
            >续抽</el-button>
            <!--            <el-button-->
            <!--              v-if="basicInfo.status===1&&(basicInfo.invitedStopped||basicInfo.inviteStatus)&&!basicInfo.confirmedRoster"-->
            <!--              class="button"-->
            <!--              type="primary"-->
            <!--              @click="reText(3)"-->
            <!--            >确认召开会议</el-button>-->
          </div>
        </div>
      </template>
      <table-list
        ref="tableListRef"
        :column="column2"
        :pagination="false"
        :data="inviteExpertListData.inviteStatistics"
      >
        <template #agreeCnt="{ scope }">
          <div class="flex items-center">
            <span>{{ scope.row.agreeCnt }}</span>
            <el-icon
              v-if="scope.row.agreeCnt===scope.row.inviteCnt"
              class="ml-8"
              style="color: #4ecb74"
            ><Select /></el-icon>
          </div>
        </template>
        <template
          #ruleId="{scope}"
        >
          <a @click="viewRule(scope.row.ruleId)">规则{{ inviteRuleDetail?.randomRules?.findIndex(i => i.id === scope.row.ruleId)+1||'' }}</a>
        </template>
      </table-list>
    </el-card>
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span>通知情况</span>
          <el-button
            v-if="!basicInfo.invitedStopped"
            class="button"
            type="danger"
            plain
            @click="stopInvites"
          >终止抽取</el-button>
        </div>
      </template>
      <el-alert
        type="warning"
        :description="`共有${inviteExpertListData.inviteExpertList?.length}位专家，已通知${inviteExpertListData.inviteExpertList?.filter(i=>i.noticeStatus==='已通知')?.length}位，尚未通知${inviteExpertListData.inviteExpertList?.filter(i=>i.noticeStatus==='未通知')?.length}位。`"
        show-icon
        :closable="false"
      />
      <table-list
        ref="tableListRef"
        :column="column3"
        :pagination="false"
        class="mt-15"
        :data="inviteExpertListData.inviteExpertList"
      >
        <template #contact="{scope}">
          <el-tooltip
            class="box-item"
            effect="dark"
            :content="scope.row.contact"
          >
            <span>{{ scope.row.contact?.replace(/(\d{3})\d*(\d{4})/, '$1****$2') }}</span>
          </el-tooltip>
        </template>
        <template #leaved="{scope}">
          <a v-if="!scope.row.leaved&&scope.row.confirmedAttend" @click="leave(scope.row)">请假</a>
          <span v-else-if="scope.row.leaved">已请假</span>
          <span v-else>-</span>
        </template>
        <template #ruleId="{ scope }">
          <a @click="viewRule(scope.row.ruleId)">规则{{ inviteRuleDetail?.randomRules?.findIndex(i => i.id === scope.row.ruleId)+1||'' }}</a>
        </template>
      </table-list>
    </el-card>
  </template>
  <!--  指定抽取-->
  <el-card v-else class="box-card">
    <template #header>
      <div class="card-header">
        <span>通知情况</span>
        <span v-if="basicInfo.status===1">
          <el-button
            v-if="!isExpertConfirmed"
            class="button"
            plain
            @click="showExpertDialog"
          >添加专家</el-button>
          <el-button
            v-if="!basicInfo.confirmedRoster&&IsAllExpertAttend()"
            class="button"
            type="primary"
            plain
            @click="reText(2)"
          >确认召开会议</el-button>
        </span>
      </div>
    </template>
    <el-alert
      type="warning"
      :description="`共有${inviteExpertListData.inviteExpertList?.length}位专家，确认参会${inviteExpertListData.inviteExpertList?.filter(i=>i.status===3)?.length}位。`"
      show-icon
      :closable="false"
    />
    <table-list
      ref="tableListRef"
      :column="column5"
      :pagination="false"
      class="mt-15"
      :data="inviteExpertListData.inviteExpertList"
    >
      <template #mobile="{scope}">
        <el-tooltip
          class="box-item"
          effect="dark"
          :content="scope.row.mobile"
        >
          <span>{{ scope.row.mobile?.replace(/(\d{3})\d*(\d{4})/, '$1****$2') }}</span>
        </el-tooltip>
      </template>
      <template #action="{ scope }">
        <div v-if="!scope.row.status&&scope.row.inviteType!==1">
          <a @click="confirmExpert(scope.row,true)">参会</a>
          <a @click="confirmExpert(scope.row,false)">不参会</a>
          <a class="text-danger" @click="removeExpert(scope.row)">移除</a>
        </div>
        <div v-else>
          <span>-</span>
        </div>
      </template>
    </table-list>
  </el-card>
  <div class="flex h-60	items-center justify-between bg-white	">
    <div class="flex items-center ml-20">
      <el-button plain @click="router.go(-1)">返回</el-button>
      <el-button plain :loading="reloadLoaing" @click="onLoad(false)">刷新</el-button>
      <el-button
        v-if="basicInfo.status===1"
        type="danger"
        plain
        @click="cancelMeeting"
      >取消会议</el-button>
      <el-button
        v-if="basicInfo.status===1&&basicInfo.inviteStatus"
        type="danger"
        plain
        @click="releaseExpert"
      >释放专家</el-button>
    </div>
    <div class="flex items-center mr-20">
      <el-button
        v-if="basicInfo.status===1&&basicInfo.confirmedRoster"
        plain
        type="primary"
        @click="showHeadManDialog"
      >设置专家组长</el-button>
      <el-button
        v-if="basicInfo.status===1&&basicInfo.confirmedRoster"
        plain
        type="primary"
        @click="reText(1)"
      >重发短信</el-button>
      <el-dropdown v-if="basicInfo.status===1&&basicInfo.confirmedRoster" class="ml-12" @command="handleCommand">
        <el-button type="primary" plain>
          导出<el-icon class="el-icon--right"><arrow-down /></el-icon>
        </el-button>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item command="1">劳务费发放审批单</el-dropdown-item>
            <el-dropdown-item command="2">专家费用单</el-dropdown-item>
            <el-dropdown-item command="3">专家抽取表</el-dropdown-item>
            <el-dropdown-item command="4">项目评审单</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>
  <el-dialog
    v-model="dialogVisible"
    title="设置专家组长"
    width="50%"
  >
    <table-list
      ref="tableHeadListRef"
      :column="column4"
      :pagination="false"
      class="mt-15"
      :data="inviteExpertListData.inviteExpertList.filter(i=>i.status===3)"
      @radio-change="radioChange"
    >
      <template #mobile="{scope}">
        <el-tooltip
          class="box-item"
          effect="dark"
          :content="scope.row.mobile"
        >
          <span>{{ scope.row.mobile?.replace(/(\d{3})\d*(\d{4})/, '$1****$2') }}</span>
        </el-tooltip>
      </template>
    </table-list>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">关闭</el-button>
        <el-button
          type="primary"
          @click="submitUpHeadman"
        >
          提交
        </el-button>
      </span>
    </template>
  </el-dialog>
  <el-dialog
    v-model="ruleDialogData.visible"
    title="规则"
    width="70%"
  >
    <el-descriptions :column="3">
      <el-descriptions-item label="内外围：">
        {{ ruleDialogData.data?.expertDicts?.find(i=>i.expertDict==='expert_type')?.dictCodes.join('、')||'-' }}
      </el-descriptions-item>
      <el-descriptions-item label="履职意向：">
        {{ ruleDialogData.data?.intentionRegions?.map(i=>i.regionName).join('-') }}
      </el-descriptions-item>
      <el-descriptions-item label="专家来源：">
        {{ ruleDialogData.data?.expertTags?.find(i=>i.expertTag==='expert_source')?.tagCodes.join('、')||'-' }}
      </el-descriptions-item>
      <el-descriptions-item label="职称级别：">
        {{ ruleDialogData.data?.expertDicts?.find(i=>i.expertDict==='title_level')?.dictCodes.join('、')||'-' }}
      </el-descriptions-item>
      <el-descriptions-item label="擅长方向：">
        {{ ruleDialogData.data?.expertTags?.find(i=>i.expertTag==='good_at')?.tagCodes.join('、')||'-' }}
      </el-descriptions-item>
      <el-descriptions-item label="技术专长：">
        {{ ruleDialogData.data?.expertTags?.find(i=>i.expertTag==='technical_expertise')?.tagCodes.join('、')||'-' }}
      </el-descriptions-item>
      <el-descriptions-item label="行业领域：">
        {{ ruleDialogData.data?.expertTags?.find(i=>i.expertTag==='industry_sector')?.tagCodes.join('、')||'-' }}
      </el-descriptions-item>
      <el-descriptions-item label="其他标签：">
        {{ ruleDialogData.data?.expertTags?.find(i=>i.expertTag==='other')?.tagCodes.join('、')||'-' }}
      </el-descriptions-item>
      <el-descriptions-item label="专家级别：">
        {{ ruleDialogData.data?.expertRegions?.map(i=>i.regionName).join('-') }}
      </el-descriptions-item>
      <el-descriptions-item label="邀请数量：">
        {{ ruleDialogData.data.count }}
      </el-descriptions-item>
    </el-descriptions>
  </el-dialog>
  <add-expert-dialog
    :visible="expertDialogData.visible"
    :data="expertDialogData.data"
    :region-tree="regionTree"
    @get-user-data="getExpertData"
    @close="expertDialogData.visible = false"
  />
  <el-drawer
    v-model="drawerVisible"
    title="评审详情"
    style="position: absolute"
    direction="rtl"
    size="70%"
    :modal="false"
    :append-to-body="false"
    modal-class="myDrawerModal"
  >
    <member-opinion :member-opinions="memberOpinions" />
  </el-drawer>
  <leave-dialog
    :visible="leaveDialogData.visible"
    :data="leaveDialogData.data"
    title="填写请假原因"
    @close="closeLeaveDialog"
  />
</template>

<style lang='less' scoped>
.box-card{
  margin-bottom: 20px;
  .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
}

</style>

