保留学籍根据对应角色查看对应数据

This commit is contained in:
2025-11-18 11:48:03 +08:00
parent dcef075410
commit 3b4aa567f4
4 changed files with 92 additions and 96 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="studentName">
<el-form-item label="姓名" prop="studentName" v-if="!roleGroup.includes('学生')">
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="民族" prop="nation">
@@ -123,9 +123,11 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['routine:enlistmentReserve:edit']">修改</el-button>
v-hasPermi="['routine:enlistmentReserve:edit']" v-if="scope.row.applyStatus == 0">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['routine:enlistmentReserve:remove']">删除</el-button>
v-hasPermi="['routine:enlistmentReserve:remove']" v-if="scope.row.applyStatus == 0">删除</el-button>
<el-button v-if="scope.row.applyStatus == 1" size="mini" type="text" icon="el-icon-info"
@click="detail(scope.row)">详情</el-button>
</template>
</el-table-column>
</el-table>
@@ -213,8 +215,8 @@
</template>
<script>
import { listEnlistmentReserve, getEnlistmentReserve, delEnlistmentReserve, addEnlistmentReserve, updateEnlistmentReserve } from "@/api/routine/enlistmentReserve/enlistmentReserve";
import { listEnlistmentReserve, getOwnInfo, delEnlistmentReserve, addEnlistmentReserve, updateEnlistmentReserve } from "@/api/routine/enlistmentReserve/enlistmentReserve";
import { getUserProfile } from '@/api/system/user' // 获取当前登录用户
export default {
name: "EnlistmentReserve",
dicts: ['rt_classes', 'rt_nation', 'rt_grade'],
@@ -307,11 +309,13 @@ export default {
createTime: [
{ required: true, message: "提交时间不能为空", trigger: "blur" }
],
}
},
roleGroup: '',
user: ''
};
},
created() {
this.getList();
this.getUser();
},
methods: {
/** 查询应征入伍保留学籍申请列表 */
@@ -323,6 +327,26 @@ export default {
this.loading = false;
});
},
getUser() {
getUserProfile().then(response => {
this.user = response.data
this.roleGroup = response.roleGroup;
// this.postGroup = response.postGroup;
if (this.roleGroup) {
if (this.roleGroup.includes("学生")) {
this.queryParams.studentName = this.user.nickName
} else if (this.roleGroup.includes("辅导员")) {
getOwnInfo().then(res => {
if (res.data) {
this.queryParams.teacherName = res.data.teacherName
}
})
}
this.getList()
}
})
},
// 取消按钮
cancel() {
this.open = false;
@@ -429,17 +453,26 @@ export default {
}, `enlistmentReserve_${new Date().getTime()}.xlsx`)
},
// 跳转申请表
openForm () {
openForm() {
this.$router.push("/routine/enlistmentReserve/applicationForm")
}
},
detail(row) {
this.$router.push({
path: "/routine/enlistmentReserve/applicationForm",
query: { id: row.id } // 将 row.id 放在 query 中
})
},
}
};
</script>
<style scoped>
.text-ellipsis {
white-space: nowrap; /* 防止文本换行 */
overflow: hidden; /* 隐藏溢出的内容 */
text-overflow: ellipsis; /* 显示省略号 */
}
.text-ellipsis {
white-space: nowrap;
/* 防止文本换行 */
overflow: hidden;
/* 隐藏溢出的内容 */
text-overflow: ellipsis;
/* 显示省略号 */
}
</style>