import { WeaTools } from 'ecCom'; 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 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); })) }