Commit a83b446e by Sweet Zhang

Merge branch 'test' into sw

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