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

69 lines
2.0 KiB
JavaScript

import { WeaTools } from 'ecCom';
import { postFetch } from '../util/request';
//个税申报表-个税申报表列表
export const getDeclareList = params => {
return fetch('/api/bs/hrmsalary/taxdeclaration/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
//个税申报表-个税申报表表单
export const getDeclareForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/taxdeclaration/getForm', 'get', params);
}
//个税申报表-个税申报表生成
export const saveDeclare = params => {
return fetch('/api/bs/hrmsalary/taxdeclaration/save', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
//个税申报表-个税申报表相关信息
export const getDeclareInfo = params => {
return WeaTools.callApi('/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo', 'get', params);
}
// 个税申报表详情列表
export const getDetailList = params => {
return fetch('/api/bs/hrmsalary/taxdeclaration/detail/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
// 个税申报表导出
export const exportSalaryArchive = (id = "") => {
fetch('/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=' + id).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 withDrawTaxDeclaration = (params) => {
return postFetch('/api/bs/hrmsalary/taxdeclaration/withDrawTaxDeclaration', params);
}