trunk/pc4mobx/organization/apis/department.js

137 lines
3.9 KiB
JavaScript
Raw Normal View History

2022-06-02 16:51:21 +08:00
import {
2024-06-17 14:30:17 +08:00
WeaTools,WeaLocaleProvider
2022-06-02 16:51:21 +08:00
} from 'ecCom'
2024-06-17 14:30:17 +08:00
const getLabel = WeaLocaleProvider.getLabel;
2022-06-02 16:51:21 +08:00
export const getSearchList = (params) => {
return fetch('/api/bs/hrmorganization/dept/listPage', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const deleteTableData = (params) => {
return fetch('/api/bs/hrmorganization/dept/deleteByIds', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const getAdvanceSearchCondition = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/getSearchCondition', 'GET', params);
}
2022-06-06 16:48:19 +08:00
export const getPostionTable = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/getJobListByPid', 'GET', params);
2022-06-02 16:51:21 +08:00
}
export const getCopyForm = (params) => {
2022-06-06 16:48:19 +08:00
return WeaTools.callApi('/api/bs/hrmorganization/dept/getCopyForm', 'GET', params);
}
export const getMergeForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/getMergeForm', 'GET', params);
}
2022-12-09 14:47:19 +08:00
export const version = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/save', 'POST', params);
}
2023-09-22 10:41:23 +08:00
2024-05-08 16:35:18 +08:00
export const exportData = () => {
return new Promise(resolve => {
fetch('/api/bs/hrmorganization/common/department/export').then(res => res.blob().then(blob => {
resolve();
2024-06-17 14:30:17 +08:00
var filename=`${getLabel(547606,'部门档案数据')}.xlsx`
2024-05-08 16:35:18 +08:00
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
});
2023-09-22 10:41:23 +08:00
}
2022-12-15 19:45:38 +08:00
export const selectVersions = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/getVersion', 'GET', params);
}
2022-06-06 16:48:19 +08:00
export const getTransferForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/getMoveForm', 'GET', params);
2022-06-02 16:51:21 +08:00
}
export const add = (params) => {
2022-12-08 18:06:21 +08:00
return WeaTools.callApi('/api/bs/hrmorganization/dept/saveBaseForm', 'POST', params);
2022-06-02 16:51:21 +08:00
}
export const copy = (params) => {
2022-06-06 16:48:19 +08:00
return fetch('/api/bs/hrmorganization/dept/copyDepartment', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const merge = (params) => {
return fetch('/api/bs/hrmorganization/dept/mergeDepartment', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const transfer = (params) => {
return fetch('/api/bs/hrmorganization/dept/moveDepartment', {
2022-06-02 16:51:21 +08:00
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const editResource = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/updateForm', 'POST', params);
}
export const updateForbiddenTag = (params) => {
return fetch('/api/bs/hrmorganization/dept/updateForbiddenTagById', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const getDeptForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/getSaveForm', 'GET', params);
}
export const getDeptExtendForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/getDeptBaseForm', 'GET', params);
}
export const getHasRight = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/getHasRight', 'GET', params);
}