Commit c3092767 by Sweet Zhang

对接出纳管理导出功能

parent 5bc9e590
...@@ -443,9 +443,8 @@ export function salarySummary(data) { ...@@ -443,9 +443,8 @@ export function salarySummary(data) {
// 薪资拆分应发信息汇总列表下载---待提供 // 薪资拆分应发信息汇总列表下载---待提供
export function exportPayRoll(data) { export function exportPayRoll(data) {
return request({ return request({
url:'csf/api/salarySplit/summary/page', url:'csf/api/salarySplit/export/summary/list',
method: 'post', method: 'post',
data: data, data: data,
responseType: 'blob'
}) })
} }
\ No newline at end of file
...@@ -107,8 +107,8 @@ const getList = async (searchParams = {}) => { ...@@ -107,8 +107,8 @@ const getList = async (searchParams = {}) => {
try { try {
const params = { const params = {
...searchParams, ...searchParams,
startMonth:searchParams.payoutMonth[0], startMonth:searchParams.payoutMonth ? searchParams.payoutMonth[0] : '',
endMonth:searchParams.payoutMonth[1], endMonth:searchParams.payoutMonth ? searchParams.payoutMonth[1] :'',
payoutMonth:undefined, payoutMonth:undefined,
pageNo: currentPage.value, pageNo: currentPage.value,
pageSize: pageSize.value pageSize: pageSize.value
...@@ -120,10 +120,6 @@ const getList = async (searchParams = {}) => { ...@@ -120,10 +120,6 @@ const getList = async (searchParams = {}) => {
pageTotal.value = response.data.page.total pageTotal.value = response.data.page.total
loading.value = false loading.value = false
} }
// 数据加载完成后,设置当前页的选中状态
nextTick(() => {
setCurrentPageSelection()
})
} catch (error) { } catch (error) {
loading.value = false loading.value = false
// ElMessage.error('获取数据失败') // ElMessage.error('获取数据失败')
...@@ -149,14 +145,21 @@ const handleReset = () => { ...@@ -149,14 +145,21 @@ const handleReset = () => {
const handleExport = async () => { const handleExport = async () => {
// 获取搜索参数 // 获取搜索参数
const params = searchFormRef.value?.getFormData() || {} let params = searchFormRef.value?.getFormData()
params = {
...params,
startMonth:params.payoutMonth ? params.payoutMonth[0] : '',
endMonth:params.payoutMonth ? params.payoutMonth[1] :'',
payoutMonth:undefined,
}
const response = await exportPayRoll(params) const response = await exportPayRoll(params)
const fileName = `薪资发放记录导出_${new Date().toLocaleString().replace(/\//g, '').replace(/:/g, '').replace(/\s/g, '')}.xlsx` if(response.data && response.data.url){
await safeDownload( window.open(response.data.url)
response, }else{
fileName, ElMessage.error('导出失败')
'application/vnd.ms-excel;charset=utf-8' }
)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment