refactor: 合并 biz_support_unit/biz_execution_unit/biz_service_org 为 biz_org, 删除 2 张孤儿表, 改 biz_person.work_unit → org_id FK
主要改动: - SQL: biz_support_unit → biz_org, 加 org_type, 加 business_nature; 删 biz_execution_unit, biz_service_org - SQL: biz_project.support_unit_id/name + service_org_id/name → org_id/name/type - SQL: biz_meeting.support_unit_name → org_name - SQL: biz_person.work_unit → org_id (FK) - 后端: 新 BizOrg entity/mapper/service/controller - 后端: BizProject/BizMeeting 字段重命名 - 后端: 删 12 个 BizSupportUnit/BizExecutionUnit/BizServiceOrg Java 文件 - 后端: BizPersonImportVO.workUnit → orgName (导入时查 biz_org 取 org_id) - 后端: BizAuthController.registerExecutor 完整实现 (原 registerSupplier stub) - 前端: 新 admin/Orgs.vue + manager/Orgs.vue (原 SupportUnits) - 前端: RegisterExecutor.vue (原 RegisterSupplier, 单页 2 步) - 前端: sponsor/executor/manager 多个文件 workUnit → orgId/orgName 重命名 - 前端: 统一 supplier → executor, 业务命名 sponsor(赞助方) / executor(执行方=供应商) - 前端: 全工程 execution → executor (company type / role / person unit_type)
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 字典类型常量 (前端统一引用,避免拼写错误)
|
||||
export const DICT_TYPE = {
|
||||
DEPARTMENT: 'department', // 科室
|
||||
TITLE: 'title' // 医生职称
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉取某类型字典的启用项 (匿名可访问)
|
||||
* @param {string} type - DICT_TYPE.*
|
||||
* @returns {Promise<{value: number, label: string, raw: object}[]>}
|
||||
* - value: deptId/titleId
|
||||
* - label: name
|
||||
* - raw: 完整字段 (含 sort/status/...)
|
||||
*/
|
||||
export async function getActiveDict(type) {
|
||||
const url = `/business/dict/${type}/active`
|
||||
const r = await request({ url, method: 'get' })
|
||||
const raw = r.data || r || []
|
||||
const idField = type === DICT_TYPE.DEPARTMENT ? 'deptId' : 'titleId'
|
||||
return raw.map(item => ({
|
||||
value: item[idField],
|
||||
label: item.name,
|
||||
raw: item
|
||||
}))
|
||||
}
|
||||
|
||||
// ===== 管理员维护接口 =====
|
||||
export function listDepartments(query) {
|
||||
return request({ url: '/business/dict/department/list', method: 'get', params: query })
|
||||
}
|
||||
export function addDepartment(data) {
|
||||
return request({ url: '/business/dict/department', method: 'post', data })
|
||||
}
|
||||
export function updateDepartment(data) {
|
||||
return request({ url: '/business/dict/department', method: 'put', data })
|
||||
}
|
||||
export function deleteDepartments(ids) {
|
||||
return request({ url: `/business/dict/department/${ids}`, method: 'delete' })
|
||||
}
|
||||
|
||||
export function listTitles(query) {
|
||||
return request({ url: '/business/dict/title/list', method: 'get', params: query })
|
||||
}
|
||||
export function addTitle(data) {
|
||||
return request({ url: '/business/dict/title', method: 'post', data })
|
||||
}
|
||||
export function updateTitle(data) {
|
||||
return request({ url: '/business/dict/title', method: 'put', data })
|
||||
}
|
||||
export function deleteTitles(ids) {
|
||||
return request({ url: `/business/dict/title/${ids}`, method: 'delete' })
|
||||
}
|
||||
Reference in New Issue
Block a user