Commit 2173ad29 by yuzhenWang

发布fanForm模块到测试

parent d53d843f
......@@ -47,3 +47,19 @@ export function getSearchCountry(name) {
method: 'get'
})
}
// 查询租户用户关系列表
export function listTenantUser(data) {
return request({
url: '/user/api/relTenantUser/page',
method: 'post',
data: data
})
}
// 查询多个字典列表
export function getMoreDicts(data) {
return request({
url: '/user/api/sysDict/type/list',
method: 'post',
data: data
})
}
......@@ -72,7 +72,7 @@ export function editCustomer(data) {
data: data
})
}
// 修改客户信息
// 获取客户列表信息
export function getCustomerList(data) {
return request({
url: '/csf/api/Customer/list/page/vo',
......@@ -83,6 +83,35 @@ export function getCustomerList(data) {
/*
客户模块接口结束
*/
/*
fanForm模块接口开始
*/
// 新增fanForm信息
export function addfanForm(data) {
return request({
url: '/csf/api/FnaForm/add',
method: 'post',
data: data
})
}
// 获取fanForm信息详情
export function getfanFormDetail(fnaFormBizId) {
return request({
url: `/csf/api/FnaForm/get/vo?fnaFormBizId=${fnaFormBizId}`,
method: 'get'
})
}
// 修改客户信息
export function editFanForm(data) {
return request({
url: '/csf/api/FnaForm/update',
method: 'post',
data: data
})
}
/*
fanForm模块接口结束
*/
// 修改角色
export function roleUpdate(data) {
return request({
......
const fnaForm = [
{
fatherTitle: '个人资料',
type: 'object',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
key: 'personalData',
child: 'no', //没有子级dom,直接展示
fatherRequired: true, //父级必填,代表个人资料这个模块有必填项
data: [
{
label: '陪同顾问姓名',
key: 'accountName',
domType: 'Select',
domType: 'SearchSelect',
required: true,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'csf_customer_title',
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
labelPosition: 'right', //标签的位置
lg: 8 //栅格布局份数
},
{
label: '理财顾问注册编号',
key: 'registrationNumber',
......@@ -32,6 +34,7 @@ const fnaForm = [
labelWidth: '130px', //标签宽度
sm: 12, //栅格布局份数
lg: 8, //栅格布局份数,
labelPosition: 'right', //标签的位置
labelWidth: '140px'
},
{
......@@ -45,6 +48,7 @@ const fnaForm = [
placeholder: '请输入',
show: true,
labelWidth: '130px', //标签宽度
labelPosition: 'right', //标签的位置
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
......@@ -59,6 +63,7 @@ const fnaForm = [
placeholder: '请输入',
show: true,
labelWidth: '120px', //标签宽度
labelPosition: 'right', //标签的位置
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
......@@ -74,6 +79,7 @@ const fnaForm = [
show: true,
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
labelPosition: 'right', //标签的位置
lg: 8 //栅格布局份数
},
{
......@@ -85,8 +91,9 @@ const fnaForm = [
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'csf_customer_title',
dictType: 'csf_employment',
labelWidth: '120px', //标签宽度
labelPosition: 'right', //标签的位置
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
......@@ -99,8 +106,9 @@ const fnaForm = [
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'csf_customer_title',
dictType: 'sys_no_yes',
labelWidth: '120px', //标签宽度
labelPosition: 'right', //标签的位置
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
......@@ -115,6 +123,7 @@ const fnaForm = [
placeholder: '请输入',
show: true,
labelWidth: '120px', //标签宽度
labelPosition: 'right', //标签的位置
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
......@@ -128,8 +137,9 @@ const fnaForm = [
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
show: false,
labelWidth: '120px', //标签宽度
labelPosition: 'right', //标签的位置
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
......@@ -138,16 +148,19 @@ const fnaForm = [
//家庭状况
{
fatherTitle: '家庭状况',
type: 'object',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'familyMembers',
child: 'yes', //有子级dom,需要循环展示
addFamilyChildren: true, //是否可以新增子级dom
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
type: '1',
childTitle: '父亲',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
// age: '',
// needProvide: '',
children: [
{
label: '年龄',
......@@ -184,6 +197,8 @@ const fnaForm = [
childTitle: '母亲',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
// age: '',
// needProvide: '',
children: [
{
label: '年龄',
......@@ -220,6 +235,8 @@ const fnaForm = [
childTitle: '配偶',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
// age: '',
// needProvide: '',
children: [
{
label: '年龄',
......@@ -256,10 +273,11 @@ const fnaForm = [
//财务需要分析
{
fatherTitle: '财务需要分析',
type: 'object',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'existingSecurityOwner',
dataLength: 5, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
child: 'yes', //有子级dom,需要循环展示
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
......@@ -338,40 +356,15 @@ const fnaForm = [
}
]
}
// {
// key: 'flow',
// childTitle: '',
// children: [
// {
// label: '流动资产种类',
// key: 'liquidAssetType',
// domType: 'Checkbox',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true
// },
// {
// label: '',
// key: 'otherLiquidAsset',
// domType: 'Input',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true
// }
// ]
// }
]
},
//受保人个人已有保障
{
type: 'object',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'existingSecurityInsured',
dataLength: 5, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
child: 'yes', //有子级dom,需要循环展示
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
childTitle: '受保人个人已有保障',
......@@ -452,224 +445,310 @@ const fnaForm = [
}
]
},
//保单持有人资产
{
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'primaryResidence',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
child: 'yes', //有子级dom,需要循环展示
subTitle: '保单持有人资产',
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
childTitle: '自住用途之房地产',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
children: [
{
label: '自住用途之房地产地址',
key: 'address',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '180px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '币种',
key: 'currency',
domType: 'Select',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'bx_currency_type',
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '自住用途之房地产市值(HKD)',
key: 'marketValue',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '220px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
}
]
},
{
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'investment',
dataLength: 2, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
child: 'yes', //有子级dom,需要循环展示
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
childTitle: '投资房地产',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
children: [
{
label: '地址',
key: 'address',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '币种',
key: 'currency',
domType: 'Select',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'bx_currency_type',
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '市值(HKD)',
key: 'marketValue',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
}
]
},
//公司业务资料
{
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
key: 'companyBusinessData',
child: 'no', //有子级dom,需要循环展示
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
subTitle: '公司业务资料 (适用于公司老板跟股东)',
data: [
{
label: '公司過去兩年平均純利 (HKD)',
key: 'averageNetProfit',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '220px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '公司現時大約的總資產 (HKD)',
key: 'estimatedTotalAssets',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '200px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
key: 'incom',
type: 'object',
label: '币种',
key: 'currency',
domType: 'Select',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'bx_currency_type',
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '资产所佔百分比 (%)',
key: 'assetPercentage',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '170px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
},
//支出
{
key: 'incomeExpense',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
child: 'no',
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
label:
'在过去24个月里,你从所有所得的收入来源所得的平均每月收入为?(包括薪金、花红、佣金、其他薪酬红利、银行存款利息、债券利息及股息等',
subLable: '金额(HKD)', //子标题
'在过去24个月里,你从所有所得的收入来源所得的平均每月收入为(包括薪金、花红、佣金、其他薪酬红利、银行存款利息、债券利息及股息等。',
key: 'monthlyIncome',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
placeholder: '请输入金额(HKD)',
show: true,
inputWidth: '300px',
labelWidth: '800px', //标签宽度
sm: 24, //栅格布局份数
lg: 24, //栅格布局份数
labelPosition: 'top', //标签的位置
layout: 'column'
labelPosition: 'top' //标签的位置
},
{
label: '过去24个月每月里,你每月的平均开支为?',
subLable: '金额(HKD)', //子标题
label: '过去24个月每月里,你每月的平均开支为',
key: 'monthlyExpense',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
placeholder: '请输入金额(HKD)',
show: true,
labelWidth: '200px', //标签宽度
sm: 12, //栅格布局份数
lg: 12, //栅格布局份数
layout: 'row'
inputWidth: '300px', //输入框宽度
labelWidth: '260px', //标签宽度
sm: 24, //栅格布局份数
lg: 12 //栅格布局份数
}
]
},
{
key: 'liquidAssets',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
child: 'no',
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
label: '您现时的累积流动资产约有多少?',
subLable: '金额(HKD)', //子标题
key: 'liquidAssets',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入金额(HKD)',
show: true,
inputWidth: '300px', //输入框宽度
labelWidth: '220px', //标签宽度
sm: 24, //栅格布局份数
lg: 12, //栅格布局份数
labelPosition: 'right' //标签的位置
},
{
label: '流动资产种类',
key: 'liquidAssetType',
domType: 'Checkbox',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入金额(HKD)',
show: true,
labelWidth: '100px', //标签宽度
sm: 20, //栅格布局份数
lg: 20, //栅格布局份数
labelPosition: 'right', //标签的位置
dictType: 'csf_liquid_asset_type'
},
{
label: '',
key: 'otherLiquidAsset',
domType: 'Input',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入说明',
show: true,
labelWidth: '0px', //标签宽度
sm: 4, //栅格布局份数
lg: 4, //栅格布局份数
labelPosition: 'right' //标签的位置
}
]
},
{
fatherTitle: '',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
child: 'no',
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
key: 'other',
data: [
{
label: '首期及续保保费的财富来源',
key: 'premiumFundingSource',
domType: 'Checkbox',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '200px', //标签宽度
sm: 12, //栅格布局份数
lg: 12 //栅格布局份数
labelWidth: '180px', //标签宽度
sm: 24, //栅格布局份数
lg: 24, //栅格布局份数
dictType: 'csf_premium_funding_source'
}
]
}
// {
// fatherTitle: '',
// secondTitle: '保单持有人资产',
// type: 'object',
// key: 'ownerAssets',
// data: [
// {
// key: 'primaryResidence',
// childTitle: '自住用途之房地產',
// childLength: 5,
// children: [
// {
// label: '地址',
// key: 'address',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true
// },
// {
// label: '市值',
// key: 'marketValue',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true
// },
// {
// label: '币种',
// key: 'currency',
// domType: 'Select',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// dictType: 'bx_currency_type'
// }
// ]
// },
// {
// key: 'investment',
// childTitle: '投資房地產',
// childLength: 2,
// children: [
// {
// label: '地址',
// key: 'address',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true
// },
// {
// label: '市值',
// key: 'marketValue',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true
// },
// {
// label: '币种',
// key: 'currency',
// domType: 'Select',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// dictType: 'bx_currency_type'
// }
// ]
// }
// ]
// },
// {
// fatherTitle: '',
// secondTitle: '公司业务资料',
// type: 'object',
// key: 'companyBusinessData',
// data: [
// {
// label: '币种',
// key: 'currency',
// domType: 'Select',
// required: true,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// dictType: 'bx_currency_type'
// },
// {
// label: '公司過去兩年平均純利 (HKD)',
// key: 'averageNetProfit',
// domType: 'Input',
// inputType: 'text',
// required: true,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true
// },
// {
// label: '公司現時大約的總資產 (HKD)',
// key: 'estimatedTotalAssets',
// domType: 'Input',
// inputType: 'text',
// required: true,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true
// },
// {
// label: '資產所佔百分比 (%)',
// key: 'assetPercentage',
// domType: 'Input',
// inputType: 'text',
// required: true,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true
// }
// ]
// },
// {
// fatherTitle: '',
// secondTitle: '首期及续保保费的财富来源',
// type: 'object',
// key: 'premiumFundingSource',
// data: [
// {
// label: '',
// key: 'premiumFundingSource',
// domType: 'Radio',
// required: true,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// dictType: 'csf_premium_funding_source'
// }
// ]
// }
]
export default fnaForm
......@@ -27,7 +27,7 @@ import elementIcons from '@/components/SvgIcon/svgicon'
import './permission' // permission control
import { useDict } from '@/utils/dict'
import { useDict,useDictLists } from '@/utils/dict'
import { getConfigKey } from '@/api/system/config'
import {
parseTime,
......@@ -57,6 +57,7 @@ const app = createApp(App)
// 全局方法挂载
app.config.globalProperties.useDict = useDict
app.config.globalProperties.useDictLists = useDictLists
app.config.globalProperties.download = download
app.config.globalProperties.parseTime = parseTime
app.config.globalProperties.getNowTime = getNowTime
......
const useDictStore = defineStore(
'dict',
{
const useDictStore = defineStore('dict', {
state: () => ({
dict: new Array()
dict: new Array(),
tenantUserList: [],
dictTypeLists: [] //字典列表,根据请求得不同会变化,所以使用之前需要使用useDictLists请求数据
}),
actions: {
// 获取字典
getDict(_key) {
if (_key == null && _key == "") {
if (_key == null && _key == '') {
return null
}
try {
......@@ -22,7 +22,7 @@ const useDictStore = defineStore(
},
// 设置字典
setDict(_key, value) {
if (_key !== null && _key !== "") {
if (_key !== null && _key !== '') {
this.dict.push({
key: _key,
value: value
......@@ -49,9 +49,16 @@ const useDictStore = defineStore(
this.dict = new Array()
},
// 初始字典
initDict() {
initDict() {},
// 设置租户用户列表
setTenantUserList(user) {
this.tenantUserList = user
},
// 设置字典列表
setDictTypeLists(typeList) {
this.dictTypeLists = typeList
}
}
})
})
export default useDictStore
{
"id": 12,
"customerBizId": "customer_XQH9OmZsSNafYMhc",
"customCode": null,
"lastName": "11",
"firstName": "11",
"name": "11",
"lastNamePinyin": "11",
"firstNamePinyin": "11",
"pinyin": "11",
"title": "Dr",
"gender": "2",
"birthdate": null,
"abnormal": null,
"age": "12",
"areaCode": "+86",
"phone": "11111",
"email": "11111",
"smoke": "1",
"smokeQuantity": "10",
"companyType": "11111",
"source": null,
"idType": "passport",
"idCard": "555",
"passport": null,
"eepCode": null,
"marriage": "MARRIED",
"birthplace": "11111111",
"education": "UNIVERSITY",
"customerExpandBizId": "customer_expand_l3eOcWeqGd1IFDJg",
"country": "CHINESE",
"countryName": "中国",
"createTime": "2025-09-16T11:40:58.000+08:00",
"customerType": null,
"residenceAreaCode": "+44",
"residenceTelephone": "22222",
"longtimeAbroad": "1",
"addressList": [
"id": 5,
"fnaFormBizId": "fna_form_8VXGgMskIU3uZWG7",
"customerBizId": "customer_bkr6dz9BkYGar48o",
"personalData": {
"accountName": "user_1002",
"registrationNumber": "11",
"number": null,
"customerName": "11",
"taxCountry": "11",
"employment": "PRAT_TIME",
"otherEmployment": null,
"isRetired": "1",
"retiredAge": null
},
"familyMembers": [
{
"type": "residenceAddress",
"region": "111",
"city": "222",
"street": "333",
"location": "444"
"type": "1",
"needProvide": "1",
"age": "11"
},
{
"type": "residentialAddress",
"region": "111",
"city": "222",
"street": "333",
"location": "444"
"type": "2",
"needProvide": "1",
"age": "11"
},
{
"type": "mailingAddress",
"region": "333",
"city": "333",
"street": "444",
"location": "555"
"type": "3",
"needProvide": "1",
"age": "11"
},
{
"type": "companyAddress",
"region": "666",
"city": "777",
"street": "888",
"location": "999"
"type": "4",
"needProvide": "1",
"age": "11"
}
],
"companyName": "444",
"companyAreaCode": "+65",
"companyTelephone": "5555",
"position": "555",
"workYear": "55",
"salary": 55555
"existingSecurityOwner": [],
"existingSecurityInsured": [],
"incomeExpense": {
"monthlyIncome": null,
"monthlyExpense": null
},
"liquidAssets": {
"liquidAssets": null,
"liquidAssetType": null,
"otherLiquidAsset": null
},
"primaryResidence": null,
"investment": null,
"companyBusinessData": {
"averageNetProfit": null,
"estimatedTotalAssets": null,
"currency": null,
"assetPercentage": null
},
"other": {
"premiumFundingSource": null
}
}
......@@ -6,12 +6,12 @@ export function formatIsoToDateTime(isoStr) {
// 替换 T 为空格,返回 "YYYY-MM-DD HH:mm:ss"
return isoStr.replace('T', ' ')
}
console.log(dayjs)
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
const DATE_FORMAT = 'YYYY-MM-DD'
export function formatToDateTime(date, format = DATE_TIME_FORMAT) {
if (!date) return ''
return dayjs(date).format(format)
}
......@@ -20,5 +20,6 @@ export function formatToDate(date, format = DATE_FORMAT) {
return dayjs(date).format(format)
}
export const getNowTime = (format = DATE_TIME_FORMAT) => {
if (!date) return ''
return dayjs().format(format)
}
import useDictStore from '@/store/modules/dict'
import { getDicts } from '@/api/system/dict/data'
import { getMoreDicts } from '@/api/common'
/**
* 获取字典数据
......@@ -22,7 +23,25 @@ export function useDict(...args) {
return toRefs(res.value)
})()
}
/**
* 获取多个字典数据
*/
export function useDictLists(typeLists) {
let params = { typeList: typeLists }
let dictArray = []
getMoreDicts(params).then(resp => {
if (resp.code === 200) {
dictArray = resp.data.map(item => {
item.dictItemList.forEach(dict => {
dict.label = dict.itemLabel
dict.value = dict.itemValue
})
return item
})
useDictStore().setDictTypeLists(dictArray)
}
})
}
// /**
// * 获取字典数据
// */
......
......@@ -104,15 +104,11 @@
<div>
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
<el-form-item label="客户姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter="customerList"
/>
<el-input v-model="queryParams.name" placeholder="请输入姓名" @input="customerList" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" circle @click="customerList" />
<el-button type="info" icon="Refresh" circle @click="resetCustomerList" />
</el-form-item>
</el-form>
<div class="customerBox">
......@@ -187,7 +183,8 @@ import Address from '@/views/components/address'
import { getDicts } from '@/api/system/dict/data'
import { watch, nextTick } from 'vue'
import { addCustomer, getCustomerDetail, editCustomer, getCustomerList } from '@/api/sign/fna'
import useDictStore from '@/store/modules/dict'
const dictStore = useDictStore() //获取字典数据
const props = defineProps({
activeName: { type: String, default: '' }, //tab名称
fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改
......@@ -279,6 +276,14 @@ const data = reactive({
}
})
const { form, rules, processedCustomerData, queryParams, oldCustomerData } = toRefs(data)
const resetCustomerList = () => {
queryParams.value = {
pageNo: 1,
pageSize: 4,
name: undefined
}
customerList()
}
const exportInfo = () => {
if (props.customerBizId && editStatus.value) {
......@@ -289,6 +294,8 @@ const exportInfo = () => {
customerList()
}
const customerList = () => {
console.log('触发了')
tableLoading.value = true
getCustomerList(queryParams.value).then(res => {
if (res.code == 200) {
......@@ -306,10 +313,15 @@ const handleExport = row => {
}
// 获取字典数据
const fetchDictData = async dictType => {
const fetchDictData = dictType => {
let options = []
try {
const resp = await getDicts(dictType)
return resp.data.map(p => ({ label: p.itemLabel, value: p.itemValue }))
dictStore.dictTypeLists.forEach(item => {
if (item.dictType == dictType) {
options = item.dictItemList
}
})
return options
} catch (error) {
console.error('获取字典数据失败:', error)
return []
......@@ -336,7 +348,7 @@ const processFormData = async () => {
for (const field of section.data) {
if (field.dictType) {
// 获取字典数据
field.options = await fetchDictData(field.dictType)
field.options = fetchDictData(field.dictType)
}
if (field.required) {
if (field.key === 'firstNamePinyin') {
......@@ -487,6 +499,8 @@ const handleSelectChange = child => {
// 改变编辑状态
const handleEditStatus = () => {
editStatus.value = !editStatus.value
console.log('触发了编辑状态', editStatus.value)
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(processedCustomerData.value))
for (const section of processedData) {
......@@ -730,12 +744,12 @@ const resetForm = () => {
.then(function () {
if (props.customerBizId) {
form.value = { ...oldObjInfo.value }
editStatus.value = true
} else {
resetShow('smokeQuantity', false)
proxy.$refs['customerRef'].resetFields()
}
processedCustomerData.value = JSON.parse(JSON.stringify(oldCustomerData.value))
console.log('processedCustomerData.value', processedCustomerData.value)
})
.catch(() => {})
......
......@@ -16,8 +16,9 @@
</el-row>
<el-form ref="fanFormRef" :model="form" :rules="rules">
<el-row v-for="father in processedFanFormData" style="margin-bottom: 10px">
<div class="formBox">
<div class="formBox formFna">
<div class="fatherLable">{{ father.fatherTitle }}</div>
<div class="subTitle" v-if="father.subTitle">{{ father.subTitle }}</div>
<el-row v-if="father.child == 'no'">
<template v-for="child in father.data" :key="child.key">
......@@ -25,10 +26,10 @@
<div>
<el-form-item
:label="child.label"
:prop="child.key"
:prop="father.key + '.' + child.key"
:key="child.key"
:label-width="child.labelWidth"
v-if="child.layout == 'row'"
:label-position="child.labelPosition"
>
<el-input
v-if="child.domType === 'Input'"
......@@ -37,12 +38,13 @@
:placeholder="child.placeholder"
maxlength="30"
:disabled="child.disabled"
:style="{ width: child.inputWidth ? child.inputWidth : '100%' }"
/>
<el-select
v-if="child.domType === 'Select'"
v-model="form[father.key][child.key]"
:placeholder="child.placeholder"
@change="handleSelectChange(child)"
@change="handleSelectChange(father, child)"
:disabled="child.disabled"
>
<el-option
......@@ -60,21 +62,37 @@
:placeholder="child.placeholder"
:disabled="child.disabled"
/>
</el-form-item>
<el-form-item
:label="child.label"
:prop="child.key"
:key="child.key"
v-if="child.layout == 'column'"
<el-checkbox-group
v-if="child.domType === 'Checkbox'"
v-model="form[father.key][child.key]"
:disabled="child.disabled"
>
<el-input
v-if="child.domType === 'Input'"
:type="child.inputType"
<el-checkbox
v-for="item in child.options"
:key="item.value"
:label="item.value"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
<el-select
v-model="form[father.key][child.key]"
:placeholder="child.placeholder"
maxlength="30"
v-if="child.domType === 'SearchSelect'"
filterable
remote
reserve-keyword
placeholder="请输入关键词搜索"
:remote-method="query => searchSelectList(query, child.key)"
:loading="searchLoadingStates[child.key]"
:disabled="child.disabled"
>
<el-option
v-for="item in searchOptions[child.key] || []"
:key="item.userBizId"
:label="item.realName"
:value="item.userBizId"
/>
</el-select>
</el-form-item>
</div>
</el-col>
......@@ -93,7 +111,8 @@
class="childLabel"
v-if="
father.key == 'existingSecurityOwner' ||
father.key == 'existingSecurityInsured'
father.key == 'existingSecurityInsured' ||
father.key == 'investment'
"
>
{{ `${child.childTitle}-${childIndex + 1}` }}
......@@ -104,7 +123,7 @@
:sm="grandchildren.sm"
:lg="grandchildren.lg"
class="formItem"
v-if="grandchildren.show"
v-if="grandchildren.show && form[father.key] && form[father.key][childIndex]"
>
<el-form-item
:label="grandchildren.label"
......@@ -124,7 +143,6 @@
v-if="grandchildren.domType === 'Select'"
v-model="form[father.key][childIndex][grandchildren.key]"
:placeholder="grandchildren.placeholder"
@change="handleSelectChange(grandchildren)"
:disabled="grandchildren.disabled"
>
<el-option
......@@ -172,16 +190,12 @@
<el-row>
<el-col>
<div class="tabButton">
<el-button
type="primary"
icon="RefreshRight"
@click="resetForm"
size="large"
:disabled="editStatus"
<!-- :disabled="editStatus" -->
<el-button type="primary" icon="RefreshRight" size="large" @click="submitForm('temp')"
>暂存</el-button
>
<!-- :disabled="editStatus" -->
<el-button type="primary" icon="Check" @click="submitForm" size="large"
<el-button type="primary" icon="Check" @click="submitForm('save')" size="large"
>提交</el-button
>
</div>
......@@ -192,16 +206,21 @@
</div>
</template>
<script setup name="customer">
import useDictStore from '@/store/modules/dict'
import fanFormDomData from '@/formJson/fnaForm'
import { getDicts } from '@/api/system/dict/data'
import { watch } from 'vue'
import { addCustomer, getCustomerDetail, editCustomer, getCustomerList } from '@/api/sign/fna'
console.log('fanFormDomData', fanFormDomData)
import { addfanForm, getfanFormDetail, editFanForm, getCustomerList } from '@/api/sign/fna'
import { listTenantUser } from '@/api/common'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
const dictStore = useDictStore() //获取字典数据
const props = defineProps({
activeName: { type: String, default: '' }, //tab名称
fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改
fnaFormBizId: { type: String, default: '' } //提交状态,新增、修改
fnaFormBizId: { type: String, default: '' }, //提交状态,新增、修改
customerBizId: { type: String, default: '' }, //提交状态,新增、修改
dictTypeLists: { type: Array, default: () => [] } //多个字典值数据
})
const emit = defineEmits(['handleSuccess'])
const { proxy } = getCurrentInstance()
......@@ -212,26 +231,10 @@ const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可
const openList = ref(false) // 客户列表弹窗
const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const noYesList = ref([]) // 是否列表
// 快捷地址的数据
const addressQuickList = ref([])
const phoneQuickList = ref([])
const deleteKeyList = ref([
'objType',
'mailingAddress',
'residentialAddress',
'residenceAddress',
'companyAddress'
]) // 存储需要删除的key
const searchOptions = ref({}) // 存储不同key对应的选项
const searchLoadingStates = ref({}) // 存储不同key对应的加载状态
const data = reactive({
form: {
familyMembers: [],
personalData: {},
existingSecurityOwner: [],
existingSecurityInsured: [],
incom: {}
},
form: {},
processedFanFormData: [], // 处理后的表单数据
oldFanFormData: [], // 保存旧的表单Dom,便于撤销操作
rules: {}, //表单验证规则,
......@@ -242,37 +245,67 @@ const data = reactive({
}
})
const { form, rules, processedFanFormData, queryParams, oldFanFormData } = toRefs(data)
const handleInputChange = val => {
console.log('form', form.value)
// 下拉框搜索方法
// 搜索方法
const searchSelectList = async (query, fieldKey) => {
// 设置该字段的加载状态
searchLoadingStates.value[fieldKey] = true
try {
// 根据不同的字段key调用不同的API
if (fieldKey === 'accountName') {
const params = {
tenantBizId: userStore.projectInfo.tenantBizId,
realName: query.trim(),
pageNo: 1,
pageSize: 10
}
const response = await listTenantUser(params)
searchOptions.value[fieldKey] = response.data.records
}
// 可以添加其他字段的处理,可以放其他的字段得请求,目前只有accountName,以后有了其他的在填充
else if (fieldKey === 'otherField') {
console.log('otherField')
}
} catch (error) {
console.error(`${fieldKey} 搜索失败`, error)
searchOptions.value[fieldKey] = []
} finally {
searchLoadingStates.value[fieldKey] = false
}
}
// 获取字典数据
const fetchDictData = async dictType => {
const fetchDictData = dictType => {
let options = []
try {
const resp = await getDicts(dictType)
return resp.data.map(p => ({ label: p.itemLabel, value: p.itemValue }))
dictStore.dictTypeLists.forEach(item => {
if (item.dictType == dictType) {
options = item.dictItemList
}
})
return options
} catch (error) {
console.error('获取字典数据失败:', error)
return []
}
}
// 添加英文校验函数
const validateEnglish = (rule, value, callback) => {
if (value && !/^[A-Za-z]*$/.test(value)) {
// 清空非英文字符
form.value.firstNamePinyin = ''
callback(new Error('只能输入英文字母'))
} else {
callback()
}
}
// 处理表单配置,添加字典数据
const processFormData = async () => {
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(fanFormDomData))
for (const section of processedData) {
if (section.fatherRequired) {
rules.value[section.key] = {}
}
//给表单赋值各模块key,对应表单的father.key便于收集值
if (section.keyType == 'Array') {
form.value[section.key] = []
} else if (section.keyType == 'Object') {
form.value[section.key] = {}
}
if (section.data) {
for (const formKey in form.value) {
if (section.key == formKey) {
......@@ -282,54 +315,60 @@ const processFormData = async () => {
}
}
for (const field of section.data) {
// 为下拉搜索框加options
if (field.domType == 'SearchSelect') {
if (field.key == 'accountName') {
searchOptions.value[field.key] = dictStore.tenantUserList
}
}
if (section.key == formKey && field.children) {
for (const child of field.children) {
if (child.dictType) {
// 获取字典数据
child.options = await fetchDictData(child.dictType)
child.options = fetchDictData(child.dictType)
if (child.dictType == 'sys_no_yes') {
noYesList.value = child.options
}
}
if (props.fnaFormBizId) {
child.disabled = true
} else {
child.disabled = false
}
}
}
if (field.dictType) {
// 获取字典数据
field.options = await fetchDictData(field.dictType)
}
if (field.required) {
if (field.key === 'firstNamePinyin') {
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' },
{ validator: validateEnglish, trigger: 'change' }
]
} else {
rules.value[field.key] = [
field.options = fetchDictData(field.dictType)
}
//
/*
1.没有嵌套子级的也就是没有children的数据加rules,根据data中的required字段判断是否必填
2.有嵌套子级的也就是有children的数据,根据children中的required字段判断是否必填,现在没这个需求,所以先注释
*/
if (field.required && section.child == 'no') {
rules.value[section.key][field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' }
]
}
}
if (props.fnaFormBizId) {
field.disabled = true
} else {
field.disabled = false
}
}
if (section.child == 'yes') {
form.value[formKey] = section.data //便于表单收集值
}
}
}
}
}
if (props.fnaFormBizId) {
getFanformInfo(props.fnaFormBizId, processedData)
} else {
processedFanFormData.value = oldFanFormData.value = processedData
console.log('====================================')
console.log('form', form.value)
console.log('====================================')
// if (props.customerBizId) {
// getCustomerInfo(props.customerBizId, processedData)
// } else {
// editStatus.value = false
// processedFanFormData.value = oldFanFormData.value = processedData
// }
}
}
// 添加表单子级dom
const addChildren = father => {
......@@ -340,6 +379,8 @@ const addChildren = father => {
span: 24, //栅格布局份数
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
delete: true, //是否显示删除按钮
age: '',
needProvide: '',
children: [
{
label: '年龄',
......@@ -373,51 +414,51 @@ const addChildren = father => {
]
}
for (const section of processedData) {
if (father.key == 'familyMembers') {
if (father.key == 'familyMembers' && section.key == father.key) {
section.data.push(obj)
}
}
//更新form表单对应的数据,以便收集填写的值
form.value['familyMembers'].push(obj)
form.value[father.key].push(obj)
processedFanFormData.value = processedData
}
const deleteChildren = (father, childIndex) => {
const processedData = JSON.parse(JSON.stringify(processedFanFormData.value))
for (const section of processedData) {
if (father.key == 'familyMembers') {
if (father.key == 'familyMembers' && section.key == father.key) {
section.data.splice(childIndex, 1)
}
}
//更新form表单对应的数据,以便收集填写的值
form.value['familyMembers'].splice(childIndex, 1)
console.log('form.value', form.value)
form.value[father.key].splice(childIndex, 1)
processedFanFormData.value = processedData
}
// 根据联动重置表单项的显示与否
const resetShow = (key, status) => {
const resetShow = (childKey, status) => {
console.log(childKey, status)
for (const section of processedFanFormData.value) {
// 暂时没考虑data里嵌套children的情况
if (section.data) {
for (const field of section.data) {
if (field.key == key) {
if (field.key == childKey) {
// 获取字典数据
field.show = status
if (!status) {
form.value[key] = ''
}
}
}
}
}
}
const handleSelectChange = child => {
const handleSelectChange = (father, child) => {
switch (child.key) {
case 'smoke':
case 'employment':
// 选择吸烟,展示吸烟数量
if (form.value[child.key] == '1') {
resetShow('smokeQuantity', true)
if (form.value[father.key][child.key] == 'OTHER') {
resetShow('otherEmployment', true)
form.value[father.key]['otherEmployment'] = ''
} else {
resetShow('smokeQuantity', false)
resetShow('otherEmployment', false)
}
break
......@@ -434,146 +475,186 @@ const handleEditStatus = () => {
for (const section of processedData) {
if (section.data) {
for (const field of section.data) {
// 改变data中字段得编辑状态
if (editStatus.value) {
field.disabled = true
} else {
field.disabled = false
}
// 改变data中的children字段得编辑状态
if (field.children) {
for (const child of field.children) {
if (editStatus.value) {
child.disabled = true
} else {
child.disabled = false
}
}
}
}
}
}
processedFanFormData.value = processedData
}
//给表单赋值 方便表单回显 obj 为表单数据
const setFormValue = (obj, formData, exportValue) => {
let tempPhoneList = []
let tempAddressList = []
addressQuickList.value = []
phoneQuickList.value = []
// 深拷贝原始数据
form.value = JSON.parse(JSON.stringify(obj))
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(formData))
for (const section of processedData) {
if (section.data) {
for (const field of section.data) {
if (obj.smokeQuantity && field.key == 'smokeQuantity') {
field.show = true
}
//要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) {
case 'phone':
let phoneObj = {}
for (const key1 in field) {
const setFormValue = (obj, formData) => {
// 写到给家人赋值了,家人传值也不太对
let newForm = JSON.parse(JSON.stringify(form.value))
// 1.先正确的拿到表单的回显值
for (const key in newForm) {
for (const key2 in obj) {
if (key1 !== 'drawerType' && field[key1] == key2) {
if (key1 == 'code' && obj[key2]) {
phoneObj[field[key1]] = obj[key2].includes('+') ? obj[key2] : `+${obj[key2]}`
} else {
phoneObj[field[key1]] = obj[key2]
if (isObject(newForm[key]) && key == key2) {
newForm[key] = obj[key2]
}
if (isArray(newForm[key]) && key == key2 && obj[key2] && obj[key2].length > 0) {
newForm[key] = obj[key2]
}
}
}
if (phoneObj[field.key]) {
phoneObj.phoneString = form.value[field.key] = `${phoneObj[field.code]} ${
phoneObj[field.key]
}`
tempPhoneList.push(phoneObj)
}
phoneObj.objType = field.drawerType
phoneObj.key = field.key
phoneObj.phoneCode = field.code
saveKey.value[field.key] = phoneObj
break
case 'address':
let addressObj = null
for (const key1 in field) {
if (obj.addressList && obj.addressList.length > 0) {
obj.addressList.forEach(item => {
if (key1 == item.type) {
addressObj = item
// 2.根据最新的表单数据更新processedFanFormData的值,因为有些模块是多项的,所以表单数据要和dom对应上,防止dom有form表单里没有对应的数据会报错
let newChildren = {
type: '4',
childTitle: '儿女',
span: 24, //栅格布局份数
delete: true, //是否显示删除按钮
age: '',
needProvide: '',
children: [
{
label: '年龄',
key: 'age',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '120px', //标签宽度
sm: 10, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '是否需要供养',
key: 'needProvide',
domType: 'Select',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'sys_no_yes',
options: noYesList.value,
labelWidth: '120px', //标签宽度
sm: 10, //栅格布局份数
lg: 8 //栅格布局份数
}
})
]
}
// 深拷贝原始表单dom数据
const processedData = JSON.parse(JSON.stringify(formData))
for (const section of processedData) {
for (const key in newForm) {
//回显的数据有的没填写就会是null,收集表单值得时候和dom对应不上,对于null值得项要根据section得keyType给form正确得数据类型
if (!newForm[key]) {
if (section.keyType == 'Array') {
newForm[key] = []
} else if (section.keyType == 'Object') {
newForm[key] = {}
}
}
if (addressObj) {
form.value[
field.key
] = `${addressObj.region} ${addressObj.city} ${addressObj.street} ${addressObj.location}`
addressObj.addressString = `${addressObj.region} ${addressObj.city} ${addressObj.street} ${addressObj.location}`
addressObj.objType = field.drawerType
saveKey.value[field.key] = addressObj
if (tempAddressList.length > 0) {
tempAddressList.forEach(item => {
if (item.addressString !== addressObj.addressString) {
tempAddressList.push(addressObj)
if (section.data) {
if (section.key == 'familyMembers' && section.key == key) {
// 根据家人得type对应,如果填写得有儿女processedFanFormData和form应该加上对应得值
newForm[key].forEach((item, index) => {
// 儿女特殊处理,因为可能有多个儿女为了区分是哪个儿女,所以加上id
if (item.type == '4') {
item.id = index + 1
section.data.push({ id: index + 1, ...newChildren })
form.value[key].push({ id: index + 1, ...newChildren })
}
})
} else {
tempAddressList.push(addressObj)
} else if (key !== 'familyMembers' && section.key == key) {
if (isArray(newForm[key]) && newForm[key].length <= section.dataLength) {
let num = section.dataLength - newForm[key].length
for (let i = 0; i < num; i++) {
newForm[key].push(section.data[0])
}
}
}
break
case 'country':
form.value[field.key] = obj.countryName
saveKey.value[field.key] = {
country: obj.country || '',
countryCode: obj.country || '',
countryName: obj.countryName || '',
name: obj.countryName || '',
objType: field.drawerType
if (section.key == 'personalData' && key == section.key) {
if (isObject(newForm[key])) {
for (const key2 in newForm[key]) {
// 如果就业情况为其他,显示其他就业情况
if (key2 == 'employment' && newForm[key][key2] == 'OTHER') {
for (const item of section.data) {
if (item.key == 'otherEmployment') {
item.show = true
}
break
default:
break
}
}
}
}
addressQuickList.value = tempAddressList
tempPhoneList.forEach(item => {
for (const key in saveKey.value) {
if (item.key == key) {
for (const key2 in saveKey.value[key]) {
if (item.key == key2) {
item.mobile = saveKey.value[key][key2]
}
if (item.phoneCode == key2) {
item.code = saveKey.value[key][key2]
}
}
}
// 回显表单值特殊处理
for (const key in form.value) {
for (const key2 in newForm) {
if (key == key2 && key == 'familyMembers') {
if (newForm[key2].length > 0) {
form.value[key] = form.value[key].map(item1 => {
newForm[key2].forEach(item2 => {
if (item1.type == '4' && item1.id == item2.id) {
item1.age = item2.age
item1.needProvide = item2.needProvide
} else {
if (item1.type == item2.type && !item2.id) {
item1.age = item2.age
item1.needProvide = item2.needProvide
}
}
})
console.log('tempPhoneList', tempPhoneList)
phoneQuickList.value = removeDuplicates(tempPhoneList, 'phoneString')
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
if (!exportValue) {
// 保存一份就得表单数据便于做撤销操作
oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
return item1
})
}
processedFanFormData.value = oldFanFormData.value = processedData
}
// 数组去重
function removeDuplicates(arr, key) {
const seen = new Map()
const result = []
for (const item of arr) {
if (!seen.has(item[key])) {
seen.set(item[key], true)
result.push(item)
} else if (key == key2 && key !== 'familyMembers') {
if (isArray(newForm[key2]) && newForm[key].length > 0) {
form.value[key] = newForm[key2]
} else if (isObject(newForm[key2])) {
for (const key3 in newForm[key2]) {
if (!newForm[key2][key3]) {
if (key3 == 'premiumFundingSource' || key3 == 'liquidAssetType') {
newForm[key2][key3] = []
} else {
newForm[key2][key3] = ''
}
} else {
if (key3 == 'premiumFundingSource' || key3 == 'liquidAssetType') {
newForm[key2][key3] = newForm[key2][key3].split(',')
}
return result
}
}
form.value[key] = newForm[key2]
}
}
}
}
console.log('====================================')
console.log('回显form.value', form.value)
console.log('====================================')
// if (!exportValue) {
// // 保存一份就得表单数据便于做撤销操作
// oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
// }
processedFanFormData.value = processedData
console.log('====================================')
console.log('processedFanFormData.value', processedFanFormData.value)
console.log('====================================')
}
// 获取校验失败的字段信息
const getInvalidFields = fields => {
const errors = []
......@@ -587,78 +668,85 @@ const getInvalidFields = fields => {
}
return errors
}
// 判断是否为数组
const isArray = value => {
return Array.isArray(value)
}
// 判断是否为对象
const isObject = value => {
return typeof value === 'object' && value !== null && !Array.isArray(value)
}
// 表单提交
const submitForm = () => {
const submitForm = saveType => {
console.log('form.value', form.value)
return
let submitObj = { ...form.value }
let addressList = []
submitObj['birthdate'] = proxy.formatToDate(submitObj['birthdate'])
// 深拷贝原始数据
let result = JSON.parse(JSON.stringify(form.value))
// return
proxy.$refs['fanFormRef'].validate((valid, fields) => {
if (valid) {
//处理表单数据
for (const key1 in form.value) {
for (const key2 in saveKey.value) {
//要判断drawerType
switch (saveKey.value[key2].objType) {
case 'phone':
if (key1 == key2) {
for (const key3 in saveKey.value[key2]) {
submitObj[key3] = saveKey.value[key2][key3]
}
}
break
case 'address':
if (key1 == key2) {
addressList.push(saveKey.value[key2])
}
break
case 'country':
if (key1 == key2) {
submitObj['country'] = saveKey.value[key2]['countryCode']
submitObj['countryName'] = saveKey.value[key2]['name']
}
break
default:
break
for (const key in result) {
if (isObject(result[key])) {
for (const key2 in result[key]) {
if (isArray(result[key][key2])) {
result[key][key2] = result[key][key2].join(',')
}
}
}
if (isArray(result[key])) {
result[key] = result[key]
.map(item => {
// 删除指定字段
delete item.childTitle
delete item.children
delete item.disabled
delete item.id
delete item.span
if (item.policyIssueDate) {
item.policyIssueDate = proxy.formatToDate(item.policyIssueDate)
}
return item
})
.filter(item => Object.keys(item).length > 0) // 过滤空对象
}
if (key == 'familyMembers') {
result[key] = result[key].filter(item => {
if (item.age || item.needProvide) return item
})
}
}
submitObj['birthdate'] = proxy.formatToDate(submitObj['birthdate'])
submitObj['addressList'] = addressList
// 删除多余字段
deleteKeyList.value.forEach(item => {
delete submitObj[item]
})
if (props.customerBizId) {
editCustomer(submitObj).then(res => {
result.saveType = saveType
result.customerBizId = props.customerBizId
console.log('====================================')
console.log('提交的数据', result)
console.log('====================================')
if (props.fnaFormBizId) {
result.fnaFormBizId = props.fnaFormBizId
editFanForm(result).then(res => {
if (res.code == 200) {
handleEditStatus()
proxy.$message.success('客户修改成功')
proxy.$message.success('fanForm修改成功')
emit('handleSuccess', {
tab: 'customer',
customerBizId: props.customerBizId,
tab: 'fnaform',
fnaFormBizId: props.fnaFormBizId,
type: 'edit'
})
}
})
} else {
addCustomer(submitObj).then(res => {
addfanForm(result).then(res => {
if (res.code == 200) {
proxy.$message.success('客户新增成功')
emit('handleSuccess', {
tab: 'customer',
customerBizId: res.data.customerBizId,
tab: 'fnaform',
fnaFormBizId: res.data.fnaFormBizId,
type: 'add'
})
}
})
}
// emit('submitForm', submitObj)
errorFields.value = [] // 清空错误信息
} else {
// 获取校验失败的字段信息
......@@ -669,25 +757,10 @@ const submitForm = () => {
}
})
}
const resetForm = () => {
proxy.$modal
.confirm('是否确认撤销所作操作?')
.then(function () {
if (props.customerBizId) {
form.value = { ...oldObjInfo.value }
} else {
resetShow('smokeQuantity', false)
proxy.$refs['fanFormRef'].resetFields()
}
processedFanFormData.value = JSON.parse(JSON.stringify(oldFanFormData.value))
console.log('processedFanFormData.value', processedFanFormData.value)
})
.catch(() => {})
}
// 获取流程详情
function getCustomerInfo(customerBizId, formData) {
getCustomerDetail(customerBizId).then(async res => {
function getFanformInfo(fnaFormBizId, formData) {
getfanFormDetail(fnaFormBizId).then(async res => {
if (res.code == 200) {
// 回显值
setFormValue(res.data, formData)
......@@ -697,8 +770,6 @@ function getCustomerInfo(customerBizId, formData) {
watch(
() => props.activeName,
newVal => {
console.log('newVal', newVal)
if (newVal === 'fnaform') {
openList.value = false
processFormData()
......@@ -721,6 +792,11 @@ watch(
padding-left: 5px;
margin-bottom: 5px;
}
.subTitle {
font-size: 16px;
padding-left: 8px;
margin-bottom: 10px;
}
.childLabel {
font-size: 14px;
padding-left: 15px;
......@@ -804,13 +880,9 @@ watch(
}
}
/* 新增的样式:防止label换行并显示省略号 */
/* :deep(.el-form-item__label) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
vertical-align: middle;
} */
.formFna :deep(.el-checkbox) {
margin-right: 10px;
}
/* 确保标签对齐方式正确 */
/* :deep(.el-form-item) {
......
......@@ -104,6 +104,8 @@
:activeName="activeName"
:fearthStatus="route.query.type"
:fnaFormBizId="processInfo.fnaFormBizId"
:customerBizId="processInfo.customerBizId"
:dictTypeLists="dictTypeLists"
@handleSuccess="handleSuccess"
/>
</div>
......@@ -119,12 +121,15 @@
</template>
<script setup name="FnaEdit">
import useUserStore from '@/store/modules/user'
import useDictStore from '@/store/modules/dict'
import { addFna, getProcessDetail, updateProcess } from '@/api/sign/fna'
import { listTenantUser } from '@/api/common'
import Customer from './components/customer'
import FanForm from './components/fanForm'
import { Check } from '@element-plus/icons-vue'
import { ref } from 'vue'
const userStore = useUserStore()
const dictStore = useDictStore()
const { proxy } = getCurrentInstance()
const route = useRoute()
const router = useRouter()
......@@ -136,6 +141,7 @@ const processInfo = ref({
customerName: userStore.name
}) // 流程详情信息
const updateStatus = ref(false)
const dictTypeLists = ref([])
const tabsList = ref([
{
label: '总览',
......@@ -180,6 +186,34 @@ const tabsList = ref([
])
const { csf_fna_status } = proxy.useDict('csf_fna_status')
// 获取各个流程所需要得字典数据
const getDictsData = async () => {
// 获取租户用户列表
const params = {
tenantBizId: userStore.projectInfo.tenantBizId,
pageNo: 1,
pageSize: 10
}
const response = await listTenantUser(params)
if (response.code == 200) {
dictStore.setTenantUserList(response.data.records)
}
// 请求每个流程中所涉及到的字典值数据
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'
])
}
// 更新流程
const processUpdate = (data, status) => {
updateProcess(data).then(res => {
......@@ -293,6 +327,23 @@ const handleSuccess = info => {
break
case 'fnaform':
if (info.type == 'add') {
//客户提交成功,更新流程
processUpdate(
{
fnaBizId: processInfo.value.fnaBizId,
customerBizId: info.customerBizId,
fnaFormBizId: info.fnaFormBizId
},
'appointment'
)
} else {
processUpdate({
fnaBizId: processInfo.value.fnaBizId,
customerBizId: info.customerBizId,
fnaFormBizId: info.fnaFormBizId
})
}
break
case 'newpolicy':
break
......@@ -302,6 +353,7 @@ const handleSuccess = info => {
break
}
}
getDictsData()
// handleDomData()
// 1.通过新建流程进来的,要请求创建/csf/api/Fna/add拿到头部dom等信息
//2.每次进来要请求根据id获取/csf/api/Fna/get/vo,根据流程BizId获取进行到哪一步了,还可以拿到头部dom等信息
......
......@@ -78,7 +78,8 @@
v-loading="loading"
:data="tenantList"
@selection-change="tableSelect"
:default-sort="{ prop: 'createTime', order: 'descending' }"
@sort-change="sortChange"
>
<el-table-column type="selection" width="55" />
<el-table-column label="流程编号" align="center" prop="fnaNo" width="200" />
......@@ -97,12 +98,12 @@
><span style="color: #43cf7c" class="iconfont icon-yiwancheng"></span> 已完成
</span>
<span v-if="scope.row.status == 'DRAFT'"
><span style="color: #86909C" class="iconfont icon-genjinjilu"></span> 草稿
><span style="color: #86909c" class="iconfont icon-genjinjilu"></span> 草稿
</span>
</template>
</el-table-column>
<!-- sortable 后端未做 -->
<el-table-column label="创建时间" align="center" prop="createTime">
<el-table-column label="创建时间" sortable align="center" prop="createTime">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......@@ -116,13 +117,7 @@
<template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)">修改</el-button>
<!-- v-if="scope.row.status == 'COMPLETED'" -->
<el-button
v-if="scope.row.status == 'COMPLETED'"
link
type="primary"
@click="handleDelete(scope.row)"
>删除</el-button
>
<el-button link type="primary" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -142,17 +137,6 @@
<script setup name="FnaList">
import Step from '@/views/components/moduleStep'
import useAppStore from '@/store/modules/app'
import {
changeUserStatus,
listTenant,
resetUserPwd,
delUser,
getTenant,
updateTenant,
addTenant,
changeTenantStatus
} from '@/api/system/tenant'
import { getFnaList, deleteFna } from '@/api/sign/fna'
import useUserStore from '@/store/modules/user'
......@@ -171,12 +155,9 @@ const { sys_status, csf_fna_status, sys_no_yes } = proxy.useDict(
)
const tenantList = ref([])
const open = ref(false)
const loading = ref(true)
const showSearch = ref(true)
const ids = ref([])
const single = ref(true)
const multiple = ref(true)
const total = ref(0)
const dateRange = ref([])
const selectIdsList = ref([])
......@@ -186,15 +167,27 @@ const data = reactive({
pageNo: 1,
pageSize: 8,
startTime: '',
endTime: ''
endTime: '',
sortField: '',
sortOrder: ''
}
})
const { queryParams, form, rules } = toRefs(data)
const sortChange = ({ prop, order }) => {
if (order == 'ascending') {
queryParams.value.sortOrder = 'ascend'
} else {
queryParams.value.sortOrder = 'descend'
}
if (prop) {
queryParams.value.sortField = prop
}
getList()
}
/** 多选框选中数据 */
function tableSelect(selection) {
selectIdsList.value = selection.map(item => item.projectBizId)
// selectIdsList.value = selection.map(item => item.projectBizId)
}
const goToAppointment = () => {
router.push({ path: '/sign/appointment' })
......@@ -252,20 +245,6 @@ function handleDelete(row) {
.catch(() => {})
}
/** 租户状态修改 */
function handleStatusChange(row, event) {
let text = row.status === 0 ? '停用' : '启用'
const tenantName = row.tenantName
proxy.$modal
.confirm(`确认要${text}"${tenantName}"租户吗?`)
.then(() => changeTenantStatus({ tenantBizId: row.tenantBizId, status: row.status }))
.then(() => proxy.$modal.msgSuccess(`${text}成功`))
.catch(() => {
// 操作取消时恢复原状态
row.status = row.status === 0 ? 1 : 0
})
}
/** 重置操作表单 */
function reset() {
form.value = {
......
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