人员管理

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,41 +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="titleChartRef" style="width: 100%; height: 400px;" :option="titleChartOption" />
</el-col>
<el-col :span="12">
<el-table :data="titleChartTableData" border show-summary style="width: 100%">
<el-table-column prop="name" label="职称" width="180" align="center" />
<el-table-column prop="value" label="人数" width="180" align="center" />
<el-table-column prop="rate" label="比例" width="180" align="center" />
</el-table>
</el-col>
</el-row>
<el-row :gutter="24" style="margin-top: 20px;">
<el-col :span="12">
<v-chart ref="techChartRef" style="width: 100%; height: 400px;" :option="techChartOption" />
</el-col>
<el-col :span="12">
<el-table :data="techChartTableData" border show-summary style="width: 100%">
<el-table-column prop="name" label="技术职务" width="180" align="center" />
<el-table-column prop="value" 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"
@@ -49,7 +14,6 @@
<el-select
v-model="search.state"
clearable
style="width: 200px"
placeholder="请选择审核状态"
>
<el-option
@@ -65,7 +29,6 @@
<el-input
v-model="search.teacherNo"
clearable
style="width: 200px"
placeholder="请输入工号"
/>
</el-form-item>
@@ -74,7 +37,6 @@
<el-input
v-model="search.realName"
clearable
style="width: 200px"
placeholder="请输入姓名"
/>
</el-form-item>
@@ -84,7 +46,6 @@
v-model="search.professionalTitleConfigId"
clearable
filterable
style="width: 200px"
placeholder="请选择职称"
>
<el-option
@@ -101,7 +62,6 @@
v-model="search.majorStation"
clearable
filterable
style="width: 200px"
placeholder="请选择专业技术职务"
>
<el-option
@@ -134,7 +94,9 @@
v-if="permissions.professional_professionaltitlerelation_add">
</el-button>
<el-button
type="success"
class="ml10"
type="warning"
plain
icon="Download"
v-if="permissions.professional_teacherbase_export"
@click="handleDownLoadWord"
@@ -188,7 +150,7 @@
v-if="scope.row.evidence && scope.row.evidence !== ''"
type="primary"
link
icon="View"
icon="Document"
@click="handlePreview(scope.row.srcList)">查看
</el-button>
<span v-else>-</span>
@@ -209,14 +171,14 @@
<el-button
type="success"
link
icon="check"
icon="CircleCheck"
v-if="permissions.professional_professionaltitlerelation_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_professionaltitlerelation_exam && (scope.row.state === '0' || scope.row.state === '1')"
@click="changeState(scope.row, -2)">驳回
</el-button>
@@ -265,21 +227,17 @@ 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,
exportRelation
} from '/@/api/professional/professionaluser/professionaltitlerelation'
import { getProfessionalTitleList } from '/@/api/professional/rsbase/professionaltitlelevelconfig'
import { getMajorStationList } from '/@/api/professional/rsbase/professionalmajorstation'
import { defineAsyncComponent } from 'vue'
// 子组件
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue'))
const MultiDialog = defineAsyncComponent(() => import('/@/views/professional/teacherbase/multiDialog.vue'))
@@ -287,9 +245,6 @@ 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])
// 使用 Pinia store
const userInfoStore = useUserInfo()
const { userInfos } = storeToRefs(userInfoStore)
@@ -316,8 +271,6 @@ const searchFormRef = ref()
const multiDialogRef = ref()
const dataFormRef = ref()
const backReasonRef = ref()
const titleChartRef = ref()
const techChartRef = ref()
const showSearch = ref(true)
// 搜索表单数据
@@ -329,12 +282,6 @@ const search = reactive({
majorStation: ''
})
// 图表数据
const titleChartOption = ref<any>({})
const titleChartTableData = ref<any[]>([])
const techChartOption = ref<any>({})
const techChartTableData = ref<any[]>([])
// 材料预览
const dialogVisible = ref(false)
const imgUrl = ref<Array<{ title: string; url: string }>>([])
@@ -371,54 +318,6 @@ const state: BasicTableProps = reactive<BasicTableProps>({
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state)
// 初始化图表
const initChartOption = async () => {
try {
const response = await getChartOption()
const data = response.data.data || {}
// 职称图表
titleChartOption.value = data.titleOption || {}
let titleTotal = 0
if (titleChartOption.value.series && titleChartOption.value.series[0] && titleChartOption.value.series[0].data) {
titleChartOption.value.series[0].data.forEach((item: any) => {
titleTotal += item.value || 0
})
titleChartTableData.value = []
titleChartOption.value.series[0].data.forEach((item: any) => {
const rate = titleTotal > 0 ? Number((item.value / titleTotal * 100).toFixed(1)) : 0
titleChartTableData.value.push({
name: item.name,
value: item.value,
rate: `${rate}%`
})
})
}
// 技术职务图表
techChartOption.value = data.techOption || {}
let techTotal = 0
if (techChartOption.value.series && techChartOption.value.series[0] && techChartOption.value.series[0].data) {
techChartOption.value.series[0].data.forEach((item: any) => {
techTotal += item.value || 0
})
techChartTableData.value = []
techChartOption.value.series[0].data.forEach((item: any) => {
const rate = techTotal > 0 ? Number((item.value / techTotal * 100).toFixed(1)) : 0
techChartTableData.value.push({
name: item.name,
value: item.value,
rate: `${rate}%`
})
})
}
} catch (error) {
// Failed to load chart data
}
}
// 预览材料
const handlePreview = (list: string[]) => {
imgUrl.value = []
@@ -477,7 +376,7 @@ const resetQuery = () => {
// 打开新增窗口
const handleAdd = () => {
multiDialogRef.value?.init(2)
dataFormRef.value?.openDialog()
}
// 打开编辑窗口