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

123 lines
3.5 KiB
JavaScript

import { WeaTools } from 'ecCom';
import { postFetch } from "../util/request";
export const tips = params => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/tips', 'get', params);
};
export const getCondition = params => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/getSearchCondition', 'get', params);
};
//社保福利档案列表
export const queryList = (params) => {
return postFetch('/api/bs/hrmsalary/archives/getTable', params);
};
//社保福利档案列表
export const queryInsuranceTabTotal = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/queryInsuranceTabTotal', params);
};
//删除待办
export const updateRunStatus = (params) => {
return postFetch('/api/bs/hrmsalary/archives/updateRunStatus', params);
};
export const getTable = params => {
return fetch('/api/bs/hrmsalary/archives/getTable', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
};
export const getBaseForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/getBaseForm', 'get', params);
};
export const getPaymentForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/getPaymentForm', 'get', params);
};
// 保存
export const save = params => {
return fetch('/api/bs/hrmsalary/archives/save', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
};
// 导出档案
export const exportDocument = params => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/export', 'get', params);
};
// 导入档案 - 获取组件的一些前置参数
export const getImportDocumentParams = params => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/getImportParams', 'get', params);
};
// 导入档案- 导出现有数据
export const exportCurData = params => {
fetch('/api/bs/hrmsalary/scheme/template/export',{
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.blob().then(blob => {
var filename=`社保福利档案模板.xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
};
// 导入档案-预览
export const previewCurData = (params) => {
return fetch('/api/bs/hrmsalary/scheme/preview', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
// 档案导入
export const importBatch = (params) => {
return fetch('/api/bs/hrmsalary/scheme/importBatch', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
// 导出档案
export const exportArchives = (ids) => {
fetch('/api/bs/hrmsalary/scheme/export?ids=' + ids).then(res => res.blob().then(blob => {
var filename=`社保福利档案.xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
}