Commit b9c161b7 by yuzhenWang

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

修改新单跟进的供款年期为输入框

See merge request !50
parents b3f69e2e aaa3c2cf
...@@ -18,31 +18,47 @@ ...@@ -18,31 +18,47 @@
<!-- 签单信息 --> <!-- 签单信息 -->
<div class="section"> <div class="section">
<h3 class="sectionTitle">基础信息</h3> <h3 class="sectionTitle">基础信息</h3>
<SearchForm ref="basicInfoFormRef" :config="basicInfoFormConfig" v-model="basicInfoFormData" /> <SearchForm
ref="basicInfoFormRef"
:config="basicInfoFormConfig"
v-model="basicInfoFormData"
/>
</div> </div>
<!-- 保单信息 --> <!-- 保单信息 -->
<div class="section"> <div class="section">
<h3 class="sectionTitle">保单信息</h3> <h3 class="sectionTitle">保单信息</h3>
<SearchForm ref="policyInfoFormRef" :config="policyInfoFormConfig" v-model="policyInfoFormData" /> <SearchForm
ref="policyInfoFormRef"
:config="policyInfoFormConfig"
v-model="policyInfoFormData"
/>
</div> </div>
</div> </div>
<!-- 产品计划 Tab 内容 --> <!-- 产品计划 Tab 内容 -->
<div v-else-if="activeTab === 'productPlan'" class="tab-content"> <div v-else-if="activeTab === 'productPlan'" class="tab-content">
<!-- 基本计划 --> <!-- 基本计划 -->
<div class="section"> <div class="section">
<h3 class="sectionTitle">基本计划</h3> <h3 class="sectionTitle">基本计划</h3>
<SearchForm ref="basicPlanFormRef" :config="basicPlanFormConfig" v-model="basicPlanFormData" <SearchForm
@selectChange="(prop, value, item) => handleSelectChange(prop, value, item, 'basicPlan')" /> ref="basicPlanFormRef"
:config="basicPlanFormConfig"
v-model="basicPlanFormData"
@selectChange="
(prop, value, item) => handleSelectChange(prop, value, item, 'basicPlan')
"
/>
</div> </div>
<!-- 附加计划(可编辑表格) --> <!-- 附加计划(可编辑表格) -->
<div class="section"> <div class="section">
<h3 class="sectionTitle">附加计划</h3> <h3 class="sectionTitle">附加计划</h3>
<EditableTable v-model="localData.additionalPlans" :row-config="additionalPlansConfig" <EditableTable
@batch-save="handleBatchSave" :disabled="props.mode === 'viewDetail'" /> v-model="localData.additionalPlans"
:row-config="additionalPlansConfig"
@batch-save="handleBatchSave"
:disabled="props.mode === 'viewDetail'"
/>
</div> </div>
</div> </div>
<!-- 首期缴费 Tab 内容 --> <!-- 首期缴费 Tab 内容 -->
...@@ -50,12 +66,19 @@ ...@@ -50,12 +66,19 @@
<!-- 签单信息 --> <!-- 签单信息 -->
<div class="section"> <div class="section">
<h3 class="sectionTitle">缴费信息</h3> <h3 class="sectionTitle">缴费信息</h3>
<SearchForm ref="firstPremiumFormRef" :config="firstPremiumFormConfig" <SearchForm
v-model="firstPremiumFormData" /> ref="firstPremiumFormRef"
:config="firstPremiumFormConfig"
v-model="firstPremiumFormData"
/>
<h3 class="sectionTitle">首期对账信息</h3> <h3 class="sectionTitle">首期对账信息</h3>
<el-table :data="firstPremiumTableData" border style="width: 100%"> <el-table :data="firstPremiumTableData" border style="width: 100%">
<el-table-column prop="createTime" label="申请对账日期" width="180" <el-table-column
:formatter="(row, col, val) => formatToDateTime(val, 'YYYY-MM-DD HH:mm:ss')" /> prop="createTime"
label="申请对账日期"
width="180"
:formatter="(row, col, val) => formatToDateTime(val, 'YYYY-MM-DD HH:mm:ss')"
/>
<el-table-column prop="reconciliationStatus" label="对账状态" width="180" /> <el-table-column prop="reconciliationStatus" label="对账状态" width="180" />
<el-table-column prop="paymentMethod" label="缴费方式" width="180" /> <el-table-column prop="paymentMethod" label="缴费方式" width="180" />
<el-table-column prop="paymentAmount" label="汇款金额" width="180" /> <el-table-column prop="paymentAmount" label="汇款金额" width="180" />
...@@ -70,9 +93,15 @@ ...@@ -70,9 +93,15 @@
<!-- 签单信息 --> <!-- 签单信息 -->
<div class="section"> <div class="section">
<h3 class="sectionTitle">介绍人信息</h3> <h3 class="sectionTitle">介绍人信息</h3>
<h5>第一位默认是客户主要负责人,客户资料出现在介绍人(主)账号下,其他介绍人不会看到客户信息</h5> <h5>
<EditableTable v-model="introducerTableData" :row-config="introducerConfig" 第一位默认是客户主要负责人,客户资料出现在介绍人(主)账号下,其他介绍人不会看到客户信息
@batch-save="handleBatchSave" :disabled="props.mode === 'viewDetail'" /> </h5>
<EditableTable
v-model="introducerTableData"
:row-config="introducerConfig"
@batch-save="handleBatchSave"
:disabled="props.mode === 'viewDetail'"
/>
</div> </div>
</div> </div>
<!-- 邮寄信息 Tab 内容 --> <!-- 邮寄信息 Tab 内容 -->
...@@ -90,8 +119,12 @@ ...@@ -90,8 +119,12 @@
<el-table-column prop="fnaNo" label="流程编号" width="180" /> <el-table-column prop="fnaNo" label="流程编号" width="180" />
<el-table-column prop="policyNo" label="保单号" width="180" /> <el-table-column prop="policyNo" label="保单号" width="180" />
<el-table-column prop="customerName" label="客户姓名" width="180" /> <el-table-column prop="customerName" label="客户姓名" width="180" />
<el-table-column prop="createTime" label="创建时间" width="180" <el-table-column
:formatter="(row) => formatToDate(row.createTime)" /> prop="createTime"
label="创建时间"
width="180"
:formatter="row => formatToDate(row.createTime)"
/>
<el-table-column fixed="right" label="操作" min-width="120"> <el-table-column fixed="right" label="操作" min-width="120">
<template #default> <template #default>
<el-button link type="primary" size="small" @click="viewRecordDetail"> <el-button link type="primary" size="small" @click="viewRecordDetail">
...@@ -106,23 +139,40 @@ ...@@ -106,23 +139,40 @@
<div v-else-if="activeTab === 'attachment'" class="tab-content"> <div v-else-if="activeTab === 'attachment'" class="tab-content">
<div class="section"> <div class="section">
<h3 class="sectionTitle">附件</h3> <h3 class="sectionTitle">附件</h3>
<el-button type="primary" @click="fileUploadDialogFlag = true" <el-button
:disabled="props.mode === 'viewDetail'"> type="primary"
<el-icon class="el-icon--right"> @click="fileUploadDialogFlag = true"
<Upload /> :disabled="props.mode === 'viewDetail'"
</el-icon>上传附件 >
<el-icon class="el-icon--right"> <Upload /> </el-icon>上传附件
</el-button> </el-button>
<el-table :data="attachmentTableData" border style="width: 100%"> <el-table :data="attachmentTableData" border style="width: 100%">
<el-table-column v-for="(column, index) in attachmentTableColumns" :key="index" <el-table-column
:prop="column.prop" :label="column.label" :width="column.width" :sortable="column.sortable" v-for="(column, index) in attachmentTableColumns"
:formatter="column.formatter" /> :key="index"
:prop="column.prop"
:label="column.label"
:width="column.width"
:sortable="column.sortable"
:formatter="column.formatter"
/>
<el-table-column fixed="right" label="操作" min-width="120"> <el-table-column fixed="right" label="操作" min-width="120">
<template #default> <template #default>
<el-button link type="primary" size="small" @click="handleClick" <el-button
:disabled="props.mode === 'viewDetail'"> link
修改 type="primary"
</el-button><el-button link type="danger" size="small" @click="handleClick" size="small"
:disabled="props.mode === 'viewDetail'"> @click="handleClick"
:disabled="props.mode === 'viewDetail'"
>
修改 </el-button
><el-button
link
type="danger"
size="small"
@click="handleClick"
:disabled="props.mode === 'viewDetail'"
>
删除 删除
</el-button> </el-button>
</template> </template>
...@@ -141,13 +191,25 @@ ...@@ -141,13 +191,25 @@
</div> </div>
</el-form> </el-form>
<CommonDialog dialogTitle='文件导入' dialogWidth='80%' :openDialog=fileUploadDialogFlag :showAction='true' <CommonDialog
:showClose='true' @close='fileUploadDialogFlag = false; files = ""' dialogTitle="文件导入"
@confirm='fileUploadDialogFlag = false; files = ""'> dialogWidth="80%"
<FileUpload v-model="files" :data="{ obiectTableName: 'policy_follow', objectBizId: props.policyBizId }" :openDialog="fileUploadDialogFlag"
:showAction="true"
:showClose="true"
@close="((fileUploadDialogFlag = false), (files = ''))"
@confirm="((fileUploadDialogFlag = false), (files = ''))"
>
<FileUpload
v-model="files"
:data="{ obiectTableName: 'policy_follow', objectBizId: props.policyBizId }"
:file-type="['xlsx', 'xls', 'doc', 'docx', 'pdf', 'txt', 'jpg', 'jpeg', 'png', 'gif']" :file-type="['xlsx', 'xls', 'doc', 'docx', 'pdf', 'txt', 'jpg', 'jpeg', 'png', 'gif']"
:action="'/oss/api/oss/batch/upload'" :limit="10" :fileSize="15" :name="'files'" :action="'/oss/api/oss/batch/upload'"
@uploadEnd="handleUploadEnd" /> :limit="10"
:fileSize="15"
:name="'files'"
@uploadEnd="handleUploadEnd"
/>
</CommonDialog> </CommonDialog>
</div> </div>
</template> </template>
...@@ -168,7 +230,16 @@ import EditableTable from '@/components/csf-common/EditableTable.vue' ...@@ -168,7 +230,16 @@ import EditableTable from '@/components/csf-common/EditableTable.vue'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
proxy.useDictLists(['sys_no_yes', 'csf_ap_frequency', 'bx_currency_type', 'csf_ap_first_issue', 'csf_ap_dividend', 'csf_fortune_status', 'csf_ap_mailing_method', 'receipt_status']) proxy.useDictLists([
'sys_no_yes',
'csf_ap_frequency',
'bx_currency_type',
'csf_ap_first_issue',
'csf_ap_dividend',
'csf_fortune_status',
'csf_ap_mailing_method',
'receipt_status'
])
const router = useRouter() const router = useRouter()
const userStore = useUserStore() const userStore = useUserStore()
const files = ref('') const files = ref('')
...@@ -213,19 +284,19 @@ const introducerConfig = [ ...@@ -213,19 +284,19 @@ const introducerConfig = [
placeholder: '输入转介人名称搜索', placeholder: '输入转介人名称搜索',
debounceWait: 500, // 自定义防抖时间 debounceWait: 500, // 自定义防抖时间
onChangeExtraFields: { onChangeExtraFields: {
broker: 'realName',// 选中后自动填 broker = raw.realName broker: 'realName', // 选中后自动填 broker = raw.realName
brokerName: 'realName', brokerName: 'realName',
internalCode: 'code', internalCode: 'code',
team: 'teamName', team: 'teamName',
phone: 'phone', phone: 'phone'
}, },
transform: (res) => { transform: res => {
return (res?.data.records || []).map(item => ({ return (res?.data.records || []).map(item => ({
value: item.clientUserBizId, value: item.clientUserBizId,
label: item.realName, label: item.realName,
...item ...item
})) }))
}, }
}, },
// { // {
...@@ -258,7 +329,8 @@ const introducerConfig = [ ...@@ -258,7 +329,8 @@ const introducerConfig = [
label: '所属团队', label: '所属团队',
span: 4, span: 4,
disabled: true disabled: true
}, { },
{
type: 'input', type: 'input',
prop: 'brokerRatio', prop: 'brokerRatio',
label: '分配比例%', label: '分配比例%',
...@@ -274,12 +346,13 @@ const introducerConfig = [ ...@@ -274,12 +346,13 @@ const introducerConfig = [
} }
} }
] ]
}, { },
{
type: 'textarea', type: 'textarea',
prop: 'remark', prop: 'remark',
label: '备注', label: '备注',
span: 4 span: 4
}, }
] ]
// 附加计划表格 // 附加计划表格
...@@ -288,46 +361,52 @@ const additionalPlansConfig = [ ...@@ -288,46 +361,52 @@ const additionalPlansConfig = [
type: 'input', type: 'input',
prop: 'product', prop: 'product',
label: '产品名称', label: '产品名称',
span: 4, span: 4
}, { },
{
type: 'input', type: 'input',
prop: 'frequency', prop: 'frequency',
label: '付款频率', label: '付款频率',
span: 4, span: 4
}, { },
{
type: 'input', type: 'input',
prop: 'term', prop: 'term',
label: '保障期限', label: '保障期限',
span: 4, span: 4
}, { },
{
type: 'input', type: 'input',
prop: 'phone', prop: 'phone',
label: '付款频率', label: '付款频率',
span: 4, span: 4
}, { },
{
type: 'input', type: 'input',
prop: 'periods', prop: 'periods',
label: '供款期数', label: '供款期数',
span: 4, span: 4
}, { },
{
type: 'input', type: 'input',
prop: 'currency', prop: 'currency',
label: '保单币种', label: '保单币种',
span: 4, span: 4
}, { },
{
type: 'input', type: 'input',
prop: 'premium', prop: 'premium',
label: '每期保费', label: '每期保费',
span: 4, span: 4
}, { },
{
type: 'input', type: 'input',
prop: 'fee', prop: 'fee',
label: '保单征费', label: '保单征费',
span: 4, span: 4
}, }
] ]
function handleBatchSave(validRows) { function handleBatchSave(validRows) {
console.log('批量提交:', validRows) console.log('批量提交:', validRows)
// 调用 API // 调用 API
...@@ -336,22 +415,20 @@ function handleBatchSave(validRows) { ...@@ -336,22 +415,20 @@ function handleBatchSave(validRows) {
function applyViewMode(fields, mode) { function applyViewMode(fields, mode) {
if (mode === 'viewDetail') { if (mode === 'viewDetail') {
return fields.map(item => ({ return fields.map(item => ({
...item, ...item,
disabled: true disabled: true
})); }))
} }
// 非查看模式:保留原对象,可选择性移除 disabled // 非查看模式:保留原对象,可选择性移除 disabled
return fields.map(item => { return fields.map(item => {
// 如果你希望编辑模式下完全不禁用,可以删除 disabled 属性 // 如果你希望编辑模式下完全不禁用,可以删除 disabled 属性
const newItem = { ...item }; const newItem = { ...item }
delete newItem.disabled; delete newItem.disabled
return newItem; return newItem
}); })
} }
const newOrderData = ref({}) const newOrderData = ref({})
const basicInfoFormRef = ref() const basicInfoFormRef = ref()
const basicInfoFormData = ref({}) const basicInfoFormData = ref({})
...@@ -359,8 +436,9 @@ const basicInfoFormConfig = ref([ ...@@ -359,8 +436,9 @@ const basicInfoFormConfig = ref([
{ {
type: 'date', type: 'date',
prop: 'signDate', prop: 'signDate',
label: '签单日', label: '签单日'
}, { },
{
type: 'select', type: 'select',
prop: 'signer', prop: 'signer',
label: '签单员', label: '签单员',
...@@ -371,32 +449,28 @@ const basicInfoFormConfig = ref([ ...@@ -371,32 +449,28 @@ const basicInfoFormConfig = ref([
debounceWait: 500, // 自定义防抖时间 debounceWait: 500, // 自定义防抖时间
onChangeExtraFields: { onChangeExtraFields: {
signerBizId: 'userSignBizId', signerBizId: 'userSignBizId',
practiceCode: 'practiceCode', practiceCode: 'practiceCode'
}, },
valueKey: 'realName', valueKey: 'realName',
labelKey: 'realName', labelKey: 'realName',
transform: (res) => { transform: res => {
return res?.data.records || [] return res?.data.records || []
}, },
rules: [ rules: [{ required: true, message: '请选择签单员', trigger: 'blur' }]
{ required: true, message: '请选择签单员', trigger: 'blur' }, },
], {
}, {
type: 'input', type: 'input',
prop: 'practiceCode', prop: 'practiceCode',
label: '签单员执业编号', label: '签单员执业编号'
},
}, { {
type: 'select', type: 'select',
prop: 'signLocation', prop: 'signLocation',
label: '签单地点', label: '签单地点',
dictType: 'csf_ap_meeting_point', dictType: 'csf_ap_meeting_point'
}, }
]) ])
// 保单信息 // 保单信息
const policyInfoFormRef = ref() const policyInfoFormRef = ref()
const policyInfoFormData = ref({}) const policyInfoFormData = ref({})
...@@ -404,59 +478,68 @@ const policyInfoFormConfig = ref([ ...@@ -404,59 +478,68 @@ const policyInfoFormConfig = ref([
{ {
type: 'input', type: 'input',
prop: 'policyNo', prop: 'policyNo',
label: '保单号', label: '保单号'
}, { },
{
type: 'date', type: 'date',
prop: 'effectiveDate', prop: 'effectiveDate',
label: '保单生效日', label: '保单生效日'
}, { },
{
type: 'date', type: 'date',
prop: 'policyExpirationDate', prop: 'policyExpirationDate',
label: '保单截止日', label: '保单截止日'
}, { },
{
type: 'date', type: 'date',
prop: 'underwritingDate', prop: 'underwritingDate',
label: '保单核保日', label: '保单核保日'
}, { },
{
type: 'date', type: 'date',
prop: 'receiptDate', prop: 'receiptDate',
label: '保单回执日', label: '保单回执日'
}, { },
{
type: 'select', type: 'select',
prop: 'receiptStatus', prop: 'receiptStatus',
label: '回执状态', label: '回执状态',
dictType: 'receipt_status', dictType: 'receipt_status'
}, { },
{
type: 'select', type: 'select',
prop: 'directPaymentEnabled', prop: 'directPaymentEnabled',
label: '是否开通直接支付', label: '是否开通直接支付',
dictType: 'sys_no_yes', dictType: 'sys_no_yes'
}, { },
{
type: 'input', type: 'input',
prop: 'policyHolder', prop: 'policyHolder',
label: '保单持有人', label: '保单持有人'
}, { },
{
type: 'input', type: 'input',
prop: 'insured', prop: 'insured',
label: '保单受保人', label: '保单受保人'
}, { },
{
type: 'input', type: 'input',
prop: 'insuredAge', prop: 'insuredAge',
label: '受保人年龄', label: '受保人年龄'
}, { },
{
type: 'input', type: 'input',
prop: 'gracePeriod', prop: 'gracePeriod',
label: '宽限期(天)', label: '宽限期(天)',
inputType: 'decimal', inputType: 'decimal',
rules: [ rules: [{ pattern: /^\d+$/, message: '只能输入正整数', trigger: 'blur' }]
{ pattern: /^\d+$/, message: '只能输入正整数', trigger: 'blur' } },
] {
}, {
type: 'select', type: 'select',
prop: 'isJoin', prop: 'isJoin',
label: '是否参加递增保障权益', label: '是否参加递增保障权益',
dictType: 'sys_no_yes', dictType: 'sys_no_yes'
}, }
]) ])
// 基本计划 // 基本计划
...@@ -474,13 +557,14 @@ const basicPlanFormConfig = ref([ ...@@ -474,13 +557,14 @@ const basicPlanFormConfig = ref([
debounceWait: 500, // 自定义防抖时间 debounceWait: 500, // 自定义防抖时间
valueKey: 'insuranceCompanyBizId', valueKey: 'insuranceCompanyBizId',
labelKey: 'fullName', labelKey: 'fullName',
transform: (res) => { transform: res => {
return res?.data.records || [] return res?.data.records || []
}, },
onChangeExtraFields: { onChangeExtraFields: {
insuranceCompany: 'fullName', insuranceCompany: 'fullName'
}
}, },
}, { {
type: 'select', type: 'select',
prop: 'productCate', prop: 'productCate',
label: '保险险种', label: '保险险种',
...@@ -491,13 +575,12 @@ const basicPlanFormConfig = ref([ ...@@ -491,13 +575,12 @@ const basicPlanFormConfig = ref([
debounceWait: 500, // 自定义防抖时间 debounceWait: 500, // 自定义防抖时间
valueKey: 'insuranceCategoryBizId', valueKey: 'insuranceCategoryBizId',
labelKey: 'name', labelKey: 'name',
transform: (res) => { transform: res => {
return res?.data.records || [] return res?.data.records || []
}, },
onChangeExtraFields: { onChangeExtraFields: {
insuranceCategoryCode: 'code', insuranceCategoryCode: 'code'
}, }
}, },
{ {
type: 'select', type: 'select',
...@@ -520,94 +603,106 @@ const basicPlanFormConfig = ref([ ...@@ -520,94 +603,106 @@ const basicPlanFormConfig = ref([
debounceWait: 500, debounceWait: 500,
valueKey: 'productName', valueKey: 'productName',
labelKey: 'productName', labelKey: 'productName',
transform: (res) => { transform: res => {
console.log('======子组件选择选项后,父组件接收的值 :', res?.data.records || []) console.log('======子组件选择选项后,父组件接收的值 :', res?.data.records || [])
return res?.data.records || [] return res?.data.records || []
}, },
onChangeExtraFields: { onChangeExtraFields: {
apiAttributeSettingDtoList: 'apiAttributeSettingDtoList', apiAttributeSettingDtoList: 'apiAttributeSettingDtoList',
productLaunchBizId: 'productLaunchBizId', productLaunchBizId: 'productLaunchBizId',
insuranceCategoryCode: 'code', insuranceCategoryCode: 'code'
// 如果需要,也可以回填其他字段 // 如果需要,也可以回填其他字段
}, }
}, },
{ {
type: 'select', type: 'select',
prop: 'paymentFrequency', prop: 'paymentFrequency',
label: '付款频率', label: '付款频率',
dictType: 'csf_ap_frequency', dictType: 'csf_ap_frequency'
}, { },
{
type: 'input', type: 'input',
prop: 'guaranteePeriod', prop: 'guaranteePeriod',
label: '保障期限', label: '保障期限'
}, { },
{
type: 'input', type: 'input',
prop: 'sumInsured', prop: 'sumInsured',
label: '保额(重疾险)', label: '保额(重疾险)'
}, { },
type: 'select', {
type: 'input',
prop: 'issueNumber', prop: 'issueNumber',
label: '供款期数', label: '供款期数',
}, { inputType: 'decimal'
},
{
type: 'select', type: 'select',
prop: 'policyCurrency', prop: 'policyCurrency',
label: '保单币种', label: '保单币种',
dictType: 'bx_currency_type' dictType: 'bx_currency_type'
}, { },
{
type: 'input', type: 'input',
prop: 'initialPremium', prop: 'initialPremium',
label: '每期保费', label: '每期保费',
inputType: 'decimal', inputType: 'decimal',
decimalDigits: 2, decimalDigits: 2,
visible: (formData) => formData.commissionBizType == 'R', visible: formData => formData.commissionBizType == 'R',
rules: [ rules: [
{ required: true, message: '请输入金额', trigger: 'blur' }, { required: true, message: '请输入金额', trigger: 'blur' },
{ pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' } { pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' }
] ]
}, { },
{
type: 'input', type: 'input',
prop: 'policyLevy', prop: 'policyLevy',
label: '保单征费', label: '保单征费',
inputType: 'decimal', inputType: 'decimal',
decimalDigits: 2, decimalDigits: 2,
visible: (formData) => formData.commissionBizType == 'R', visible: formData => formData.commissionBizType == 'R',
rules: [ rules: [
{ required: true, message: '请输入金额', trigger: 'blur' }, { required: true, message: '请输入金额', trigger: 'blur' },
{ pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' } { pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' }
] ]
}, { },
{
type: 'select', type: 'select',
prop: 'isPrepay', prop: 'isPrepay',
label: '是否预缴', label: '是否预缴',
dictType: 'sys_no_yes' dictType: 'sys_no_yes'
}, { },
{
type: 'select', type: 'select',
prop: 'isTraceable', prop: 'isTraceable',
label: '是否追溯', label: '是否追溯',
dictType: 'sys_no_yes' dictType: 'sys_no_yes'
}, { },
{
type: 'date', type: 'date',
prop: 'retroactiveDate', prop: 'retroactiveDate',
label: '回溯日期', label: '回溯日期'
}, { },
{
type: 'select', type: 'select',
prop: 'initialPaymentMethod', prop: 'initialPaymentMethod',
label: '首期付款方式', label: '首期付款方式',
dictType: 'csf_ap_first_issue' dictType: 'csf_ap_first_issue'
}, { },
{
type: 'select', type: 'select',
prop: 'renewalPaymentMethod', prop: 'renewalPaymentMethod',
label: '续期付款方式', label: '续期付款方式',
dictType: 'csf_ap_first_issue' dictType: 'csf_ap_first_issue'
}, { },
{
type: 'select', type: 'select',
prop: 'dividendDistributionMethod', prop: 'dividendDistributionMethod',
label: '红利付款方式', label: '红利付款方式',
dictType: 'csf_ap_dividend' dictType: 'csf_ap_dividend'
}, }
]) ])
// 首期保费 // 首期保费
const firstPremiumTableData = ref([]) const firstPremiumTableData = ref([])
const firstPremiumFormRef = ref() const firstPremiumFormRef = ref()
...@@ -623,7 +718,8 @@ const firstPremiumFormConfig = ref([ ...@@ -623,7 +718,8 @@ const firstPremiumFormConfig = ref([
{ required: true, message: '请输入金额', trigger: 'blur' }, { required: true, message: '请输入金额', trigger: 'blur' },
{ pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' } { pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' }
] ]
}, { },
{
type: 'input', type: 'input',
prop: 'policyLevy', prop: 'policyLevy',
label: '保单征费', label: '保单征费',
...@@ -633,12 +729,14 @@ const firstPremiumFormConfig = ref([ ...@@ -633,12 +729,14 @@ const firstPremiumFormConfig = ref([
{ required: true, message: '请输入金额', trigger: 'blur' }, { required: true, message: '请输入金额', trigger: 'blur' },
{ pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' } { pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' }
] ]
}, { },
{
type: 'select', type: 'select',
prop: 'initialPaymentMethod', prop: 'initialPaymentMethod',
label: '首期缴费方式', label: '首期缴费方式',
dictType: 'csf_ap_first_issue' dictType: 'csf_ap_first_issue'
}, { },
{
type: 'input', type: 'input',
prop: 'initialPremiumPaid', prop: 'initialPremiumPaid',
label: '首期已缴保费', label: '首期已缴保费',
...@@ -648,7 +746,8 @@ const firstPremiumFormConfig = ref([ ...@@ -648,7 +746,8 @@ const firstPremiumFormConfig = ref([
{ required: true, message: '请输入金额', trigger: 'blur' }, { required: true, message: '请输入金额', trigger: 'blur' },
{ pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' } { pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' }
] ]
}, { },
{
type: 'input', type: 'input',
prop: 'initialPremiumDue', prop: 'initialPremiumDue',
label: '首期待缴保费', label: '首期待缴保费',
...@@ -658,7 +757,8 @@ const firstPremiumFormConfig = ref([ ...@@ -658,7 +757,8 @@ const firstPremiumFormConfig = ref([
{ required: true, message: '请输入金额', trigger: 'blur' }, { required: true, message: '请输入金额', trigger: 'blur' },
{ pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' } { pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' }
] ]
}, { },
{
type: 'input', type: 'input',
prop: 'initialPremiumTotal', prop: 'initialPremiumTotal',
label: '首期缴费总额', label: '首期缴费总额',
...@@ -681,7 +781,8 @@ const firstPremiumFormConfig = ref([ ...@@ -681,7 +781,8 @@ const firstPremiumFormConfig = ref([
prop: 'latestPaymentDate', prop: 'latestPaymentDate',
label: '最晚缴费日', label: '最晚缴费日',
placeholder: '请选择' placeholder: '请选择'
}, { },
{
type: 'input', type: 'input',
prop: 'initialPremiumDiscount', prop: 'initialPremiumDiscount',
label: '首期保费优惠金额', label: '首期保费优惠金额',
...@@ -691,7 +792,7 @@ const firstPremiumFormConfig = ref([ ...@@ -691,7 +792,7 @@ const firstPremiumFormConfig = ref([
{ required: true, message: '请输入金额', trigger: 'blur' }, { required: true, message: '请输入金额', trigger: 'blur' },
{ pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' } { pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' }
] ]
}, }
]) ])
// 邮寄信息 // 邮寄信息
...@@ -703,43 +804,64 @@ const postalFormConfig = ref([ ...@@ -703,43 +804,64 @@ const postalFormConfig = ref([
prop: 'mailingMethod', prop: 'mailingMethod',
label: '寄送方式', label: '寄送方式',
dictType: 'csf_mailing_method' dictType: 'csf_mailing_method'
}, { },
{
type: 'input', type: 'input',
prop: 'deliveryNo', prop: 'deliveryNo',
label: '快递单号', label: '快递单号',
visible: (formData) => formData.mailingMethod == '2' visible: formData => formData.mailingMethod == '2'
}, { },
{
type: 'date', type: 'date',
prop: 'brokerSignDate', prop: 'brokerSignDate',
label: '我司签收日', label: '我司签收日',
rules: [ rules: [{ required: true, message: '请输入我司签收日', trigger: 'blur' }]
{ required: true, message: '请输入我司签收日', trigger: 'blur' } },
] {
}, {
type: 'date', type: 'date',
prop: 'customerSignDate', prop: 'customerSignDate',
label: '客户签收日', label: '客户签收日',
rules: [ rules: [{ required: true, message: '请输入客户签收日', trigger: 'blur' }]
{ required: true, message: '请输入客户签收日', trigger: 'blur' } }
]
},
]) ])
// 关联记录 // 关联记录
const relatedTableData = ref([]) const relatedTableData = ref([])
const attachmentTableData = ref([]) const attachmentTableData = ref([])
const attachmentTableColumns = ref([ const attachmentTableColumns = ref([
{ prop: 'originalName', label: '文件名', sortable: true, width: '150', formatter: (row) => row.originalName || '-' }, {
{ prop: 'fileType', label: '文件类型', sortable: true, width: '150', formatter: (row) => row.fileType || '-' }, prop: 'originalName',
{ prop: 'createTime', label: '上传时间', sortable: true, width: '150', formatter: (row) => row.createTime || '-' }, label: '文件名',
{ prop: 'creatorName', label: '上传人', sortable: true, width: '150', formatter: (row) => row.creatorName || '-' }, sortable: true,
width: '150',
formatter: row => row.originalName || '-'
},
{
prop: 'fileType',
label: '文件类型',
sortable: true,
width: '150',
formatter: row => row.fileType || '-'
},
{
prop: 'createTime',
label: '上传时间',
sortable: true,
width: '150',
formatter: row => row.createTime || '-'
},
{
prop: 'creatorName',
label: '上传人',
sortable: true,
width: '150',
formatter: row => row.creatorName || '-'
}
]) ])
// ===== 本地响应式数据 ===== // ===== 本地响应式数据 =====
const defaultFormData = () => ({}) const defaultFormData = () => ({})
// ✅ 使用 ref 而不是 reactive // ✅ 使用 ref 而不是 reactive
const localData = ref(defaultFormData()) const localData = ref(defaultFormData())
...@@ -751,24 +873,22 @@ onMounted(async () => { ...@@ -751,24 +873,22 @@ onMounted(async () => {
localData.value = { ...defaultFormData(), ...props.modelValue } localData.value = { ...defaultFormData(), ...props.modelValue }
} }
try { try {
getPolicyfollowDetail() getPolicyfollowDetail()
} catch (error) { } catch (error) {
console.error('字典加载失败', error) console.error('字典加载失败', error)
} finally { } finally {
} }
// 应用查看模式到基本信息表格 // 应用查看模式到基本信息表格
basicInfoFormConfig.value = basicInfoFormConfig ? applyViewMode(basicInfoFormConfig.value, props.mode) : [] basicInfoFormConfig.value = basicInfoFormConfig
policyInfoFormConfig.value = policyInfoFormConfig ? applyViewMode(policyInfoFormConfig.value, props.mode) : [] ? applyViewMode(basicInfoFormConfig.value, props.mode)
: []
policyInfoFormConfig.value = policyInfoFormConfig
? applyViewMode(policyInfoFormConfig.value, props.mode)
: []
}) })
// 监听基本信息(basic) // 监听基本信息(basic)
watch( watch(
[ [basicInfoFormData, policyInfoFormData],
basicInfoFormData,
policyInfoFormData,
],
() => { () => {
tabDirty.value.basic = true tabDirty.value.basic = true
}, },
...@@ -788,7 +908,8 @@ watch( ...@@ -788,7 +908,8 @@ watch(
() => { () => {
tabDirty.value.postal = true tabDirty.value.postal = true
}, },
{ deep: true }) { deep: true }
)
// 监听基本计划(productPlan) // 监听基本计划(productPlan)
watch( watch(
basicPlanFormData, basicPlanFormData,
...@@ -800,7 +921,7 @@ watch( ...@@ -800,7 +921,7 @@ watch(
// ✅ 监听 localData 变化,emit 出去(用于 v-model) // ✅ 监听 localData 变化,emit 出去(用于 v-model)
watch( watch(
() => localData.value, () => localData.value,
(newVal) => { newVal => {
console.log('========父组件监测的localData:', newVal) console.log('========父组件监测的localData:', newVal)
emit('update:modelValue', newVal) emit('update:modelValue', newVal)
}, },
...@@ -816,15 +937,11 @@ const handleBeforeLeave = async (newTabName, oldTabName) => { ...@@ -816,15 +937,11 @@ const handleBeforeLeave = async (newTabName, oldTabName) => {
console.log('切换前确认-----------------------', newTabName, oldTabName) console.log('切换前确认-----------------------', newTabName, oldTabName)
if (tabDirty.value[oldTabName]) { if (tabDirty.value[oldTabName]) {
try { try {
await ElMessageBox.confirm( await ElMessageBox.confirm(`“${getTabLabel(oldTabName)}” 未提交,确定要切换吗?`, '提示', {
`“${getTabLabel(oldTabName)}” 未提交,确定要切换吗?`,
'提示',
{
confirmButtonText: '继续切换', confirmButtonText: '继续切换',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
} })
)
return true // 允许切换 return true // 允许切换
} catch { } catch {
return false // 阻止切换 return false // 阻止切换
...@@ -832,7 +949,7 @@ const handleBeforeLeave = async (newTabName, oldTabName) => { ...@@ -832,7 +949,7 @@ const handleBeforeLeave = async (newTabName, oldTabName) => {
} }
return true // 无未保存内容,允许切换 return true // 无未保存内容,允许切换
} }
const getTabLabel = (name) => { const getTabLabel = name => {
const labels = { const labels = {
basic: '基础信息', basic: '基础信息',
productPlan: '产品计划', productPlan: '产品计划',
...@@ -844,28 +961,36 @@ const getTabLabel = (name) => { ...@@ -844,28 +961,36 @@ const getTabLabel = (name) => {
} }
return labels[name] || name return labels[name] || name
} }
const handleTabClick = (tab) => { const handleTabClick = tab => {
if (tab.props.name === 'firstPayment') { if (tab.props.name === 'firstPayment') {
firstPremiumFormConfig.value = firstPremiumFormConfig ? applyViewMode(firstPremiumFormConfig.value, props.mode) : [] firstPremiumFormConfig.value = firstPremiumFormConfig
? applyViewMode(firstPremiumFormConfig.value, props.mode)
: []
if (!policyInfoFormData.value.policyNo) return if (!policyInfoFormData.value.policyNo) return
getPremiumReconciliationList(policyInfoFormData.value.policyNo) getPremiumReconciliationList(policyInfoFormData.value.policyNo)
} else if (tab.props.name === 'postal') { } else if (tab.props.name === 'postal') {
postalFormConfig.value = postalFormConfig ? applyViewMode(postalFormConfig.value, props.mode) : [] postalFormConfig.value = postalFormConfig
? applyViewMode(postalFormConfig.value, props.mode)
: []
} else if (tab.props.name === 'related') { } else if (tab.props.name === 'related') {
getRelationRecord(newOrderData.value.fnaBizId) getRelationRecord(newOrderData.value.fnaBizId)
} else if (tab.props.name === 'attachment') { } else if (tab.props.name === 'attachment') {
getAttachmentListDetail(newOrderData.value.policyBizId) getAttachmentListDetail(newOrderData.value.policyBizId)
} else if (tab.props.name === 'productPlan') { } else if (tab.props.name === 'productPlan') {
basicPlanFormConfig.value = basicPlanFormConfig ? applyViewMode(basicPlanFormConfig.value, props.mode) : [] basicPlanFormConfig.value = basicPlanFormConfig
? applyViewMode(basicPlanFormConfig.value, props.mode)
: []
} else if (tab.props.name === 'introducer') { } else if (tab.props.name === 'introducer') {
// introducerConfig.value = introducerConfig ? applyViewMode(introducerConfig.value, props.mode) : [] // introducerConfig.value = introducerConfig ? applyViewMode(introducerConfig.value, props.mode) : []
} else if (tab.props.name === 'basic') { } else if (tab.props.name === 'basic') {
basicInfoFormConfig.value = basicInfoFormConfig ? applyViewMode(basicInfoFormConfig.value, props.mode) : [] basicInfoFormConfig.value = basicInfoFormConfig
? applyViewMode(basicInfoFormConfig.value, props.mode)
: []
} }
} }
const handleSubmit = () => { const handleSubmit = () => {
formRef.value?.validate((valid) => { formRef.value?.validate(valid => {
if (valid) { if (valid) {
console.log('提交数据', introducerTableData.value) console.log('提交数据', introducerTableData.value)
if (activeTab.value === 'postal') { if (activeTab.value === 'postal') {
...@@ -877,11 +1002,18 @@ const handleSubmit = () => { ...@@ -877,11 +1002,18 @@ const handleSubmit = () => {
} else if (activeTab.value === 'introducer') { } else if (activeTab.value === 'introducer') {
emit('submit', { ...introducerTableData.value, activeTab: activeTab.value }) emit('submit', { ...introducerTableData.value, activeTab: activeTab.value })
} else if (activeTab.value === 'basic') { } else if (activeTab.value === 'basic') {
emit('submit', { ...basicInfoFormData.value, activeTab: activeTab.value, ...policyInfoFormData.value }) emit('submit', {
...basicInfoFormData.value,
activeTab: activeTab.value,
...policyInfoFormData.value
})
} else if (activeTab.value === 'productPlan') { } else if (activeTab.value === 'productPlan') {
emit('submit', { ...basicPlanFormData.value, activeTab: activeTab.value, ...localData.additionalPlans }) emit('submit', {
...basicPlanFormData.value,
activeTab: activeTab.value,
...localData.additionalPlans
})
} }
} }
}) })
} }
...@@ -890,14 +1022,14 @@ const handleCancel = () => { ...@@ -890,14 +1022,14 @@ const handleCancel = () => {
emit('cancel') emit('cancel')
} }
const handleClick = (tab) => { const handleClick = tab => {
activeTab.value = tab.name activeTab.value = tab.name
} }
// 如果外部 modelValue 更新(比如重新加载数据),同步到 localData // 如果外部 modelValue 更新(比如重新加载数据),同步到 localData
watch( watch(
() => props.modelValue, () => props.modelValue,
(newVal) => { newVal => {
if (newVal) { if (newVal) {
Object.assign(localData, defaultFormData(), newVal) Object.assign(localData, defaultFormData(), newVal)
} }
...@@ -914,26 +1046,27 @@ const getPolicyfollowDetail = () => { ...@@ -914,26 +1046,27 @@ const getPolicyfollowDetail = () => {
if (res.code === 200) { if (res.code === 200) {
console.log('====父组件在赋值basicPlanFormData前', basicPlanFormData.value) console.log('====父组件在赋值basicPlanFormData前', basicPlanFormData.value)
newOrderData.value = res.data newOrderData.value = res.data
policyInfoFormData.value = { ...transformToFormData(res.data, policyInfoFormConfig.value) }; policyInfoFormData.value = { ...transformToFormData(res.data, policyInfoFormConfig.value) }
basicPlanFormData.value = { ...transformToFormData(res.data, basicPlanFormConfig.value) }; basicPlanFormData.value = { ...transformToFormData(res.data, basicPlanFormConfig.value) }
basicInfoFormData.value = { ...transformToFormData(res.data, basicInfoFormConfig.value) }; basicInfoFormData.value = { ...transformToFormData(res.data, basicInfoFormConfig.value) }
firstPremiumFormData.value = { ...transformToFormData(res.data, firstPremiumFormConfig.value) }; firstPremiumFormData.value = {
...transformToFormData(res.data, firstPremiumFormConfig.value)
}
introducerTableData.value = res.data.brokerList || [] introducerTableData.value = res.data.brokerList || []
console.log('====父组件在赋值basicPlanFormData后', basicPlanFormData.value) console.log('====父组件在赋值basicPlanFormData后', basicPlanFormData.value)
} }
}) })
} }
// 查询附件列表 // 查询附件列表
const getAttachmentListDetail = (policyBizId) => { const getAttachmentListDetail = policyBizId => {
if (!policyBizId) { if (!policyBizId) {
return return
} }
const params = { const params = {
objectBizId: policyBizId, objectBizId: policyBizId,
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100
} }
uploadOssFileList(params).then(res => { uploadOssFileList(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
...@@ -944,7 +1077,7 @@ const getAttachmentListDetail = (policyBizId) => { ...@@ -944,7 +1077,7 @@ const getAttachmentListDetail = (policyBizId) => {
} }
// 附件上传方法 // 附件上传方法
const handleUploadEnd = (code) => { const handleUploadEnd = code => {
if (code === 200) { if (code === 200) {
ElMessage.success('上传文件成功') ElMessage.success('上传文件成功')
fileUploadDialogFlag.value = false fileUploadDialogFlag.value = false
...@@ -957,38 +1090,38 @@ const handleUploadEnd = (code) => { ...@@ -957,38 +1090,38 @@ const handleUploadEnd = (code) => {
// 组装表单数据 // 组装表单数据
const transformToFormData = (apiData, formConfig) => { const transformToFormData = (apiData, formConfig) => {
const formData = {}; const formData = {}
formConfig.forEach(item => { formConfig.forEach(item => {
const { prop, dictType } = item; const { prop, dictType } = item
let value = null; let value = null
// 特殊映射(按需添加) // 特殊映射(按需添加)
switch (prop) { switch (prop) {
case 'signLocation': case 'signLocation':
value = apiData.signLocation; value = apiData.signLocation
break; break
default: default:
value = apiData[prop]; value = apiData[prop]
} }
// 处理字典字段:如果配置了 dictType,且值是 number,转为 string // 处理字典字段:如果配置了 dictType,且值是 number,转为 string
if (dictType && typeof value === 'number') { if (dictType && typeof value === 'number') {
value = String(value); value = String(value)
} }
formData[prop] = value ?? null; formData[prop] = value ?? null
}); })
return formData; return formData
}; }
// 获取首期保费对账列表 // 获取首期保费对账列表
const getPremiumReconciliationList = (policyNo) => { const getPremiumReconciliationList = policyNo => {
const params = { const params = {
policyNo: policyNo, policyNo: policyNo,
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100
} }
premiumReconciliationList(params).then(res => { premiumReconciliationList(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
...@@ -998,7 +1131,7 @@ const getPremiumReconciliationList = (policyNo) => { ...@@ -998,7 +1131,7 @@ const getPremiumReconciliationList = (policyNo) => {
} }
// 获取关联流程记录 // 获取关联流程记录
const getRelationRecord = (fnaBizId) => { const getRelationRecord = fnaBizId => {
getProcessDetail(fnaBizId).then(res => { getProcessDetail(fnaBizId).then(res => {
if (res.code === 200) { if (res.code === 200) {
relatedTableData.value = [res.data] || [] relatedTableData.value = [res.data] || []
...@@ -1007,7 +1140,7 @@ const getRelationRecord = (fnaBizId) => { ...@@ -1007,7 +1140,7 @@ const getRelationRecord = (fnaBizId) => {
}) })
} }
const viewRecordDetail = (e) => { const viewRecordDetail = e => {
router.push({ router.push({
path: '/sign/FnaList/edit', path: '/sign/FnaList/edit',
query: { query: {
...@@ -1031,16 +1164,15 @@ const handleSelectChange = async (prop, value, item, type) => { ...@@ -1031,16 +1164,15 @@ const handleSelectChange = async (prop, value, item, type) => {
insuranceCompanyBizIdList: [basicPlanFormData.value.insuranceCompanyBizId], insuranceCompanyBizIdList: [basicPlanFormData.value.insuranceCompanyBizId],
categoryCodeList: [basicPlanFormData.value.insuranceCategoryCode], categoryCodeList: [basicPlanFormData.value.insuranceCategoryCode],
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100
} }
console.log('====父组件拿到值,去调用产品列表查询接口', params) console.log('====父组件拿到值,去调用产品列表查询接口', params)
getProductLists(params) getProductLists(params)
} }
} }
// 获取产品列表 // 获取产品列表
const getProductLists = (params) => { const getProductLists = params => {
getProductList(params).then(res => { getProductList(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
console.log('productList', res.data.records || []) console.log('productList', res.data.records || [])
...@@ -1052,7 +1184,6 @@ const getProductLists = (params) => { ...@@ -1052,7 +1184,6 @@ const getProductLists = (params) => {
defineExpose({ defineExpose({
getPolicyfollowDetail getPolicyfollowDetail
}) })
</script> </script>
<style scoped> <style scoped>
......
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