Commit 2cd023a8 by yuzhenWang

Merge branch 'wyz' into 'test'

薪资,出账,入账加统计接口

See merge request !181
parents d2f695fc 65084a3f
......@@ -572,3 +572,27 @@ export function batchActualPayoutDate(data) {
data: data
})
}
// 计算出账检核统计
export function statisticsFortune(data) {
return request({
url: '/csf/api/fortune/statistics',
method: 'post',
data: data
})
}
// 计算入账检核统计
export function statisticsCommission(data) {
return request({
url: '/csf/api/commission/statistics',
method: 'post',
data: data
})
}
// 计算薪资发放统计
export function statisticsFortuneAccount(data) {
return request({
url: '/csf/api/fortune/fortuneAccount/statistics',
method: 'post',
data: data
})
}
......@@ -344,7 +344,8 @@ import {
commissionExchangeRateApi,
actualPayoutDateApi,
editExchangeRateApi,
batchActualPayoutDate
batchActualPayoutDate,
statisticsFortune
} from '@/api/financial/commission'
import useUserStore from '@/store/modules/user'
const rateExchangeFormRef = ref(null)
......@@ -367,7 +368,7 @@ const loading = ref(false)
const selectedRow = ref(null)
const searchFormRef = ref(null)
const searchParams = ref({})
let oldStaticData = ref({})
// 动态生成操作菜单项(根据行数据)
const getOperateItems = row => {
const items = []
......@@ -1391,7 +1392,7 @@ const loadTableData = async (searchParams = {}) => {
pageTotal.value = res.data.page.total || 0
pageSize.value = res.data.page.size || 0
// 统计信息
statisticsData.value = res.data.statisticsVO || {}
statisticsData.value = oldStaticData.value = res.data.statisticsVO || {}
} catch (error) {
console.error('加载数据失败:', error)
ElMessage.error(error.message || '加载数据失败')
......@@ -1488,7 +1489,31 @@ const updatePayoutAmountapi = async data => {
}
const updatePayRollStatusDisable = ref(true)
const multipleSelection = ref([])
// 获取统计
const getStaticData = async data => {
try {
const res = await statisticsFortune(data)
console.log('====================================')
console.log('统计数据', res)
console.log('====================================')
if (res.code === 200) {
statisticsData.value = res.data || {}
} else {
ElMessage.error(res.msg || '获取统计数据失败')
}
} catch (error) {
console.error('获取统计数据失败:', error)
ElMessage.error(error.message || '获取统计数据失败')
}
}
const handleSelectionChange = val => {
let fortuneIdList = val.map(item => item.id) || []
if (fortuneIdList.length > 0) {
getStaticData({ fortuneIdList })
} else {
statisticsData.value = JSON.parse(JSON.stringify(oldStaticData.value))
}
multipleSelection.value = val
console.log('全选:', val)
// 完成检核按钮是否禁用
......
......@@ -494,13 +494,15 @@ import {
deletePolicyCommission,
syncExpectedCommission,
compareCommissionEntry,
editStatusApi
editStatusApi,
statisticsCommission
} from '@/api/financial/commission'
import { InfoFilled, Select, Upload, Plus } from '@element-plus/icons-vue'
import FileUpload from '@/components/FileUpload/index.vue'
import { loadDicts, getDictLabel } from '@/utils/useDict'
const oldStaticData = ref({})
const accountedStatusFormModel = ref({})
const accountedStatusFlag = ref(false)
const accountedStatusFormRef = ref(null)
......@@ -1025,9 +1027,32 @@ const checkRecordQuery = async () => {
ElMessage.error('查询检核记录失败')
}
}
// 获取统计
const getStaticData = async data => {
try {
const res = await statisticsCommission(data)
console.log('====================================')
console.log('统计数据', res)
console.log('====================================')
if (res.code === 200) {
statisticsData.value = res.data || {}
} else {
ElMessage.error(res.msg || '获取统计数据失败')
}
} catch (error) {
console.error('获取统计数据失败:', error)
ElMessage.error(error.message || '获取统计数据失败')
}
}
const multipleSelection = ref([])
const handleSelectionChange = val => {
let commissionIds = val.map(item => item.id) || []
if (commissionIds.length > 0) {
getStaticData({ commissionIds })
} else {
statisticsData.value = JSON.parse(JSON.stringify(oldStaticData.value))
}
multipleSelection.value = val
console.log('全选:', val)
// 生成可出账记录按钮是否禁用
......@@ -1089,7 +1114,7 @@ const loadTableData = async (searchParams = {}) => {
pageTotal.value = res.data.page.total || 0
pageSize.value = res.data.page.size || 0
// 统计信息
statisticsData.value = res.data.commissionStatisticsVO || {}
statisticsData.value = oldStaticData.value = res.data.commissionStatisticsVO || {}
} catch (error) {
console.error('加载数据失败:', error)
ElMessage.error(error.message || '加载数据失败')
......
......@@ -354,7 +354,8 @@ import {
billSplitRate,
billBatchSave,
billCalculateToAmount,
updatePolicyFortuneAccount
updatePolicyFortuneAccount,
statisticsFortuneAccount
} from '@/api/financial/commission'
import { formatCurrency, inputThousands } from '@/utils/number'
import { generateId } from '@/utils/common'
......@@ -836,7 +837,7 @@ const getList = async (searchParams = {}) => {
loading.value = false
}
if (response.data.statisticsVO) {
statisticInfo.value = response.data.statisticsVO
statisticInfo.value = oldStaticData.value = response.data.statisticsVO
}
// 数据加载完成后,设置当前页的选中状态
......@@ -877,9 +878,31 @@ const handleReset = () => {
console.log('表单已重置')
getList(searchParams.value)
}
// 获取统计
const getStaticData = async data => {
try {
const res = await statisticsFortuneAccount(data)
console.log('====================================')
console.log('统计数据', res)
console.log('====================================')
if (res.code === 200) {
statisticsData.value = res.data || {}
} else {
ElMessage.error(res.msg || '获取统计数据失败')
}
} catch (error) {
console.error('获取统计数据失败:', error)
ElMessage.error(error.message || '获取统计数据失败')
}
}
// 选择行变化
const handleSelectionChange = selection => {
let fortuneAccountIdList = selection.map(item => item.id) || []
if (fortuneAccountIdList.length > 0) {
getStaticData({ fortuneAccountIdList })
} else {
statisticsData.value = JSON.parse(JSON.stringify(oldStaticData.value))
}
selectedRows.value = selection
// 更新全局选中状态
updateAllSelectedRows()
......
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