| | |
| | | v-model.trim="queryParams.num" |
| | | placeholder="请输入专家总人数" |
| | | style="width: 150px;" |
| | | @input="queryParams.num = queryParams.num.replace(/[^1-9]/g,'')" |
| | | @input="queryParams.num = queryParams.num.replace(/[^0-9]/g,'')" |
| | | :disabled="!state.isAble || state.newProgress >=3 " |
| | | |
| | | > |
| | |
| | | <el-icon style="margin-left: 10px;margin-right: 4px;margin-top: 2px;color: #FE8E8A"><InfoFilled /></el-icon> |
| | | <span style="font-size: 14px;color: #FE8E8A">仅专家组组长允许固定选取,仅允许固定选取1人</span> |
| | | </div> |
| | | <el-button type="primary" :disabled="state.info.step == 4 || state.isAdmin" style="width: 120px;margin-bottom: 10px" @click="chooseExpert('选取专家')">选取专家组组长</el-button> |
| | | <div> |
| | | <el-button type="primary" :disabled="state.info.step == 4 || state.isAdmin" style="width: 120px;margin-bottom: 10px" @click="chooseExpert('选取专家')">选取专家组组长</el-button> |
| | | <el-button type="primary" :disabled="state.info.step == 4 || state.isAdmin" style="width: 120px;margin-bottom: 10px" @click="addOutExpertLeader">填报库外专家</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table v-loading="fLoading" :data="fixedDataList" :border="true" ref="fTableRef" style="width: 100%;"> |
| | | <el-table-column label="姓名" prop="name" align="center" /> |
| | |
| | | <div style="display: flex;align-items: center"> |
| | | <span style="font-weight: 600">随机选用部分</span> |
| | | <el-icon style="margin-left: 10px;margin-right: 4px;margin-top: 2px;color: #FE8E8A"><InfoFilled /></el-icon> |
| | | <span style="font-size: 14px;color: #FE8E8A">随机人数为 {{queryParams.num-1}} 的5倍,可根据实际情况删除至 {{queryParams.num-1}} 人</span> |
| | | <span style="font-size: 14px;color: #FE8E8A">随机人数为 {{queryParams.num-1}} 的5倍,可根据实际情况选取{{queryParams.num-1}} 人</span> |
| | | </div> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" style="margin-top: 10px" label-width="90px"> |
| | | <el-row :gutter="24"> |
| | |
| | | </el-col> |
| | | |
| | | <el-col :span="8"> |
| | | <el-form-item style="float: right;" v-if=" state.newProgress < 3 && state.isAble && Number(queryParams.num) !=1 && queryParams.num!=''"> |
| | | <el-button style="width: 100px;margin-right: -32px;" :disabled="state.info.step == 4 || state.isAdmin" type="primary" @click="random">随机抽取</el-button> |
| | | </el-form-item> |
| | | <div style="display: flex;align-items: center;justify-content: flex-end"> |
| | | <div style="float: right;" v-if=" state.newProgress < 3 && state.isAble && Number(queryParams.num) !=1 && queryParams.num!=''"> |
| | | <el-button style="width: 100px;margin-bottom: 20px;margin-right: 10px" :disabled="state.info.step == 4 || state.isAdmin" type="primary" @click="random">随机抽取</el-button> |
| | | </div> |
| | | <el-button type="primary" :disabled="state.info.step == 4 || state.isAdmin" style="width: 120px;margin-bottom: 20px" @click="addOutExpertLists">填报库外专家</el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div style="display: flex;align-items: center;justify-content: flex-end;margin-top: -15px;margin-bottom: 10px" v-if="state.newProgress < 3"> |
| | |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | </el-form> |
| | | <el-table v-loading="rLoading" :data="randomDataList" :border="true" ref="rTableRef" style="width: 100%;"> |
| | | <el-table v-loading="rLoading" :data="randomDataList" :border="true" ref="rTableRef" style="width: 100%;" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column label="姓名" prop="name" align="center" /> |
| | | <el-table-column label="性别" prop="sex" align="center" > |
| | | <template #default="scope"> |
| | |
| | | </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="delR(scope.row)" :disabled="state.info.step == 4 || state.isAdmin">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <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)" :disabled="state.info.step == 4 || state.isAdmin">删除</el-button>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | </div> |
| | | <experts-list ref="expertsListRef" @getName="getSelected"></experts-list> |
| | | <out-expert ref="outRef" @getList="getOutItem"></out-expert> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import {ElMessage} from "element-plus"; |
| | | import {addProject, choose, expertRound, getCheckInfo, getProjectInfo} from "@/api/projectManage"; |
| | | import Cookies from "js-cookie"; |
| | | import outExpert from './addOutExpertDialog.vue' |
| | | |
| | | const emit = defineEmits(["getNextStatus"]); |
| | | const fTableRef = ref(null); |
| | | const outRef = ref(null); |
| | | const expertsListRef = ref(null) |
| | | const fLoading = ref(false); |
| | | const rLoading = ref(false); |
| | |
| | | id:null, |
| | | step: 2, |
| | | saveData: [], |
| | | delData: [] |
| | | delData: [], |
| | | saveOutData: [], |
| | | delOutData: [] |
| | | }, |
| | | info: {}, |
| | | levelList: [ |
| | |
| | | randomNum:0, |
| | | isAble: true |
| | | }) |
| | | |
| | | const choosedRandomList = ref([]) |
| | | const userInfo = ref() |
| | | onMounted(async () =>{ |
| | | // localStorage.removeItem('numData') |
| | |
| | | fixDataArr.forEach(item => { |
| | | if(item.projectId == state.projectId){ |
| | | fixedDataList.value = [item.fixedData] |
| | | const uniqueItem = fixedDataList.value.find(itemA => |
| | | !itemA.id && !state.formData.saveOutData.some(itemB => itemB.name === itemA.name) |
| | | ); |
| | | if(uniqueItem){ |
| | | state.formData.saveOutData.push(uniqueItem) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | rondomDataArr.forEach(item => { |
| | | if(item.projectId == state.projectId){ |
| | | randomDataList.value = item.rondomData |
| | | |
| | | const uniqueItem = randomDataList.value.find(itemA => |
| | | !itemA.id && !state.formData.saveOutData.some(itemB => itemB.name === itemA.name) |
| | | ); |
| | | if(uniqueItem){ |
| | | state.formData.saveOutData.push(uniqueItem) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | fixedData: newVal[0] |
| | | } |
| | | if(state.newProgress < 2){ |
| | | |
| | | saveObjectToLocalStorage('fixedDataList',data) |
| | | } |
| | | } |
| | |
| | | localStorage.setItem(key, JSON.stringify(dataArray)); |
| | | } |
| | | |
| | | |
| | | const typeNow = ref('') |
| | | const firstRandomList = ref([]) |
| | | const riskOpen = async (type,val) => { |
| | | typeNow.value = type |
| | | console.log("type",type,val) |
| | | state.projectId = val |
| | | await getProjectProcess() |
| | |
| | | // return; |
| | | // } |
| | | } |
| | | |
| | | |
| | | //保存按钮 |
| | | if(type === 'add'){ |
| | | // choosedRandomList.value = randomDataList.value |
| | | let fData = [] |
| | | let rData = [] |
| | | //成功后自动到下一步 项目id |
| | | const {...data} = state.formData |
| | | data.id = val |
| | | |
| | | if(fixedDataList.value && fixedDataList.value.length > 0){ |
| | | fData = fixedDataList.value.map(item => { |
| | | return { |
| | |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | if(randomDataList.value && randomDataList.value.length > Number(queryParams.num) - 1){ |
| | | ElMessage.warning(`仅可保留${Number(queryParams.num) - 1}名随机专家`); |
| | | if(choosedRandomList.value && choosedRandomList.value.length > Number(queryParams.num) - 1){ |
| | | ElMessage.warning(`仅可选取${Number(queryParams.num) - 1}名随机专家`); |
| | | return |
| | | } |
| | | if(randomDataList.value && randomDataList.value.length > 0){ |
| | | rData = randomDataList.value.map(item => { |
| | | if(choosedRandomList.value.length < Number(queryParams.num) - 1){ |
| | | ElMessage.warning(`随机专家数不能低于${Number(queryParams.num) - 1}人`) |
| | | return |
| | | } |
| | | if(choosedRandomList.value && choosedRandomList.value.length > 0){ |
| | | rData = choosedRandomList.value.map(item => { |
| | | return { |
| | | expertId: item.id, |
| | | expertName:item.name, |
| | |
| | | } |
| | | }) |
| | | } |
| | | fData = fData.filter(i => i.expertId) |
| | | rData = rData.filter(i => i.expertId) |
| | | const chooseIds = choosedRandomList.value.map(i => i.id) |
| | | const x = randomDataList.value.filter(i => !chooseIds.includes(i.id)) |
| | | x.forEach(i => { |
| | | if(i.expertType == 1 && i.expertId){ |
| | | data.delData.push(i.id) |
| | | }else if(i.expertType == 2 ){ |
| | | if( i.id){ |
| | | data.delOutData.push(i.id) |
| | | data.saveOutData = data.saveOutData.filter(f => f.id != i.id) |
| | | }else { |
| | | data.saveOutData = data.saveOutData.filter(f => f != i) |
| | | } |
| | | } |
| | | }) |
| | | data.saveData = fData.concat(rData) |
| | | data.saveOutData.forEach(item => { |
| | | item.projectId = state.projectId |
| | | }) |
| | | |
| | | const res = await choose(data); |
| | | if(res.code == 200){ |
| | |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }else if(type === 'clickEdit'){ |
| | | // choosedRandomList.value = randomDataList.value |
| | | let fData = [] |
| | | let rData = [] |
| | | const {...data} = state.formData |
| | | data.id = val |
| | | |
| | | if(fixedDataList.value && fixedDataList.value.length > 0){ |
| | | fData = fixedDataList.value.map(item => { |
| | | return { |
| | | ...item, |
| | | id: item.expertId ? item.id : '', |
| | | expertId: item.expertId ? item.expertId : item.id, |
| | | expertName:item.name, |
| | | selectionMode: 1, |
| | | teamLeader: 1 |
| | | teamLeader: 1, |
| | | } |
| | | }) |
| | | } |
| | | if(randomDataList.value && randomDataList.value.length > Number(queryParams.num) - 1){ |
| | | ElMessage.warning(`仅可保留${Number(queryParams.num) - 1}名随机专家`); |
| | | if(choosedRandomList.value && choosedRandomList.value.length > Number(queryParams.num) - 1){ |
| | | ElMessage.warning(`仅可选取${Number(queryParams.num) - 1}名随机专家`); |
| | | return |
| | | } |
| | | if(randomDataList.value && randomDataList.value.length > 0){ |
| | | rData = randomDataList.value.map(item => { |
| | | if(choosedRandomList.value.length < Number(queryParams.num) - 1){ |
| | | ElMessage.warning(`随机专家数不能低于${Number(queryParams.num) - 1}人`) |
| | | return |
| | | } |
| | | if(choosedRandomList.value && choosedRandomList.value.length > 0){ |
| | | rData = choosedRandomList.value.map(item => { |
| | | return { |
| | | ...item, |
| | | id: item.expertId ? item.id : '', |
| | | expertId: item.expertId ? item.expertId : item.id, |
| | | expertName:item.name, |
| | |
| | | } |
| | | }) |
| | | } |
| | | fData = fData.filter(i => i.expertType == 1) |
| | | rData = rData.filter(i => i.expertType == 1) |
| | | console.log('randon',randomDataList.value) |
| | | console.log('choodse',choosedRandomList.value) |
| | | const chooseIds = choosedRandomList.value.map(i => i.id) |
| | | const x = randomDataList.value.filter(i => !chooseIds.includes(i.id)) |
| | | x.forEach(i => { |
| | | if(i.expertType == 1 && i.expertId){ |
| | | data.delData.push(i.id) |
| | | }else if(i.expertType == 2 ){ |
| | | if( i.id){ |
| | | data.delOutData.push(i.id) |
| | | data.saveOutData = data.saveOutData.filter(f => f.id != i.id) |
| | | }else { |
| | | data.saveOutData = data.saveOutData.filter(f => f != i) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | data.saveData = fData.concat(rData) |
| | | data.saveOutData.forEach(item => { |
| | | item.projectId = state.projectId |
| | | }) |
| | | |
| | | const res = await choose(data); |
| | | if(res.code == 200){ |
| | | ElMessage.success('修改成功') |
| | |
| | | if(res.code == 200){ |
| | | fixedDataList.value = res.data.projectExpertCheckResp.filter(item => item.selectionMode === 1) |
| | | randomDataList.value = res.data.projectExpertCheckResp.filter(item => item.selectionMode === 2) |
| | | firstRandomList.value = res.data.projectExpertCheckResp.filter(item => item.selectionMode === 2) |
| | | const fdata = fixedDataList.value.filter(i => i.expertType == 2) |
| | | const rdata = randomDataList.value.filter(i => i.expertType == 2) |
| | | state.info = res.data |
| | | state.formData.saveOutData = fdata.concat(rdata) |
| | | console.log('res',fixedDataList.value) |
| | | queryParams.num = res.data.expertNum |
| | | removeLocal() |
| | |
| | | } |
| | | |
| | | const chooseExpert = (type) => { |
| | | // if(fixedDataList.value && fixedDataList.value.length >0){ |
| | | // ElMessage.warning('只能选择一个组长') |
| | | // return |
| | | // } |
| | | if(fixedDataList.value && fixedDataList.value.length >0){ |
| | | ElMessage.warning('仅允许选择1位组长') |
| | | return |
| | | } |
| | | expertsListRef.value.openDialog(type,fixedDataList.value,domainList.value) |
| | | } |
| | | |
| | |
| | | // } |
| | | // localStorage.setItem('randomNum', JSON.stringify(rnDataArray)); |
| | | } |
| | | const handleSelectionChange = (val) => { |
| | | choosedRandomList.value = val |
| | | } |
| | | |
| | | const getSelected = (type,data)=>{ |
| | | data[0].expertType = 1 |
| | | |
| | | const selectData = JSON.parse(JSON.stringify(data)) |
| | | // if(fixedDataList.value && fixedDataList.value.length > 0){ |
| | | // fixedDataList.value.forEach(item => { |
| | |
| | | if(fixedDataList.value && fixedDataList.value.length >0){ |
| | | state.formData.delData.push(fixedDataList.value[0].id) |
| | | } |
| | | |
| | | fixedDataList.value = selectData |
| | | } |
| | | const delF = (val) => { |
| | | if(val.expertId){ |
| | | state.formData.delData.push(val.id) |
| | | //库外 |
| | | if(val.expertType == 2){ |
| | | if(val.expertId){ |
| | | state.formData.delOutData.push(val.id) |
| | | } |
| | | state.formData.saveOutData = state.formData.saveOutData.filter(i => i.idCard != val.idCard) |
| | | }else{ |
| | | //库内 |
| | | if(val.expertId){ |
| | | state.formData.delData.push(val.id) |
| | | } |
| | | } |
| | | |
| | | fixedDataList.value = fixedDataList.value.filter(item => item.id != val.id) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | const random = async () => { |
| | | console.log('11',randomDataList.value) |
| | | randomDataList.value.forEach(item => { |
| | | if(item.expertId){ |
| | | state.formData.delData.push(item.id) |
| | | } |
| | | }) |
| | | console.log('first',firstRandomList.value) |
| | | firstRandomList.value.forEach(item => { |
| | | if(item.expertId && item.expertType == 1){ |
| | | state.formData.delData.push(item.id) |
| | | } |
| | | }) |
| | | if(fixedDataList.value && fixedDataList.value.length <= 0){ |
| | | ElMessage.warning('请先选择专家组组长') |
| | | return |
| | |
| | | } |
| | | const res = await expertRound(param) |
| | | if(res.code == 200){ |
| | | randomDataList.value = res.data |
| | | randomDataList.value = [] |
| | | res.data = res.data.map(item => { |
| | | return{ |
| | | ...item, |
| | | expertType: 1 |
| | | } |
| | | }) |
| | | const outLists = state.formData.saveOutData.filter(i => i.teamLeader == 0) |
| | | if(outLists && outLists.length >0){ |
| | | randomDataList.value = outLists.concat(res.data) |
| | | }else { |
| | | randomDataList.value = res.data |
| | | } |
| | | state.randomNum = state.randomNum + 1 |
| | | const obj = { |
| | | projectId: state.projectId, |
| | |
| | | } |
| | | rLoading.value = false |
| | | } |
| | | const addOutExpertLeader = () => { |
| | | if(fixedDataList.value.length>0){ |
| | | ElMessage.warning('仅允许选取1名专家组长') |
| | | return; |
| | | } |
| | | outRef.value.openDialog('leader') |
| | | } |
| | | const addOutExpertLists = () => { |
| | | outRef.value.openDialog('') |
| | | } |
| | | |
| | | const getOutItem = (val) => { |
| | | console.log('val',val) |
| | | val.expertType = 2 |
| | | if(val.teamLeader == 1){ |
| | | fixedDataList.value.push(val) |
| | | const data = { |
| | | projectId :state.projectId, |
| | | fixedData: val |
| | | } |
| | | if(state.newProgress < 2){ |
| | | saveObjectToLocalStorage('fixedDataList',data) |
| | | } |
| | | }else { |
| | | // choosedRandomList.value.push(val) |
| | | randomDataList.value.push(val) |
| | | } |
| | | state.formData.saveOutData.push(val) |
| | | |
| | | } |
| | | |
| | | defineExpose({ |
| | | riskOpen |