From 048a1d039d347cf109e053961865f7b01d721643 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期三, 27 八月 2025 16:36:27 +0800 Subject: [PATCH] 修改 --- src/views/safetyReview/projectManage/components/chooseExpert.vue | 179 ++++++++++++++++++++++--- src/views/safetyReview/expertManage/postEvaluation/components/evaluate.vue | 6 src/views/safetyReview/projectManage/components/addOutExpertDialog.vue | 151 +++++++++++++++++++++ src/api/projectManage.js | 7 + src/views/safetyReview/expertManage/postEvaluation/components/expertList.vue | 2 src/views/safetyReview/expertManage/evaluateRecord/components/evaluateDetail.vue | 3 src/views/safetyReview/projectManage/components/expertsList.vue | 4 src/views/safetyReview/projectManage/index.vue | 4 src/views/safetyReview/projectManage/components/projectApproval.vue | 16 + 9 files changed, 338 insertions(+), 34 deletions(-) diff --git a/src/api/projectManage.js b/src/api/projectManage.js index 543f33d..268a7b7 100644 --- a/src/api/projectManage.js +++ b/src/api/projectManage.js @@ -50,6 +50,13 @@ data: data }) } +export function chooseBuildCheck(data) { + return request({ + url: '/system/management/projectBuildCheck', + method: 'post', + data: data + }) +} // 随机获取专家 diff --git a/src/views/safetyReview/expertManage/evaluateRecord/components/evaluateDetail.vue b/src/views/safetyReview/expertManage/evaluateRecord/components/evaluateDetail.vue index ea33c08..56c478a 100644 --- a/src/views/safetyReview/expertManage/evaluateRecord/components/evaluateDetail.vue +++ b/src/views/safetyReview/expertManage/evaluateRecord/components/evaluateDetail.vue @@ -71,7 +71,8 @@ state.form = value state.form.leader = value.teamLeader==1?'是':'否' const param = { - projectExpertId: value.projectExpertId + projectExpertId: value.projectExpertId, + expertType: value.expertType } const res = await getExpertEvaDetail(param); if(res.code === 200){ diff --git a/src/views/safetyReview/expertManage/postEvaluation/components/evaluate.vue b/src/views/safetyReview/expertManage/postEvaluation/components/evaluate.vue index 0ab1e04..fd8cd29 100644 --- a/src/views/safetyReview/expertManage/postEvaluation/components/evaluate.vue +++ b/src/views/safetyReview/expertManage/postEvaluation/components/evaluate.vue @@ -463,14 +463,15 @@ }) const openDialog = async (type, value, projectName, projectCheckTime) => { - state.info = value + state.info = JSON.parse(JSON.stringify(value)) state.form.projectExpertId = value.id state.info.projectName = projectName state.info.teamLeader = state.info.teamLeader == 1 ? '是' : '否' + state.info.expertType= value.expertType if (type === 'view') { state.title = '查看' state.disable = true - const res = await getExpertEvaDetail({projectExpertId: value.id}); + const res = await getExpertEvaDetail({projectExpertId: value.id,expertType: value.expertType}); if (res.code == 200) { state.form = res.data state.addData = res.data.expertDetails ? res.data.expertDetails.filter(i => i.scoreType == '1') : [] @@ -595,6 +596,7 @@ state.form.saveData = [...state.addData, ...state.deductData] state.form.delData = state.form.delData.filter((id) => !state.form.saveData.some((item) => item.id === id)) state.form.score = totalScore.value || 0 + state.form.expertType = state.info.expertType // state.form.taxableIncome = taxIncome.value || 0 // state.form.incomeTaxPayable = taxPay.value || 0 // state.form.afterTaxAmount = afterTaxIncome.value || 0 diff --git a/src/views/safetyReview/expertManage/postEvaluation/components/expertList.vue b/src/views/safetyReview/expertManage/postEvaluation/components/expertList.vue index 4af447f..0abbc98 100644 --- a/src/views/safetyReview/expertManage/postEvaluation/components/expertList.vue +++ b/src/views/safetyReview/expertManage/postEvaluation/components/expertList.vue @@ -143,7 +143,7 @@ const downloadFile = async (val) => { - const res = await getExpertEvaDetail({projectExpertId: val.id}); + const res = await getExpertEvaDetail({projectExpertId: val.id,expertType:val.expertType}); if(res.code == 200){ let outData = res.data outData.deptName = state.deptName diff --git a/src/views/safetyReview/projectManage/components/addOutExpertDialog.vue b/src/views/safetyReview/projectManage/components/addOutExpertDialog.vue new file mode 100644 index 0000000..cf8c310 --- /dev/null +++ b/src/views/safetyReview/projectManage/components/addOutExpertDialog.vue @@ -0,0 +1,151 @@ +<template> + <div class="notice"> + <el-dialog + v-model="dialogVisible" + :title="title" + width="500px" + :before-close="handleClose" + > + <el-form :model="state.form" size="default" ref="busRef" :rules="state.formRules" label-width="110px" > + <el-form-item label="姓名:" prop="name"> + <el-input v-model.trim="state.form.name"></el-input> + </el-form-item> + <el-form-item label="性别:" prop="sex"> + <el-radio-group v-model="state.form.sex" > + <el-radio :label="0">男</el-radio> + <el-radio :label="1">女</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="身份证号:" prop="idCard"> + <el-input v-model.trim="state.form.idCard"></el-input> + </el-form-item> + <el-form-item label="等级:" prop="ratingLevel"> + <el-radio-group v-model="state.form.ratingLevel"> + <el-radio label="1">一级</el-radio> + <el-radio label="2">二级</el-radio> + <el-radio label="3">三级</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="专业领域:" prop="domain"> + <el-input v-model.trim="state.form.domain"></el-input> + </el-form-item> + <el-form-item label="工作单位:" prop="companyName"> + <el-input v-model.trim="state.form.companyName"></el-input> + </el-form-item> + <el-form-item label="职称:" prop="title"> + <el-input v-model.trim="state.form.title"></el-input> + </el-form-item> + </el-form> + <template #footer> + <span class="dialog-footer"> + <el-button @click="handleClose" size="default">取 消</el-button> + <el-button type="primary" @click="onSubmit" size="default" v-preReClick>确认</el-button> + </span> + </template> + </el-dialog> + </div> +</template> +<script setup> +import {reactive, ref, toRefs} from 'vue' +import Editor from "@/components/Editor/index.vue"; +import {ElMessage} from "element-plus"; +import {addNotice} from "@/api/backManage/notice"; +import {addDict, editDict, getDictDetail} from "@/api/backManage/evaluate"; +import {verifyIdCard} from "@/utils/validate"; + +const dialogVisible = ref(false); +const title = ref(""); +const busRef = ref(); +const length = ref() +const emit = defineEmits(["getList"]); +let verifyId = (rule, value, callback)=>{ + if(value === ''){ + callback(new Error('请输入身份证号')) + }else{ + if(!verifyIdCard(value)){ + callback(new Error('身份证号格式有误')) + }else{ + callback() + } + } +} +const state = reactive({ + form: { + id: '', + name: '', + sex: '', + idCard: "", + ratingLevel: "", + domain: "", + title: '', + companyName: '' + + }, + formRules:{ + name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], + sex: [{ required: true, message: '请选择性别', trigger: 'blur' }], + idCard: [{ required: true, validator: verifyId, trigger: 'blur' }], + ratingLevel: [{ required: true, message: '请选择等级', trigger: 'blur' }], + domain: [{ required: true, message: '请输入专业领域', trigger: 'blur' }], + title: [{ required: true, message: '请输入职称', trigger: 'blur' }], + companyName: [{ required: true, message: '请输入工作单位', trigger: 'blur' }], + }, + type: '' + +}) + + +const openDialog = async (type, value) => { + state.type = type + title.value = '库外专家'; + dialogVisible.value = true; +} + +const onSubmit = async () => { + const valid = await busRef.value.validate(); + if(valid){ + state.form.teamLeader = state.type == 'leader' ? 1 : 0 + state.form.selectionMode = state.type == 'leader' ? 1 : 2 + emit("getList",state.form) + busRef.value.clearValidate(); + reset(); + dialogVisible.value = false; + } +} + +const handleClose = () => { + busRef.value.clearValidate(); + reset(); + dialogVisible.value = false; + +} +const reset = () => { + state.form = { + id: '', + name: '', + sex: '', + idCard: "", + ratingLevel: "", + domain: "", + title: '', + companyName: '' + } +} +defineExpose({ + openDialog +}); + +</script> + +<style scoped lang="scss"> +.notice{ + :deep(.el-form .el-form-item__label) { + font-size: 15px; + } + .file { + display: flex; + flex-direction: column; + align-items: flex-start; + } +} +</style> diff --git a/src/views/safetyReview/projectManage/components/chooseExpert.vue b/src/views/safetyReview/projectManage/components/chooseExpert.vue index 2b8af6e..0e8a5e9 100644 --- a/src/views/safetyReview/projectManage/components/chooseExpert.vue +++ b/src/views/safetyReview/projectManage/components/chooseExpert.vue @@ -20,7 +20,10 @@ <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" /> @@ -76,9 +79,12 @@ </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"> @@ -122,6 +128,7 @@ </el-table> </div> <experts-list ref="expertsListRef" @getName="getSelected"></experts-list> + <out-expert ref="outRef" @getList="getOutItem"></out-expert> </div> </template> @@ -132,9 +139,11 @@ 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); @@ -156,7 +165,9 @@ id:null, step: 2, saveData: [], - delData: [] + delData: [], + saveOutData: [], + delOutData: [] }, info: {}, levelList: [ @@ -197,6 +208,12 @@ 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) + } } }) } @@ -207,7 +224,12 @@ 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) + } } }) } @@ -256,6 +278,7 @@ fixedData: newVal[0] } if(state.newProgress < 2){ + saveObjectToLocalStorage('fixedDataList',data) } } @@ -305,8 +328,10 @@ 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() @@ -324,13 +349,17 @@ // 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 { @@ -360,7 +389,26 @@ } }) } + 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){ @@ -372,18 +420,21 @@ 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, } }) } @@ -398,14 +449,39 @@ if(choosedRandomList.value && choosedRandomList.value.length > 0){ rData = choosedRandomList.value.map(item => { return { - expertId: item.id, + ...item, + id: item.expertId ? item.id : '', + expertId: item.expertId ? item.expertId : item.id, expertName:item.name, selectionMode: 2, teamLeader: 0 } }) } + 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('修改成功') @@ -421,7 +497,11 @@ 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() @@ -432,10 +512,10 @@ } 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) } @@ -505,6 +585,8 @@ } 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 => { @@ -520,13 +602,22 @@ 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) } @@ -557,12 +648,12 @@ } 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 @@ -584,7 +675,19 @@ } 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, @@ -599,6 +702,36 @@ } 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 diff --git a/src/views/safetyReview/projectManage/components/expertsList.vue b/src/views/safetyReview/projectManage/components/expertsList.vue index c344be6..c132417 100644 --- a/src/views/safetyReview/projectManage/components/expertsList.vue +++ b/src/views/safetyReview/projectManage/components/expertsList.vue @@ -185,11 +185,11 @@ return{ ...item, birthdayName: item.birthday ? item.birthday.slice(0,10) : '', - supportName: item.supportDirectionSafety.split(',') + supportName: item.supportDirectionSafety?.split(',') } }) data.expertList.forEach(item => { - item.supportName.forEach((s,index) => { + item.supportName?.forEach((s,index) => { switch (s){ case '1': item.supportName[index] = '现场检查' diff --git a/src/views/safetyReview/projectManage/components/projectApproval.vue b/src/views/safetyReview/projectManage/components/projectApproval.vue index 576829d..ca810ca 100644 --- a/src/views/safetyReview/projectManage/components/projectApproval.vue +++ b/src/views/safetyReview/projectManage/components/projectApproval.vue @@ -108,7 +108,15 @@ import {getToken} from "@/utils/auth"; import axios from "axios"; import {generateWordDocument} from "@/views/safetyReview/projectManage/components/exportWord"; -import {addProject, checkProject, choose, getCheckInfo, getFileInfo, getProjectList} from "@/api/projectManage"; +import { + addProject, + checkProject, + choose, + chooseBuildCheck, + getCheckInfo, + getFileInfo, + getProjectList +} from "@/api/projectManage"; import Cookies from "js-cookie"; import moment from "moment"; const emit = defineEmits(["getNextStatus","backStatus"]); @@ -206,7 +214,7 @@ step: 3, saveData: state.dataList } - const res = await choose(data); + const res = await chooseBuildCheck(data); if(res.code == 200){ await getList() dialogVisible.value = true @@ -426,7 +434,9 @@ return { ...item, selectionTime: item.selectionTime ? moment(item.selectionTime).format('YYYY年MM月DD日 HH:mm:ss') : '--', - expertRemark: item.expertRemark ? item.expertRemark : '' + expertRemark: item.expertRemark ? item.expertRemark : '', + phone: item.phone ? item.phone: '', + isInside: item.expertType == 1 ? '是' : item.expertType == 2 ? '否': '' } }) data.expertNum = data.tableData.length diff --git a/src/views/safetyReview/projectManage/index.vue b/src/views/safetyReview/projectManage/index.vue index a0e6af0..c2086d5 100644 --- a/src/views/safetyReview/projectManage/index.vue +++ b/src/views/safetyReview/projectManage/index.vue @@ -124,11 +124,11 @@ <el-cascader style="width: 100%" clearable - v-model.trim="search.queryParams.deptId" + v-model.trim="search.queryParams.deptIds" :show-all-levels="false" placeholder="请选择部门" :options="deptList" - :props="{ value: 'deptId',label: 'deptName',emitPath: false,checkStrictly: true}"></el-cascader> + :props="{ value: 'deptId',label: 'deptName',emitPath: false,checkStrictly: true,multiple:true}"></el-cascader> </el-form-item> <el-form-item label="项目编码"> <el-input v-model.trim="search.queryParams.projectCode" placeholder="请输入项目编码"></el-input> -- Gitblit v1.9.2