This commit is contained in:
guochunsi
2026-01-30 16:29:15 +08:00
parent 53f71066f3
commit c6da6e286f
70 changed files with 688 additions and 519 deletions

View File

@@ -84,17 +84,17 @@
</template>
</search-form>
<!-- 操作按钮 -->
<!-- 操作按钮无权限不渲染 -->
<el-row>
<div class="mb15" style="width: 100%;">
<el-button
v-auth="'professional_professionaltitlerelation_add'"
<el-button
v-if="hasAuth('professional_professionaltitlerelation_add')"
type="primary"
icon="FolderAdd"
@click="handleAdd">
</el-button>
<el-button
v-auth="'professional_teacherbase_export'"
<el-button
v-if="hasAuth('professional_teacherbase_export')"
class="ml10"
type="warning"
plain
@@ -109,6 +109,7 @@
<el-table
ref="tableRef"
:data="state.dataList"
row-key="id"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
@@ -139,11 +140,7 @@
{{ getMajorStationName(scope.row.majorStation) }}
</template>
</el-table-column>
<!-- <el-table-column prop="changedTime" label="变动时间" width="180" align="center" />
<el-table-column prop="createTime" label="创建时间" width="180" align="center" /> -->
<el-table-column label="证明材料" width="120" align="center">
<template #default="scope">
<el-button
@@ -161,48 +158,43 @@
<el-table-column label="操作" width="280" align="center" fixed="right">
<template #default="scope">
<el-button
v-auth="'professional_professionaltitlerelation_edit'"
v-if="scope.row.state === '0' || scope.row.state === '-2'"
<el-button
v-if="hasAuth('professional_professionaltitlerelation_edit') && (scope.row.state === '0' || scope.row.state === '-2')"
type="primary"
link
icon="edit-pen"
@click="handleEdit(scope.row)">修改
</el-button>
<el-button
v-auth="'professional_professionaltitlerelation_exam'"
v-if="scope.row.canExam"
<el-button
v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canExam"
type="success"
link
icon="CircleCheck"
@click="changeState(scope.row, 1)">通过
</el-button>
<el-button
type="success"
link
icon="CircleCheck"
v-auth="'professional_professionaltitlerelation_exam'"
v-if="scope.row.canDeptExam"
@click="changeState(scope.row, 1)">部门通过
v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canDeptExam"
type="success"
link
icon="CircleCheck"
@click="changeState(scope.row, 1)">部门通过
</el-button>
<el-button
v-auth="'professional_professionaltitlerelation_exam'"
v-if="scope.row.canBack"
<el-button
v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canBack"
type="danger"
link
icon="CircleClose"
@click="changeState(scope.row, -2)">驳回
</el-button>
<el-button
type="danger"
link
v-auth="'professional_professionaltitlerelation_exam'"
icon="CircleClose"
v-if="scope.row.canDeptBack"
@click="changeState(scope.row, -2)">部门驳回
v-if="hasAuth('professional_professionaltitlerelation_exam') && scope.row.canDeptBack"
type="danger"
link
icon="CircleClose"
@click="changeState(scope.row, -2)">部门驳回
</el-button>
<el-button
v-auth="'professional_professionaltitlerelation_del'"
<el-button
v-if="hasAuth('professional_professionaltitlerelation_del')"
type="danger"
link
icon="delete"
@@ -239,6 +231,7 @@
<script setup lang="ts">
import { ref, reactive, onMounted, nextTick } from 'vue'
import { BasicTableProps, useTable } from '/@/hooks/table'
import { useAuth } from '/@/hooks/auth'
import { useMessage } from '/@/hooks/message'
import { useMessageBox } from '/@/hooks/message'
import { useDict } from '/@/hooks/dict'
@@ -260,7 +253,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'))
// 使用 Pinia store
// 无权限即无节点:使用 useAuth + v-if
const { hasAuth } = useAuth()
// 消息提示 hooks
const message = useMessage()
const messageBox = useMessageBox()
@@ -336,7 +331,6 @@ const handlePreview = (list: string[]) => {
// 审核状态变更
const changeState = (row: any, val: number) => {
if (val === 1) {
// 通过
const str = '通过'
messageBox.confirm(`是否确认${str}${row.realName}的申请`).then(async () => {
try {
@@ -348,11 +342,9 @@ const changeState = (row: any, val: number) => {
getDataList()
} catch (error: any) {
// 处理业务错误
message.error(error.msg)
}
}).catch(() => {})
} else if (val === -2) {
// 驳回
backReasonRef.value?.init(row, 'title')
}
}