bxs-tools-ui 3.2.0-1 → 3.2.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/add-and-take/index.js +13 -3
- package/es/adjust-baoe/index.js +2 -1
- package/es/index.js +48 -23
- package/es/insure-calculate/index.js +1 -0
- package/es/person-info/index.js +19 -14
- package/es/product-info/index.js +20 -15
- package/es/share-sheet/index.js +16 -4
- package/es/utils/index.js +47 -22
- package/lib/add-and-take/index.js +13 -3
- package/lib/adjust-baoe/index.js +2 -1
- package/lib/index.js +48 -23
- package/lib/insure-calculate/index.js +1 -0
- package/lib/person-info/index.js +19 -14
- package/lib/product-info/index.js +20 -15
- package/lib/share-sheet/index.js +16 -4
- package/lib/utils/index.js +47 -22
- package/package.json +1 -4
- package/packages/add-and-take/readme.md +162 -256
- package/packages/adjust-baoe/readme.md +118 -83
- package/packages/business-card/readme.md +91 -28
- package/packages/bxs-utils/planbook/common.ts +40 -18
- package/packages/bxs-utils/planbook/person.ts +1 -1
- package/packages/bxs-utils/planbook/product.ts +6 -3
- package/packages/bxs-utils/readme.md +407 -425
- package/packages/canvas-poster/readme.md +123 -83
- package/packages/index.ts +1 -1
- package/packages/insure-calculate/readme.md +185 -129
- package/packages/person-info/readme.md +149 -134
- package/packages/planbook-input/readme.md +143 -84
- package/packages/product-info/readme.md +130 -69
|
@@ -1,156 +1,171 @@
|
|
|
1
|
-
<!--仅用于绕过 eslint-loader 校验的错误信息:Parsing error: Invalid character-->
|
|
2
|
-
<!--??以目前现象看,文档首字符不为 "<" 会报错??-->
|
|
3
1
|
## 计划书人员(PersonInfo)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
|
|
3
|
+
计划书投保页的人员信息模块,基于服务端下发的 `eleOrderList` 动态渲染表单元素,支持性别、年龄、生日等字段的展示与编辑。
|
|
4
|
+
|
|
5
|
+
> 数据来源:访问[计划书初始化 API](http://app.winbaoxian.cn/planBook/V2/getInitData?insuranceTypeId=6128) 查看示例数据。
|
|
6
|
+
> - `inputData`:`data → initData → inputData`
|
|
7
|
+
> - `verifyData`:`data → verifyData`
|
|
8
|
+
> - `personData`:`data → initData → inputData → personData → personOrderList[0]`
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
### 模块引用(import)
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
import { PersonInfo } from 'bxs-tools-ui';
|
|
12
16
|
export default {
|
|
13
17
|
components: {
|
|
14
18
|
PersonInfo
|
|
15
19
|
}
|
|
16
|
-
}
|
|
20
|
+
};
|
|
17
21
|
```
|
|
18
|
-
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
### 示例(example)
|
|
26
|
+
|
|
19
27
|
```html
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{
|
|
41
|
-
"key": "applicantAndInsuredSame",
|
|
42
|
-
"value": 0,
|
|
43
|
-
"label": "投被保人",
|
|
44
|
-
"componentName": "cmCommonRadio",
|
|
45
|
-
"options": [
|
|
28
|
+
<template>
|
|
29
|
+
<PersonInfo
|
|
30
|
+
:input-data="inputData"
|
|
31
|
+
:verify-data="verifyData"
|
|
32
|
+
:person-data="personData"
|
|
33
|
+
@change="changePersonInfo"
|
|
34
|
+
/>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import { PersonInfo } from 'bxs-tools-ui';
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
components: { PersonInfo },
|
|
42
|
+
data() {
|
|
43
|
+
return {
|
|
44
|
+
inputData: null,
|
|
45
|
+
verifyData: null,
|
|
46
|
+
personData: {
|
|
47
|
+
eleOrderList: [
|
|
46
48
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
isImport: true,
|
|
50
|
+
value: true,
|
|
51
|
+
key: 'title',
|
|
52
|
+
isDisabled: false,
|
|
53
|
+
componentName: 'cmCommonTitle',
|
|
54
|
+
label: '投保人信息'
|
|
49
55
|
},
|
|
50
56
|
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"label": "性别",
|
|
62
|
-
"componentName": "cmCommonRadio",
|
|
63
|
-
"options": [
|
|
64
|
-
{
|
|
65
|
-
"val": 1,
|
|
66
|
-
"desc": "男"
|
|
57
|
+
key: 'applicantAndInsuredSame',
|
|
58
|
+
value: 0,
|
|
59
|
+
label: '投被保人',
|
|
60
|
+
componentName: 'cmCommonRadio',
|
|
61
|
+
options: [
|
|
62
|
+
{ val: 0, desc: '非同一人' },
|
|
63
|
+
{ val: 1, desc: '是同一人' }
|
|
64
|
+
],
|
|
65
|
+
isDisabled: null,
|
|
66
|
+
isHide: null
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"componentName": "cmCommonSelect",
|
|
81
|
-
"placeholder": "请选择年龄",
|
|
82
|
-
"options": [
|
|
69
|
+
value: 1,
|
|
70
|
+
key: 'sex',
|
|
71
|
+
label: '性别',
|
|
72
|
+
componentName: 'cmCommonRadio',
|
|
73
|
+
options: [
|
|
74
|
+
{ val: 1, desc: '男' },
|
|
75
|
+
{ val: 2, desc: '女' }
|
|
76
|
+
],
|
|
77
|
+
isDisabled: false,
|
|
78
|
+
isHide: false
|
|
79
|
+
},
|
|
83
80
|
{
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
value: 30,
|
|
82
|
+
key: 'age',
|
|
83
|
+
label: '年龄',
|
|
84
|
+
componentName: 'cmCommonSelect',
|
|
85
|
+
placeholder: '请选择年龄',
|
|
86
|
+
options: [
|
|
87
|
+
{ val: 18, desc: '18岁' },
|
|
88
|
+
{ val: 19, desc: '19岁' }
|
|
89
|
+
],
|
|
90
|
+
isHide: false
|
|
86
91
|
},
|
|
87
92
|
{
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
key: 'birthday',
|
|
94
|
+
value: null,
|
|
95
|
+
label: '生日',
|
|
96
|
+
componentName: 'cmCommonDate',
|
|
97
|
+
placeholder: '请选择生日',
|
|
98
|
+
minDate: new Date(2000, 0, 1),
|
|
99
|
+
maxDate: new Date(),
|
|
100
|
+
defaulValue: new Date(2020, 11, 1),
|
|
101
|
+
isHide: false
|
|
90
102
|
}
|
|
91
|
-
]
|
|
92
|
-
"isHide": false
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"key": "birthday",
|
|
96
|
-
"value": null,
|
|
97
|
-
"label": "生日",
|
|
98
|
-
"componentName": "cmCommonDate",
|
|
99
|
-
"placeholder": "请选择生日",
|
|
100
|
-
"minDate": new Date(2000),
|
|
101
|
-
"maxDate": new Date(),
|
|
102
|
-
"defaulValue": new Date(2020, 11, 1),
|
|
103
|
-
"isHide": false
|
|
103
|
+
]
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
methods: {
|
|
108
|
+
changePersonInfo(personData, eleData) {
|
|
109
|
+
console.log(`${eleData.label} -> ${eleData.value}`);
|
|
110
|
+
}
|
|
106
111
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
...
|
|
112
|
+
};
|
|
113
|
+
</script>
|
|
111
114
|
```
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
114
118
|
### Attributes
|
|
115
|
-
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
| person-data |
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
148
|
-
|
|
119
|
+
|
|
120
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
121
|
+
| --- | --- | --- | --- |
|
|
122
|
+
| `input-data` | 必传,计划书初始化数据;不传则不执行模块内部的人员逻辑与产品逻辑 | Object | `{}` |
|
|
123
|
+
| `person-data` | 必传,人员数据结构,见 PersonData 对象 | Object | `{}` |
|
|
124
|
+
| `verify-data` | 可选,计划书限制条件;不传则不执行模块内部的产品逻辑 | Object | `{}` |
|
|
125
|
+
| `is-show-crm-person` | 可选,是否显示修改 CRM 人员信息的按钮 | Boolean | `false` |
|
|
126
|
+
| `params` | 可选,附加信息 | Object | `{}` |
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
#### PersonData 对象
|
|
130
|
+
|
|
131
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
132
|
+
| --- | --- | --- | --- |
|
|
133
|
+
| `eleOrderList` | 必传,人员信息的元素数据,见 EleOrderList 数组 | Array | — |
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
#### EleOrderList 数组(单项)
|
|
137
|
+
|
|
138
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
139
|
+
| --- | --- | --- | --- |
|
|
140
|
+
| `key` | 必传,元素关键字 | String | — |
|
|
141
|
+
| `value` | 必传,元素当前值 | String / Number | — |
|
|
142
|
+
| `componentName` | 必传,对应渲染组件(`cmCommonTitle` / `cmCommonInput` / `cmCommonRadio` / `cmCommonSelect` / `cmAgeBirthday`) | String | — |
|
|
143
|
+
| `label` | 元素名称 | String | — |
|
|
144
|
+
| `placeholder` | 元素占位符 | String | — |
|
|
145
|
+
| `options` | 元素选项列表(`cmCommonRadio` / `cmCommonSelect` / `cmAgeBirthday` 适用) | Array | — |
|
|
146
|
+
| `rules` | 校验规则(基于 vant van-form) | Array | — |
|
|
147
|
+
| `labelIcon` | 标签右侧图标 class 名(`cmCommonInput` 适用) | String | — |
|
|
148
|
+
| `maxlength` | 输入最大长度,默认 9(`cmCommonInput` 适用) | Number | `9` |
|
|
149
|
+
| `minDate` | 日期最小范围(`cmAgeBirthday` 适用) | Date | — |
|
|
150
|
+
| `maxDate` | 日期最大范围(`cmAgeBirthday` 适用) | Date | — |
|
|
151
|
+
| `defaulValue` | 日期默认值(`cmAgeBirthday` 适用) | Date | — |
|
|
152
|
+
| `isHide` | 必传,是否隐藏元素 | Boolean | — |
|
|
153
|
+
| `isDisabled` | 必传,元素值是否不可修改 | Boolean | — |
|
|
154
|
+
| `isImport` | 预留字段 | Boolean | — |
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
149
158
|
### Methods
|
|
150
|
-
|
|
151
|
-
|
|
|
152
|
-
|
|
159
|
+
|
|
160
|
+
| 方法名 | 说明 | 参数 |
|
|
161
|
+
| --- | --- | --- |
|
|
162
|
+
| `validate` | 表单校验,通过 `$refs` 调用,返回 Promise;若当前人员的 `title` 为 `false`(折叠状态)则跳过校验 | — |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
153
166
|
### Events
|
|
154
|
-
|
|
155
|
-
|
|
|
156
|
-
|
|
|
167
|
+
|
|
168
|
+
| 事件名 | 说明 | 回调参数 |
|
|
169
|
+
| --- | --- | --- |
|
|
170
|
+
| `change` | 任一元素的值变化时触发 | `Function(personData, eleData)`;`personData` 为 PersonData 对象,`eleData` 为当前变化的元素(EleOrderList 单项) |
|
|
171
|
+
| `clickLabel` | 点击 `cmCommonInput` 元素的标签区域时触发 | `Function(personData, eleData)` |
|
|
@@ -1,20 +1,40 @@
|
|
|
1
|
-
<!--仅用于绕过 eslint-loader 校验的错误信息:Parsing error: Invalid character-->
|
|
2
|
-
<!--??以目前现象看,文档首字符不为 "<" 会报错??-->
|
|
3
1
|
## 计划书投保页(PlanbookInput)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
|
|
3
|
+
计划书投保页的完整实现示例,基于 `PersonInfo`(人员模块)和 `ProductInfo`(产品模块)组合构建。
|
|
4
|
+
|
|
5
|
+
**核心处理逻辑**:
|
|
6
|
+
|
|
7
|
+
1. **数据初始化**:请求[计划书初始化 API](http://app.winbaoxian.cn/planBook/V2/getInitData?insuranceTypeId=6128) 后,调用封装好的辅助函数处理人员与产品数据(参考 `initPageData`),也可按各模块数据结构自行初始化。
|
|
8
|
+
2. **人员信息变更**:模块内部已封装投被保人关系、险种联动等主要逻辑;`change` 回调中可追加额外处理(如触发产品数据重算)。
|
|
9
|
+
3. **产品信息变更**:模块内部已封装险种逻辑与产品数据校验;`change` 回调中可处理错误提示等额外逻辑。
|
|
10
|
+
4. **产品表单校验**:通过 `$refs.productInfo.validate()` 调用产品模块内部的校验方法。
|
|
11
|
+
|
|
12
|
+
> 查看[辅助函数文档](https://docs.winbaoxian.cn/bxs-tools-ui/docs.html#/bxs-utils)了解 `initPersonData`、`personDataHandler`、`initProductData`、`productDataHandler` 等封装函数的用法。
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
### 模块引用(import)
|
|
17
|
+
|
|
18
|
+
```javascript
|
|
19
|
+
import { PersonInfo, ProductInfo } from 'bxs-tools-ui';
|
|
20
|
+
export default {
|
|
21
|
+
components: {
|
|
22
|
+
PersonInfo,
|
|
23
|
+
ProductInfo
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### 示例(example)
|
|
31
|
+
|
|
32
|
+
**投保页主页面(index.vue):**
|
|
33
|
+
|
|
15
34
|
```html
|
|
16
35
|
<template>
|
|
17
36
|
<div class="bxt-planbook" v-if="inputData">
|
|
37
|
+
<!-- 人员模块 -->
|
|
18
38
|
<div class="bxt-planbook-person">
|
|
19
39
|
<div class="bxt-person-container" v-if="inputData.personData">
|
|
20
40
|
<template v-for="person in inputData.personData.personOrderList">
|
|
@@ -24,10 +44,11 @@ index.app
|
|
|
24
44
|
:verify-data="planbookData.verifyData"
|
|
25
45
|
:person-data="person"
|
|
26
46
|
@change="changePersonInfo"
|
|
27
|
-
|
|
47
|
+
/>
|
|
28
48
|
</template>
|
|
29
49
|
</div>
|
|
30
50
|
</div>
|
|
51
|
+
<!-- 产品模块 -->
|
|
31
52
|
<div class="bxt-planbook-product">
|
|
32
53
|
<template v-for="g in inputData.productGroupList">
|
|
33
54
|
<template v-for="(p, pi) in g.prodOrderList">
|
|
@@ -39,79 +60,73 @@ index.app
|
|
|
39
60
|
:group-key="g.key"
|
|
40
61
|
:product-key="p.key"
|
|
41
62
|
@confirm="confirmProduct"
|
|
42
|
-
|
|
63
|
+
/>
|
|
43
64
|
</template>
|
|
44
65
|
</template>
|
|
45
66
|
</div>
|
|
46
|
-
...
|
|
47
67
|
</div>
|
|
48
68
|
</template>
|
|
49
69
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
<script>
|
|
71
|
+
import { PersonInfo } from 'bxs-tools-ui';
|
|
72
|
+
import { initPersonData, personDataHandler, initProductData, productDataHandler } from 'bxs-utils';
|
|
73
|
+
|
|
74
|
+
export default {
|
|
75
|
+
components: { PersonInfo },
|
|
76
|
+
methods: {
|
|
77
|
+
async initPageData(data) {
|
|
78
|
+
const inputData = data && data.initData && data.initData.inputData;
|
|
79
|
+
if (inputData) {
|
|
80
|
+
initPersonData(inputData, data.verifyData);
|
|
81
|
+
personDataHandler(inputData.personData);
|
|
82
|
+
const productGroupList = inputData.productGroupList || [];
|
|
83
|
+
productGroupList
|
|
84
|
+
.filter(g => g.prodOrderList)
|
|
85
|
+
.forEach(g => {
|
|
86
|
+
g.prodOrderList.forEach(p => {
|
|
87
|
+
initProductData(p);
|
|
88
|
+
productDataHandler(p, data.verifyData[p.key], inputData.personData);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return data;
|
|
93
|
+
},
|
|
94
|
+
changePersonInfo(person, ele) {
|
|
95
|
+
this.inputData.productGroupList.forEach(g => {
|
|
96
|
+
g.prodOrderList &&
|
|
97
|
+
g.prodOrderList.forEach(p => {
|
|
98
|
+
if (p.hadChoice) {
|
|
99
|
+
this.doubleCalcProductData(this.inputData, {
|
|
100
|
+
planbookId: this.URL_PARAM.planbookId * 1,
|
|
101
|
+
groupKey: g.key,
|
|
102
|
+
productKey: p.key,
|
|
103
|
+
isIgnoreError: true
|
|
104
|
+
});
|
|
105
|
+
}
|
|
67
106
|
});
|
|
68
|
-
}
|
|
69
107
|
});
|
|
108
|
+
},
|
|
109
|
+
confirmProduct(options, inst) {
|
|
110
|
+
inst.$refs.productInfo
|
|
111
|
+
.validate()
|
|
112
|
+
.then(valid => {
|
|
113
|
+
// 校验通过,执行投保逻辑
|
|
114
|
+
})
|
|
115
|
+
.catch(err => {
|
|
116
|
+
console.log(err);
|
|
117
|
+
});
|
|
70
118
|
}
|
|
71
119
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
g.prodOrderList.map(p => {
|
|
79
|
-
if (p.hadChoice) {
|
|
80
|
-
this.calcProductData(this.inputData, {
|
|
81
|
-
planbookId: this.URL_PARAM.planbookId * 1,
|
|
82
|
-
groupKey: g.key,
|
|
83
|
-
productKey: p.key,
|
|
84
|
-
isIgnoreError: true
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
confirmProduct(options, inst) {
|
|
91
|
-
let self = this;
|
|
92
|
-
inst.$refs.productInfo
|
|
93
|
-
.validate()
|
|
94
|
-
.then(valid => {
|
|
95
|
-
// ...
|
|
96
|
-
})
|
|
97
|
-
.catch(err => {
|
|
98
|
-
console.log(err);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
// ...
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
product-table.vue
|
|
120
|
+
};
|
|
121
|
+
</script>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**产品弹层子组件(product-table.vue):**
|
|
125
|
+
|
|
105
126
|
```html
|
|
106
127
|
<template>
|
|
107
|
-
<div
|
|
108
|
-
:class="['bxt-product-show', `bxt-product-id-${productData.key}`]"
|
|
109
|
-
v-if="productData"
|
|
110
|
-
>
|
|
111
|
-
...
|
|
128
|
+
<div :class="['bxt-product-show', `bxt-product-id-${productData.key}`]" v-if="productData">
|
|
112
129
|
<bxs-bottom-sheets
|
|
113
|
-
class="product-sheets"
|
|
114
|
-
:key="`sheets-${productData.key}`"
|
|
115
130
|
v-model="isShowProductSheet"
|
|
116
131
|
:title="productData.titleName"
|
|
117
132
|
height="middle"
|
|
@@ -124,19 +139,63 @@ product-table.vue
|
|
|
124
139
|
:group-key="groupKey"
|
|
125
140
|
:product-key="productKey"
|
|
126
141
|
@change="cgProduct"
|
|
127
|
-
|
|
128
|
-
...
|
|
142
|
+
/>
|
|
129
143
|
</bxs-bottom-sheets>
|
|
130
144
|
</div>
|
|
131
145
|
</template>
|
|
132
146
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
147
|
+
<script>
|
|
148
|
+
import { ProductInfo } from 'bxs-tools-ui';
|
|
149
|
+
|
|
150
|
+
export default {
|
|
151
|
+
components: { ProductInfo },
|
|
152
|
+
methods: {
|
|
153
|
+
cgProduct(product, options) {
|
|
154
|
+
if (options.type === 'change' && options.errorMsg) {
|
|
155
|
+
this.$nextTick(() => {
|
|
156
|
+
this.$toast(options.errorMsg);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
139
160
|
}
|
|
140
|
-
}
|
|
141
|
-
|
|
161
|
+
};
|
|
162
|
+
</script>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### 说明
|
|
168
|
+
|
|
169
|
+
投保页本身不是一个独立的 Vue 组件,而是由 `PersonInfo` + `ProductInfo` 等模块组合而成的页面。各模块的 props、events、methods 请分别参考:
|
|
170
|
+
|
|
171
|
+
- [PersonInfo 文档](../person-info/readme.md)
|
|
172
|
+
- [ProductInfo 文档](../product-info/readme.md)
|
|
173
|
+
- [辅助函数文档](../bxs-utils/readme.md)
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### helper.js 导出函数
|
|
178
|
+
|
|
179
|
+
`helper.js` 封装了投保页常用的数据处理与请求函数,可按需单独引入:
|
|
180
|
+
|
|
181
|
+
```javascript
|
|
182
|
+
import {
|
|
183
|
+
initPageData,
|
|
184
|
+
setPageDataBaseOnResult,
|
|
185
|
+
calculateProductData,
|
|
186
|
+
doubleCalcProductData,
|
|
187
|
+
createPlanbookDataToMake,
|
|
188
|
+
setupUnderwriteRuleToInputData
|
|
189
|
+
} from 'packages/planbook-input/helper.js';
|
|
142
190
|
```
|
|
191
|
+
|
|
192
|
+
| 函数名 | 说明 | 入参 | 出参 |
|
|
193
|
+
| --- | --- | --- | --- |
|
|
194
|
+
| `initPageData(data)` | 初始化计划书数据,依次处理人员数据和所有产品数据 | `data`:接口返回的原始数据 | Promise\<data\> |
|
|
195
|
+
| `setPageDataBaseOnResult(data)` | 将已生成结果中的导出数据(`exportData`)回填到初始化数据中,用于「编辑已有计划书」场景 | `data`:同上 | data |
|
|
196
|
+
| `calculateProductData(inputData, options)` | 对指定产品发起一次试算请求,并将结果写回 `inputData` | `inputData`;`options`:`{ planbookId, publicPbUuid, groupKey, productKey, isIgnoreError }` | Promise |
|
|
197
|
+
| `doubleCalcProductData(inputData, verifyData, options)` | 先执行 `productDataHandler` 再执行 `calculateProductData`,对存在 `revalidateFlag` 的产品自动执行二次试算 | 同上,额外需要 `verifyData` | Promise |
|
|
198
|
+
| `createPlanbookDataToMake(planbookData, options)` | 将投保页数据转换为提交计划书所需的 JSON 结构 | `planbookData`;`options`:`{ pbType, insuranceTypeId, publicPbUuid, totalBaof, userUuid }` | Object / null |
|
|
199
|
+
| `setupUnderwriteRuleToInputData(inputData)` | 将核保规则(underwrite rule)应用到 inputData,返回处理后的 inputData | `inputData` | Promise\<inputData\> |
|
|
200
|
+
| `createdProductDataToCalc(inputData, options)` | 生成试算接口的请求参数(jd + signature) | `inputData`;`options`:`{ planbookId, publicPbUuid, groupKey, productKey }` | Promise\<{ errorMsg, jd, signature }\> |
|
|
201
|
+
| `receiveProductData(inputData, rProductData, options)` | 将试算接口返回的产品数据写回 `inputData` | `inputData`;`rProductData`:接口返回的产品数据;`options` | productData |
|