Commit 14446ff2 by yuzhenWang

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

修复流程bug

See merge request !69
parents 97435f21 37e28dde
......@@ -13,6 +13,7 @@ const beneficiary = [
label: '是否法定受益人',
key: 'isLegalBeneficiary',
domType: 'Select',
defaultValue: '1',
required: true,
disabled: false,
placeholder: '请选择',
......
......@@ -70,7 +70,7 @@ const customer = [
custom: true,
placeholder: '请选择证件有效期',
// required: true,
width:300
width: 300
}
],
data: []
......
......@@ -245,6 +245,7 @@ const fnaForm = [
{
label: '在过去12个月里你的平均每月收入',
key: 'monthlyIncome',
customerKey: 'monthIncome',
value: '',
domType: 'Input',
unit: 'HKD',
......@@ -264,6 +265,7 @@ const fnaForm = [
{
label: '在过去12个月里你的平均每月开支',
key: 'monthlyExpense',
customerKey: 'monthExpenditure',
value: '',
domType: 'Input',
unit: 'HKD',
......@@ -282,6 +284,7 @@ const fnaForm = [
{
label: '您现时的累积流动资产约有多少?',
key: 'liquidAssets',
customerKey: 'totalCurrentAssets',
value: '',
domType: 'Input',
unit: 'HKD',
......
......@@ -12,6 +12,7 @@ const secondHolder = [
{
label: '是否有第二持有人',
key: 'isSecond',
defaultValue: '0',
domType: 'Select',
required: true,
disabled: false,
......
......@@ -1133,6 +1133,10 @@ const setFormValue = (obj, formData, exportValue) => {
phoneQuickList.value = []
// 深拷贝原始数据
form.value = JSON.parse(JSON.stringify(obj))
// 新增预约,是受保人,与投保人关系默认值是本人
if (props.activeName == 'insurantInfo' && !props.idsObj.appointmentBizId) {
form.value['policyholderRel'] = 'MYSELF'
}
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(formData))
......@@ -1159,8 +1163,7 @@ const setFormValue = (obj, formData, exportValue) => {
// 编辑状态当tab为受保人时,与投保人关系为本人控制受保人信息模块隐藏
if (
props.activeName == 'insurantInfo' &&
props.idsObj.appointmentBizId &&
obj.policyholderRel == 'MYSELF' &&
form.value['policyholderRel'] == 'MYSELF' &&
section.key !== 'policyholderRel'
) {
section.showMoudle = false
......@@ -1609,7 +1612,6 @@ watch(
} else {
processFormData()
}
// processFormData()
// 因为客户资料里的编辑状态是单独控制的
if (props.tabSource == 'customer' && props.customerBizId) {
editStatus.value = true
......
......@@ -567,6 +567,13 @@ const processFormData = async () => {
}
if (section.data) {
for (const field of section.data) {
if (field.customerKey) {
for (const cKey in props.customerInfo) {
if (cKey == field.customerKey && !props.fnaFormBizId) {
form.value[section.key][field.key] = props.customerInfo[cKey]
}
}
}
if (field.dictType) {
// 获取字典数据
field.options = fetchDictData(field.dictType)
......@@ -593,6 +600,9 @@ const processFormData = async () => {
loading.value = false
}
processedFanFormData.value = oldFanFormData.value = processedData
console.log('====================================')
console.log('新增', form.value)
console.log('====================================')
}
// 添加表单子级dom
const addChildren = father => {
......
......@@ -87,6 +87,7 @@
</div>
</div>
</div>
<Customer
v-if="tab.name === 'customer'"
:activeName="activeName"
......@@ -153,7 +154,8 @@ const dictStore = useDictStore()
const { proxy } = getCurrentInstance()
const route = useRoute()
const router = useRouter()
const activeName = ref('overview')
const activeName = ref()
const loading = ref(false)
const processInfo = ref({
fnaNo: '--',
status: '未保存',
......@@ -163,7 +165,6 @@ const processInfo = ref({
const updateStatus = ref(false)
const dictTypeLists = ref([])
const customerInfo = ref({})
const tabPaneRef = ref(null)
const tabsList = ref([
{
label: '总览',
......@@ -210,40 +211,40 @@ const tabsList = ref([
const { csf_fna_status } = proxy.useDict('csf_fna_status')
// 获取各个流程所需要得字典数据
const getDictsData = async () => {
// 请求每个流程中所涉及到的字典值数据,如果缓存中有,则不再请求
if (dictStore.dictTypeLists.length == 0) {
proxy.useDictLists([
'csf_employment',
'sys_no_yes',
'bx_currency_type',
'csf_liquid_asset_type',
'csf_premium_funding_source',
'csf_customer_type',
'csf_customer_title',
'sys_gender',
'csf_marriage',
'csf_education',
'csf_id_type',
'csf_ap_apply_type',
'csf_ap_meeting_point',
'csf_ap_first_issue',
'csf_ap_dividend',
'csf_ap_frequency',
'csf_ap_rel',
'csf_ap_registration',
'csf_ap_exercise',
'csf_ap_risk',
'csf_ap_movie',
'csf_ap_game',
'wj_question_first_category',
'wj_question_second_category',
'csf_ap_policy_transfer',
'md_bank',
'csf_property_type',
'oss_data_type',
'oss_data_person'
])
}
loading.value = true
await proxy.useDictLists1([
'csf_employment',
'sys_no_yes',
'bx_currency_type',
'csf_liquid_asset_type',
'csf_premium_funding_source',
'csf_customer_type',
'csf_customer_title',
'sys_gender',
'csf_marriage',
'csf_education',
'csf_id_type',
'csf_ap_apply_type',
'csf_ap_meeting_point',
'csf_ap_first_issue',
'csf_ap_dividend',
'csf_ap_frequency',
'csf_ap_rel',
'csf_ap_registration',
'csf_ap_exercise',
'csf_ap_risk',
'csf_ap_movie',
'csf_ap_game',
'wj_question_first_category',
'wj_question_second_category',
'csf_ap_policy_transfer',
'md_bank',
'csf_property_type',
'oss_data_type',
'oss_data_person'
])
activeName.value = 'overview'
loading.value = false
// 获取租户用户列表
const params1 = {
tenantBizId: userStore.projectInfo.tenantBizId,
......@@ -394,7 +395,7 @@ const processUpdate = (data, status) => {
// 获取流程详情
function getProcessInfo(fnaBizId, changeTab, currentTab) {
getProcessDetail(fnaBizId).then(res => {
getProcessDetail(fnaBizId).then(async res => {
if (res.code == 200) {
processInfo.value = res.data
tabsList.value.forEach(item => {
......@@ -404,13 +405,16 @@ function getProcessInfo(fnaBizId, changeTab, currentTab) {
item.status = '0'
}
})
console.log('客户资料新增成功', tabsList.value)
csf_fna_status._object.csf_fna_status.forEach(item => {
if (item.value == res.data.status) {
processInfo.value.status = item.label
}
})
if (res.data.customerBizId) {
await getCustomerInfo(res.data.customerBizId)
}
if (currentTab == 'appointment' && changeTab == 'appointment') {
router.push({ path: '/sign/appointment' })
} else if (changeTab) {
......@@ -421,9 +425,6 @@ function getProcessInfo(fnaBizId, changeTab, currentTab) {
}
// Tab切换前的验证
const beforeTabLeave = (activeTabName, oldTabName) => {
if (processInfo.value.customerBizId) {
// getCustomerInfo(processInfo.value.customerBizId)
}
// 如果切换到总览,始终允许
if (activeTabName === 'overview' || activeTabName === 'customer') {
return true
......@@ -471,9 +472,6 @@ const handleStep = item => {
// 允许切换
activeName.value = item.name
}
const handleBack = () => {
router.go(-1)
}
if (route.query.type == 'add') {
// getAddInfo()
......@@ -482,24 +480,30 @@ if (route.query.type == 'add') {
getProcessInfo(route.query.fnaBizId)
}, 100)
}
// 获取客户详情
// 获取客户详情(返回 Promise)
function getCustomerInfo(customerBizId) {
getCustomerDetail(customerBizId).then(async res => {
if (res.code == 200) {
return getCustomerDetail(customerBizId).then(res => {
if (res.code === 200) {
customerInfo.value = res.data
return res.data // 成功时返回数据
} else {
// 可选:抛出错误以便调用方捕获
throw new Error(res.msg || '获取客户详情失败')
}
})
}
const handleSuccess = info => {
const handleSuccess = async info => {
switch (info.tab) {
case 'customer':
// await getCustomerInfo(info.customerBizId)
if (info.type == 'add') {
//客户提交成功,更新流程
processUpdate({ fnaBizId: info.fnaBizId, customerBizId: info.customerBizId }, 'fnaform')
} else {
processUpdate({ fnaBizId: processInfo.value.fnaBizId, customerBizId: info.customerBizId })
}
getCustomerInfo(info.customerBizId)
break
case 'fnaform':
if (info.type == 'add') {
......@@ -552,7 +556,17 @@ getDictsData()
min-height: calc(100vh - 84.5px);
padding: 20px;
background-color: #f2f3f5;
.domEmpty {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
font-size: 16px;
color: #a8abb2;
margin-top: 100px;
}
.cardHeader {
display: flex;
justify-content: space-between;
......
......@@ -752,37 +752,7 @@ function getCustomerInfo(customerBizId) {
}
// 获取各个流程所需要得字典数据
const getDictsData = async () => {
// proxy.useDictLists([
// 'csf_employment',
// 'sys_no_yes',
// 'bx_currency_type',
// 'csf_liquid_asset_type',
// 'csf_premium_funding_source',
// 'csf_customer_type',
// 'csf_customer_title',
// 'sys_gender',
// 'csf_marriage',
// 'csf_education',
// 'csf_id_type',
// 'csf_ap_apply_type',
// 'csf_ap_meeting_point',
// 'csf_ap_first_issue',
// 'csf_ap_dividend',
// 'csf_ap_frequency',
// 'csf_ap_rel',
// 'csf_ap_registration',
// 'csf_ap_exercise',
// 'csf_ap_risk',
// 'csf_ap_movie',
// 'csf_ap_game',
// 'csf_ap_policy_transfer',
// 'wj_question_first_category',
// 'wj_question_second_category',
// 'csf_ap_status',
// 'md_bank',
// 'oss_data_type',
// 'oss_data_person'
// ])
if (route.query.source == 'policyList') {
const params4 = {
pageNo: 1,
......
......@@ -571,6 +571,13 @@ const processFormData = async obj => {
for (const section of processedData) {
if (section.data) {
for (const field of section.data) {
if (!props.idsObj.appointmentBizId && field.defaultValue) {
if (field.key == 'isLegalBeneficiary') {
form.value[field.key] = Number(field.defaultValue)
} else {
form.value[field.key] = field.defaultValue
}
}
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' }
]
......@@ -589,7 +596,7 @@ const processFormData = async obj => {
}
}
}
if (props.idsObj.appointmentBizId ) {
if (props.idsObj.appointmentBizId) {
setFormValue(processedData)
} else {
processedBeneficiaryData.value = oldAppointmentData.value = processedData
......
......@@ -436,6 +436,13 @@ const processFormData = async obj => {
for (const section of processedData) {
if (section.data) {
for (const field of section.data) {
if (!props.idsObj.appointmentBizId && field.defaultValue) {
if (field.key == 'isSecond') {
form.value[field.key] = Number(field.defaultValue)
} else {
form.value[field.key] = field.defaultValue
}
}
// 编辑状态下回显表单值
if (section.key == 'apiSecondHolderInfoDto' && props.idsObj.appointmentBizId) {
if (obj['detailInfo'] && obj['detailInfo']['isSecond'] == '0') {
......
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