zhouwx
2024-12-09 2adbfd2aed024bf8fda3b85b3e7af07108329f85
src/views/safetyReview/projectManage/components/chooseExpert.vue
@@ -1,31 +1,31 @@
<template>
  <div class="expertChoose">
    <div style="margin-bottom: 50px">
      <div class="fTop">
        <span style="font-weight: 600">固定选用部分</span>
        <el-button type="primary" style="width: 100px" @click="chooseExpert('选取专家')">选取专家</el-button>
      </div>
      <el-table v-loading="fLoading"  :data="fixedDataList" :border="true" ref="fTableRef" style="width: 100%;">
        <el-table-column label="姓名" prop="name" align="center" />
        <el-table-column label="性别" prop="sex" align="center" >
          <template #default="scope">
           {{scope.row.sex === 0 ? '男' : '女' }}
          </template>
        </el-table-column>
        <el-table-column label="身份证号" prop="idCard" align="center" />
        <el-table-column label="等级" prop="ratingLevel" align="center" >
          <template #default="scope">
            <span>{{scope.row.ratingLevel == 1 ?'一级':scope.row.ratingLevel == 1?'二级':'三级'}}</span>
          </template>
        </el-table-column>
        <el-table-column label="专业领域" prop="domain" align="center" />
        <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="180">
          <template #default="scope">
            <el-button link type="primary" @click="delF(scope.row)" >删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
<!--    <div style="margin-bottom: 50px">-->
<!--      <div class="fTop">-->
<!--        <span style="font-weight: 600">固定选用部分</span>-->
<!--        <el-button type="primary" :disabled="state.info.step == 4 || state.isAdmin" style="width: 100px" @click="chooseExpert('选取专家')">选取专家</el-button>-->
<!--      </div>-->
<!--      <el-table v-loading="fLoading"  :data="fixedDataList" :border="true" ref="fTableRef" style="width: 100%;">-->
<!--        <el-table-column label="姓名" prop="name" align="center" />-->
<!--        <el-table-column label="性别" prop="sex" align="center" >-->
<!--          <template #default="scope">-->
<!--           {{scope.row.sex === 0 ? '男' : '女' }}-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column label="身份证号" prop="idCard" align="center" />-->
<!--        <el-table-column label="等级" prop="ratingLevel" align="center" >-->
<!--          <template #default="scope">-->
<!--            <span>{{scope.row.ratingLevel == 1 ?'一级':scope.row.ratingLevel == 1?'二级':'三级'}}</span>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column label="专业领域" prop="domain" align="center" />-->
<!--        <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="180">-->
<!--          <template #default="scope">-->
<!--            <el-button link type="primary" @click="delF(scope.row)" :disabled="state.info.step == 4 || state.isAdmin">删除</el-button>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--      </el-table>-->
<!--    </div>-->
    <div style="display: flex;flex-direction: column">
      <span style="font-weight: 600">随机选用部分</span>
      <el-form :model="queryParams" ref="queryForm" :inline="true" style="margin-top: 10px" label-width="90px">
@@ -36,7 +36,7 @@
                  style="width: 100%"
                  v-model="expertType"
                  :options="domainList"
                  :props="{ expandTrigger: 'hover',value: 'id',label: 'classifyName',multiple: true }"
                  :props="{ expandTrigger: 'hover',value: 'classifyName',label: 'classifyName',multiple: true }"
                  @change="professionChange"
                  collapse-tags
                  collapse-tags-tooltip
@@ -54,7 +54,7 @@
          </el-col>
          <el-col :span="8">
            <el-form-item style="float: right;">
              <el-button style="width: 100px;margin-right: -32px;" type="primary" @click="random">随机抽取</el-button>
              <el-button style="width: 100px;margin-right: -32px;" :disabled="state.info.step == 4 || state.isAdmin" type="primary" @click="random">随机抽取</el-button>
            </el-form-item>
          </el-col>
        </el-row>
@@ -88,7 +88,7 @@
        <el-table-column label="专业领域" prop="domain" align="center" />
        <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="180">
          <template #default="scope">
            <el-button link type="primary" @click="delR(scope.row)" >删除</el-button>
            <el-button link type="primary" @click="delR(scope.row)" :disabled="state.info.step == 4 || state.isAdmin">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
@@ -103,6 +103,7 @@
import {getExpertTypes} from "@/api/form";
import {ElMessage} from "element-plus";
import {addProject, choose, expertRound, getCheckInfo} from "@/api/projectManage";
import Cookies from "js-cookie";
const emit = defineEmits(["getNextStatus"]);
const fTableRef  = ref(null);
@@ -125,6 +126,7 @@
    saveData: [],
    delData: []
  },
  info: {},
  levelList: [
    {
      id: 1,
@@ -138,17 +140,24 @@
      id: 3,
      name: '三级'
    },
  ]
  ],
  isAdmin: false
})
const userInfo = ref()
onMounted(() =>{
  userInfo.value = JSON.parse(Cookies.get('userInfo'))
  state.isAdmin = userInfo.value.admin
  getDomain()
})
const riskOpen = async (type,val) => {
  console.log("type",type,val)
  if(type === 'add' || type === 'clickEdit'){
    if (state.isAdmin) {
      ElMessage.warning("当前用户暂无权限");
      return;
    }
    if(fixedDataList.value.length === 0 && randomDataList.value.length === 0){
      ElMessage.warning('请选择专家')
      return;
@@ -234,6 +243,7 @@
    if(res.code == 200){
      fixedDataList.value = res.data.projectExpertCheckResp.filter(item => item.selectionMode === 1)
      randomDataList.value = res.data.projectExpertCheckResp.filter(item => item.selectionMode === 2)
      state.info = res.data
      console.log('res',fixedDataList.value)
    }else{
      ElMessage.warning(res.message)
@@ -291,6 +301,10 @@
      state.formData.delData.push(item.id)
    }
  })
  if(queryParams.value.domain == undefined ||  (queryParams.value.domain && queryParams.value.domain.length == 0)){
    ElMessage.warning('专业领域不能为空')
    return
  }
  if(queryParams.value.num =='' || queryParams.value.num == undefined){
    ElMessage.warning('拟选用人数不能为空')
    return