@@ -409,7 +409,6 @@ const handleExpertRegion = ($event, index) => { | |||||
}) || [] | }) || [] | ||||
} | } | ||||
// 假设组件有两个 props:title 和 content | |||||
const { detailData } = defineProps({ | const { detailData } = defineProps({ | ||||
detailData: Object | detailData: Object | ||||
}) | }) | ||||
@@ -1,460 +1,77 @@ | |||||
<template> | <template> | ||||
<el-card class="mb-16" shadow="never"> | |||||
<template #header> | |||||
<div class="card-header"> | |||||
<span>抽取信息</span> | |||||
</div> | |||||
<el-dialog | |||||
:model-value="visible" | |||||
title="续抽" | |||||
width="840px" | |||||
destroy-on-close | |||||
@close="visible= false" | |||||
> | |||||
<rule-form-com ref="ruleFormComRef" v-model="rules" /> | |||||
<avoid-com ref="avoidConRef" /> | |||||
<template #footer> | |||||
<el-button type="primary" size="small" @click="confirm"> | |||||
确定 | |||||
</el-button> | |||||
<el-button size="small" @click="visible=false"> | |||||
关闭 | |||||
</el-button> | |||||
</template> | </template> | ||||
<el-row | |||||
:gutter="20" | |||||
> | |||||
<el-col :span="24"> | |||||
<el-form-item | |||||
label="抽取规则" | |||||
> | |||||
<el-card | |||||
v-for="(rulesItem,index) in randomRules" | |||||
:key="index" | |||||
class="box-card w-full mb-8" | |||||
> | |||||
<template #header> | |||||
<div class="card-header flex justify-between"> | |||||
<span>规则{{ index + 1 }}</span> | |||||
<el-button | |||||
type="danger" | |||||
plain | |||||
icon="Delete" | |||||
:disabled="randomRules.length === 1" | |||||
@click="delExtractionRule(index)" | |||||
> | |||||
删除规则 | |||||
</el-button> | |||||
</div> | |||||
</template> | |||||
<el-row class="mt-8" :gutter="10"> | |||||
<el-col :span="8"> | |||||
<el-form-item | |||||
label="邀请数量" | |||||
:label-width="100" | |||||
:prop="`expertInviteRule.randomRules[${index}].count`" | |||||
:rules=" [ | |||||
{ required: true, message: ' ', trigger: 'blur' } | |||||
]" | |||||
> | |||||
<el-input-number | |||||
v-model="rulesItem.count" | |||||
placeholder="请输入" | |||||
:min="1" | |||||
:controls="false" | |||||
:step="1" | |||||
step-strictly | |||||
/> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | |||||
<el-row :gutter="10" class="mt-8"> | |||||
<el-col :span="8"> | |||||
<el-form-item label="其他标签" :label-width="100"> | |||||
<el-select | |||||
v-model="rulesItem.otherTag" | |||||
class="w-full" | |||||
clearable | |||||
placeholder="请选择" | |||||
> | |||||
<el-option | |||||
v-for="item in otherTree" | |||||
:key="item.value" | |||||
:label="item.label" | |||||
:value="item.label" | |||||
/> | |||||
</el-select> | |||||
</el-form-item> | |||||
</el-col> | |||||
<el-col :span="8"> | |||||
<el-form-item label="专家级别" :label-width="100"> | |||||
<el-cascader | |||||
v-model="rulesItem.expertRegionList" | |||||
clearable | |||||
:options="regionTree" | |||||
placeholder="请选择" | |||||
class="w-full" | |||||
:props="regionProps" | |||||
/> | |||||
</el-form-item> | |||||
</el-col> | |||||
<el-col :span="8"> | |||||
<el-form-item label="内外围" :label-width="100"> | |||||
<el-select | |||||
v-model="rulesItem.expertType" | |||||
placeholder="请选择" | |||||
class="w-full" | |||||
clearable | |||||
> | |||||
<el-option | |||||
v-for="(item,order) in dictList && | |||||
dictList.length && | |||||
dictList.find(i => i.dictionaryName === 'expert_type') | |||||
.dictionaryList" | |||||
:key="order" | |||||
:label="item.describe" | |||||
:value="item.describe" | |||||
/> | |||||
</el-select> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | |||||
<el-row :gutter="10" class="mt-8"> | |||||
<el-col :span="8"> | |||||
<el-form-item label="履职意向" :label-width="100"> | |||||
<el-cascader | |||||
v-model="rulesItem.intentionRegion" | |||||
:options="regionTree" | |||||
class="w-full" | |||||
clearable | |||||
/> | |||||
</el-form-item> | |||||
</el-col> | |||||
<el-col :span="8"> | |||||
<el-form-item label="专家来源" :label-width="100"> | |||||
<el-select | |||||
v-model="rulesItem.expertSource" | |||||
class="w-full" | |||||
placeholder="请选择" | |||||
clearable | |||||
> | |||||
<el-option | |||||
v-for="(item,order) in expertSource" | |||||
:key="order" | |||||
:label="item.label" | |||||
:value="item.label" | |||||
/> | |||||
</el-select> | |||||
</el-form-item> | |||||
</el-col> | |||||
<el-col :span="8"> | |||||
<el-form-item label="职称级别" :label-width="100"> | |||||
<el-select | |||||
v-model="rulesItem.professionalLevel" | |||||
class="w-full" | |||||
placeholder="请选择" | |||||
clearable | |||||
> | |||||
<el-option | |||||
v-for="(item,order) in dictList && | |||||
dictList.length && | |||||
dictList.find(i => i.dictionaryName === 'title_level') | |||||
.dictionaryList" | |||||
:key="order" | |||||
:label="item.describe" | |||||
:value="item.describe" | |||||
/> | |||||
</el-select> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | |||||
<el-row :gutter="10" class="mt-8"> | |||||
<el-col :span="8"> | |||||
<el-form-item label="擅长方向" :label-width="100"> | |||||
<el-select | |||||
v-model="rulesItem.goodAt" | |||||
class="w-full" | |||||
placeholder="请选择" | |||||
clearable | |||||
> | |||||
<el-option | |||||
v-for="(item,order) in goodAtTree" | |||||
:key="order" | |||||
:label="item.label" | |||||
:value="item.label" | |||||
/> | |||||
</el-select> | |||||
</el-form-item> | |||||
</el-col> | |||||
<el-col :span="8"> | |||||
<el-form-item label="技术专长" :label-width="100"> | |||||
<el-cascader | |||||
v-model="rulesItem.technicalExpertise" | |||||
:options="technicalExpertiseTree" | |||||
placeholder="请选择" | |||||
class="w-full" | |||||
clearable | |||||
/> | |||||
</el-form-item> | |||||
</el-col> | |||||
<el-col :span="8"> | |||||
<el-form-item label="行业领域" :label-width="100"> | |||||
<el-cascader | |||||
v-model="rulesItem.industrySector" | |||||
:options="industrySectorTree" | |||||
placeholder="请选择" | |||||
class="w-full" | |||||
clearable | |||||
/> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | |||||
</el-card> | |||||
<el-button | |||||
class="w-full" | |||||
type="primary" | |||||
icon="plus" | |||||
plain | |||||
@click="addExtractionRule" | |||||
>添加规则 | |||||
</el-button> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | |||||
</el-dialog> | |||||
<el-button @click="handleParmas">测试</el-button> | |||||
</el-card> | |||||
</template> | </template> | ||||
<script setup> | <script setup> | ||||
import { getCurrentInstance, onMounted, ref, watch } from 'vue' | |||||
import { storeToRefs } from 'pinia' | |||||
import store from '@/store' | |||||
const { dictList } = storeToRefs(store.dictStore) | |||||
const regionTree = ref([]) | |||||
const regionProps = ref({ multiple: true }) | |||||
import { getDictionaryTree } from '@/http/apis/expertManage/expertStore' | |||||
import { districtList } from '@/http/apis/commonApi' | |||||
// import { continueInviteDisposable } from '@/http/apis/expertManage/reviewMeeting' | |||||
const { proxy } = getCurrentInstance() | |||||
const randomRules = ref([ | |||||
{ | |||||
// other##信息安全##5200000 | |||||
count: '', | |||||
otherTag: '', | |||||
expertRegionList: [], | |||||
expertType: '', | |||||
intentionRegion: {}, | |||||
expertSource: '', | |||||
professionalLevel: '', | |||||
goodAt: '', | |||||
technicalExpertise: '', | |||||
industrySector: '' | |||||
} | |||||
]) | |||||
onMounted(async () => { | |||||
// 获取履职意向数据 | |||||
const res = await districtList({ regionCode: 330500, regionLevel: 2 }) | |||||
const regionRes = [] | |||||
regionRes.push(res.data) | |||||
regionTree.value = copeData(regionRes) | |||||
const technicalExpertiseRes = await getDictionaryTree({ rootTagCodeList: ['technical_expertise'] }) | |||||
technicalExpertiseTree.value = copeDictionaryData(technicalExpertiseRes)[0].children | |||||
import RuleFormCom from '@/pages/expertManage/reviewMeeting/addMeeting/components/ruleFormCom.vue' | |||||
import { ref, defineModel, watch, nextTick } from 'vue' | |||||
import { continueInviteDisposable } from '@/http/apis/expertManage/reviewMeeting' | |||||
import { useRoute } from 'vue-router' | |||||
import AvoidCom from '@/pages/expertManage/reviewMeeting/addMeeting/components/avoidCom.vue' | |||||
const { detailData } = defineProps({ | |||||
detailData: Object | |||||
}) | |||||
const ruleFormComRef = ref() | |||||
const avoidConRef = ref() | |||||
const industrySectorRes = await getDictionaryTree({ rootTagCodeList: ['industry_sector'] }) | |||||
industrySectorTree.value = copeDictionaryData(industrySectorRes)[0].children | |||||
const rules = ref([{}]) | |||||
getDictionaryData('technical_expertise') | |||||
getDictionaryData('industry_sector') | |||||
getDictionaryData('expert_source') | |||||
getDictionaryData('good_at') | |||||
getDictionaryData('other') | |||||
const visible = defineModel({ | |||||
type: Boolean, | |||||
default: false | |||||
}) | }) | ||||
const copeData = (val) => { | |||||
const data = val.map((item) => { | |||||
const deptData = {} | |||||
deptData.value = item.unionCode | |||||
deptData.label = item.name | |||||
if (item.children && item.children.length) { | |||||
deptData.children = item.children.map((v) => ({ value: v.unionCode, label: v.name })) | |||||
const childrenData = copeData(item.children) | |||||
deptData.children = [...childrenData] | |||||
} | |||||
return deptData | |||||
}) | |||||
return data | |||||
} | |||||
const addExtractionRule = () => { | |||||
if (randomRules.value.length >= 5) { | |||||
proxy.$message.warning('最多添加5个规则') | |||||
return | |||||
} | |||||
randomRules.value.push({}) | |||||
} | |||||
const delExtractionRule = (index) => { | |||||
randomRules.value.splice(index, 1) | |||||
} | |||||
// 各种字典数据 | |||||
const technicalExpertiseTree = ref([])// 技术专长 | |||||
const industrySectorTree = ref([])// 行业领域 | |||||
const expertSource = ref([])// 专家来源 | |||||
const goodAtTree = ref([])// 擅长 | |||||
const otherTree = ref([])// 其他标签 | |||||
// 获取各种字典数据 | |||||
const getDictionaryData = async (params) => { | |||||
if (params === 'technical_expertise' && technicalExpertiseTree.value.length === 0) { | |||||
const technicalExpertiseRes = await getDictionaryTree({ rootTagCodeList: [params] }) | |||||
technicalExpertiseTree.value = copeDictionaryData(technicalExpertiseRes)[0].children | |||||
} else if (params === 'industry_sector' && industrySectorTree.value.length === 0) { | |||||
const industrySectorRes = await getDictionaryTree({ rootTagCodeList: [params] }) | |||||
industrySectorTree.value = copeDictionaryData(industrySectorRes)[0].children | |||||
} else if (params === 'expert_source' && expertSource.value.length === 0) { | |||||
const expertSourceRes = await getDictionaryTree({ rootTagCodeList: [params] }) | |||||
expertSource.value = copeDictionaryData(expertSourceRes)[0].children | |||||
} else if (params === 'good_at' && goodAtTree.value.length === 0) { | |||||
const goodAtRes = await getDictionaryTree({ rootTagCodeList: [params] }) | |||||
goodAtTree.value = copeDictionaryData(goodAtRes)[0].children | |||||
} else if (params === 'other' && otherTree.value.length === 0) { | |||||
const otherRes = await getDictionaryTree({ rootTagCodeList: [params] }) | |||||
otherTree.value = copeDictionaryData(otherRes)[0].children | |||||
const route = useRoute() | |||||
function confirm () { | |||||
ruleFormComRef.value.handleParmas() | |||||
const postData = { | |||||
meetingId: route.query.id, | |||||
avoidRule: avoidConRef.value.getAvoidRule(), | |||||
randomRules: ruleFormComRef.value.handleParmas() | |||||
} | } | ||||
continueInviteDisposable(postData) | |||||
visible.value = false | |||||
emits('refresh') | |||||
} | } | ||||
const copeDictionaryData = (val) => { // 处理字典数据的方法 | |||||
const data = val?.map((item) => { | |||||
const deptData = {} | |||||
deptData.value = item.parentCode + '##' + item.unionCode | |||||
deptData.label = item.tagName | |||||
// deptData.isLeaf = false | |||||
if (item.children && item.children.length) { | |||||
deptData.children = item.children.map((v) => ({ value: v.parentCode + '##' + v.unionCode, label: v.tagName })) | |||||
const childrenData = copeDictionaryData(item.children) | |||||
deptData.children = [...childrenData] | |||||
} | |||||
return deptData | |||||
}) | |||||
return data | |||||
} | |||||
const { detailData } = defineProps({ | |||||
detailData: Object | |||||
}) | |||||
console.log(detailData) | |||||
// randomRules | |||||
// 使用深度监听 | |||||
const emits = defineEmits(['refresh']) | |||||
watch( | watch( | ||||
() => detailData, | () => detailData, | ||||
(newVal, oldVal) => { | (newVal, oldVal) => { | ||||
if (newVal && newVal.randomRules && newVal.randomRules) { | |||||
// ruleForm.expertInviteRule.randomRules = newVal.randomRules | |||||
// console.log(ruleForm.expertInviteRule.randomRules) | |||||
// ruleForm.expertInviteRule.randomRules = handleParmas(newVal.randomRules) | |||||
showData() | |||||
} | |||||
}, | |||||
{ deep: true } | |||||
) | |||||
function showData () { | |||||
} | |||||
function handleParmas () { | |||||
const postdata = randomRules.value.map(item => { | |||||
return { | |||||
count: item.count, | |||||
expertDicts: getExpertDicts(item), | |||||
expertRegionList: getExpertRegionList(item), | |||||
...getIntentionRegion(item), | |||||
expertTags: getExpertTags(item), | |||||
formEditJson: JSON.stringify(item) | |||||
} | |||||
}) | |||||
console.log(postdata) | |||||
} | |||||
function getExpertRegionList (item) { | |||||
if (item.expertRegionList && Array.isArray(item.expertRegionList) && item.expertRegionList.length > 0) { | |||||
return item.expertRegionList.map(i => { | |||||
return { | |||||
regionCode: i[1].split('##')[0], regionLevel: i[1].split('##')[2] | |||||
} | |||||
}) | |||||
} | |||||
return [] | |||||
} | |||||
function getIntentionRegion (item) { | |||||
// ["330500##湖州市##2","330503##南浔区##3"] | |||||
if (item.intentionRegion && Array.isArray(item.intentionRegion) && item.intentionRegion.length > 1) { | |||||
return { | |||||
intentionRegionCode: item.intentionRegion[1].split('##')[0], | |||||
intentionRegionLevel: item.intentionRegion[1].split('##')[2] | |||||
} | |||||
} else { | |||||
return {} | |||||
} | |||||
} | |||||
function getExpertTags (item) { | |||||
const list = [] | |||||
if (item.otherTag) { | |||||
list.push({ | |||||
expertTag: 'other', | |||||
tagCodes: [item.otherTag] | |||||
}) | |||||
} | |||||
if (item.expertSource) { | |||||
list.push({ | |||||
expertTag: 'expert_source', | |||||
tagCodes: [item.expertSource] | |||||
}) | |||||
} | |||||
if (item.goodAt) { | |||||
list.push({ | |||||
expertTag: 'good_at', | |||||
tagCodes: [item.goodAt] | |||||
}) | |||||
} | |||||
// expert_source | |||||
// ["industry_sector##制造业##4030000","4030000##酒、饮料及精制茶制造业##4030300"] | |||||
if (item.industrySector && Array.isArray(item.industrySector) && item.industrySector.length > 1) { | |||||
list.push({ | |||||
expertTag: 'industry_sector', | |||||
tagCodes: [item.industrySector[1].split('##')[1]] | |||||
}) | |||||
} | |||||
if (item.technicalExpertise && Array.isArray(item.technicalExpertise) && item.technicalExpertise.length > 1) { | |||||
if (item.technicalExpertise.length === 2) { | |||||
list.push({ | |||||
expertTag: 'technical_expertise', | |||||
tagCodes: [item.technicalExpertise[1].split('##')[1]] | |||||
if (newVal && visible) { | |||||
const list = [] | |||||
newVal.randomRules.forEach(item => { | |||||
let json = {} | |||||
if (item.formEditJson)json = JSON.parse(item.formEditJson) | |||||
list.push({ | |||||
... json, | |||||
id: item.id | |||||
}) | |||||
}) | }) | ||||
} else if (item.technicalExpertise.length === 3) { | |||||
list.push({ | |||||
expertTag: 'technical_expertise', | |||||
tagCodes: [item.technicalExpertise[2].split('##')[1]] | |||||
nextTick(() => { | |||||
rules.value = list | |||||
avoidConRef.value.setNewData(newVal) | |||||
}) | }) | ||||
} | } | ||||
} | } | ||||
return list | |||||
} | |||||
function getExpertDicts (item) { | |||||
const list = [] | |||||
if (item.expertType) { | |||||
list.push({ | |||||
expertDict: 'expert_type', | |||||
dictCodes: [item.expertType] | |||||
}) | |||||
} | |||||
if (item.professionalLevel) { | |||||
list.push({ | |||||
expertDict: 'title_level', | |||||
dictCodes: [item.professionalLevel] | |||||
}) | |||||
} | |||||
return list | |||||
} | |||||
// const textZc = ref(['technical_expertise##计算机科学技术##3020000', '3020000##人工智能##3020200', '3020200##机器翻译##3020203']) | |||||
// const zjjb = ref([['330500##湖州市##2', '330503##南浔区##3'], ['330500##湖州市##2', '330521##德清县##3']]) | |||||
// const lzyx = ref(['330500##湖州市##2', '330521##德清县##3']) | |||||
// const hyly = ref(['industry_sector##制造业##4030000', '4030000##酒、饮料及精制茶制造业##4030300']) | |||||
// { deep: true } | |||||
) | |||||
</script> | </script> | ||||
<style scoped lang="less"> | <style scoped lang="less"> | ||||
@@ -0,0 +1,318 @@ | |||||
<script setup> | |||||
import { reactive, ref } from 'vue' | |||||
import { storeToRefs } from 'pinia' | |||||
import store from '@/store' | |||||
import AddExpertDialog from '@/pages/expertManage/reviewMeeting/addMeeting/components/addExpertDialog.vue' | |||||
import OrgTree from '@/components/orgTree/index.vue' | |||||
const userInfo = storeToRefs(store.userStore).userInfo || {} | |||||
const ruleForm = reactive({ | |||||
expertInviteRule: { | |||||
inviteType: 1, | |||||
randomRules: [{ expertDicts: [], expertTags: [] }], | |||||
appointRule: {}, | |||||
avoidRule: { | |||||
avoidUnitIdList: [{ 'organizationCode': 'GO_ff70e47bae684fdba0d64f4acab85661', 'name': '杭州宁达科技有限公司' }, { 'organizationCode': 'GO_13e5ef6615ae4b1293c4811b58e52955', 'name': '发改委' }, { 'organizationCode': 'GO_c50ee049114146dd80a8e1bb82812cd9', 'name': '委领导' }], | |||||
avoidOrgIdList: [], | |||||
expertIds: [], | |||||
avoidType: userInfo.value.regionName === '市本级' ? 2 : 1 | |||||
} | |||||
}, | |||||
meetingBasicInfo: { | |||||
isInnerProject: true | |||||
} | |||||
}) | |||||
const setNewData = (data) => { | |||||
console.log('11111111111111') | |||||
console.log(data) | |||||
ruleForm.expertInviteRule.avoidRule.avoidType = data.avoidInfo.avoidType | |||||
if (data.avoidInfo.expert && Array.isArray(data.avoidInfo.experts)) { | |||||
ruleForm.expertInviteRule.avoidRule.expertIds = data.avoidInfo.experts.map(item => { | |||||
return { | |||||
...item, | |||||
expertName: item.name | |||||
} | |||||
}) | |||||
} | |||||
if (data.avoidInfo.avoidUnitIds && Array.isArray(data.avoidInfo.avoidUnitIds)) { | |||||
const list = [] | |||||
data.avoidInfo.avoidUnitIds.forEach((item, index) => { | |||||
list.push({ | |||||
organizationCode: item, | |||||
name: data.avoidInfo.avoidUnits[index] | |||||
}) | |||||
}) | |||||
ruleForm.expertInviteRule.avoidRule.avoidUnitIdList = list | |||||
} | |||||
ruleForm.expertInviteRule.avoidRule.weekInviteCount = data.avoidInfo.weekInviteCount | |||||
} | |||||
defineExpose({ | |||||
getAvoidRule, setNewData | |||||
}) | |||||
function getAvoidRule () { | |||||
const ruleFormClone = JSON.parse(JSON.stringify(ruleForm)) | |||||
// 处理回避单位数据 | |||||
ruleFormClone.expertInviteRule.avoidRule.avoidUnitIdList = ruleFormClone.expertInviteRule.avoidRule.avoidUnitIdList.map(ele => { | |||||
return ele.organizationCode | |||||
}) | |||||
// // 处理回避条线数据 | |||||
// ruleFormClone.expertInviteRule.avoidRule.avoidOrgIdList = ruleFormClone.expertInviteRule.avoidRule.avoidOrgIdList.map(ele => { | |||||
// return ele.businessStripCode | |||||
// }) | |||||
// 处理回避专家数据 | |||||
ruleFormClone.expertInviteRule.avoidRule.expertIds = ruleFormClone.expertInviteRule.avoidRule.expertIds.map(ele => { | |||||
return ele.userId | |||||
}) | |||||
return ruleFormClone.expertInviteRule.avoidRule | |||||
} | |||||
// 添加指定抽取专家弹窗 | |||||
const selectExpertType = ref() | |||||
const unitUserDialogData = reactive({ | |||||
visible: false, | |||||
// orgCode: route.query.orgCode || userInfo.value.orgCode, | |||||
data: [] | |||||
}) | |||||
const addAvoidanceExpert = () => { | |||||
selectExpertType.value = 2 | |||||
unitUserDialogData.visible = true | |||||
unitUserDialogData.data = ruleForm.expertInviteRule.avoidRule?.expertIds || [] | |||||
} | |||||
// 删除回避单位 | |||||
const delTag = (index) => { | |||||
ruleForm.expertInviteRule.avoidRule.avoidUnitIdList.splice(index, 1) | |||||
} | |||||
const getUserData = (data) => { | |||||
if (selectExpertType.value === 1) { | |||||
ruleForm.expertInviteRule.appointRule.expertIdList = data.map(i => { | |||||
return { | |||||
id: i.userId, | |||||
name: i.expertName | |||||
} | |||||
}) | |||||
} else { | |||||
ruleForm.expertInviteRule.avoidRule.expertIds = data | |||||
} | |||||
unitUserDialogData.visible = false | |||||
} | |||||
const orgProps = reactive({ | |||||
unitVisible: false, | |||||
showCheckbox: false, | |||||
data: undefined | |||||
}) | |||||
const showOrgTree = () => { | |||||
orgProps.unitVisible = true | |||||
orgProps.showCheckbox = true | |||||
orgProps.defaultProps = { | |||||
children: 'children', | |||||
label: 'title', | |||||
value: 'key', | |||||
isLeaf: 'isLeaf' | |||||
} | |||||
orgProps.type = 'UNIT' | |||||
orgProps.data = ruleForm.expertInviteRule.avoidRule.avoidUnitIdList && ruleForm.expertInviteRule.avoidRule.avoidUnitIdList.map(i => { | |||||
return { | |||||
key: i.organizationCode, | |||||
title: i.name | |||||
} | |||||
}) || [] | |||||
} | |||||
// 添加回避条线 | |||||
const title = ref() | |||||
const showLineTree = () => { | |||||
title.value = '回避条线' | |||||
orgProps.defaultProps = { | |||||
children: 'records', | |||||
label: 'businessStripName', | |||||
value: 'businessStripCode', | |||||
isLeaf: 'isLeaf' | |||||
} | |||||
orgProps.type = 'LINE' | |||||
orgProps.unitVisible = true | |||||
orgProps.showCheckbox = true | |||||
orgProps.data = ruleForm.expertInviteRule.avoidRule.avoidOrgIdList && ruleForm.expertInviteRule.avoidRule.avoidOrgIdList.map(i => i) || [] | |||||
} | |||||
const closeTag2 = (tag) => { | |||||
ruleForm.expertInviteRule.avoidRule.expertIds.splice(ruleForm.expertInviteRule.avoidRule.expertIds.indexOf(tag), 1) | |||||
} | |||||
const getOrgData = (data) => { | |||||
if (title.value === '回避条线') { | |||||
ruleForm.expertInviteRule.avoidRule.avoidOrgIdList = data.map(i => i) | |||||
} else { | |||||
ruleForm.expertInviteRule.avoidRule.avoidUnitIdList = data.map(i => ({ organizationCode: i.key, name: i.title })) | |||||
} | |||||
} | |||||
const closeOrg = () => { | |||||
title.value = undefined | |||||
orgProps.unitVisible = false | |||||
} | |||||
const closeTag3 = (index) => { | |||||
ruleForm.expertInviteRule.avoidRule.avoidOrgIdList.splice(index, 1) | |||||
} | |||||
</script> | |||||
<template> | |||||
<add-expert-dialog | |||||
:visible="unitUserDialogData.visible" | |||||
:org-code="unitUserDialogData.orgCode" | |||||
:data="unitUserDialogData.data" | |||||
:select-expert-type="selectExpertType" | |||||
@get-user-data="getUserData" | |||||
@close="unitUserDialogData.visible = false" | |||||
/> | |||||
<org-tree | |||||
:visible="orgProps.unitVisible" | |||||
:show-checkbox="orgProps.showCheckbox" | |||||
:default-data="orgProps.data" | |||||
:title="title" | |||||
:type="orgProps.type" | |||||
:default-props="orgProps.defaultProps" | |||||
@close="closeOrg" | |||||
@get-select-unit="getOrgData" | |||||
/> | |||||
<el-card shadow="never"> | |||||
<template #header> | |||||
<div class="card-header"> | |||||
<span>回避信息</span> | |||||
</div> | |||||
</template> | |||||
<el-row> | |||||
<el-col> | |||||
<el-form-item label="部门、条线回避规则" prop="avoidRule.avoidType"> | |||||
<el-select v-model="ruleForm.expertInviteRule.avoidRule.avoidType"> | |||||
<el-option :value="1" label="回避单位" /> | |||||
<el-option :value="2" label="回避条线" /> | |||||
<el-option :value="3" label="不回避" /> | |||||
</el-select> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | |||||
<el-row :gutter="20"> | |||||
<el-col :span="12"> | |||||
<el-form-item | |||||
label="回避单位" | |||||
> | |||||
<div class="flex flex-col items-start"> | |||||
<el-button | |||||
type="primary" | |||||
size="small" | |||||
icon="Plus" | |||||
@click="showOrgTree" | |||||
> | |||||
添加回避单位 | |||||
</el-button> | |||||
<p> | |||||
<el-tag | |||||
v-for="(item,index) in ruleForm.expertInviteRule.avoidRule.avoidUnitIdList" | |||||
:key="index" | |||||
class="mr-8" | |||||
closable | |||||
@close="delTag(index)" | |||||
> | |||||
{{ item.name }} | |||||
</el-tag> | |||||
</p> | |||||
</div> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | |||||
<el-row :gutter="20"> | |||||
<el-col :span="12"> | |||||
<el-form-item | |||||
label="回避专家" | |||||
> | |||||
<div class="flex flex-col items-start"> | |||||
<el-button | |||||
type="primary" | |||||
class="button-new-tag ml-1" | |||||
size="small" | |||||
icon="Plus" | |||||
@click="addAvoidanceExpert" | |||||
> | |||||
添加回避专家 | |||||
</el-button> | |||||
<p> | |||||
<el-tag | |||||
v-for="tag in ruleForm.expertInviteRule.avoidRule.expertIds" | |||||
:key="tag" | |||||
class="mx-1" | |||||
closable | |||||
:disable-transitions="false" | |||||
@close="closeTag2(tag)" | |||||
> | |||||
{{ tag.expertName }} | |||||
</el-tag> | |||||
</p> | |||||
</div> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | |||||
<el-row :gutter="20"> | |||||
<el-col :span="12"> | |||||
<el-form-item | |||||
v-if="false" | |||||
label="回避条线" | |||||
> | |||||
<div class="flex flex-col items-start"> | |||||
<el-button | |||||
type="primary" | |||||
class="button-new-tag ml-1" | |||||
size="small" | |||||
icon="Plus" | |||||
@click="showLineTree" | |||||
> | |||||
添加回避条线 | |||||
</el-button> | |||||
<p> | |||||
<el-tag | |||||
v-for="(tag,index) in ruleForm.expertInviteRule.avoidRule.avoidOrgIdList" | |||||
:key="tag" | |||||
class="mx-1" | |||||
closable | |||||
:disable-transitions="false" | |||||
@close="closeTag3(index)" | |||||
> | |||||
{{ tag.businessStripName }} | |||||
</el-tag> | |||||
</p> | |||||
</div> | |||||
</el-form-item> | |||||
<el-form-item label="回避条线"> | |||||
<el-select v-model="ruleForm.expertInviteRule.avoidRule.avoidOrgIdList" multiple> | |||||
<el-option | |||||
v-for="(item,index) in lineListData" | |||||
:key="index" | |||||
:label="item.businessStripName" | |||||
:value="item.businessStripCode" | |||||
/> | |||||
</el-select> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | |||||
<el-row :gutter="20"> | |||||
<el-col :span="24"> | |||||
<el-form-item label="一周内参与"> | |||||
<el-input-number | |||||
v-model="ruleForm.expertInviteRule.avoidRule.weekInviteCount" | |||||
placeholder="请输入" | |||||
:min="0" | |||||
:controls="false" | |||||
style="width: 100px !important;" | |||||
/> | |||||
<div style="fontSize:14px; color:#666666; lineHeight:2em">次的专家不再抽取</div> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | |||||
</el-card> | |||||
</template> | |||||
<style scoped lang="less"> | |||||
</style> |
@@ -65,7 +65,7 @@ | |||||
v-for="item in otherTree" | v-for="item in otherTree" | ||||
:key="item.value" | :key="item.value" | ||||
:label="item.label" | :label="item.label" | ||||
:value="item.label" | |||||
:value="item.value" | |||||
/> | /> | ||||
</el-select> | </el-select> | ||||
</el-form-item> | </el-form-item> | ||||
@@ -97,7 +97,7 @@ | |||||
.dictionaryList" | .dictionaryList" | ||||
:key="order" | :key="order" | ||||
:label="item.describe" | :label="item.describe" | ||||
:value="item.describe" | |||||
:value="item.dictionaryCode" | |||||
/> | /> | ||||
</el-select> | </el-select> | ||||
</el-form-item> | </el-form-item> | ||||
@@ -126,7 +126,7 @@ | |||||
v-for="(item,order) in expertSource" | v-for="(item,order) in expertSource" | ||||
:key="order" | :key="order" | ||||
:label="item.label" | :label="item.label" | ||||
:value="item.label" | |||||
:value="item.value" | |||||
/> | /> | ||||
</el-select> | </el-select> | ||||
</el-form-item> | </el-form-item> | ||||
@@ -146,7 +146,7 @@ | |||||
.dictionaryList" | .dictionaryList" | ||||
:key="order" | :key="order" | ||||
:label="item.describe" | :label="item.describe" | ||||
:value="item.describe" | |||||
:value="item.dictionaryCode" | |||||
/> | /> | ||||
</el-select> | </el-select> | ||||
</el-form-item> | </el-form-item> | ||||
@@ -165,7 +165,7 @@ | |||||
v-for="(item,order) in goodAtTree" | v-for="(item,order) in goodAtTree" | ||||
:key="order" | :key="order" | ||||
:label="item.label" | :label="item.label" | ||||
:value="item.label" | |||||
:value="item.value" | |||||
/> | /> | ||||
</el-select> | </el-select> | ||||
</el-form-item> | </el-form-item> | ||||
@@ -205,12 +205,10 @@ | |||||
</el-form-item> | </el-form-item> | ||||
</el-col> | </el-col> | ||||
</el-row> | </el-row> | ||||
<el-button @click="handleParmas">测试</el-button> | |||||
</el-card> | </el-card> | ||||
</template> | </template> | ||||
<script setup> | <script setup> | ||||
import { getCurrentInstance, onMounted, ref, watch } from 'vue' | |||||
import { getCurrentInstance, onMounted, ref } from 'vue' | |||||
import { storeToRefs } from 'pinia' | import { storeToRefs } from 'pinia' | ||||
import store from '@/store' | import store from '@/store' | ||||
@@ -262,17 +260,11 @@ onMounted(async () => { | |||||
regionRes.push(res.data) | regionRes.push(res.data) | ||||
regionTree.value = copeData(regionRes) | regionTree.value = copeData(regionRes) | ||||
const technicalExpertiseRes = await getDictionaryTree({ rootTagCodeList: ['technical_expertise'] }) | |||||
technicalExpertiseTree.value = copeDictionaryData(technicalExpertiseRes)[0].children | |||||
const industrySectorRes = await getDictionaryTree({ rootTagCodeList: ['industry_sector'] }) | |||||
industrySectorTree.value = copeDictionaryData(industrySectorRes)[0].children | |||||
getDictionaryData('technical_expertise') | |||||
getDictionaryData('industry_sector') | |||||
getDictionaryData('expert_source') | |||||
getDictionaryData('good_at') | |||||
getDictionaryData('other') | |||||
await getDictionaryData('technical_expertise') | |||||
await getDictionaryData('industry_sector') | |||||
await getDictionaryData('expert_source') | |||||
await getDictionaryData('good_at') | |||||
await getDictionaryData('other') | |||||
}) | }) | ||||
const copeData = (val) => { | const copeData = (val) => { | ||||
const data = val.map((item) => { | const data = val.map((item) => { | ||||
@@ -341,30 +333,6 @@ const copeDictionaryData = (val) => { // 处理字典数据的方法 | |||||
return data | return data | ||||
} | } | ||||
const { detailData } = defineProps({ | |||||
detailData: Object | |||||
}) | |||||
console.log(detailData) | |||||
// randomRules | |||||
// 使用深度监听 | |||||
watch( | |||||
() => detailData, | |||||
(newVal, oldVal) => { | |||||
if (newVal && newVal.randomRules && newVal.randomRules) { | |||||
// ruleForm.expertInviteRule.randomRules = newVal.randomRules | |||||
// console.log(ruleForm.expertInviteRule.randomRules) | |||||
// ruleForm.expertInviteRule.randomRules = handleParmas(newVal.randomRules) | |||||
showData() | |||||
} | |||||
}, | |||||
{ deep: true } | |||||
) | |||||
function showData () { | |||||
} | |||||
defineExpose({ | defineExpose({ | ||||
handleParmas | handleParmas | ||||
}) | }) | ||||
@@ -373,6 +341,7 @@ function handleParmas () { | |||||
const postdata = randomRules.value.map(item => { | const postdata = randomRules.value.map(item => { | ||||
return { | return { | ||||
inviteType: 1, | inviteType: 1, | ||||
id: item.id || '', | |||||
count: item.count, | count: item.count, | ||||
expertDicts: getExpertDicts(item), | expertDicts: getExpertDicts(item), | ||||
expertRegionList: getExpertRegionList(item), | expertRegionList: getExpertRegionList(item), | ||||
@@ -412,21 +381,24 @@ function getExpertTags (item) { | |||||
const list = [] | const list = [] | ||||
if (item.otherTag) { | if (item.otherTag) { | ||||
list.push({ | list.push({ | ||||
'tagType': 'other', | |||||
expertTag: 'other', | expertTag: 'other', | ||||
tagCodes: [item.otherTag] | |||||
tagCodes: [item.otherTag.split('##')[2]] | |||||
}) | }) | ||||
} | } | ||||
if (item.expertSource) { | if (item.expertSource) { | ||||
list.push({ | list.push({ | ||||
tagType: 'other', | |||||
expertTag: 'expert_source', | expertTag: 'expert_source', | ||||
tagCodes: [item.expertSource] | |||||
tagCodes: [item.expertSource.split('##')[2]] | |||||
}) | }) | ||||
} | } | ||||
if (item.goodAt) { | if (item.goodAt) { | ||||
list.push({ | list.push({ | ||||
'tagType': 'good_at', | |||||
expertTag: 'good_at', | expertTag: 'good_at', | ||||
tagCodes: [item.goodAt] | |||||
tagCodes: [item.goodAt.split('##')[2]] | |||||
}) | }) | ||||
} | } | ||||
@@ -435,25 +407,27 @@ function getExpertTags (item) { | |||||
// ["industry_sector##制造业##4030000","4030000##酒、饮料及精制茶制造业##4030300"] | // ["industry_sector##制造业##4030000","4030000##酒、饮料及精制茶制造业##4030300"] | ||||
if (item.industrySector && Array.isArray(item.industrySector) && item.industrySector.length > 1) { | if (item.industrySector && Array.isArray(item.industrySector) && item.industrySector.length > 1) { | ||||
list.push({ | list.push({ | ||||
'tagGeneralType': 'industry_sector', | |||||
expertTag: 'industry_sector', | expertTag: 'industry_sector', | ||||
tagCodes: [item.industrySector[1].split('##')[1]] | |||||
tagCodes: [item.industrySector[1].split('##')[2]] | |||||
}) | }) | ||||
} | } | ||||
if (item.technicalExpertise && Array.isArray(item.technicalExpertise) && item.technicalExpertise.length > 1) { | if (item.technicalExpertise && Array.isArray(item.technicalExpertise) && item.technicalExpertise.length > 1) { | ||||
if (item.technicalExpertise.length === 2) { | if (item.technicalExpertise.length === 2) { | ||||
list.push({ | list.push({ | ||||
'tagGeneralType': 'technical_expertise', | |||||
expertTag: 'technical_expertise', | expertTag: 'technical_expertise', | ||||
tagCodes: [item.technicalExpertise[1].split('##')[1]] | |||||
tagCodes: [item.technicalExpertise[1].split('##')[2]] | |||||
}) | }) | ||||
} else if (item.technicalExpertise.length === 3) { | } else if (item.technicalExpertise.length === 3) { | ||||
list.push({ | list.push({ | ||||
'tagGeneralType': 'technical_expertise', | |||||
expertTag: 'technical_expertise', | expertTag: 'technical_expertise', | ||||
tagCodes: [item.technicalExpertise[2].split('##')[1]] | |||||
tagCodes: [item.technicalExpertise[2].split('##')[2]] | |||||
}) | }) | ||||
} | } | ||||
} | } | ||||
return list | return list | ||||
} | } | ||||
@@ -11,13 +11,13 @@ import store from '@/store' | |||||
import { useRouter } from 'vue-router' | import { useRouter } from 'vue-router' | ||||
import getTimeDiffer from '@/utils/getTimeDiffer.js' | import getTimeDiffer from '@/utils/getTimeDiffer.js' | ||||
import { ElMessageBox } from 'element-plus' | import { ElMessageBox } from 'element-plus' | ||||
// import AvoidCom from '@/pages/expertManage/reviewMeeting/addMeeting/components/avoidCom.vue' | |||||
const { meetingTypeOptions, projectTypeOptions } = store.dictStore.globalDicts || {} | const { meetingTypeOptions, projectTypeOptions } = store.dictStore.globalDicts || {} | ||||
const { proxy } = getCurrentInstance(), | const { proxy } = getCurrentInstance(), | ||||
userInfo = storeToRefs(store.userStore).userInfo || {}, | userInfo = storeToRefs(store.userStore).userInfo || {}, | ||||
router = useRouter(), | router = useRouter(), | ||||
ruleFormRef = ref(), | ruleFormRef = ref(), | ||||
ruleFormComRef = ref(), | ruleFormComRef = ref(), | ||||
randowRules = ref([{}]), | |||||
ruleForm = reactive({ | ruleForm = reactive({ | ||||
expertInviteRule: { | expertInviteRule: { | ||||
inviteType: 1, | inviteType: 1, | ||||
@@ -400,6 +400,8 @@ onMounted(async () => { | |||||
label-suffix=":" | label-suffix=":" | ||||
scroll-to-error | scroll-to-error | ||||
> | > | ||||
<!-- <avoid-com />--> | |||||
<el-card class="mb-16" shadow="never"> | <el-card class="mb-16" shadow="never"> | ||||
<template #header> | <template #header> | ||||
<div class="card-header"> | <div class="card-header"> | ||||
@@ -608,7 +610,7 @@ onMounted(async () => { | |||||
v-if="ruleForm.expertInviteRule.inviteType == 1" | v-if="ruleForm.expertInviteRule.inviteType == 1" | ||||
:gutter="20" | :gutter="20" | ||||
> | > | ||||
<rule-form-com ref="ruleFormComRef" v-model="randowRules" /> | |||||
<rule-form-com ref="ruleFormComRef" /> | |||||
</el-row> | </el-row> | ||||
<el-row | <el-row | ||||
v-else | v-else | ||||
@@ -361,15 +361,18 @@ const { proxy } = getCurrentInstance(), | |||||
reloadLoaing.value = false | reloadLoaing.value = false | ||||
}, | }, | ||||
// 随机邀请人数是否足够 | // 随机邀请人数是否足够 | ||||
getIsEnough = () => { | |||||
if (!inviteExpertListData.value.inviteStatistics) return false | |||||
if (inviteExpertListData.value.inviteStatistics.filter(i => i.agreeCnt !== i.inviteCnt)?.length) { | |||||
return true | |||||
} | |||||
return false | |||||
}, | |||||
// getIsEnough = () => { | |||||
// if (!inviteExpertListData.value.inviteStatistics) return false | |||||
// if (inviteExpertListData.value.inviteStatistics.filter(i => i.agreeCnt !== i.inviteCnt)?.length) { | |||||
// return true | |||||
// } | |||||
// return false | |||||
// }, | |||||
// 续抽 | // 续抽 | ||||
continueInvites = () => { | continueInvites = () => { | ||||
refillDialogData.value.refillDialogVisible = true | |||||
refillDialogData.value.inviteRuleDetail = inviteRuleDetail.value | |||||
if (refillDialogData.value.refillDialogVisible) return | |||||
proxy.$messageBox | proxy.$messageBox | ||||
.confirm('续抽后,将重新通知已拒绝参会的专家们,确定继续吗?', '提示!', { | .confirm('续抽后,将重新通知已拒绝参会的专家们,确定继续吗?', '提示!', { | ||||
type: 'warning' | type: 'warning' | ||||
@@ -449,10 +452,21 @@ onMounted(async () => { | |||||
regionTree.value.push(res.data) | regionTree.value.push(res.data) | ||||
}) | }) | ||||
import RefillDialog from '@/pages/expertManage/reviewMeeting/addMeeting/components/RefillDialogCopy.vue' | import RefillDialog from '@/pages/expertManage/reviewMeeting/addMeeting/components/RefillDialogCopy.vue' | ||||
const refillDialogData = ref({ | |||||
refillDialogVisible: false, | |||||
inviteRuleDetail: {} | |||||
}) | |||||
function refresh () { | |||||
setTimeout(() => { | |||||
getDetail() | |||||
getInviteExpertList() | |||||
}, 1000) | |||||
} | |||||
</script> | </script> | ||||
<template> | <template> | ||||
<refill-dialog :detail-data="inviteRuleDetail" /> | |||||
<refill-dialog v-model="refillDialogData.refillDialogVisible" :detail-data="refillDialogData.inviteRuleDetail" @refresh="refresh" /> | |||||
<el-card class="box-card"> | <el-card class="box-card"> | ||||
<template #header> | <template #header> | ||||
<div class="card-header"> | <div class="card-header"> | ||||
@@ -558,18 +572,18 @@ import RefillDialog from '@/pages/expertManage/reviewMeeting/addMeeting/componen | |||||
@click="toAppointInvite" | @click="toAppointInvite" | ||||
>转为指定抽取</el-button> | >转为指定抽取</el-button> | ||||
<el-button | <el-button | ||||
v-if="basicInfo.status===1&&(basicInfo.invitedStopped||basicInfo.inviteStatus)&&getIsEnough()" | |||||
v-if="!basicInfo.confirmedRoster" | |||||
class="button" | class="button" | ||||
type="primary" | type="primary" | ||||
plain | plain | ||||
@click="continueInvites" | @click="continueInvites" | ||||
>续抽</el-button> | >续抽</el-button> | ||||
<!-- <el-button--> | |||||
<!-- v-if="basicInfo.status===1&&(basicInfo.invitedStopped||basicInfo.inviteStatus)&&!basicInfo.confirmedRoster"--> | |||||
<!-- class="button"--> | |||||
<!-- type="primary"--> | |||||
<!-- @click="reText(3)"--> | |||||
<!-- >确认召开会议</el-button>--> | |||||
<el-button | |||||
v-if="!basicInfo.confirmedRoster" | |||||
class="button" | |||||
type="primary" | |||||
@click="reText(3)" | |||||
>确认召开会议</el-button> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
@@ -797,7 +811,7 @@ import RefillDialog from '@/pages/expertManage/reviewMeeting/addMeeting/componen | |||||
{{ ruleDialogData.data?.expertDicts?.find(i=>i.expertDict==='expert_type')?.dictCodes.join('、')||'-' }} | {{ ruleDialogData.data?.expertDicts?.find(i=>i.expertDict==='expert_type')?.dictCodes.join('、')||'-' }} | ||||
</el-descriptions-item> | </el-descriptions-item> | ||||
<el-descriptions-item label="履职意向:"> | <el-descriptions-item label="履职意向:"> | ||||
{{ ruleDialogData.data?.intentionRegions?.map(i=>i.regionName).join('-') }} | |||||
{{ ruleDialogData.data?.intentionRegions?.map(i=>i?.regionName).join('-') }} | |||||
</el-descriptions-item> | </el-descriptions-item> | ||||
<el-descriptions-item label="专家来源:"> | <el-descriptions-item label="专家来源:"> | ||||
{{ ruleDialogData.data?.expertTags?.find(i=>i.expertTag==='expert_source')?.tagCodes.join('、')||'-' }} | {{ ruleDialogData.data?.expertTags?.find(i=>i.expertTag==='expert_source')?.tagCodes.join('、')||'-' }} | ||||