This commit is contained in:
zhoutianchi
2026-02-06 14:24:42 +08:00
parent f98d3ea674
commit 37e709cf7e
10 changed files with 484 additions and 607 deletions

View File

@@ -8,3 +8,11 @@ export const makeExportTeacherInfoBySelfTask = (data?: any) => {
data: data, data: data,
}); });
}; };
export const makeExportTeacherInfoByTypeTask = (data?: any) => {
return request({
url: '/professional/file/makeExportTeacherInfoByTypeTask',
method: 'post',
data: data,
});
};

View File

@@ -138,16 +138,3 @@ export const titleCountInfo = () => {
}); });
}; };
/**
* 导出Excel
* @param data 查询参数
*/
export const exportRelation = (data: any) => {
return request({
url: '/professional/professionaltitlerelation/exportRelation',
method: 'post',
data: data,
responseType: 'blob',
});
};

View File

@@ -98,7 +98,7 @@ const handleAvatarError = (err: any) => {
}; };
const handleDownloadTemplate = () => { const handleDownloadTemplate = () => {
downBlobFile('/professional/file/exportTeacherInfoTemplate', { type: currentType.value || 'titleRelation' }, '职工信息导入模板.xlsx') downBlobFile('/professional/file/exportTeacherInfoTemplate', { type: currentType.value || 'titleRelation' }, title.value+'模板.xlsx')
} }
// 暴露方法给父组件 // 暴露方法给父组件

View File

