提交 f8b27f95 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 评分专家增加所属机构

上级 39e3e1d8
...@@ -5,6 +5,7 @@ import { ElMessage } from 'element-plus' ...@@ -5,6 +5,7 @@ import { ElMessage } from 'element-plus'
import { createExpert, updateExpert } from '../api' import { createExpert, updateExpert } from '../api'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { useArea } from '@/composables/useArea' import { useArea } from '@/composables/useArea'
import { useGetProjectList } from '@/composables/useGetProjectList'
interface Props { interface Props {
data?: Expert data?: Expert
...@@ -17,6 +18,8 @@ const emit = defineEmits<{ ...@@ -17,6 +18,8 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
// 机构列表
const { organizations } = useGetProjectList()
// 性别 // 性别
const genderList = useMapStore().getMapValuesByKey('system_gender') const genderList = useMapStore().getMapValuesByKey('system_gender')
// 职务 // 职务
...@@ -31,7 +34,8 @@ const form = reactive<ExpertCreateParams>({ ...@@ -31,7 +34,8 @@ const form = reactive<ExpertCreateParams>({
position_id: '', position_id: '',
province: '', province: '',
city: '', city: '',
area: '' area: '',
organization_id: ''
}) })
const { provinceList, cityList, countyList, provinceValue, cityValue, countyValue } = useArea( const { provinceList, cityList, countyList, provinceValue, cityValue, countyValue } = useArea(
...@@ -47,7 +51,7 @@ watchEffect(() => { ...@@ -47,7 +51,7 @@ watchEffect(() => {
watchEffect(() => { watchEffect(() => {
if (!props.data) return if (!props.data) return
Object.assign(form, props.data, { position_id: props.data.position.id }) Object.assign(form, props.data, { position_id: props.data.position.id, organization_id: props.data.organization.id })
}) })
const rules = ref<FormRules>({ const rules = ref<FormRules>({
...@@ -57,7 +61,8 @@ const rules = ref<FormRules>({ ...@@ -57,7 +61,8 @@ const rules = ref<FormRules>({
position_id: [{ required: true, message: '请选择职务' }], position_id: [{ required: true, message: '请选择职务' }],
province: [{ required: true, message: '请选择省' }], province: [{ required: true, message: '请选择省' }],
city: [{ required: true, message: '请选择市' }], city: [{ required: true, message: '请选择市' }],
area: [{ required: true, message: '请选择区/县' }] area: [{ required: true, message: '请选择区/县' }],
organization_id: [{ required: true, message: '请选择所属部门/学校' }]
}) })
const isUpdate = $computed(() => { const isUpdate = $computed(() => {
return !!props.data?.id return !!props.data?.id
...@@ -93,7 +98,12 @@ function handleUpdate() { ...@@ -93,7 +98,12 @@ function handleUpdate() {
<template> <template>
<el-dialog :title="title" :close-on-click-modal="false" width="600px" @update:modelValue="$emit('update:modelValue')"> <el-dialog :title="title" :close-on-click-modal="false" width="600px" @update:modelValue="$emit('update:modelValue')">
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="所属部门/学校" prop="organization_id">
<el-select v-model="form.organization_id" style="width: 100%" :disabled="isUpdate">
<el-option v-for="item in organizations" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="姓名" prop="name"> <el-form-item label="姓名" prop="name">
<el-input v-model="form.name" :disabled="isUpdate" /> <el-input v-model="form.name" :disabled="isUpdate" />
</el-form-item> </el-form-item>
......
...@@ -14,6 +14,7 @@ export interface Expert { ...@@ -14,6 +14,7 @@ export interface Expert {
updated_time: string updated_time: string
position: ExpertPosition position: ExpertPosition
competition: ExpertCompetition competition: ExpertCompetition
organization: ExpertOrganization
check_count: 1 check_count: 1
} }
export interface ExpertPosition { export interface ExpertPosition {
...@@ -25,6 +26,10 @@ export interface ExpertCompetition { ...@@ -25,6 +26,10 @@ export interface ExpertCompetition {
id: string id: string
name: string name: string
} }
export interface ExpertOrganization {
id: string
name: string
}
export interface ExpertCreateParams { export interface ExpertCreateParams {
name: string name: string
mobile: string mobile: string
...@@ -34,6 +39,7 @@ export interface ExpertCreateParams { ...@@ -34,6 +39,7 @@ export interface ExpertCreateParams {
province: string province: string
city: string city: string
area: string area: string
organization_id: string
} }
export type ExpertUpdateParams = ExpertCreateParams & { id: string } export type ExpertUpdateParams = ExpertCreateParams & { id: string }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论