人员管理

This commit is contained in:
guochunsi
2026-01-04 18:23:27 +08:00
parent fee5e2a6c0
commit 24453baf3e
34 changed files with 1603 additions and 1259 deletions

View File

@@ -1,28 +1,6 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<!-- 图表统计 -->
<div style="text-align: right; margin-bottom: 20px;">
<el-collapse accordion @change="initChartOption">
<el-collapse-item title="学历统计">
<div style="width: 100%">
<el-row :gutter="24">
<el-col :span="12">
<v-chart ref="chartRef" style="width: 100%; height: 400px;" :option="chartOption" />
</el-col>
<el-col :span="12">
<el-table :data="chartData" border show-summary style="width: 100%">
<el-table-column prop="xl" label="学历" width="180" align="center" />
<el-table-column prop="total" label="人数" width="180" align="center" />
<el-table-column prop="rate" label="占比" width="180" align="center" />
</el-table>
</el-col>
</el-row>
</div>
</el-collapse-item>
</el-collapse>
</div>
<!-- 搜索表单 -->
<search-form
v-show="showSearch"
@@ -36,7 +14,6 @@
<el-select
v-model="search.state"
clearable
style="width: 200px"
placeholder="请选择审核状态"
>
<el-option
@@ -52,7 +29,6 @@
<el-input
v-model="search.teacherNo"
clearable
style="width: 200px"
placeholder="请输入工号"
/>
</el-form-item>
@@ -61,7 +37,6 @@
<el-input
v-model="search.realName"
clearable
style="width: 200px"
placeholder="请输入姓名"
/>
</el-form-item>
@@ -87,7 +62,8 @@
v-if="permissions.professional_professionalteacheracademicrelation_add">
</el-button>
<el-button
type="success"
type="warning"
plain
icon="Download"
v-if="permissions.professional_teacherbase_export"
@click="handleDownLoadWord"
@@ -109,18 +85,15 @@
<el-table-column prop="state" label="审核状态" width="120" align="center">
<template #default="scope">
<el-tag v-if="scope.row.state === '1'" type="success">通过</el-tag>
<el-tag v-else-if="scope.row.state === '-2'" type="danger">驳回</el-tag>
<el-tag v-else-if="scope.row.state === '0'" type="warning">待审核</el-tag>
<span v-else>-</span>
</template>
<AuditState :state="scope.row.state" :options="auditStateOptions" />
</template>
</el-table-column>
<el-table-column prop="backReason" label="驳回理由" min-width="150" align="center" show-overflow-tooltip />
<el-table-column prop="teacherNo" label="工号" min-width="120" align="center" show-overflow-tooltip />
<el-table-column prop="realName" label="姓名" min-width="120" align="center" show-overflow-tooltip />
<el-table-column label="姓名/工号" min-width="150" align="center">
<template #default="scope">
<TeacherNameNo :name="scope.row.realName" :no="scope.row.teacherNo" />
</template>
</el-table-column>
<el-table-column prop="graduateTime" label="毕业时间" width="180" align="center" />
@@ -144,10 +117,11 @@
v-if="scope.row.qualificationImg && scope.row.qualificationImg !== ''"
type="primary"
link
icon="Document"
@click="handlePreview(scope.row.qiList, 1)">查看
</el-button>
</el-button>
<span v-else>-</span>
</template>
</template>
</el-table-column>
<el-table-column label="学位证书附件" width="130" align="center">
@@ -156,40 +130,44 @@
v-if="scope.row.degreeImg && scope.row.degreeImg !== ''"
type="primary"
link
icon="Document"
@click="handlePreview(scope.row.deList, 2)">查看
</el-button>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" width="250" align="center" fixed="right">
<el-table-column prop="backReason" label="驳回理由" min-width="150" align="center" show-overflow-tooltip />
<el-table-column label="操作" width="280" align="center" fixed="right">
<template #default="scope">
<el-button
type="primary"
link
icon="Edit"
icon="edit-pen"
v-if="permissions.professional_professionalteacheracademicrelation_edit && (scope.row.state === '0' || scope.row.state === '-2')"
@click="handleEdit(scope.row)">编辑
</el-button>
<el-button
type="success"
link
icon="Check"
icon="CircleCheck"
v-if="permissions.professional_professionalteacheracademicrelation_exam && scope.row.state === '0'"
@click="changeState(scope.row, 1)">通过
</el-button>
<el-button
type="danger"
link
icon="Close"
icon="CircleClose"
v-if="permissions.professional_professionalteacheracademicrelation_exam && (scope.row.state === '0' || scope.row.state === '1')"
@click="changeState(scope.row, -2)">驳回
</el-button>
<el-button
type="danger"
type="primary"
link
icon="Delete"
icon="delete"
v-if="permissions.professional_professionalteacheracademicrelation_del"
style="margin-left: 12px"
@click="handleDel(scope.row)">删除
</el-button>
</template>
@@ -214,7 +192,6 @@
</el-dialog>
<!-- 子组件 -->
<MultiDialog ref="multiDialogRef" @getList="getDataList" :page="state.pagination" :nowRow="null" />
<DataForm ref="dataFormRef" @refreshData="handleFilter" />
<ProfessionalBackResaon ref="backReasonRef" @refreshData="handleFilter" />
</div>
@@ -229,28 +206,28 @@ import { BasicTableProps, useTable } from '/@/hooks/table'
import { useMessage } from '/@/hooks/message'
import { useMessageBox } from '/@/hooks/message'
import { useDict } from '/@/hooks/dict'
import VChart from 'vue-echarts'
import { use } from 'echarts/core'
import { PieChart } from 'echarts/charts'
import { TooltipComponent, LegendComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
import {
fetchList,
putObj,
delObj,
getChartOption,
exportExcel
} from '/@/api/professional/professionaluser/professionalteacheracademicrelation'
import { getDegreeList } from '/@/api/professional/rsbase/professionalacademicdegreeconfig'
import { getQualificationList } from '/@/api/professional/rsbase/academicqualificationsconfig'
import { defineAsyncComponent } from 'vue'
const MultiDialog = defineAsyncComponent(() => import('/@/views/professional/teacherbase/multiDialog.vue'))
import DataForm from './form.vue'
import ProfessionalBackResaon from '/@/views/professional/common/professional-back-resaon.vue'
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue'))
const DataForm = defineAsyncComponent(() => import('./form.vue'))
const ProfessionalBackResaon = defineAsyncComponent(() => import('/@/views/professional/common/professional-back-resaon.vue'))
const authImg = defineAsyncComponent(() => import('/@/components/tools/auth-img.vue'))
// 注册 ECharts 组件
use([TooltipComponent, LegendComponent, PieChart, CanvasRenderer])
// 审核状态选项(独立定义,防止其他页面修改时被波及)
import type { StateOption } from '/@/components/AuditState/index.vue'
const auditStateOptions: StateOption[] = [
{ value: '1', label: '已通过', type: 'success', icon: 'fa-solid fa-circle-check', effect: 'dark' },
{ value: '-2', label: '已驳回', type: 'danger', icon: 'fa-solid fa-circle-xmark', effect: 'dark' },
{ value: '0', label: '待审核', type: 'warning', icon: 'fa-regular fa-clock', effect: 'light' }
]
// 使用 Pinia store
const userInfoStore = useUserInfo()
@@ -275,10 +252,8 @@ const { professional_state: professionalState } = useDict('professional_state')
// 表格引用
const tableRef = ref()
const searchFormRef = ref()
const multiDialogRef = ref()
const dataFormRef = ref()
const backReasonRef = ref()
const chartRef = ref()
const showSearch = ref(true)
// 搜索表单数据
@@ -288,10 +263,6 @@ const search = reactive({
realName: ''
})
// 图表数据
const chartOption = ref<any>({})
const chartData = ref<any[]>([])
// 材料预览
const dialogVisible = ref(false)
const dialogTitle = ref('')
@@ -334,34 +305,6 @@ const state: BasicTableProps = reactive<BasicTableProps>({
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state)
// 初始化图表
const initChartOption = async () => {
try {
const response = await getChartOption()
chartOption.value = response.data.data || {}
// 处理图表数据(如果有的话)
if (chartOption.value.series && chartOption.value.series[0] && chartOption.value.series[0].data) {
let total = 0
chartOption.value.series[0].data.forEach((item: any) => {
total += item.value || 0
})
chartData.value = []
chartOption.value.series[0].data.forEach((item: any) => {
const rate = total > 0 ? Number((item.value / total * 100).toFixed(1)) : 0
chartData.value.push({
xl: item.name,
total: item.value,
rate: `${rate}%`
})
})
}
} catch (error) {
// Failed to load chart data
}
}
// 预览材料
const handlePreview = (list: string[], type: number) => {
imgUrl.value = []
@@ -425,7 +368,7 @@ const resetQuery = () => {
// 打开新增窗口
const handleAdd = () => {
multiDialogRef.value?.init(1)
dataFormRef.value?.openDialog()
}
// 打开编辑窗口