新增教研室和教员的时候,同步创建部门和教员账号

This commit is contained in:
2026-09-17 12:00:44 +08:00
parent f7299c36e8
commit 95a3571c69
25 changed files with 1452 additions and 50 deletions
@@ -100,3 +100,16 @@ export function endPublishTeachingTask(bh) {
params: { bh }
})
}
/**
* 导出教学任务书 Excel(该任务下全部教研室任务书课程明细)
* GET /teachingTask/exportTaskBook?bh=
*/
export function exportTaskBook(bh) {
return request({
url: '/teachingTask/exportTaskBook',
method: 'get',
params: { bh },
responseType: 'blob'
})
}
+37 -7
View File
@@ -9,30 +9,32 @@ export function listOffice(query) {
})
}
// 新增教研室
export function addOffice(data) {
// 新增教研室(syncDept=true 时同步创建组织部门)
export function addOffice(data, syncDept) {
return request({
url: '/jys/office/add',
method: 'post',
params: syncDept === undefined ? {} : { syncDept },
data: data
})
}
// 更新教研室
export function updateOffice(data) {
// 更新教研室(syncDeptName=true 时将名称/序号同步到关联部门)
export function updateOffice(data, syncDeptName) {
return request({
url: '/jys/office/update',
method: 'post',
params: syncDeptName === undefined ? {} : { syncDeptName },
data: data
})
}
// 停用教研室(jysdh 必传,query 参数)
export function disableOffice(jysdh) {
// 停用教研室(jysdh 必传,query 参数;syncDept=true 时联动停用部门)
export function disableOffice(jysdh, syncDept) {
return request({
url: '/jys/office/disable',
method: 'post',
params: { jysdh: jysdh }
params: syncDept === undefined ? { jysdh } : { jysdh, syncDept }
})
}
@@ -44,3 +46,31 @@ export function downloadOfficeTemplate() {
responseType: 'blob'
})
}
// 单个教研室补建/对齐组织部门
export function syncOfficeDept(jysdh) {
return request({
url: '/jys/office/sync-dept',
method: 'post',
params: { jysdh }
})
}
// 对齐组织部门:批量创建/复用(ids 不传 = 全部教研室)
export function alignDepts(ids) {
return request({
url: '/jys/org/align-dept',
method: 'post',
data: ids ? { ids } : {},
timeout: 120000
})
}
// 一键对齐:先部门后账号(幂等,返回 { dept, user } 两环节结果)
export function alignApply() {
return request({
url: '/jys/org/align-apply',
method: 'post',
timeout: 180000
})
}
+54
View File
@@ -73,3 +73,57 @@ export function updateTeacherAttribute(data) {
data
})
}
/** 下载教员导入模板 GET /download/jy */
export function downloadTeacherTemplate() {
return request({
url: '/download/jy',
method: 'get',
responseType: 'blob'
})
}
/** 导出教员 Excel GET /jys/teacher/export */
export function exportTeacher(params) {
return request({
url: '/jys/teacher/export',
method: 'get',
params,
responseType: 'blob'
})
}
/** 导入教员 Excel POST /jys/teacher/import */
export function importTeacher(file) {
const formData = new FormData()
formData.append('file', file)
return request({
url: '/jys/teacher/import',
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' },
timeout: 60000
})
}
/** 单个教员补建/对齐系统账号 POST /jys/teacher/sync-user */
export function syncTeacherUser(jybh, params) {
return request({
url: '/jys/teacher/sync-user',
method: 'post',
params: Object.assign({ jybh }, params || {})
})
}
/**
* 对齐到用户表:为无账号教员批量建账号
* POST /jys/teacher/align-user body: { ids }(不传 = 全部无账号教员)
*/
export function alignTeacherUsers(ids) {
return request({
url: '/jys/teacher/align-user',
method: 'post',
data: ids && ids.length ? { ids } : {},
timeout: 180000
})
}