更新后端
This commit is contained in:
1 parent
20bc65b1f3
commit
e297a4871f
8 files changed
+2292
No files matched your search
@@ -0,0 +1,285 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 组织架构相关接口
|
||||
|
||||
// 获取组织架构列表
|
||||
export function getOrganizationList(params) {
|
||||
return request({
|
||||
url: '/backend/erp/getOrganization',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获取组织架构详情
|
||||
export function getOrganizationDetail(id) {
|
||||
return request({
|
||||
url: `/backend/erp/getOrganizationDetail/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 创建组织架构
|
||||
export function createOrganization(data) {
|
||||
return request({
|
||||
url: '/backend/erp/createOrganization',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新组织架构
|
||||
export function updateOrganization(id, data) {
|
||||
return request({
|
||||
url: `/backend/erp/editOrganization/${id}`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除组织架构
|
||||
export function deleteOrganization(id) {
|
||||
return request({
|
||||
url: `/backend/erp/deleteOrganization/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取企业单位列表
|
||||
export function getCompanyList(params) {
|
||||
return request({
|
||||
url: '/backend/erp/getCompanys',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获取部门列表
|
||||
export function getDepartmentList(params) {
|
||||
return request({
|
||||
url: '/backend/erp/getDepartments',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 员工相关接口
|
||||
|
||||
// 获取员工列表
|
||||
export function getEmployeeList(params) {
|
||||
return request({
|
||||
url: '/backend/erp/getEmployee',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获取员工详情
|
||||
export function getEmployeeDetail(id) {
|
||||
return request({
|
||||
url: `/backend/erp/getEmployeeDetail/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 创建员工
|
||||
export function createEmployee(data) {
|
||||
return request({
|
||||
url: '/backend/erp/createEmployee',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新员工
|
||||
export function updateEmployee(id, data) {
|
||||
return request({
|
||||
url: `/backend/erp/editEmployee/${id}`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除员工
|
||||
export function deleteEmployee(id) {
|
||||
return request({
|
||||
url: `/backend/erp/deleteEmployee/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 职位相关接口
|
||||
|
||||
// 获取职位列表
|
||||
export function getPositionList(params) {
|
||||
return request({
|
||||
url: '/backend/erp/getPosition',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获取职位详情
|
||||
export function getPositionDetail(id) {
|
||||
return request({
|
||||
url: `/backend/erp/getPositionDetail/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 创建职位
|
||||
export function createPosition(data) {
|
||||
return request({
|
||||
url: '/backend/erp/createPosition',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新职位
|
||||
export function updatePosition(id, data) {
|
||||
return request({
|
||||
url: `/backend/erp/editPosition/${id}`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除职位
|
||||
export function deletePosition(id) {
|
||||
return request({
|
||||
url: `/backend/erp/deletePosition/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 组织设置相关接口
|
||||
|
||||
// 获取组织设置
|
||||
export function getOrgSettings() {
|
||||
return request({
|
||||
url: '/backend/erp/getOrgSettings',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 保存组织设置
|
||||
export function saveOrgSettings(data) {
|
||||
return request({
|
||||
url: '/backend/erp/saveOrgSettings',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 组织架构导出
|
||||
export function exportOrganization(params) {
|
||||
return request({
|
||||
url: '/backend/erp/exportOrganization',
|
||||
method: 'get',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 组织架构导入
|
||||
export function importOrganization(data) {
|
||||
return request({
|
||||
url: '/backend/erp/importOrganization',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 批量操作组织
|
||||
export function batchOrganizeOrganizations(ids, action) {
|
||||
return request({
|
||||
url: '/backend/erp/batchOrganizeOrganizations',
|
||||
method: 'post',
|
||||
data: {
|
||||
ids,
|
||||
action
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 获取组织架构统计信息
|
||||
export function getOrganizationStats() {
|
||||
return request({
|
||||
url: '/backend/erp/getOrganizationStats',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取组织架构树形结构
|
||||
export function getOrganizationTree(params) {
|
||||
return request({
|
||||
url: '/backend/erp/getOrganizationTree',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 搜索组织架构
|
||||
export function searchOrganizations(keyword) {
|
||||
return request({
|
||||
url: '/backend/erp/searchOrganizations',
|
||||
method: 'get',
|
||||
params: { keyword }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取组织架构下的所有员工
|
||||
export function getOrganizationEmployees(orgId) {
|
||||
return request({
|
||||
url: `/backend/erp/getOrganizationEmployees/${orgId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 移动员工到其他组织
|
||||
export function moveEmployeeToOrg(employeeId, orgId) {
|
||||
return request({
|
||||
url: '/backend/erp/moveEmployeeToOrg',
|
||||
method: 'post',
|
||||
data: {
|
||||
employee_id: employeeId,
|
||||
org_id: orgId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 获取组织架构层级关系
|
||||
export function getOrganizationHierarchy(orgId) {
|
||||
return request({
|
||||
url: `/backend/erp/getOrganizationHierarchy/${orgId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 验证组织编码唯一性
|
||||
export function checkOrgCodeUnique(orgCode, excludeId) {
|
||||
return request({
|
||||
url: '/backend/erp/checkOrgCodeUnique',
|
||||
method: 'get',
|
||||
params: {
|
||||
org_code: orgCode,
|
||||
exclude_id: excludeId || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 验证员工账号唯一性
|
||||
export function checkEmployeeAccountUnique(account, excludeId) {
|
||||
return request({
|
||||
url: '/backend/erp/checkEmployeeAccountUnique',
|
||||
method: 'get',
|
||||
params: {
|
||||
account,
|
||||
exclude_id: excludeId || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user