@@ -229,11 +229,10 @@ import { useDict } from '/@/hooks/dict'
import { import {
fetchList, fetchList,
examObj, examObj,
delObj, delObj} from '/@/api/professional/professionaluser/professionalqualificationrelation'
exportExcel
} from '/@/api/professional/professionaluser/professionalqualificationrelation'
import { getLevelList } from '/@/api/professional/rsbase/professionalqualificationconfig' import { getLevelList } from '/@/api/professional/rsbase/professionalqualificationconfig'
import { getWorkTypeList } from '/@/api/professional/rsbase/professionalworktype' import { getWorkTypeList } from '/@/api/professional/rsbase/professionalworktype'
import { makeExportTeacherInfoByTypeTask } from '/@/api/professional/professionalfile';
import { PROFESSIONAL_AUDIT_STATE_OPTIONS } from '/@/config/global' import { PROFESSIONAL_AUDIT_STATE_OPTIONS } from '/@/config/global'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
import { Medal } from '@element-plus/icons-vue' import { Medal } from '@element-plus/icons-vue'
@@ -391,27 +390,15 @@ const handleDel = (row: any) => {
// 导出 // 导出
const handleDownLoadWord = async () => { const handleDownLoadWord = async () => {
exportLoading.value = true exportLoading.value = true;
try { let params = Object.assign(search, { type: 'P20003' });
const response: any = await exportExcel(search) makeExportTeacherInfoByTypeTask(params).then((res: any) => {
message.success('后台下载进行中,请稍后查看任务列表');
const blob = new Blob([response as BlobPart]) });
const fileName = '职业资格信息.xls' setTimeout(() => {
const elink = document.createElement('a') exportLoading.value = false;
elink.download = fileName }, 3000); // 5分钟后自动关闭
elink.style.display = 'none' };
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
message.success('导出成功')
} catch (error) {
message.error('导出失败')
} finally {
exportLoading.value = false
}
}
// 获取资格等级名称 // 获取资格等级名称
const getQualificationLevelName = (id: string | number) => { const getQualificationLevelName = (id: string | number) => {

View File

@@ -84,10 +84,10 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="证书编" prop="certificateNumber"> <el-form-item label="证书编" prop="certificateNumber">
<el-input <el-input
v-model="dataForm.certificateNumber" v-model="dataForm.certificateNumber"
placeholder="请输入证书编(仅支持英文和数字)" placeholder="请输入证书编(仅支持英文和数字)"
clearable clearable
show-word-limit show-word-limit
maxlength="100" maxlength="100"
@@ -215,8 +215,8 @@ const formRules = computed(() => {
{ required: true, message: '请输入所学专业', trigger: 'blur' } { required: true, message: '请输入所学专业', trigger: 'blur' }
], ],
certificateNumber: [ certificateNumber: [
{ required: true, message: '请输入证书编', trigger: 'blur' }, { required: true, message: '请输入证书编', trigger: 'blur' },
{ pattern: /^[A-Za-z0-9]+$/, message: '证书编只能包含英文和数字', trigger: 'blur' } { pattern: /^[A-Za-z0-9]+$/, message: '证书编只能包含英文和数字', trigger: 'blur' }
] ]
} }

View File

@@ -241,14 +241,13 @@ import { useDict } from '/@/hooks/dict'
import { import {
fetchList, fetchList,
examObj, examObj,
delObj, delObj} from '/@/api/professional/professionaluser/professionalteacheracademicrelation'
exportExcel
} from '/@/api/professional/professionaluser/professionalteacheracademicrelation'
import { getDegreeList } from '/@/api/professional/rsbase/professionalacademicdegreeconfig' import { getDegreeList } from '/@/api/professional/rsbase/professionalacademicdegreeconfig'
import { getQualificationList } from '/@/api/professional/rsbase/academicqualificationsconfig' import { getQualificationList } from '/@/api/professional/rsbase/academicqualificationsconfig'
import { getAllTypeList } from '/@/api/professional/rsbase/professionalacademiceducationtypeconfig' import { getAllTypeList } from '/@/api/professional/rsbase/professionalacademiceducationtypeconfig'
import { PROFESSIONAL_AUDIT_STATE_OPTIONS } from '/@/config/global' import { PROFESSIONAL_AUDIT_STATE_OPTIONS } from '/@/config/global'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
import {makeExportTeacherInfoByTypeTask} from "/@/api/professional/professionalfile";
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue')) const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue')) const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue'))
const DataForm = defineAsyncComponent(() => import('./form.vue')) const DataForm = defineAsyncComponent(() => import('./form.vue'))
@@ -412,26 +411,14 @@ const handleDel = (row: any) => {
// 导出 // 导出
const handleDownLoadWord = async () => { const handleDownLoadWord = async () => {
exportLoading.value = true exportLoading.value = true;
try { let params = Object.assign(search, { type: 'P20005' });
const response: any = await exportExcel(search) makeExportTeacherInfoByTypeTask(params).then((res: any) => {
message.success('后台下载进行中,请稍后查看任务列表');
const blob = new Blob([response as BlobPart]) });
const fileName = '学历学位信息.xls' setTimeout(() => {
const elink = document.createElement('a') exportLoading.value = false;
elink.download = fileName }, 3000); // 5分钟后自动关闭
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
message.success('导出成功')
} catch (error) {
message.error('导出失败')
} finally {
exportLoading.value = false
}
} }
// 获取学位名称 // 获取学位名称

View File

@@ -212,9 +212,10 @@ import { getTeacherCertificateList } from '/@/api/professional/rsbase/profession
import { import {
fetchList, fetchList,
examObj, examObj,
delObj, delObj
exportExcel
} from '/@/api/professional/professionaluser/professionalteachercertificaterelation' } from '/@/api/professional/professionaluser/professionalteachercertificaterelation'
import { makeExportTeacherInfoByTypeTask } from '/@/api/professional/professionalfile';
import { PROFESSIONAL_AUDIT_STATE_OPTIONS } from '/@/config/global' import { PROFESSIONAL_AUDIT_STATE_OPTIONS } from '/@/config/global'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue')) const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
@@ -368,27 +369,15 @@ const handleDel = (row: any) => {
// 导出 // 导出
const handleDownLoadWord = async () => { const handleDownLoadWord = async () => {
exportLoading.value = true exportLoading.value = true;
try { let params = Object.assign(search, { type: 'P20004' });
const response: any = await exportExcel(search) makeExportTeacherInfoByTypeTask(params).then((res: any) => {
message.success('后台下载进行中,请稍后查看任务列表');
const blob = new Blob([response as BlobPart]) });
const fileName = '教师资格证信息.xls' setTimeout(() => {
const elink = document.createElement('a') exportLoading.value = false;
elink.download = fileName }, 3000); // 5分钟后自动关闭
elink.style.display = 'none' };
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
message.success('导出成功')
} catch (error) {
message.error('导出失败')
} finally {
exportLoading.value = false
}
}
// 获取证书名称 // 获取证书名称
const getCertificateName = (id: string | number) => { const getCertificateName = (id: string | number) => {

View File

@@ -243,6 +243,7 @@ import {
} from '/@/api/professional/professionaluser/professionalteacherhonor' } from '/@/api/professional/professionaluser/professionalteacherhonor'
import { PROFESSIONAL_AUDIT_STATE_OPTIONS, getStatusConfig } from '/@/config/global' import { PROFESSIONAL_AUDIT_STATE_OPTIONS, getStatusConfig } from '/@/config/global'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
import {makeExportTeacherInfoByTypeTask} from "/@/api/professional/professionalfile";
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue')) const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue')) const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue'))
const ClickableTag = defineAsyncComponent(() => import('/@/components/ClickableTag/index.vue')) const ClickableTag = defineAsyncComponent(() => import('/@/components/ClickableTag/index.vue'))
@@ -393,29 +394,14 @@ const handleDel = (row: any) => {
// 导出 // 导出
const handleDownLoadWord = async () => { const handleDownLoadWord = async () => {
exportLoading.value = true exportLoading.value = true;
try { let params = Object.assign(search, { type: 'P20006' });
const response = await fetchList({ makeExportTeacherInfoByTypeTask(params).then((res: any) => {
current: 1, message.success('后台下载进行中,请稍后查看任务列表');
size: 999999, });
...search setTimeout(() => {
}) exportLoading.value = false;
const data = response.data.records || [] }, 3000); // 5分钟后自动关闭
const tHeader = ['工号', '姓名', '荣誉', '表彰单位', '年份']
const filterVal = ['teacherNo', 'teacherName', 'honor', 'honorCompany', 'year']
// 动态导入导出工具
const { export_json_to_excel } = await import('/@/excel/Export2Excel.js')
const exportData = data.map((v: any) => filterVal.map((j: string) => v[j]))
export_json_to_excel(tHeader, exportData, '综合表彰.xls')
message.success('导出成功')
} catch (error) {
message.error('导出失败')
} finally {
exportLoading.value = false
}
} }
// 打开导入弹窗 // 打开导入弹窗

View File

@@ -5,74 +5,28 @@
<div class="content-block"> <div class="content-block">
<!-- 最上搜索区 --> <!-- 最上搜索区 -->
<div v-show="showSearch" class="content-block__filter"> <div v-show="showSearch" class="content-block__filter">
<search-form <search-form :model="search" ref="searchFormRef" @keyup-enter="handleFilter">
:model="search"
ref="searchFormRef"
@keyup-enter="handleFilter"
>
<template #default="{ visible }"> <template #default="{ visible }">
<template v-if="visible"> <template v-if="visible">
<el-form-item label="姓名" prop="realName"> <el-form-item label="姓名" prop="realName">
<el-input <el-input v-model="search.realName" clearable placeholder="请输入姓名" class="filter-input" />
v-model="search.realName"
clearable
placeholder="请输入姓名"
class="filter-input"
/>
</el-form-item> </el-form-item>
<el-form-item label="工号" prop="teacherNo"> <el-form-item label="工号" prop="teacherNo">
<el-input <el-input v-model="search.teacherNo" clearable placeholder="请输入工号" class="filter-input" />
v-model="search.teacherNo"
clearable
placeholder="请输入工号"
class="filter-input"
/>
</el-form-item> </el-form-item>
<el-form-item label="审核状态" prop="state"> <el-form-item label="审核状态" prop="state">
<el-select <el-select v-model="search.state" clearable placeholder="请选择审核状态" class="filter-select">
v-model="search.state" <el-option v-for="item in professionalState" :key="item.value" :label="item.label" :value="item.value" />
clearable
placeholder="请选择审核状态"
class="filter-select"
>
<el-option
v-for="item in professionalState"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="职称" prop="professionalTitleConfigId"> <el-form-item label="职称" prop="professionalTitleConfigId">
<el-select <el-select v-model="search.professionalTitleConfigId" clearable filterable placeholder="请选择职称" class="filter-select">
v-model="search.professionalTitleConfigId" <el-option v-for="item in professionalTitleList" :key="item.id" :label="item.professionalTitle" :value="item.id" />
clearable
filterable
placeholder="请选择职称"
class="filter-select"
>
<el-option
v-for="item in professionalTitleList"
:key="item.id"
:label="item.professionalTitle"
:value="item.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="专业技术职务" prop="majorStation"> <el-form-item label="专业技术职务" prop="majorStation">
<el-select <el-select v-model="search.majorStation" clearable filterable placeholder="请选择专业技术职务" class="filter-select">
v-model="search.majorStation" <el-option v-for="item in majorStationList" :key="item.id" :label="item.majorStationName" :value="item.id" />
clearable
filterable
placeholder="请选择专业技术职务"
class="filter-select"
>
<el-option
v-for="item in majorStationList"
:key="item.id"
:label="item.majorStationName"
:value="item.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
@@ -90,12 +44,9 @@
<div class="content-block__header"> <div class="content-block__header">
<div class="header-actions"> <div class="header-actions">
<div class="action-group"> <div class="action-group">
<el-button <el-button v-if="hasAuth('professional_professionaltitlerelation_add')" type="primary" icon="FolderAdd" @click="handleAdd"
v-if="hasAuth('professional_professionaltitlerelation_add')" >新增</el-button
type="primary" >
icon="FolderAdd"
@click="handleAdd"
>新增</el-button>
<el-button <el-button
v-if="hasAuth('professional_teacherbase_export')" v-if="hasAuth('professional_teacherbase_export')"
type="warning" type="warning"
@@ -103,21 +54,20 @@
icon="Download" icon="Download"
@click="handleDownLoadWord" @click="handleDownLoadWord"
:loading="exportLoading" :loading="exportLoading"
>导出信息</el-button> >导出信息</el-button
>
<el-button <el-button
v-auth="'professional_teacherinfo_import'" v-auth="'professional_teacherinfo_import'"
type="primary" type="primary"
plain plain
icon="UploadFilled" icon="UploadFilled"
:loading="exportLoading" :loading="exportLoading"
@click="handleImportDialog">导入信息 @click="handleImportDialog"
>导入信息
</el-button> </el-button>
</div> </div>
<div class="header-right"> <div class="header-right">
<RightToolbar <RightToolbar v-model:showSearch="showSearch" @queryTable="getDataList" />
v-model:showSearch="showSearch"
@queryTable="getDataList"
/>
</div> </div>
</div> </div>
</div> </div>
@@ -167,7 +117,8 @@
type="primary" type="primary"
link link
icon="Document" icon="Document"
@click="handlePreview(scope.row.srcList)">查看 @click="handlePreview(scope.row.srcList)"
>查看
</el-button> </el-button>
<span v-else class="empty-text">-</span> <span v-else class="empty-text">-</span>
</template> </template>
@@ -183,42 +134,43 @@
type="primary" type="primary"
link link
icon="edit-pen" icon="edit-pen"
@click="handleEdit(scope.row)">修改 @click="handleEdit(scope.row)"
>修改
</el-button> </el-button>
<el-button <el-button
v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canExam" v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canExam"
type="success" type="success"
link link
icon="CircleCheck" icon="CircleCheck"
@click="changeState(scope.row, 1)">通过 @click="changeState(scope.row, 1)"
>通过
</el-button> </el-button>
<el-button <el-button
v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canDeptExam" v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canDeptExam"
type="success" type="success"
link link
icon="CircleCheck" icon="CircleCheck"
@click="changeState(scope.row, 1)">部门通过 @click="changeState(scope.row, 1)"
>部门通过
</el-button> </el-button>
<el-button <el-button
v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canBack" v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canBack"
type="danger" type="danger"
link link
icon="CircleClose" icon="CircleClose"
@click="changeState(scope.row, -2)">驳回 @click="changeState(scope.row, -2)"
>驳回
</el-button> </el-button>
<el-button <el-button
v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canDeptBack" v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canDeptBack"
type="danger" type="danger"
link link
icon="CircleClose" icon="CircleClose"
@click="changeState(scope.row, -2)">部门驳回 @click="changeState(scope.row, -2)"
>部门驳回
</el-button> </el-button>
<el-button <el-button v-if="hasAuth('professional_professionaltitlerelation_del')" type="danger" link icon="delete" @click="handleDel(scope.row)"
v-if="hasAuth('professional_professionaltitlerelation_del')" >删除
type="danger"
link
icon="delete"
@click="handleDel(scope.row)">删除
</el-button> </el-button>
</div> </div>
</template> </template>
@@ -226,21 +178,12 @@
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<pagination <pagination v-bind="state.pagination" @current-change="currentChangeHandle" @size-change="sizeChangeHandle" />
v-bind="state.pagination"
@current-change="currentChangeHandle"
@size-change="sizeChangeHandle"
/>
</div> </div>
</div> </div>
<!-- 材料预览图片直接显示PDF 在组件内部 dialog 中显示 --> <!-- 材料预览图片直接显示PDF 在组件内部 dialog 中显示 -->
<preview-file <preview-file v-for="src in imgUrl" :key="src.title" :authSrc="src.url" dialog-title="职称材料" />
v-for="src in imgUrl"
:key="src.title"
:authSrc="src.url"
dialog-title="职称材料"
/>
<!-- 子组件 --> <!-- 子组件 -->
<MultiDialog ref="multiDialogRef" @getList="getDataList" :page="state.pagination" :nowRow="null" /> <MultiDialog ref="multiDialogRef" @getList="getDataList" :page="state.pagination" :nowRow="null" />
@@ -252,48 +195,44 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted, nextTick } from 'vue' import { ref, reactive, onMounted, nextTick } from 'vue';
import { BasicTableProps, useTable } from '/@/hooks/table' import { BasicTableProps, useTable } from '/@/hooks/table';
import { useAuth } from '/@/hooks/auth' import { useAuth } from '/@/hooks/auth';
import { useMessage } from '/@/hooks/message' import { useMessage } from '/@/hooks/message';
import { useMessageBox } from '/@/hooks/message' import { useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict' import { useDict } from '/@/hooks/dict';
// 接口 // 接口
import { import { fetchList, examObj, delObj } from '/@/api/professional/professionaluser/professionaltitlerelation';
fetchList, import { getProfessionalTitleList } from '/@/api/professional/rsbase/professionaltitlelevelconfig';
examObj, import { getMajorStationList } from '/@/api/professional/rsbase/professionalmajorstation';
delObj, import { makeExportTeacherInfoByTypeTask } from '/@/api/professional/professionalfile';
exportRelation import { defineAsyncComponent } from 'vue';
} 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 TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'));
const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue')) const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue'));
const MultiDialog = defineAsyncComponent(() => import('/@/views/professional/teacherbase/multiDialog.vue')) const MultiDialog = defineAsyncComponent(() => import('/@/views/professional/teacherbase/multiDialog.vue'));
const DataForm = defineAsyncComponent(() => import('./form.vue')) const DataForm = defineAsyncComponent(() => import('./form.vue'));
const ProfessionalBackResaon = defineAsyncComponent(() => import('/@/views/professional/common/professional-back-resaon.vue')) const ProfessionalBackResaon = defineAsyncComponent(() => import('/@/views/professional/common/professional-back-resaon.vue'));
const previewFile = defineAsyncComponent(() => import('/@/components/tools/preview-file.vue')) const previewFile = defineAsyncComponent(() => import('/@/components/tools/preview-file.vue'));
const ImportTeacherOtherInfo = defineAsyncComponent(() => import('/@/views/professional/common/import-teacher-other-info.vue')) const ImportTeacherOtherInfo = defineAsyncComponent(() => import('/@/views/professional/common/import-teacher-other-info.vue'));
// 无权限即无节点:使用 useAuth + v-if // 无权限即无节点:使用 useAuth + v-if
const { hasAuth } = useAuth() const { hasAuth } = useAuth();
// 消息提示 hooks // 消息提示 hooks
const message = useMessage() const message = useMessage();
const messageBox = useMessageBox() const messageBox = useMessageBox();
// 字典数据 // 字典数据
const { professional_state: professionalState } = useDict('professional_state') const { professional_state: professionalState } = useDict('professional_state');
// 表格引用 // 表格引用
const tableRef = ref() const tableRef = ref();
const searchFormRef = ref() const searchFormRef = ref();
const multiDialogRef = ref() const multiDialogRef = ref();
const dataFormRef = ref() const dataFormRef = ref();
const backReasonRef = ref() const backReasonRef = ref();
const showSearch = ref(true) // 方案 F默认收起筛选首屏仅一张大卡片 const showSearch = ref(true); // 方案 F默认收起筛选首屏仅一张大卡片
// 搜索表单数据 // 搜索表单数据
const search = reactive({ const search = reactive({
@@ -301,82 +240,85 @@ const search = reactive({
teacherNo: '', teacherNo: '',
realName: '', realName: '',
professionalTitleConfigId: '', professionalTitleConfigId: '',
majorStation: '' majorStation: '',
}) });
// 材料预览 // 材料预览
const imgUrl = ref<Array<{ title: string; url: string }>>([]) const imgUrl = ref<Array<{ title: string; url: string }>>([]);
// 导出加载状态 // 导出加载状态
const exportLoading = ref(false) const exportLoading = ref(false);
// 职称和专业技术职务列表 // 职称和专业技术职务列表
const professionalTitleList = ref<any[]>([]) const professionalTitleList = ref<any[]>([]);
const majorStationList = ref<any[]>([]) const majorStationList = ref<any[]>([]);
// 配置 useTable // 配置 useTable
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
pageList: async (params: any) => { pageList: async (params: any) => {
const response = await fetchList(params) const response = await fetchList(params);
const records = response.data.records || [] const records = response.data.records || [];
// 处理证明材料列表 // 处理证明材料列表
records.forEach((v: any) => { records.forEach((v: any) => {
if (v.evidence != null) { if (v.evidence != null) {
v.srcList = [v.evidence] v.srcList = [v.evidence];
} else { } else {
v.srcList = [] v.srcList = [];
} }
}) });
return { return {
data: { data: {
records, records,
total: response.data.total || 0 total: response.data.total || 0,
}
}
}, },
queryForm: search };
}) },
queryForm: search,
});
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state) const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state);
// 预览材料 // 预览材料
const handlePreview = (list: string[]) => { const handlePreview = (list: string[]) => {
imgUrl.value = [] imgUrl.value = [];
nextTick(() => { nextTick(() => {
list.forEach(v => { list.forEach((v) => {
imgUrl.value.push({ imgUrl.value.push({
title: '', title: '',
url: v url: v,
}) });
}) });
}) });
} };
// 审核状态变更 // 审核状态变更
const changeState = (row: any, val: number) => { const changeState = (row: any, val: number) => {
if (val === 1) { if (val === 1) {
const str = '通过' const str = '通过';
messageBox.confirm(`是否确认${str}${row.realName}的申请`).then(async () => { messageBox
.confirm(`是否确认${str}${row.realName}的申请`)
.then(async () => {
try { try {
await examObj({ await examObj({
id: row.id, id: row.id,
state: val state: val,
}) });
message.success('操作成功') message.success('操作成功');
getDataList() getDataList();
} catch (error: any) { } catch (error: any) {
// 处理业务错误 // 处理业务错误
} }
}).catch(() => {}) })
.catch(() => {});
} else if (val === -2) { } else if (val === -2) {
backReasonRef.value?.init(row, 'title') backReasonRef.value?.init(row, 'title');
} }
} };
// 查询 // 查询
const handleFilter = () => { const handleFilter = () => {
getDataList() getDataList();
} };
// 重置查询 // 重置查询
const resetQuery = () => { const resetQuery = () => {
@@ -385,103 +327,94 @@ const resetQuery = () => {
teacherNo: '', teacherNo: '',
realName: '', realName: '',
professionalTitleConfigId: '', professionalTitleConfigId: '',
majorStation: '' majorStation: '',
}) });
getDataList() getDataList();
} };
// 打开新增窗口 // 打开新增窗口
const handleAdd = () => { const handleAdd = () => {
dataFormRef.value?.openDialog() dataFormRef.value?.openDialog();
} };
// 打开编辑窗口 // 打开编辑窗口
const handleEdit = (row: any) => { const handleEdit = (row: any) => {
dataFormRef.value?.openDialog(row) dataFormRef.value?.openDialog(row);
} };
// 删除 // 删除
const handleDel = (row: any) => { const handleDel = (row: any) => {
messageBox.confirm('是否确认删除该条记录').then(async () => { messageBox
.confirm('是否确认删除该条记录')
.then(async () => {
try { try {
await delObj(row.id) await delObj(row.id);
message.success('删除成功') message.success('删除成功');
// 如果当前页只剩一条数据,且不是第一页,则跳转到上一页 // 如果当前页只剩一条数据,且不是第一页,则跳转到上一页
if (state.pagination && state.dataList && state.dataList.length === 1 && state.pagination.current && state.pagination.current > 1) { if (state.pagination && state.dataList && state.dataList.length === 1 && state.pagination.current && state.pagination.current > 1) {
state.pagination.current = state.pagination.current - 1 state.pagination.current = state.pagination.current - 1;
} }
getDataList() getDataList();
} catch (error: any) { } catch (error: any) {
// 处理业务错误 // 处理业务错误
message.error(error.msg) message.error(error.msg);
} }
}).catch(() => {}) })
} .catch(() => {});
};
// 导出 // 导出
const handleDownLoadWord = async () => { const handleDownLoadWord = async () => {
exportLoading.value = true exportLoading.value = true;
try { let params = Object.assign(search, { type: 'P20002' });
const response: any = await exportRelation(search) makeExportTeacherInfoByTypeTask(params).then((res: any) => {
message.success('后台下载进行中,请稍后查看任务列表');
const blob = new Blob([response as BlobPart]) });
const fileName = '职称信息.xls' setTimeout(() => {
const elink = document.createElement('a') exportLoading.value = false;
elink.download = fileName }, 3000); // 5分钟后自动关闭
elink.style.display = 'none' };
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
message.success('导出成功')
} catch (error) {
message.error('导出失败')
} finally {
exportLoading.value = false
}
}
// 获取职称名称 // 获取职称名称
const getProfessionalTitleName = (id: string | number) => { const getProfessionalTitleName = (id: string | number) => {
const item = professionalTitleList.value.find((item: any) => item.id === id) const item = professionalTitleList.value.find((item: any) => item.id === id);
return item ? item.professionalTitle : '-' return item ? item.professionalTitle : '-';
} };
// 获取专业技术职务名称 // 获取专业技术职务名称
const getMajorStationName = (id: string | number) => { const getMajorStationName = (id: string | number) => {
const item = majorStationList.value.find((item: any) => item.id === id) const item = majorStationList.value.find((item: any) => item.id === id);
return item ? item.majorStationName : '-' return item ? item.majorStationName : '-';
} };
// 加载字典数据 // 加载字典数据
const loadDictData = async () => { const loadDictData = async () => {
try { try {
// 加载职称列表 // 加载职称列表
const titleRes = await getProfessionalTitleList() const titleRes = await getProfessionalTitleList();
if (titleRes && titleRes.data) { if (titleRes && titleRes.data) {
professionalTitleList.value = titleRes.data professionalTitleList.value = titleRes.data;
} }
// 加载专业技术职务列表 // 加载专业技术职务列表
const majorRes = await getMajorStationList() const majorRes = await getMajorStationList();
if (majorRes && majorRes.data) { if (majorRes && majorRes.data) {
majorStationList.value = majorRes.data majorStationList.value = majorRes.data;
} }
} catch (error) { } catch (error) {
// Failed to load dict data // Failed to load dict data
} }
} };
const importTeacherOtherInfoRef=ref() const importTeacherOtherInfoRef = ref();
const handleImportDialog = () => { const handleImportDialog = () => {
importTeacherOtherInfoRef.value?.init('titleRelation') importTeacherOtherInfoRef.value?.init('titleRelation');
} };
// 初始化:仅加载下拉字典,表格数据由 useTable 在 createdIsNeed: true 时自动请求 // 初始化:仅加载下拉字典,表格数据由 useTable 在 createdIsNeed: true 时自动请求
onMounted(async () => { onMounted(async () => {
await loadDictData() await loadDictData();
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -1024,7 +1024,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="graduateSchool" label="毕业学校" min-width="180" align="center" show-overflow-tooltip /> <el-table-column prop="graduateSchool" label="毕业学校" min-width="180" align="center" show-overflow-tooltip />
<el-table-column prop="major" label="所学专业" min-width="150" align="center" show-overflow-tooltip /> <el-table-column prop="major" label="所学专业" min-width="150" align="center" show-overflow-tooltip />
<el-table-column prop="certificateNumber" label="证书编" min-width="120" align="center" /> <el-table-column prop="certificateNumber" label="证书编" min-width="120" align="center" />
<el-table-column label="学历证书" min-width="150" align="center"> <el-table-column label="学历证书" min-width="150" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button