Commit ef6e03ce by Sweet Zhang

财务中心对接

parent 79007a4a
......@@ -395,3 +395,11 @@ export function syncExpectedCommission(data){
data: data
})
}
// 更新出账记录
export function updatePayRecord(data){
return request({
url: '/csf/api/expectedFortune/update',
method: 'post',
data: data
})
}
<template>
<el-form ref="formRef" :model="localModel" :rules="formRules" label-width="auto" v-bind="$attrs" :validate-on-rule-change="false">
<el-row :gutter="20">
<el-col v-for="item in visibleConfig" :key="item.prop" :span="item.span || 8">
<el-col v-for="item in visibleConfig" :key="item.prop" :span="item.span || 6">
<el-form-item :label="item.label" :prop="item.prop" :class="{ 'search-form-item': isSearch }">
<!-- Input -->
<el-input v-if="item.type === 'input'" v-model="localModel[item.prop]"
......@@ -520,7 +520,7 @@ defineExpose({
const resetData = {}
internalConfig.value.forEach(item => {
const key = item.prop
if (['checkbox-group', 'daterange'].includes(item.type)) {
if (['checkbox-group', 'daterange'].includes(item.type) || item.multiple) {
resetData[key] = item.defaultValue ?? []
} else {
resetData[key] = item.defaultValue ?? ''
......
......@@ -490,8 +490,5 @@ onMounted(() => {
margin-bottom: 8px;
}
.pagination-container {
justify-content: center;
}
}
</style>
......@@ -364,12 +364,10 @@ const handleExport = () => {
const handleReset = () => {
// 重置搜索表单
searchFormRef.value.resetForm()
searchParams.value = {}
console.log('表单已重置')
}
const handleQuery = async () => {
const params = searchFormRef.value.getFormData()
console.log('父组件发起查询:', params)
loadTableData(params)
}
const visibleDefaultButtons = ref(['add', 'import', 'export', 'reset', 'query'])
......
......@@ -117,6 +117,7 @@ const searchConfig = ref([
label: '出账状态',
dictType: 'csf_expected_fortune_status',
multiple: true,
defaultValue: ['6'],//默认查询待出账,已检核的数据
}
])
// 添加表格引用
......
......@@ -151,8 +151,9 @@
</el-table>
</CommonDialog>
<!-- 新增出账记录 -->
<CommonDialog dialogTitle="新增出账记录" dialogWidth="80%" :openDialog="addPayRecordDialogVisible" :showAction="true"
:showClose="true" @close="addPayRecordDialogVisible = false" @confirm="handleConfirmAddPayRecord">
<CommonDialog :dialogTitle="editStatus === 'add' ? '新增出账记录' : '修改出账记录'" dialogWidth="80%"
:openDialog="addPayRecordDialogVisible" :showAction="true" :showClose="true"
@close="addPayRecordDialogVisible = false; editStatus = 'add'" @confirm="handleConfirmAddPayRecord">
<SearchForm ref="addPayRecordFormRef" :config="addPayRecordFormConfig" v-model="addPayRecordFormModel" />
</CommonDialog>
<!-- 设置出账状态 -->
......@@ -170,7 +171,7 @@ import CommonPage from '@/components/commonPage'
import { ref, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { formatCurrency } from '@/utils/number'
import { expectedFortuneList, payRecordList, addPayRecord, userSaleExpandDetail } from '@/api/financial/commission'
import { expectedFortuneList, payRecordList, addPayRecord, updatePayRecord } from '@/api/financial/commission'
import SearchForm from '@/components/SearchForm/SearchForm.vue'
import CommonDialog from '@/components/commonDialog'
import { loadDicts, getDictLabel } from '@/utils/useDict'
......@@ -298,7 +299,7 @@ const searchConfig = ref([
])
const payRecordDialogTableVisible = ref(false)
// 新增出账记录
const addPayRecordFormModel = reactive({
const addPayRecordFormModel = ref({
fortuneBizType: 'U',
})
const addPayRecordDialogVisible = ref(false)
......@@ -390,24 +391,42 @@ const addPayRecordFormConfig = [
}
]
const handleConfirmAddPayRecord = async () => {
if (editStatus.value === 'add') {
const handleConfirmAddPayRecordparams = addPayRecordFormRef.value.getFormData()
try {
await addPayRecord([handleConfirmAddPayRecordparams])
ElMessage.success('新增出账记录成功')
addPayRecordDialogVisible.value = false
addPayRecordFormRef.value.resetForm()
} catch (error) {
ElMessage.error(error.message)
}
}
} else if (editStatus.value === 'edit') {
try {
const params = {
expectedFortuneBizId: selectedRow.value.expectedFortuneBizId,
...addPayRecordFormModel.value
}
await updatePayRecord(params)
ElMessage.success('更新出账记录成功')
addPayRecordDialogVisible.value = false
addPayRecordFormRef.value.resetForm()
editStatus.value = 'add'
} catch (error) {
ElMessage.error(error.message)
}
}
}
const editStatus = ref('add')
// 出账记录
const payRecordDialogTableData = ref([])
const payRecordDialogTableColumns = ref([])
const handleSelect = async (e, row) => {
selectedRow.value = row
selectedRow.value = { ...row }
if (e === 'payRecord') {
payRecordDialogTableVisible.value = true
loadPayRecordTableData(selectedRow.value.expectedFortuneBizId);
......@@ -439,6 +458,16 @@ const handleSelect = async (e, row) => {
defaultValue: selectedRow.value.statusDesc || ''
},
]
} else if (e === 'updateData') {
editStatus.value = 'edit'
addPayRecordDialogVisible.value = true
if (addPayRecordFormRef.value) {
addPayRecordFormModel.value = {
...selectedRow.value
}
}
console.log(addPayRecordFormModel.value)
}
}
......@@ -452,7 +481,8 @@ const loading = ref(false)
// 表格操作菜单
const dropdownItems = [
{ label: '出账记录', value: 'payRecord' },
{ label: '设置状态', value: 'setStatus' }
{ label: '设置状态', value: 'setStatus' },
{ label: '更新数据', value: 'updateData' }
]
// 表格数据
......
<template>
<div>
<CommonPage :operationBtnList="operationBtnList" :showSearchForm="true" :show-pagination="true"
:total="pageTotal" :current-page="currentPage" :page-size="pageSize" @size-change="handleSizeChange"
@current-change="handleCurrentChange">
<CommonPage :operationBtnList="operationBtnList" :visibleDefaultButtons="visibleDefaultButtons"
:showSearchForm="true" :show-pagination="true" :total="pageTotal" :current-page="currentPage"
:page-size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange">
<!-- 搜索区域 -->
<template #searchForm>
<SearchForm ref="searchFormRef" :config="searchConfig" />
......@@ -36,7 +36,7 @@
{{ getCommissionBizTypeLabel(row.commissionBizType) }}
</template>
</el-table-column>
<el-table-column prop="receivableNo" label="应收款编号" width="120" />
<el-table-column prop="receivableNo" label="应收款编号" width="150" sortable />
<el-table-column prop="policyNo" label="保单号" width="120" fixed="left" sortable />
<el-table-column prop="reconciliationCompany" label="对账公司" width="120" sortable />
<el-table-column prop="status" label="入账状态" width="120" sortable :formatter="formatStatus" />
......@@ -76,8 +76,8 @@
</el-table-column>
<el-table-column prop="currency" label="入账币种" width="100" />
<el-table-column prop="defaultExchangeRate" label="结算汇率(估)" width="120" />
<el-table-column prop="insurerBizId" label="保险公司" width="120" sortable />
<el-table-column prop="productLaunchBizId" label="产品计划" width="120" sortable />
<el-table-column prop="insuranceCompany" label="保险公司" width="120" sortable />
<el-table-column prop="productName" label="产品计划" width="120" sortable />
<el-table-column prop="premium" label="期交保费" width="120" sortable>
<template #default="{ row }">
{{ numberWithCommas(row.premium) }}
......@@ -135,7 +135,8 @@
</CommonDialog>
<!-- 新增应收款管理 -->
<CommonDialog dialogTitle="新增应收款" dialogWidth="80%" :openDialog="addReceivablesDialogVisible"
<CommonDialog :dialogTitle="editStatus === 'add' ? '新增应收款' : '更新应收款'" dialogWidth="80%"
:openDialog="addReceivablesDialogVisible"
@close="addReceivablesDialogVisible = false; resetAddReceivablesForm()"
@confirm="handleConfirmAddReceivables">
<SearchForm ref="addRecordRef" :config="addReceivablesFormConfig" v-model="addReceivablesFormModel" />
......@@ -162,9 +163,10 @@ const commissionBizTypeOptions = [
{ value: 'R', label: '关联保单应收单' },
{ value: 'U', label: '非关联保单应收单' }
]
const editStatus = ref('add')
// 新增应收款管理
const addReceivablesFormModel = reactive({
const addReceivablesFormModel = ref({
commissionBizType: 'U',
})
const addReceivablesDialogVisible = ref(false)
......@@ -206,13 +208,15 @@ const addReceivablesFormConfig = [
prop: 'commissionDate',
label: '入账日(估)',
placeholder: '请选择'
}, {
type: 'date',
prop: 'actualCommissionDate',
label: '入账日(实)',
placeholder: '请选择',
maxDate: 'today'
}, {
},
// {
// type: 'date',
// prop: 'actualCommissionDate',
// label: '入账日(实)',
// placeholder: '请选择',
// maxDate: 'today'
// },
{
type: 'input',
prop: 'amount',
label: '入账金额',
......@@ -241,9 +245,12 @@ const addReceivablesFormConfig = [
dictType: 'bx_currency_type'
}, {
type: 'select',
prop: 'commissionName',
prop: 'commissionType',
label: '入账项目',
dictType: 'csf_commission_type'
dictType: 'csf_commission_type',
onChangeExtraFields: {
commissionName: 'itemLabel',
},
}, {
type: 'select',
prop: 'reconciliationCompanyBizId',
......@@ -268,11 +275,13 @@ const addReceivablesFormConfig = [
// 弹窗表单重置
const resetAddReceivablesForm = () => {
addRecordRef.value.resetForm()
editStatus.value = 'add'
}
const handleConfirmAddReceivables = async () => {
if (editStatus.value === 'add') {
const p = addRecordRef.value.getFormData()
try {
await addReceivedFortune({
......@@ -285,6 +294,26 @@ const handleConfirmAddReceivables = async () => {
} catch (error) {
ElMessage.error(error.message)
}
} else {
try {
const res = await updateCommissionExpected({
commissionExpectedBizId: selectedRow.value.commissionExpectedBizId,
...addReceivablesFormModel.value
})
if (res.code === 200) {
ElMessage.success('应收款修改成功')
addReceivablesDialogVisible.value = false
resetAddReceivablesForm()
loadTableData() // 重新加载表格
} else {
ElMessage.error(res.msg || '应收款修改失败')
}
} catch (error) {
console.error('修改应收款失败:', error)
ElMessage.error('修改应收款失败')
}
}
}
......@@ -417,7 +446,8 @@ const getCommissionBizTypeLabel = (value) => {
// 表格操作菜单
const dropdownItems = [
{ label: '入账记录', value: 'entryRecord' },
{ label: '设置状态', value: 'setStatus' }
{ label: '设置状态', value: 'setStatus' },
{ label: '更新数据', value: 'updateData' },
]
// 弹窗状态
......@@ -451,7 +481,12 @@ const statisticsData = ref({
// 按钮事件处理
const handleAdd = () => {
addReceivablesDialogVisible.value = true
if (addRecordRef.value) {
addRecordRef.value.resetForm()
}
addReceivablesFormModel.value = {}
}
const handleImport = () => ElMessage.info('点击导入按钮')
const handleExport = async () => {
......@@ -480,11 +515,13 @@ const handleReset = () => {
const handleQuery = () => {
loadTableData()
}
const visibleDefaultButtons = ref([
'add', 'export', 'reset', 'query'
])
// 按钮配置
const operationBtnList = ref([
{ key: 'add', direction: 'left', click: handleAdd },
{ key: 'import', direction: 'left', click: handleImport },
// { key: 'import', direction: 'left', click: handleImport },
{ key: 'export', direction: 'right', click: handleExport },
{ key: 'reset', direction: 'right', click: handleReset },
{ key: 'query', direction: 'right', click: handleQuery }
......@@ -569,7 +606,7 @@ const loadEntryEditRecordData = async (cbd) => {
// 操作菜单选择事件
const handleSelect = async (e, row) => {
selectedRow.value = row
selectedRow.value = { ...row }
if (e === 'entryRecord') {
entryRecordDialogTableVisible.value = true
entryRecordDialogTableColumns.value = [
......@@ -603,6 +640,15 @@ const handleSelect = async (e, row) => {
},
]
setStatusDialogTableVisible.value = true
} else if (e === 'updateData') {
editStatus.value = 'update'
addReceivablesDialogVisible.value = true
if (addRecordRef.value) {
addReceivablesFormModel.value = {
...selectedRow.value
}
}
console.log('更新数据', selectedRow.value)
}
}
......@@ -621,15 +667,7 @@ const handleClick = async () => {
]
// 加载真实数据
const records = await loadEntryEditRecordData(selectedRow.value.commissionExpectedBizId)
actionRecordsDialogTableData.value = records.length ? records : [{
checkMonth: '2023-08',
compareStatus: '比对成功',
entryRatio: '10%',
shouldEntryRatio: '10%',
reconciliationCompany: 'XX保险公司',
createTime: '2023-08-01 10:00:00',
userName: '张三'
}]
actionRecordsDialogTableData.value = records.length ? records : []
}
// 新增:设置状态确认事件
......
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