diff --git a/src/views/moneyManage/receiveDetail/receiveFinance.vue b/src/views/moneyManage/receiveDetail/receiveFinance.vue index 46be806..711a22d 100644 --- a/src/views/moneyManage/receiveDetail/receiveFinance.vue +++ b/src/views/moneyManage/receiveDetail/receiveFinance.vue @@ -58,6 +58,8 @@
查询 重置 + 导出excel + 查看导出列表
@@ -231,6 +233,38 @@ + + + + + + + + + + + + + + + + + @@ -688,6 +722,80 @@ const closeConfirmRefund = () => { textContent.value = '' } +//导出相关 +const exportListVisible = ref(false) +const exportList = ref([]) +const exportExcel = async function () { + const statusParam = ref([30, 32, 40, 41])// 默认:看不到进度没到这里的 + if (searchData.value.statuses === '待审核') { + statusParam.value = [30] + } else if (searchData.value.statuses === '审核通过') { + statusParam.value = [40] + } else if (searchData.value.statuses === '已驳回') { + statusParam.value = [32] + } else if (searchData.value.statuses === '退款成功') { + statusParam.value = [41] + } else { + statusParam.value = [30, 32, 40, 41] + } + + const params = { + pageNum: pagination.value.pageNum, + pageSize: pagination.value.pageSize, + cashRecordDTO: { + jwcode: searchData.value.jwcode, + name: searchData.value.name, + markets: searchData.value.markets, + goodsNames: searchData.value.goodsName, + statuses: statusParam.value, + paymentCurrency: searchData.value.paymentCurrency, + payType: searchData.value.payType, + startTime: getTime.value && getTime.value[0] ? dayjs(getTime.value[0]).format('YYYY-MM-DD HH:mm:ss') : "", + endTime: getTime.value && getTime.value[1] ? dayjs(getTime.value[1]).format('YYYY-MM-DD HH:mm:ss') : "", + adminId: adminData.value.id + } + } + + const res = await API({ url: '/export/exportFinance', data: params }) + if (res.code === 200) { + ElMessage.success('导出成功') + } else { + ElMessage.error(res.msg || '导出失败') + } +} +const openExportList = () => { + getExportList() + exportListVisible.value = true +} +const getExportList = async () => { + exportListLoading.value = true + try { + const result = await API({ url: '/export/export' }) + if (result.code === 200) { + const filteredData = result.data.filter(item => { + return item.type === 12 + }) + exportList.value = filteredData + } else { + ElMessage.error(result.msg || '获取导出列表失败') + } + } catch (error) { + console.error('获取导出列表出错:', error) + ElMessage.error('获取导出列表失败,请稍后重试') + } finally { + exportListLoading.value = false + } +} +const downloadExportFile = (item) => { + if (item.state === 2) { + const link = document.createElement('a') + link.href = item.url + link.download = item.fileName + link.click() + } else { + ElMessage.warning('文件还在导出中,请稍后再试') + } +} // 2.1 数据加载:获取地区财务订单列表 const getlist = async () => { @@ -771,7 +879,7 @@ const submitRefund = async () => { } if (refundFormData.value.refundModel == 0) { refundFormData.value.partRefundGold = refundFormData.value.permanentGold, - refundFormData.value.partRefundFree = refundFormData.value.freeGold + refundFormData.value.partRefundFree = refundFormData.value.freeGold } const result = await request({ url: '/Money/addOnline',