salary-management-front/pc4mobx/hrmSalary/apis/welfareScheme.js

85 lines
2.7 KiB
JavaScript

import { WeaTools } from 'ecCom';
export const getForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/scheme/getForm', 'get', params);
};
export const getTable = params => {
// return WeaTools.callApi('/api/bs/hrmsalary/scheme/getTable', 'get', params);
return fetch('/api/bs/hrmsalary/scheme/getTable', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
};
export const createScheme = params => {
return fetch('/api/bs/hrmsalary/scheme/insert', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
};
export const updateScheme = params => {
return fetch('/api/bs/hrmsalary/scheme/update', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
};
export const getCopyForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/scheme/copyForm', 'get', params);
};
export const copyScheme = params => {
return WeaTools.callApi('/api/bs/hrmsalary/scheme/copyScheme', 'get', params);
};
export const getCustomCategoryForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/sicategory/customCategoryForm', 'get', params);
};
export const getCustomCategoryList = params => {
return WeaTools.callApi('/api/bs/hrmsalary/sicategory/customCategoryList', 'get', params);
};
export const createSICategory = params => {
return fetch('/api/bs/hrmsalary/sicategory/createSICategory', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
};
export const updateCustomCategory = params => {
return fetch('/api/bs/hrmsalary/sicategory/updateCustomCategory', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
};
export const deleteCustomCategory = params => {
return WeaTools.callApi('/api/bs/hrmsalary/sicategory/deleteCustomCategory', 'post', params);
};
export const updateCustomCategoryStatus = params => {
return fetch('/api/bs/hrmsalary/sicategory/updateCustomCategoryStatus', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
};