This commit is contained in:
guochunsi
2026-01-27 13:48:18 +08:00
parent c5eea52c46
commit b3ea5ee1ee
25 changed files with 192 additions and 428 deletions

View File

@@ -59,13 +59,13 @@
type="primary"
icon="FolderAdd"
@click="handleAdd"
v-if="permissions.professional_professionalqualificationrelation_add">
v-auth="'professional_professionalqualificationrelation_add'">
</el-button>
<el-button
type="warning"
plain
icon="Download"
v-if="permissions.professional_teacherbase_export"
v-auth="'professional_teacherbase_export'"
@click="handleDownLoadWord"
:loading="exportLoading">导出信息
</el-button>
@@ -127,31 +127,34 @@
<el-table-column label="操作" width="280" align="center" fixed="right">
<template #default="scope">
<el-button
v-auth="'professional_professionalqualificationrelation_edit'"
v-if="scope.row.state === '0' || scope.row.state === '-2'"
type="primary"
link
icon="edit-pen"
v-if="permissions.professional_professionalqualificationrelation_edit && (scope.row.state === '0' || scope.row.state === '-2')"
@click="handleEdit(scope.row)">编辑
@click="handleEdit(scope.row)">修改
</el-button>
<el-button
v-auth="'professional_professionalqualificationrelation_exam'"
v-if="scope.row.state === '0'"
type="success"
link
icon="CircleCheck"
v-if="permissions.professional_professionalqualificationrelation_exam && scope.row.state === '0'"
@click="changeState(scope.row, 1)">通过
</el-button>
<el-button
v-auth="'professional_professionalqualificationrelation_exam'"
v-if="scope.row.state === '0' || scope.row.state === '1'"
type="danger"
link
icon="CircleClose"
v-if="permissions.professional_professionalqualificationrelation_exam && (scope.row.state === '0' || scope.row.state === '1')"
@click="changeState(scope.row, -2)">驳回
</el-button>
<el-button
v-auth="'professional_professionalqualificationrelation_del'"
type="danger"
link
icon="delete"
v-if="permissions.professional_professionalqualificationrelation_del"
style="margin-left: 12px"
@click="handleDel(scope.row)">删除
</el-button>
@@ -182,9 +185,7 @@
</template>
<script setup lang="ts">
import { ref, reactive, computed, onMounted, nextTick } from 'vue'
import { storeToRefs } from 'pinia'
import { useUserInfo } from '/@/stores/userInfo'
import { ref, reactive, onMounted, nextTick } from 'vue'
import { BasicTableProps, useTable } from '/@/hooks/table'
import { useMessage } from '/@/hooks/message'
import { useMessageBox } from '/@/hooks/message'
@@ -197,6 +198,7 @@ import {
} from '/@/api/professional/professionaluser/professionalqualificationrelation'
import { getLevelList } from '/@/api/professional/rsbase/professionalqualificationconfig'
import { getWorkTypeList } from '/@/api/professional/rsbase/professionalworktype'
import { PROFESSIONAL_AUDIT_STATE_OPTIONS } from '/@/config/global'
import { defineAsyncComponent } from 'vue'
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue'))
@@ -204,26 +206,9 @@ const DataForm = defineAsyncComponent(() => import('./form.vue'))
const ProfessionalBackResaon = defineAsyncComponent(() => import('/@/views/professional/common/professional-back-resaon.vue'))
const previewFile = defineAsyncComponent(() => import('/@/components/tools/preview-file.vue'))
// 审核状态选项(独立定义,防止其他页面修改时被波及)
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' }
]
// 审核状态选项
const auditStateOptions = PROFESSIONAL_AUDIT_STATE_OPTIONS
// 使用 Pinia store
const userInfoStore = useUserInfo()
const { userInfos } = storeToRefs(userInfoStore)
// 创建权限对象
const permissions = computed(() => {
const perms: Record<string, boolean> = {}
userInfos.value.authBtnList.forEach((perm: string) => {
perms[perm] = true
})
return perms
})
// 消息提示 hooks
const message = useMessage()
@@ -357,7 +342,7 @@ const handleDel = (row: any) => {
getDataList()
} catch (error: any) {
// 处理业务错误
message.error(error.msg)
}
}).catch(() => {})
}