forked from liweijie/education
添加一个复职的功能,页面操作列按钮分成两行展示,添加根据离职过滤
This commit is contained in:
+15
-1
@@ -213,6 +213,18 @@ public class JYSController {
|
|||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复职(还原离职状态)教员
|
||||||
|
*
|
||||||
|
* @param jybh 教员编号
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||||
|
@PostMapping("/teacher/enable")
|
||||||
|
public Result<Void> enableTeacher(@RequestParam("jybh") String jybh) {
|
||||||
|
facultyService.enableJYB(jybh);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单个教员补建/对齐系统账号(幂等:已有账号直接返回用户编号)。
|
* 单个教员补建/对齐系统账号(幂等:已有账号直接返回用户编号)。
|
||||||
*/
|
*/
|
||||||
@@ -303,7 +315,8 @@ public class JYSController {
|
|||||||
@RequestParam(required = false) String jyxm,
|
@RequestParam(required = false) String jyxm,
|
||||||
@RequestParam(required = false) String jysdh,
|
@RequestParam(required = false) String jysdh,
|
||||||
@RequestParam(required = false) String zc,
|
@RequestParam(required = false) String zc,
|
||||||
@RequestParam(required = false) String jylb) {
|
@RequestParam(required = false) String jylb,
|
||||||
|
@RequestParam(required = false) Integer lzzt) {
|
||||||
PageQuery query = new PageQuery();
|
PageQuery query = new PageQuery();
|
||||||
query.setPageNum(pageNum);
|
query.setPageNum(pageNum);
|
||||||
query.setPageSize(pageSize);
|
query.setPageSize(pageSize);
|
||||||
@@ -312,6 +325,7 @@ public class JYSController {
|
|||||||
cond.setJysdh(jysdh);
|
cond.setJysdh(jysdh);
|
||||||
cond.setZc(zc);
|
cond.setZc(zc);
|
||||||
cond.setJylb(jylb);
|
cond.setJylb(jylb);
|
||||||
|
cond.setLzzt(lzzt);
|
||||||
PageResult<TeacherListVO> pageResult = facultyService.pageJYBDetail(query, cond);
|
PageResult<TeacherListVO> pageResult = facultyService.pageJYBDetail(query, cond);
|
||||||
return Result.success(pageResult);
|
return Result.success(pageResult);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,11 +75,20 @@
|
|||||||
t."虚实类型" AS xslx,
|
t."虚实类型" AS xslx,
|
||||||
t."教研室代号" AS jysdh,
|
t."教研室代号" AS jysdh,
|
||||||
t."用户编号" AS yhbh,
|
t."用户编号" AS yhbh,
|
||||||
t."部门编号" AS bmbh
|
t."部门编号" AS bmbh,
|
||||||
|
t."离职状态" AS lzzt
|
||||||
FROM "教员表" t
|
FROM "教员表" t
|
||||||
LEFT JOIN "教员属性" s ON s."教员编号" = t."教员编号"
|
LEFT JOIN "教员属性" s ON s."教员编号" = t."教员编号"
|
||||||
LEFT JOIN "教研室表" j ON j."教研室代号" = t."教研室代号"
|
LEFT JOIN "教研室表" j ON j."教研室代号" = t."教研室代号"
|
||||||
WHERE t."离职状态" = 0
|
WHERE 1=1
|
||||||
|
<choose>
|
||||||
|
<when test="jyb.lzzt != null">
|
||||||
|
AND t."离职状态" = #{jyb.lzzt}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
AND t."离职状态" = 0
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
<if test="jyb.jyxm != null and jyb.jyxm != ''">
|
<if test="jyb.jyxm != null and jyb.jyxm != ''">
|
||||||
AND t."教员姓名" LIKE CONCAT('%', #{jyb.jyxm}, '%')
|
AND t."教员姓名" LIKE CONCAT('%', #{jyb.jyxm}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -79,6 +79,11 @@ public interface FacultyService {
|
|||||||
*/
|
*/
|
||||||
void disableJYB(String jYBH);
|
void disableJYB(String jYBH);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复职(还原离职状态)教员
|
||||||
|
*/
|
||||||
|
void enableJYB(String jYBH);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新教员基本信息
|
* 更新教员基本信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
+17
@@ -299,6 +299,23 @@ public class FacultyServiceImpl implements FacultyService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void enableJYB(String jybh) {
|
||||||
|
JYB before = jybMapper.selectById(jybh);
|
||||||
|
JYB entity = new JYB();
|
||||||
|
entity.setJybh(jybh);
|
||||||
|
entity.setLzzt(0);
|
||||||
|
jybMapper.updateById(entity);
|
||||||
|
// 复职同步启用关联账号
|
||||||
|
if (before != null) {
|
||||||
|
JYB after = new JYB();
|
||||||
|
after.setJybh(jybh);
|
||||||
|
after.setLzzt(0);
|
||||||
|
orgSyncService.syncTeacherAccount(before, after);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateJYB(JYB entity) {
|
public void updateJYB(JYB entity) {
|
||||||
|
|||||||
@@ -55,4 +55,7 @@ public class TeacherListVO {
|
|||||||
|
|
||||||
/** 部门编号(SYS_DEPT.DEPT_ID) */
|
/** 部门编号(SYS_DEPT.DEPT_ID) */
|
||||||
private Long bmbh;
|
private Long bmbh;
|
||||||
|
|
||||||
|
/** 离职状态(0-在职 1-离职) */
|
||||||
|
private Integer lzzt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,15 @@ export function disableTeacher(jybh) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 教员复职(还原离职状态)POST /jys/teacher/enable?jybh= */
|
||||||
|
export function enableTeacher(jybh) {
|
||||||
|
return request({
|
||||||
|
url: '/jys/teacher/enable',
|
||||||
|
method: 'post',
|
||||||
|
params: { jybh }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/** 查询教员属性 GET /jys/teacher/attribute/get?jybh= */
|
/** 查询教员属性 GET /jys/teacher/attribute/get?jybh= */
|
||||||
export function getTeacherAttribute(jybh) {
|
export function getTeacherAttribute(jybh) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -24,6 +24,14 @@
|
|||||||
<el-input v-model="searchForm.jylb" placeholder="请输入" clearable />
|
<el-input v-model="searchForm.jylb" placeholder="请输入" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="状态">
|
||||||
|
<el-radio-group v-model="searchForm.lzzt" @change="handleSearch">
|
||||||
|
<el-radio label="0">在职</el-radio>
|
||||||
|
<el-radio label="1">离职</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="search-actions">
|
<div class="search-actions">
|
||||||
@@ -45,7 +53,7 @@
|
|||||||
<el-button type="success" plain icon="el-icon-refresh" :loading="alignLoading" @click="handleAlignUsers">对齐到用户表</el-button>
|
<el-button type="success" plain icon="el-icon-refresh" :loading="alignLoading" @click="handleAlignUsers">对齐到用户表</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table v-loading="loading" :data="tableData" stripe border highlight-current-row
|
<el-table ref="teacherTable" v-loading="loading" :data="tableData" stripe border highlight-current-row
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
@@ -75,12 +83,16 @@
|
|||||||
@click="handleCreateAccount(row)">创建账号</el-button>
|
@click="handleCreateAccount(row)">创建账号</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" fixed="right" class-name="table-action-column" width="260">
|
<el-table-column label="操作" align="center" fixed="right" width="180">
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
|
<div class="op-btn-grid">
|
||||||
<el-button type="text" size="small" icon="el-icon-view" @click="handleViewAttribute(row)">查看属性</el-button>
|
<el-button type="text" size="small" icon="el-icon-view" @click="handleViewAttribute(row)">查看属性</el-button>
|
||||||
<el-button type="text" size="small" icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
|
<el-button type="text" size="small" icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
|
||||||
<el-button type="text" size="small" icon="el-icon-date" @click="handleTeacherCalendar(row)">教员历</el-button>
|
<el-button type="text" size="small" icon="el-icon-date" @click="handleTeacherCalendar(row)">教员历</el-button>
|
||||||
<el-button type="text" size="small" class="danger-text" @click="handleDisable(row)">离职</el-button>
|
<el-button v-if="Number(row.lzzt) === 1" type="text" size="small" class="success-text"
|
||||||
|
@click="handleEnable(row)">复职</el-button>
|
||||||
|
<el-button v-else type="text" size="small" class="danger-text" @click="handleDisable(row)">离职</el-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -718,6 +730,7 @@ import {
|
|||||||
addTeacher,
|
addTeacher,
|
||||||
updateTeacher,
|
updateTeacher,
|
||||||
disableTeacher,
|
disableTeacher,
|
||||||
|
enableTeacher,
|
||||||
getTeacherAttribute,
|
getTeacherAttribute,
|
||||||
updateTeacherAttribute,
|
updateTeacherAttribute,
|
||||||
downloadTeacherTemplate,
|
downloadTeacherTemplate,
|
||||||
@@ -739,7 +752,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 查询条件(仅后端 JYBMapper.xml 支持的字段:jyxm 模糊 / jysdh 等值 / zc 模糊 / jylb 等值)
|
// 查询条件(仅后端 JYBMapper.xml 支持的字段:jyxm 模糊 / jysdh 等值 / zc 模糊 / jylb 等值)
|
||||||
searchForm: { jyxm: '', jysdh: '', zc: '', jylb: '' },
|
searchForm: { jyxm: '', jysdh: '', zc: '', jylb: '', lzzt: '0' },
|
||||||
|
|
||||||
// 列表
|
// 列表
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -946,7 +959,7 @@ export default {
|
|||||||
// ==================== 列表 ====================
|
// ==================== 列表 ====================
|
||||||
buildQuery() {
|
buildQuery() {
|
||||||
const params = {}
|
const params = {}
|
||||||
;['jyxm', 'jysdh', 'zc', 'jylb'].forEach(key => {
|
;['jyxm', 'jysdh', 'zc', 'jylb', 'lzzt'].forEach(key => {
|
||||||
const value = this.searchForm[key]
|
const value = this.searchForm[key]
|
||||||
if (value !== '' && value !== null && value !== undefined) {
|
if (value !== '' && value !== null && value !== undefined) {
|
||||||
params[key] = String(value).trim()
|
params[key] = String(value).trim()
|
||||||
@@ -967,6 +980,9 @@ export default {
|
|||||||
this.tableData = data.records || []
|
this.tableData = data.records || []
|
||||||
this.pagination.total = data.total || 0
|
this.pagination.total = data.total || 0
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.teacherTable && this.$refs.teacherTable.doLayout()
|
||||||
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.pagination.total = 0
|
this.pagination.total = 0
|
||||||
@@ -980,7 +996,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleReset() {
|
handleReset() {
|
||||||
this.searchForm = { jyxm: '', jysdh: '', zc: '', jylb: '' }
|
this.searchForm = { jyxm: '', jysdh: '', zc: '', jylb: '', lzzt: '0' }
|
||||||
this.pagination.pageNum = 1
|
this.pagination.pageNum = 1
|
||||||
this.fetchList()
|
this.fetchList()
|
||||||
},
|
},
|
||||||
@@ -1172,6 +1188,24 @@ export default {
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ==================== 复职(还原离职状态) ====================
|
||||||
|
handleEnable(row) {
|
||||||
|
if (!row.jybh) {
|
||||||
|
this.$message.warning('当前行缺少教员编号')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$confirm(`确定要办理教员「${row.jyxm || row.jybh}」复职吗?`, '系统提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
enableTeacher(row.jybh).then(() => {
|
||||||
|
this.$message.success('已办理复职')
|
||||||
|
this.fetchList()
|
||||||
|
}).catch(() => {})
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
|
||||||
// ==================== 教员属性 ====================
|
// ==================== 教员属性 ====================
|
||||||
handleViewAttribute(row) {
|
handleViewAttribute(row) {
|
||||||
this.attributeMode = 'view'
|
this.attributeMode = 'view'
|
||||||
@@ -1352,6 +1386,17 @@ export default {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.teacher-page {
|
.teacher-page {
|
||||||
|
.op-btn-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
justify-items: center;
|
||||||
|
row-gap: 2px;
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.search-card {
|
.search-card {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
|
||||||
@@ -1414,6 +1459,10 @@ export default {
|
|||||||
color: #f56c6c;
|
color: #f56c6c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.success-text {
|
||||||
|
color: #67c23a;
|
||||||
|
}
|
||||||
|
|
||||||
.account-section {
|
.account-section {
|
||||||
.section-title {
|
.section-title {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|||||||
Reference in New Issue
Block a user