Commit 4f8fad46 by yuzhenWang

Merge branch 'test' into 'feature-20250827wyz-写业务'

修复证件类型刷新后没有下拉选项,修复新单跟进无法保存,增加入账检核下载模板

See merge request !47
parents 90164b0b 902799a5
......@@ -182,7 +182,7 @@
@click="fileUploadDialogFlag = true;">导入</el-button>
</el-col>
<el-col :xs="24" :sm="24" :md="3" :lg="3">
<el-button link type="primary">下载导入模板 </el-button>
<el-button type="primary" link @click="downloadTemplate">下载模板</el-button>
</el-col>
</el-row>
<el-row :gutter="10">
......@@ -303,8 +303,13 @@ import { loadDicts, getDictLabel } from '@/utils/useDict'
const { proxy } = getCurrentInstance()
const { csf_expected_commission_status } = proxy.useDict('csf_expected_commission_status')
const { csf_commission_status } = proxy.useDict('csf_commission_status')
const downloadTemplateUrl = 'https://yd-ali-oss.oss-cn-shanghai-finance-1-pub.aliyuncs.com/xlsx/2026/01/26/33f0637762144d58a256f5d8d3c2d2b6.xlsx'
const downloadTemplate = () => {
const link = document.createElement('a')
link.href = downloadTemplateUrl // 注意:以 / 开头,指向 public 下的文件
link.download = '入账检核导入模板.xlsx' // 设置下载文件名
link.click() // 自动触发点击,无需 append 到 DOM(现代浏览器支持)
}
const formatRatio = (row, column, cellValue, index) => {
if (cellValue == null || cellValue == '' || cellValue == 0) {
return '-'
......
......@@ -3,7 +3,7 @@
<div class="form-page">
<el-form ref="formRef" :model="localData" label-width="120px" size="default">
<!-- Tabs -->
<el-tabs v-model="activeTab" @tab-click="handleTabClick" @before-leave="handleBeforeLeave">
<el-tabs v-model="activeTab" @tab-click="handleTabClick" :before-leave="handleBeforeLeave">
<el-tab-pane label="基础信息" name="basic"></el-tab-pane>
<el-tab-pane label="产品计划" name="productPlan"></el-tab-pane>
<el-tab-pane label="首期缴费" name="firstPayment"></el-tab-pane>
......@@ -763,20 +763,40 @@ onMounted(async () => {
policyInfoFormConfig.value = policyInfoFormConfig ? applyViewMode(policyInfoFormConfig.value, props.mode) : []
})
// 监听基本信息(basic)
watch(
() => ({
...basicInfoFormData.value,
...policyInfoFormData.value,
...firstPremiumFormData.value,
...postalFormData.value,
...basicPlanFormData.value
}),
[
basicInfoFormData,
policyInfoFormData,
],
() => {
console.log('========父组件监听basicPlanFormData的变化', basicPlanFormData.value)
tabDirty.value.basic = true
},
{ deep: true }
)
// 监听首期保费(firstPayment)
watch(
firstPremiumFormData,
() => {
tabDirty.value.firstPayment = true
},
{ deep: true }
)
// 监听邮寄信息
watch(
postalFormData,
() => {
tabDirty.value.postal = true
},
{ deep: true })
// 监听基本计划(productPlan)
watch(
basicPlanFormData,
() => {
tabDirty.value.productPlan = true
},
{ deep: true }
)
// ✅ 监听 localData 变化,emit 出去(用于 v-model)
watch(
() => localData.value,
......@@ -793,11 +813,11 @@ const activeTab = ref('basic')
// ✅ 新增:切换前确认
// ========================
const handleBeforeLeave = async (newTabName, oldTabName) => {
console.log('切换前确认', newTabName, oldTabName)
console.log('切换前确认-----------------------', newTabName, oldTabName)
if (tabDirty.value[oldTabName]) {
try {
await ElMessageBox.confirm(
`“${getTabLabel(oldTabName)}有未保存的内容,确定要切换吗?`,
`“${getTabLabel(oldTabName)}未提交,确定要切换吗?`,
'提示',
{
confirmButtonText: '继续切换',
......@@ -848,7 +868,6 @@ const handleSubmit = () => {
formRef.value?.validate((valid) => {
if (valid) {
console.log('提交数据', introducerTableData.value)
savTabList.value.push(activeTab.value)
if (activeTab.value === 'postal') {
emit('submit', { ...postalFormData.value, activeTab: activeTab.value })
} else if (activeTab.value === 'firstPayment') {
......
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