109 lines
3.2 KiB
JavaScript
109 lines
3.2 KiB
JavaScript
import { WeaTools } from "ecCom";
|
|
import { postFetch } from "../util/request";
|
|
|
|
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 fetch(`/api/bs/hrmsalary/scheme/copyScheme?id=${params.id}&schemeName=${params.schemeName}`, {
|
|
method: "GET",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
}
|
|
}).then(res => res.json());
|
|
};
|
|
export const deleteScheme = params => {
|
|
return fetch("/api/bs/hrmsalary/scheme/delete", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
|
|
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);
|
|
return fetch("/api/bs/hrmsalary/sicategory/customCategoryList", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
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/updateCustomCategoryName", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
export const deleteCustomCategory = (params) => {
|
|
return postFetch("/api/bs/hrmsalary/sicategory/deleteCustomCategory", 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());
|
|
};
|