Files
education/frontend/src/api/teachBusiness/training.js
T

123 lines
2.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import request from '@/utils/request'
// 人才培养方案(专业表 ZYB /training
// 接口依据:TrainingProgramController(前端 baseURL 为 /api,此处不重复 /api 前缀)
/**
* 新增培养方案(专业)
* POST /training/add
* 请求体(ZYB):zymc/pxcc/pxlx 必填;
* zydh 留空时按 ZYSEED01 规则生成;zydm 留空时按 ZSY001 规则生成;后端同时置 ty=false、qysj=当前时间
*/
export function addTraining(data) {
return request({
url: '/training/add',
method: 'post',
data
})
}
/**
* 停用(逻辑删除)培养方案
* POST /training/disable?zydh=
* @param zydh 专业代号(必填)
*/
export function disableTraining(zydh) {
return request({
url: '/training/disable',
method: 'post',
params: { zydh }
})
}
/**
* 更新培养方案
* POST /training/update
* 请求体(ZYB):zydh 必传
*/
export function updateTraining(data) {
return request({
url: '/training/update',
method: 'post',
data
})
}
/**
* 根据专业代号查询培养方案详情
* GET /training/get?zydh=
* @param zydh 专业代号
*/
export function getTraining(zydh) {
return request({
url: '/training/get',
method: 'get',
params: { zydh }
})
}
/**
* 分页条件查询培养方案列表
* GET /training/list
* 查询参数:zymc(模糊)、zydm(模糊)、pxlx(精确)、pxcc(精确)、pageNum、pageSize
* 返回:PageResult<ZYB>records/total
*/
export function listTraining(params) {
return request({
url: '/training/list',
method: 'get',
params
})
}
/**
* 导出培养方案到 Excel(返回 Blob)
* GET /training/export
*/
export function exportTrainingProgram() {
return request({
url: '/training/export',
method: 'get',
responseType: 'blob'
})
}
/**
* 下载培养方案导入模板(返回 Blob)
* GET /download/training-program
*/
export function downloadTrainingProgramTemplate() {
return request({
url: '/download/training-program',
method: 'get',
responseType: 'blob'
})
}
/**
* 教学管理机构下拉选项
* GET /training/teaching-organizations
* 返回:[{ bh, mc }]
*/
export function listTeachingOrganizations() {
return request({
url: '/training/teaching-organizations',
method: 'get'
})
}
/**
* 导入培养方案 Excelmultipart,字段名 file
* POST /training/import
*/
export function importTrainingProgram(file) {
const formData = new FormData()
formData.append('file', file)
return request({
url: '/training/import',
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
})
}