Commit 14446ff2 by yuzhenWang

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

修复流程bug

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