This commit is contained in:
guochunsi
2026-01-06 19:23:18 +08:00
parent 8af3aaa9b6
commit e1cb334fbf
33 changed files with 685 additions and 329 deletions

View File

@@ -369,24 +369,26 @@
<el-tab-pane label="基本信息" name="first">
<div class="base-info-form">
<el-form ref="baseForm" :model="form" label-width="120px" :rules="mergedRules">
<!-- 照片区域 -->
<div v-if="isAdd==false && imageUrl" class="photo-section">
<div class="photo-wrapper">
<img :src="imageUrl" class="avatar-photo" alt="照片">
</div>
</div>
<!-- 子标签页 -->
<el-tabs v-model="subActiveName" type="card" class="sub-tabs">
<!-- 基本信息子标签 -->
<el-tab-pane label="基本信息" name="subBaseInfo">
<!-- 基本信息分组 -->
<div class="form-section">
<div class="section-title">
<el-icon><User /></el-icon>
<span>基本信息</span>
<!-- 照片区域和基本信息分组 -->
<div class="base-info-layout">
<!-- 左侧照片区域 -->
<div v-if="isAdd==false && imageUrl" class="photo-section">
<div class="photo-wrapper">
<img :src="imageUrl" class="avatar-photo" alt="照片">
</div>
</div>
<el-row :gutter="16">
<!-- 右侧基本信息分组 -->
<div class="form-section">
<div class="section-title">
<el-icon><User /></el-icon>
<span>基本信息</span>
</div>
<el-row :gutter="16">
<el-col :span="6">
<el-form-item label="姓名" prop="baseInfo.realName">
<el-input
@@ -442,6 +444,7 @@
</el-form-item>
</el-col>
</el-row>
</div>
</div>
<!-- 联系方式分组 -->
@@ -886,19 +889,23 @@
<el-tab-pane label="政治面貌" name="politicsPane">
<div class="table-section">
<div class="table-header" v-if="permissions.professional_teacherbase_edit">
<div class="table-header">
<div class="table-title">
<el-icon><Flag /></el-icon>
<span>政治面貌信息</span>
</div>
<el-button type="primary" size="default" @click="handleAddPolitics">
<el-button v-if="permissions.professional_teacherbase_edit" type="primary" size="default" @click="handleAddPolitics">
<el-icon><Plus /></el-icon>
<span>新增</span>
</el-button>
</div>
<el-table :data="dataPolitics" border stripe class="data-table">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="politicsStatus" label="政治面貌" min-width="120" align="center" />
<el-table-column prop="politicsStatus" label="政治面貌" min-width="120" align="center">
<template #default="scope">
{{ getPoliticsStatusName(scope.row.politicsStatusId || scope.row.politicsStatus) }}
</template>
</el-table-column>
<el-table-column prop="joinTime" label="加入时间" min-width="120" align="center">
<template #default="scope">
{{ scope.row.joinTime ? new Date(scope.row.joinTime).toLocaleDateString() : '-' }}
@@ -932,12 +939,12 @@
<el-tab-pane label="社会关系" name="third">
<div class="table-section">
<div class="table-header" v-if="permissions.professional_teacherbase_edit">
<div class="table-header">
<div class="table-title">
<el-icon><Connection /></el-icon>
<span>社会关系信息</span>
</div>
<el-button type="primary" size="default" @click="handleAddRelation">
<el-button v-if="permissions.professional_teacherbase_edit" type="primary" size="default" @click="handleAddRelation">
<el-icon><Plus /></el-icon>
<span>新增</span>
</el-button>
@@ -951,7 +958,11 @@
{{ scope.row.birthday ? new Date(scope.row.birthday).toLocaleDateString() : '-' }}
</template>
</el-table-column>
<el-table-column prop="politicsStatus" label="政治面貌" min-width="120" align="center" />
<el-table-column prop="politicsStatus" label="政治面貌" min-width="120" align="center">
<template #default="scope">
{{ getPoliticsStatusName(scope.row.politicsStatusId || scope.row.politicsStatus) }}
</template>
</el-table-column>
<el-table-column prop="workStation" label="工作单位及职务" min-width="200" align="center" show-overflow-tooltip />
<el-table-column label="操作" width="150" align="center" v-if="permissions.professional_teacherbase_edit">
<template #default="scope">
@@ -971,15 +982,11 @@
<el-tab-pane label="学历" name="second">
<div class="table-section">
<div class="table-header" v-if="permissions.professional_teacherbase_edit">
<div class="table-header">
<div class="table-title">
<el-icon><School /></el-icon>
<span>学历信息</span>
</div>
<el-button type="primary" size="default" @click="handleAddEducation">
<el-icon><Plus /></el-icon>
<span>新增</span>
</el-button>
</div>
<el-table :data="dataEducation" border stripe class="data-table">
<el-table-column type="index" label="序号" width="60" align="center" />
@@ -1024,18 +1031,6 @@
{{ scope.row.createTime ? new Date(scope.row.createTime).toLocaleDateString() : '-' }}
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center" v-if="permissions.professional_teacherbase_edit">
<template #default="scope">
<el-button type="primary" link size="small" @click="handleEditEducation(scope.row, scope.$index)">
<el-icon><Edit /></el-icon>
<span>编辑</span>
</el-button>
<el-button type="danger" link size="small" @click="handleDeleteEducation(scope.row, scope.$index)">
<el-icon><Delete /></el-icon>
<span>删除</span>
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
@@ -1043,15 +1038,11 @@
<!--职称表单-->
<el-tab-pane label="职称" name="fourth">
<div class="table-section">
<div class="table-header" v-if="permissions.professional_teacherbase_edit">
<div class="table-header">
<div class="table-title">
<el-icon><Medal /></el-icon>
<span>职称信息</span>
</div>
<el-button type="primary" size="default" @click="handleAddPro">
<el-icon><Plus /></el-icon>
<span>新增</span>
</el-button>
</div>
<el-table :data="proData" border stripe class="data-table">
<el-table-column type="index" label="序号" width="60" align="center" />
@@ -1086,18 +1077,6 @@
{{ scope.row.createTime ? new Date(scope.row.createTime).toLocaleDateString() : '-' }}
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center" v-if="permissions.professional_teacherbase_edit">
<template #default="scope">
<el-button type="primary" link size="small" @click="handleEditPro(scope.row, scope.$index)">
<el-icon><Edit /></el-icon>
<span>编辑</span>
</el-button>
<el-button type="danger" link size="small" @click="handleDeletePro(scope.row, scope.$index)">
<el-icon><Delete /></el-icon>
<span>删除</span>
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
@@ -1105,15 +1084,11 @@
<!--职业资格表单-->
<el-tab-pane label="职业资格" name="five">
<div class="table-section">
<div class="table-header" v-if="permissions.professional_teacherbase_edit">
<div class="table-header">
<div class="table-title">
<el-icon><Medal /></el-icon>
<span>职业资格信息</span>
</div>
<el-button type="primary" size="default" @click="handleAddWork">
<el-icon><Plus /></el-icon>
<span>新增</span>
</el-button>
</div>
<el-table :data="workData" border stripe class="data-table">
<el-table-column type="index" label="序号" width="60" align="center" />
@@ -1143,18 +1118,6 @@
{{ scope.row.createTime ? new Date(scope.row.createTime).toLocaleDateString() : '-' }}
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center" v-if="permissions.professional_teacherbase_edit">
<template #default="scope">
<el-button type="primary" link size="small" @click="handleEditWork(scope.row, scope.$index)">
<el-icon><Edit /></el-icon>
<span>编辑</span>
</el-button>
<el-button type="danger" link size="small" @click="handleDeleteWork(scope.row, scope.$index)">
<el-icon><Delete /></el-icon>
<span>删除</span>
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
@@ -1198,6 +1161,12 @@
<el-tab-pane label="岗位变更" name="stationChange">
<div class="table-section">
<div class="table-header">
<div class="table-title">
<el-icon><Switch /></el-icon>
<span>岗位变更信息</span>
</div>
</div>
<el-table :data="stationChange" border stripe class="data-table">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="oldDeptName" label="原部门名称" min-width="180" align="center" show-overflow-tooltip />
@@ -1213,6 +1182,12 @@
<el-tab-pane label="党员调动" name="partyChange">
<div class="table-section">
<div class="table-header">
<div class="table-title">
<el-icon><Flag /></el-icon>
<span>党员调动信息</span>
</div>
</div>
<el-table :data="partyChange" border stripe class="data-table">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="oldBranchName" label="原支部名称" min-width="180" align="center" show-overflow-tooltip />
@@ -1236,6 +1211,12 @@
<!--综合表彰-->
<el-tab-pane label="综合表彰" name="teacherHonor">
<div class="table-section">
<div class="table-header">
<div class="table-title">
<el-icon><Medal /></el-icon>
<span>综合表彰信息</span>
</div>
</div>
<el-table :data="honorVOList" border stripe class="data-table">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="honor" label="荣誉" min-width="180" align="center" show-overflow-tooltip />
@@ -1251,6 +1232,12 @@
</el-tab-pane>
<el-tab-pane label="教师论文" name="nine">
<div class="table-section">
<div class="table-header">
<div class="table-title">
<el-icon><Document /></el-icon>
<span>教师论文信息</span>
</div>
</div>
<el-table :data="paperVOList" border stripe class="data-table">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="author" label="作者" min-width="100" align="center" />
@@ -1285,6 +1272,12 @@
<el-tab-pane label="教材列表" name="ten">
<div class="table-section">
<div class="table-header">
<div class="table-title">
<el-icon><Document /></el-icon>
<span>教材列表信息</span>
</div>
</div>
<el-table :data="materialVOList" border stripe class="data-table">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="materialName" label="教材名称" min-width="180" align="center" show-overflow-tooltip />
@@ -1312,6 +1305,12 @@
<el-tab-pane label="课题列表" name="eleven">
<div class="table-section">
<div class="table-header">
<div class="table-title">
<el-icon><Document /></el-icon>
<span>课题列表信息</span>
</div>
</div>
<el-table :data="topicListVOList" border stripe class="data-table">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="deptName" label="课题所属部门" min-width="180" align="center" show-overflow-tooltip />
@@ -1342,6 +1341,7 @@
<template #footer>
<div class="dialog-footer">
<el-button
v-if="activeName === 'first'"
type="primary"
@click="saveSubmit"
:disabled="!canSave"
@@ -1908,12 +1908,6 @@
if (politicsRes && politicsRes.data) {
searchPoliticsStatusList.value = politicsRes.data
}
// 加载授课类型字典
const teacherCateRes: any = await getDicts(global.TEACHER_CATE)
if (teacherCateRes && teacherCateRes.data) {
searchTeacherCateList.value = teacherCateRes.data
}
} catch (error) {
console.error('加载搜索字典数据失败:', error)
}
@@ -2022,21 +2016,20 @@
const exportExcelA = (head: string[], val: string[], fileName: string) => {
exportNoImgUser().then((response: any) => {
if (response.data.msg == "fail") {
alert(JSON.stringify(response.data.data));
} else {
if (response.data.msg == "fail") {
alert(JSON.stringify(response.data));
} else {
import('/@/excel/Export2Excel.js').then(({ export_json_to_excel }) => {
const tHeader = head;
const filterVal = val;
const list = response.data.data;
const tHeader = head;
const filterVal = val;
const list = response.data;
const data = formatJson(filterVal, list);
export_json_to_excel(tHeader, data, fileName);
})
}
export_json_to_excel(tHeader, data, fileName);
})
.catch((error: any) => {
console.log(error);
});
}
}).catch((error: any) => {
console.log(error);
});
}
const exportUserInfo = () => {
@@ -2253,6 +2246,13 @@
const politicsForm = ref<any>({})
const politicsEditIndex = ref(-1)
// 根据政治面貌ID获取名称
const getPoliticsStatusName = (id: string | number | undefined) => {
if (!id) return '-'
const item = searchPoliticsStatusList.value.find((item: any) => item.id === id || item.id === String(id))
return item ? item.politicsStatus : '-'
}
const handleAddPolitics = () => {
politicsForm.value = {}
politicsEditIndex.value = -1
@@ -2285,7 +2285,8 @@
politicsDialogVisible.value = false
// 刷新数据
getObj(form.baseInfo.id).then((res: any) => {
const baseInfo = res.data.data;
const baseInfo = res.data;
if (!baseInfo) return;
dataPolitics.value = baseInfo.poList;
})
});
@@ -2367,7 +2368,8 @@
educationDialogVisible.value = false
// 刷新数据
getObj(form.baseInfo.id).then((res: any) => {
const baseInfo = res.data.data;
const baseInfo = res.data;
if (!baseInfo) return;
dataEducation.value = baseInfo.acadeList
dataEducation.value.forEach((v: any) => {
v.qiList = []
@@ -2460,7 +2462,8 @@
relationDialogVisible.value = false
// 刷新数据
getObj(form.baseInfo.id).then((res: any) => {
const baseInfo = res.data.data;
const baseInfo = res.data;
if (!baseInfo) return;
relationData.value = baseInfo.socialList;
})
});
@@ -2541,7 +2544,8 @@
proDialogVisible.value = false
// 刷新数据
getObj(form.baseInfo.id).then((res: any) => {
const baseInfo = res.data.data;
const baseInfo = res.data;
if (!baseInfo) return;
proData.value = baseInfo.titleList
proData.value.forEach((v: any) => {
v.srcList = []
@@ -2626,7 +2630,8 @@
workDialogVisible.value = false
// 刷新数据
getObj(form.baseInfo.id).then((res: any) => {
const baseInfo = res.data.data;
const baseInfo = res.data;
if (!baseInfo) return;
workData.value = baseInfo.quaList
workData.value.forEach((v: any) => {
v.srcList = []
@@ -2698,32 +2703,19 @@
}
const init = async () => {
// 获取一级部门
fetchSecondTree()
await Promise.all([
// 健康状况
getDicts(global.HEATH).then((response: any) => {
healthList.value = response.data;
}),
// 授课类型
getDicts(global.TEACHER_CATE).then((response: any) => {
teacherCateList.value = response.data;
}),
// 宗教信仰
getDicts(religiousBelief).then((response: any) => {
religiousBeliefDic.value = response.data;
}),
// 批量获取字典数据
// 批量获取字典数据 religious_belief宗教信仰 health健康状况 teacher_cate授课类型
getDictsByTypes(['religious_belief', 'heath', 'teacher_cate']).then((response: any) => {
religiousBeliefDic.value = response.data.religious_belief;
healthList.value = response.data.heath;
teacherCateList.value = response.data.teacher_cate;
teacherCateList.value = response.data.teacher_cate;
}),
// 民族
getNationalList().then((response: any) => {
nationalList.value = response.data;
}),
// 岗位类型部门树
treeForCascader().then((response: any) => {
deptTreeList.value = response.data;
@@ -2809,6 +2801,7 @@
workData.value = [];
dialogFromVisible.value = true;
}
const handleEdit = (row: any, index: any) => {
isAdd.value = false
nowUserInfo.uploadUrl = '/professional/file/upload?teacherNo=' + row.teacherNo;
@@ -2819,7 +2812,12 @@
imageUrl.value = ''
//查询基础信息
getObj(row.id).then((response: any) => {
const baseInfo = response.data.data;
const baseInfo = response.data;
if (!baseInfo || !baseInfo.teacherBase) {
console.error('[teacherbase] 获取教师详情失败,返回数据异常:', response);
message.error('获取教师详情失败,请稍后重试');
return;
}
form.baseInfo.teacherPhoto = "";
nowImage.value = baseInfo.teacherBase.teacherPhoto;
imgList.value = [];
@@ -2827,7 +2825,7 @@
dialogForListImageUrl.value = "/professional/minio/show?fileName=base-teach_photo/" + baseInfo.teacherBase.teacherNo + "/" + baseInfo.teacherBase.teacherNo + ".jpg"
imageUrl.value = dialogForListImageUrl.value
dataPolitics.value = baseInfo.poList;
//资格证
//资格证
zgzData.value = baseInfo.certList;
zgzData.value.forEach((v: any) => {
v.srcList = []
@@ -2919,7 +2917,7 @@
}
if (row.deptCode != null && row.deptCode != '') {
getDeptByCode(row.deptCode).then((response: any) => {
const dept = response.data.data
const dept = response.data
if (dept) {
form.professionalStationRelation.deptCodeList = [];
form.professionalStationRelation.deptCodeList[0] = dept.parentCode
@@ -3173,28 +3171,59 @@
.base-info-form {
background: #ffffff;
// 照片区域
// 基本信息布局(照片+表单)
.base-info-layout {
display: flex;
gap: 18px;
align-items: center;
margin-bottom: 16px;
// 照片区域
.photo-section {
flex-shrink: 0;
.photo-wrapper {
width: 120px;
height: 160px;
border-radius: 8px;
overflow: hidden;
border: 1px solid #e4e7ed;
background: #fafafa;
.avatar-photo {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
}
}
// 表单区域
.form-section {
flex: 1;
min-width: 0; // 防止 flex 子元素溢出
}
}
// 照片区域(独立显示,当没有表单时)
.photo-section {
margin-bottom: 24px;
display: flex;
justify-content: center;
.photo-wrapper {
width: 120px;
height: 120px;
height: 160px;
border-radius: 8px;
overflow: hidden;
border: 2px solid #e4e7ed;
border: 1px solid #e4e7ed;
background: #fafafa;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
.avatar-photo {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
}
}
@@ -3214,9 +3243,10 @@
// 表单分组样式优化 - 保持当前间距,添加背景
.form-section {
margin-bottom: 16px;
padding: 16px;
padding: 20px;
background: #fafbfc;
border-radius: 6px;
border-radius: 8px;
border: 1px solid #ebeef5;
&:last-child {
margin-bottom: 0;
@@ -3248,11 +3278,12 @@
}
}
}
}
// 表格模块样式优化
.table-section {
padding: 24px;
// padding: 24px;
background: #ffffff;
.table-header {