bxs-tools-ui 3.3.3 → 3.4.0
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 +1 -7969
- package/es/adjust-baoe/index.js +197 -8192
- package/es/index.css +1 -1
- package/es/index.js +8788 -43737
- package/es/insure-calculate/index.css +1 -1
- package/es/insure-calculate/index.js +1046 -36665
- package/es/person-info/index.css +1 -1
- package/es/person-info/index.js +83 -8042
- package/es/product-info/index.css +1 -1
- package/es/product-info/index.js +3006 -10612
- package/es/share-sheet/index.js +69 -8040
- package/es/utils/index.js +1250 -9334
- package/lib/add-and-take/index.js +4 -7973
- package/lib/adjust-baoe/index.js +196 -8192
- package/lib/index.css +1 -1
- package/lib/index.js +8717 -43671
- package/lib/insure-calculate/index.css +1 -1
- package/lib/insure-calculate/index.js +1034 -36662
- package/lib/person-info/index.css +1 -1
- package/lib/person-info/index.js +86 -8046
- package/lib/product-info/index.css +1 -1
- package/lib/product-info/index.js +2807 -10414
- package/lib/share-sheet/index.js +72 -8044
- package/lib/utils/index.js +1252 -9337
- package/package.json +5 -3
- package/packages/adjust-baoe/index.vue +2 -9
- package/packages/bxs-utils/planbook/common.ts +5 -0
- package/packages/bxs-utils/planbook/insurance.ts +19 -0
- package/packages/bxs-utils/planbook/person.ts +3 -2
- package/packages/bxs-utils/planbook/product.ts +57 -164
- package/packages/bxs-utils/readme.md +3 -1
- package/packages/index.ts +1 -1
- package/packages/insure-calculate/demo/index.vue +1 -1
- package/packages/insure-calculate/index.vue +18 -17
- package/packages/planbook-input/components/product-table.vue +3 -13
- package/packages/planbook-input/helper.js +4 -26
- package/packages/product-info/components/product-insurance-form.md +46 -0
- package/packages/product-info/components/product-insurance-form.vue +360 -0
- package/packages/product-info/demo/index.vue +2 -1
- package/packages/product-info/handler.js +307 -0
- package/packages/product-info/handler.md +26 -0
- package/packages/product-info/index.less +33 -0
- package/packages/product-info/index.vue +306 -532
- package/packages/product-info/readme.md +7 -1
- package/packages/share-sheet/constant.js +1 -2
- package/src/api/trade.js +31 -0
- package/src/components/common/common-group-title.less +54 -0
- package/src/components/common/common-group-title.md +34 -0
- package/src/components/common/common-group-title.vue +72 -0
- package/src/components/common/common-title.less +4 -0
- package/src/components/common/common-title.vue +8 -2
- package/src/components/profession-list/README.md +114 -0
- package/src/components/profession-list/constant.js +4 -0
- package/src/components/profession-list/handler.js +155 -0
- package/src/components/profession-list/index.less +182 -0
- package/src/components/profession-list/index.vue +443 -0
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
clearAddAndTakeAndAdjustBaoeData,
|
|
13
13
|
convertProductData,
|
|
14
14
|
verifyProductRules,
|
|
15
|
-
convertEleOrderListToObj,
|
|
16
15
|
getExpressionParamMap
|
|
17
16
|
} from '../bxs-utils/index'
|
|
18
17
|
import { calcPlanbookProduct, uploadPlanBookResult, getUnderwriteEffectiveRules } from '../../src/api/index.js'
|
|
@@ -141,8 +140,6 @@ export function setPageDataBaseOnResult(inputData, exportData, policyInfo, optio
|
|
|
141
140
|
// 已生成的计划书取回的产品数据,赋值到初始化中的产品对象中
|
|
142
141
|
for (let k in prod) {
|
|
143
142
|
if (k == 'mulInsOrderList') {
|
|
144
|
-
// 清除组合险
|
|
145
|
-
prod.mulInsOrderList = prod.mulInsOrderList.filter(ins => !ins.isGroup)
|
|
146
143
|
// 已生成的计划书取回的险种数据,赋值到初始化中的险种对象中
|
|
147
144
|
prod.mulInsOrderList.forEach(ins => {
|
|
148
145
|
const eInsuranceData = eProductData.mulInsOrderList.find(m => m.key === ins.key)
|
|
@@ -240,7 +237,8 @@ export async function createdProductDataToCalc(inputData, options = {}) {
|
|
|
240
237
|
'shmInsData',
|
|
241
238
|
'totalBaof',
|
|
242
239
|
// 'calcResultExp', // 不能删除,后面有依赖
|
|
243
|
-
'revalidateFlag'
|
|
240
|
+
'revalidateFlag',
|
|
241
|
+
'deriveRequired'
|
|
244
242
|
].includes(k)
|
|
245
243
|
) {
|
|
246
244
|
tempIns[k] = ins[k]
|
|
@@ -317,20 +315,6 @@ export function receiveProductData(inputData, rProductData, options = {}) {
|
|
|
317
315
|
}
|
|
318
316
|
})
|
|
319
317
|
|
|
320
|
-
productData.mulInsOrderList.forEach(ins => {
|
|
321
|
-
if (ins.isGroup) {
|
|
322
|
-
return
|
|
323
|
-
}
|
|
324
|
-
const groupInsData = convertEleOrderListToObj(ins)
|
|
325
|
-
const insuranceId = groupInsData.isCheckbox ? groupInsData.insuranceId[0] : groupInsData.insuranceId
|
|
326
|
-
const checkedIns = productData.mulInsOrderList.find(i => i.key === insuranceId)
|
|
327
|
-
for (const key in checkedIns) {
|
|
328
|
-
if (['allowSamePerson', 'code', 'eleOrderList', 'groupKey', 'groupName', 'huomian', 'key', 'name'].indexOf(key) === -1) {
|
|
329
|
-
ins[key] = checkedIns[key]
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
})
|
|
333
|
-
|
|
334
318
|
const hasSomeCheckedIns = rProductData.mulInsOrderList.some(ins => ins.title)
|
|
335
319
|
productData.hadChoice = hasSomeCheckedIns
|
|
336
320
|
productData.totalBaof = hasSomeCheckedIns ? rProductData.totalBaof : null
|
|
@@ -786,13 +770,7 @@ export async function makePlanbook(inputData, options = {}) {
|
|
|
786
770
|
clientVersion: appVersion,
|
|
787
771
|
isIos
|
|
788
772
|
})
|
|
789
|
-
)
|
|
790
|
-
if (!success || !data) {
|
|
791
|
-
Toast(info || '生成计划书失败')
|
|
792
|
-
return Promise.reject()
|
|
793
|
-
}
|
|
794
|
-
return Promise.resolve(data)
|
|
795
|
-
})
|
|
773
|
+
)
|
|
796
774
|
}
|
|
797
775
|
|
|
798
776
|
export function convertInputDataToResultData(inputData, options = {}) {
|
|
@@ -915,7 +893,7 @@ export function cleanNeedlessResultData(resultData) {
|
|
|
915
893
|
// 获取产品险种标签;入参过滤与 findInsuranceTag().catch 与 compare3 fetchInsuranceSaleStatusMap 一致
|
|
916
894
|
export async function getProductInsuranceTags(inputData, options = {}, key = 'salesStatus') {
|
|
917
895
|
const product = getProductFromInputData(inputData, options)
|
|
918
|
-
const mulInsOrderList =
|
|
896
|
+
const mulInsOrderList = _get(product, 'mulInsOrderList') || []
|
|
919
897
|
|
|
920
898
|
if (!mulInsOrderList.length) {
|
|
921
899
|
return {}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# ProductInsuranceForm
|
|
2
|
+
|
|
3
|
+
## 说明
|
|
4
|
+
|
|
5
|
+
单个险种表单:渲染 `ins.eleOrderList`(标题 + 选中后的输入/单选/下拉等)。供 `ProductInfo` 在普通险与组合子险中复用。
|
|
6
|
+
|
|
7
|
+
非目标:组合险组头开关、组内互斥逻辑(由父组件处理)。
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
12
|
+
|------|------|------|--------|
|
|
13
|
+
| `ins` | 必传,险种数据 | Object | — |
|
|
14
|
+
| `ins-mode` | 场景:`normal` 普通险 / `groupSub` 组合子险(内部挂 `bxt-product-group-sub` 等 class,title 走 `title-change`) | String | `normal` |
|
|
15
|
+
| `product-key` | 产品 key,用于 DOM id | Number / String | `null` |
|
|
16
|
+
| `mul-ins-order-list` | 产品下全部险种(豁免标签等) | Array | `[]` |
|
|
17
|
+
| `person-data` | 人员信息(豁免提示) | Object | `{}` |
|
|
18
|
+
| `recommend-values` | 保额/保费推荐值 | Object | `{}` |
|
|
19
|
+
| `insurance-sale-status` | 停售状态映射 | Object | `{}` |
|
|
20
|
+
| `show-huomian-tips` | 是否展示豁免设置提示 | Boolean | `false` |
|
|
21
|
+
| `is-follow` | 是否与上一险种紧贴 | Boolean | `false` |
|
|
22
|
+
|
|
23
|
+
## Events
|
|
24
|
+
|
|
25
|
+
| 事件 | 说明 | 参数 |
|
|
26
|
+
|------|------|------|
|
|
27
|
+
| `change` | 元素变更(普通险含 title;组合子险 title 除外) | `{ insData, eleData }` |
|
|
28
|
+
| `title-change` | 仅 `insMode=groupSub`:标题勾选,由父做互斥后再 `onChange` | `{ insData, eleData }` |
|
|
29
|
+
| `openCrmPerson` | 点击豁免提示 | — |
|
|
30
|
+
|
|
31
|
+
## Methods
|
|
32
|
+
|
|
33
|
+
| 方法 | 说明 |
|
|
34
|
+
|------|------|
|
|
35
|
+
| `validate` | 调用内部 `van-form.validate` |
|
|
36
|
+
|
|
37
|
+
## 依赖
|
|
38
|
+
|
|
39
|
+
- Vant:`van-form` / `van-field` / `van-radio` 等
|
|
40
|
+
- `CommonTitle` / `CommonRadio` / `CommonSelect`
|
|
41
|
+
|
|
42
|
+
## 埋点清单
|
|
43
|
+
|
|
44
|
+
| 事件类型 | 触发节点 | statId | 备注 |
|
|
45
|
+
|----------|----------|--------|------|
|
|
46
|
+
| 点击 | 标题 / 单选 / 下拉 | `product_insurance_${ele.key}` | 声明式 `data-stat-id` |
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<van-form ref="insuranceForm" :class="formClassList" :show-error="false" @submit.native.prevent="closeKeyBoard()">
|
|
3
|
+
<template v-for="ele in ins.eleOrderList">
|
|
4
|
+
<van-field v-if="['cmCommonTitle'].includes(ele.componentName)" :key="ele.key" :name="ele.key" :rules="getElementRules(ele)">
|
|
5
|
+
<template #input>
|
|
6
|
+
<CommonTitle
|
|
7
|
+
v-model="ele.value"
|
|
8
|
+
:key="`${productKey}_${ins.key}_${ele.key}`"
|
|
9
|
+
:name="ele.key"
|
|
10
|
+
:code="ins.code"
|
|
11
|
+
:huomian-tag="getInsuranceTitleHmTag(ins)"
|
|
12
|
+
:status-tag="getInsuranceSaleStatusTag(ins)"
|
|
13
|
+
:huomian-tips="showHuomianTips && getHuomianTips(ins, ele)"
|
|
14
|
+
:label="ele.labelName"
|
|
15
|
+
:style="{
|
|
16
|
+
fontSize: '17px',
|
|
17
|
+
fontWeight: 'bold'
|
|
18
|
+
}"
|
|
19
|
+
:disabled="getElementDisabled(ele)"
|
|
20
|
+
:always-show-checkbox="isGroupSub"
|
|
21
|
+
:data-stat-id="`product_insurance_${ele.key}`"
|
|
22
|
+
@change="onTitleChange(ele)"
|
|
23
|
+
@openCrmPerson="$emit('openCrmPerson')"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
26
|
+
</van-field>
|
|
27
|
+
|
|
28
|
+
<template v-if="isInsuranceChecked && !ele.isHide && ele.componentName !== 'cmCommonTitle'">
|
|
29
|
+
<van-field
|
|
30
|
+
v-if="['cmCommonInput'].includes(ele.componentName)"
|
|
31
|
+
v-model.number="ele.value"
|
|
32
|
+
:ref="ins.key + ele.key + 'item'"
|
|
33
|
+
:key="ins.key + ele.key"
|
|
34
|
+
:id="`id_${ins.key}_${ele.key}`"
|
|
35
|
+
:type="ele.inputType || 'tel'"
|
|
36
|
+
:class="{
|
|
37
|
+
'van-field-unit': activeInputKey === ins.key + ele.key && numberUnitStr
|
|
38
|
+
}"
|
|
39
|
+
:prop="ele.key"
|
|
40
|
+
:label="ele.labelName"
|
|
41
|
+
:placeholder="ele.placeholder"
|
|
42
|
+
:disabled="getElementDisabled(ele)"
|
|
43
|
+
:readonly="getElementDisabled(ele)"
|
|
44
|
+
:maxlength="ele.maxlength || 9"
|
|
45
|
+
:rules="getElementRules(ele)"
|
|
46
|
+
autocomplete="off"
|
|
47
|
+
input-align="right"
|
|
48
|
+
error-message-align="right"
|
|
49
|
+
clearable
|
|
50
|
+
:inputmode="ele.inputType || 'text'"
|
|
51
|
+
@focus="
|
|
52
|
+
activeInputKey = ins.key + ele.key
|
|
53
|
+
numberUnitStr = getAmountUnit(ele)
|
|
54
|
+
"
|
|
55
|
+
@blur="activeInputKey = ''"
|
|
56
|
+
@input="numberUnitStr = getAmountUnit(ele)"
|
|
57
|
+
@change="emitChange(ele)"
|
|
58
|
+
@clear="emitChange(ele)"
|
|
59
|
+
>
|
|
60
|
+
<template v-if="!ele.isDisabled" #right-icon>
|
|
61
|
+
<i class="icon iconfont icon-edit" style="font-size: 20px;" @click="onClickIcon(`id_${ins.key}_${ele.key}`)" />
|
|
62
|
+
</template>
|
|
63
|
+
</van-field>
|
|
64
|
+
<div v-if="activeInputKey === ins.key + ele.key && numberUnitStr" :key="ins.key + ele.key + 'unit'" class="bxt-ins-unit-tips">
|
|
65
|
+
<em />
|
|
66
|
+
<span>
|
|
67
|
+
{{ numberUnitStr }}
|
|
68
|
+
</span>
|
|
69
|
+
</div>
|
|
70
|
+
<div v-if="getRecommendValues(ele)" :key="ins.key + ele.key + 'recommend'" class="bxt-ins-recommend-values">
|
|
71
|
+
<span v-for="v in getRecommendValues(ele)" :key="v" @click="onClickRecommendValue(v, ele)">
|
|
72
|
+
{{ v }}
|
|
73
|
+
</span>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<CommonRadio
|
|
77
|
+
v-if="['cmCommonRadioBtn'].includes(ele.componentName)"
|
|
78
|
+
v-model="ele.value"
|
|
79
|
+
class="bxt-ins-form-radio-btn"
|
|
80
|
+
:key="ins.key + ele.key"
|
|
81
|
+
:name="ele.key"
|
|
82
|
+
:label="ele.labelName"
|
|
83
|
+
:disabled="getElementDisabled(ele)"
|
|
84
|
+
:readonly="getElementDisabled(ele)"
|
|
85
|
+
:rules="getElementRules(ele)"
|
|
86
|
+
:options="ele.opts.filter(o => !o.isHide && !o.isDisabled && !o.isInvalid)"
|
|
87
|
+
input-align="right"
|
|
88
|
+
border
|
|
89
|
+
:data-stat-id="`product_insurance_${ele.key}`"
|
|
90
|
+
@input="emitChange(ele)"
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<van-field
|
|
94
|
+
v-if="['cmCommonRadio'].includes(ele.componentName)"
|
|
95
|
+
class="bxt-ins-form-radio"
|
|
96
|
+
:key="ins.key + ele.key"
|
|
97
|
+
:name="ele.key"
|
|
98
|
+
:label="ele.labelName"
|
|
99
|
+
:rules="getElementRules(ele)"
|
|
100
|
+
>
|
|
101
|
+
<template #input>
|
|
102
|
+
<van-radio-group v-model="ele.value" :disabled="getElementDisabled(ele)" @change="emitChange(ele)">
|
|
103
|
+
<van-radio
|
|
104
|
+
v-for="opt in ele.opts"
|
|
105
|
+
:id="`${productKey}_${ins.key}_${ele.key}_${opt.val}`"
|
|
106
|
+
:key="opt.val"
|
|
107
|
+
:name="typeof ele.value === 'number' && !isNaN(Number(opt.val)) ? opt.val * 1 : opt.val"
|
|
108
|
+
:disabled="opt.val != ele.value && opt.isDisabled"
|
|
109
|
+
:label-disabled="opt.val != ele.value && opt.isDisabled"
|
|
110
|
+
>
|
|
111
|
+
<template #icon="props">
|
|
112
|
+
<van-icon v-if="props.checked" class-prefix="iconfont icon" name="multiple_choice" size="20px" />
|
|
113
|
+
<van-icon v-else class-prefix="iconfont icon" name="choose_none_line" size="20px" />
|
|
114
|
+
</template>
|
|
115
|
+
<div class="bxt-ins-form-radio-content">
|
|
116
|
+
<span v-if="opt.code" class="bxt-ins-form-radio--code">{{ opt.code }}</span>
|
|
117
|
+
<span
|
|
118
|
+
class="bxt-ins-form-radio--tx"
|
|
119
|
+
:class="[genInsuranceHmTag(opt) || getInsuranceSaleStatusTagByKey(opt.val) ? 'bxt-ins-form-radio--width' : '']"
|
|
120
|
+
>
|
|
121
|
+
{{ opt.desc }}
|
|
122
|
+
</span>
|
|
123
|
+
<span v-if="getInsuranceSaleStatusTagByKey(opt.val)" class="bxt-ins-form-radio--sale-tag">
|
|
124
|
+
{{ getInsuranceSaleStatusTagByKey(opt.val) }}
|
|
125
|
+
</span>
|
|
126
|
+
<span v-if="genInsuranceHmTag(opt)" class="bxt-ins-form-radio--tag">
|
|
127
|
+
{{ genInsuranceHmTag(opt) }}
|
|
128
|
+
</span>
|
|
129
|
+
</div>
|
|
130
|
+
</van-radio>
|
|
131
|
+
</van-radio-group>
|
|
132
|
+
</template>
|
|
133
|
+
</van-field>
|
|
134
|
+
|
|
135
|
+
<CommonSelect
|
|
136
|
+
v-if="['cmCommonSelect'].includes(ele.componentName)"
|
|
137
|
+
v-model="ele.value"
|
|
138
|
+
:key="ele.componentName + ins.key + ele.key"
|
|
139
|
+
:name="ele.key"
|
|
140
|
+
:label="ele.labelName"
|
|
141
|
+
:placeholder="ele.placeholder"
|
|
142
|
+
:disabled="getElementDisabled(ele)"
|
|
143
|
+
:readonly="getElementDisabled(ele)"
|
|
144
|
+
:rules="getElementRules(ele)"
|
|
145
|
+
:options="ele.opts.filter(o => !o.isHide && !o.isDisabled && !o.isInvalid)"
|
|
146
|
+
:right-icon="getElementDisabled(ele) ? '' : 'arrow'"
|
|
147
|
+
input-align="right"
|
|
148
|
+
border
|
|
149
|
+
:data-stat-id="`product_insurance_${ele.key}`"
|
|
150
|
+
@change="emitChange(ele)"
|
|
151
|
+
/>
|
|
152
|
+
|
|
153
|
+
<div :key="`${ins.key}${ele.key}_note`" v-if="ele.note" class="bxt-form-item-label-note">
|
|
154
|
+
{{ ele.note }}
|
|
155
|
+
</div>
|
|
156
|
+
</template>
|
|
157
|
+
</template>
|
|
158
|
+
</van-form>
|
|
159
|
+
</template>
|
|
160
|
+
<script lang="ts">
|
|
161
|
+
import Vue from 'vue'
|
|
162
|
+
import { Component, Prop } from 'vue-property-decorator'
|
|
163
|
+
import { get as _get } from 'lodash'
|
|
164
|
+
import { convertEleOrderListToObj } from 'packages/bxs-utils/index'
|
|
165
|
+
import CommonTitle from '../../../src/components/common/common-title.vue'
|
|
166
|
+
import CommonRadio from '../../../src/components/common/common-radio.vue'
|
|
167
|
+
import CommonSelect from '../../../src/components/common/common-select.vue'
|
|
168
|
+
|
|
169
|
+
@Component({
|
|
170
|
+
name: 'ProductInsuranceForm',
|
|
171
|
+
components: {
|
|
172
|
+
CommonTitle,
|
|
173
|
+
CommonRadio,
|
|
174
|
+
CommonSelect
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
export default class ProductInsuranceForm extends Vue {
|
|
178
|
+
activeInputKey = ''
|
|
179
|
+
numberUnitStr = ''
|
|
180
|
+
|
|
181
|
+
@Prop({ required: true })
|
|
182
|
+
ins!: any
|
|
183
|
+
|
|
184
|
+
/** 险种表单场景:normal 普通险 | groupSub 组合子险 */
|
|
185
|
+
@Prop({ default: 'normal' })
|
|
186
|
+
insMode!: string
|
|
187
|
+
|
|
188
|
+
@Prop({ default: null })
|
|
189
|
+
productKey!: number | string
|
|
190
|
+
|
|
191
|
+
@Prop({ default: () => [] })
|
|
192
|
+
mulInsOrderList!: any[]
|
|
193
|
+
|
|
194
|
+
@Prop({ default: () => ({}) })
|
|
195
|
+
personData!: any
|
|
196
|
+
|
|
197
|
+
@Prop({ default: () => ({}) })
|
|
198
|
+
recommendValues!: any
|
|
199
|
+
|
|
200
|
+
@Prop({ default: () => ({}) })
|
|
201
|
+
insuranceSaleStatus!: any
|
|
202
|
+
|
|
203
|
+
@Prop({ default: false })
|
|
204
|
+
showHuomianTips!: boolean
|
|
205
|
+
|
|
206
|
+
@Prop({ default: false })
|
|
207
|
+
isFollow!: boolean
|
|
208
|
+
|
|
209
|
+
/** 组合险 locked:其他子险 title 不可点 */
|
|
210
|
+
@Prop({ default: false })
|
|
211
|
+
lockTitleClick!: boolean
|
|
212
|
+
|
|
213
|
+
get isGroupSub() {
|
|
214
|
+
return this.insMode === 'groupSub'
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
get formClassList() {
|
|
218
|
+
return [
|
|
219
|
+
'bxt-product-info-form',
|
|
220
|
+
`bxt-product-insurance-id-${this.ins.key}`,
|
|
221
|
+
this.isGroupSub ? 'bxt-product-group-sub' : '',
|
|
222
|
+
this.isGroupSub ? 'bxt-product-insurance-type-group' : '',
|
|
223
|
+
this.isFollow ? 'bxt-product-info-form-follow' : ''
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
get isInsuranceChecked() {
|
|
228
|
+
const titleEle = (this.ins.eleOrderList || []).find(e => e.key === 'title')
|
|
229
|
+
return this.ins.key === 'common' || (!!titleEle && titleEle.value)
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
validate() {
|
|
233
|
+
const form: any = this.$refs.insuranceForm
|
|
234
|
+
return form && form.validate ? form.validate() : Promise.resolve()
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
emitChange(ele) {
|
|
238
|
+
this.$emit('change', { insData: this.ins, eleData: ele })
|
|
239
|
+
}
|
|
240
|
+
onTitleChange(ele) {
|
|
241
|
+
if (this.isGroupSub) {
|
|
242
|
+
this.$emit('title-change', { insData: this.ins, eleData: ele })
|
|
243
|
+
} else {
|
|
244
|
+
this.emitChange(ele)
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
onClickIcon(id) {
|
|
248
|
+
const inputDom: any = document.querySelector(`#${id}`)
|
|
249
|
+
if (inputDom) {
|
|
250
|
+
inputDom.focus()
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
closeKeyBoard() {
|
|
254
|
+
const activeElement: any = document.activeElement
|
|
255
|
+
if (!activeElement) {
|
|
256
|
+
return false
|
|
257
|
+
}
|
|
258
|
+
activeElement.blur()
|
|
259
|
+
return false
|
|
260
|
+
}
|
|
261
|
+
getElementRules(ele) {
|
|
262
|
+
let _rules = ele.rules || []
|
|
263
|
+
if (ele.isIgnoreValidate) {
|
|
264
|
+
_rules = []
|
|
265
|
+
}
|
|
266
|
+
return _rules
|
|
267
|
+
}
|
|
268
|
+
getElementDisabled(ele) {
|
|
269
|
+
if (ele.key === 'title' && this.lockTitleClick) {
|
|
270
|
+
return true
|
|
271
|
+
}
|
|
272
|
+
const opts = (ele.opts || []).filter(o => !o.isHide && !o.isDisabled && !o.isInvalid)
|
|
273
|
+
return ele.isDisabled || (opts.length === 1 && _get(opts, '[0].val') === ele.value)
|
|
274
|
+
}
|
|
275
|
+
genInsuranceHmTag(opt) {
|
|
276
|
+
const refInsurance = (this.mulInsOrderList || []).find(ins => ins.key === opt.val)
|
|
277
|
+
if (!refInsurance || !refInsurance.huomian) {
|
|
278
|
+
return ''
|
|
279
|
+
}
|
|
280
|
+
if (refInsurance.huomian === 'beiHuomian') {
|
|
281
|
+
return '被保人'
|
|
282
|
+
}
|
|
283
|
+
return '投保人'
|
|
284
|
+
}
|
|
285
|
+
getInsuranceTitleHmTag(insurance) {
|
|
286
|
+
if (!insurance.huomian) {
|
|
287
|
+
return ''
|
|
288
|
+
}
|
|
289
|
+
if (insurance.huomian === 'beiHuomian') {
|
|
290
|
+
return '被保人'
|
|
291
|
+
}
|
|
292
|
+
return '投保人'
|
|
293
|
+
}
|
|
294
|
+
getInsuranceSaleStatusTagByKey(key: string | number) {
|
|
295
|
+
const map = this.insuranceSaleStatus
|
|
296
|
+
if (!map || typeof map !== 'object' || key === undefined || key === null) {
|
|
297
|
+
return ''
|
|
298
|
+
}
|
|
299
|
+
const status = map[key] ?? map[String(key)]
|
|
300
|
+
if (status === undefined || status === null) {
|
|
301
|
+
return ''
|
|
302
|
+
}
|
|
303
|
+
return Number(status) === 2 ? '停' : ''
|
|
304
|
+
}
|
|
305
|
+
getInsuranceSaleStatusTag(insurance) {
|
|
306
|
+
return this.getInsuranceSaleStatusTagByKey(insurance.key)
|
|
307
|
+
}
|
|
308
|
+
getHuomianTips(insurance, element) {
|
|
309
|
+
const personOrderList = _get(this.personData, 'personOrderList') || []
|
|
310
|
+
const applicationInfo = personOrderList.find(p => p.key === 'applicantInfo')
|
|
311
|
+
const applicationTitle = _get(applicationInfo, 'eleOrderList', []).find(e => e.key === 'title')
|
|
312
|
+
const applicationSame = _get(applicationInfo, 'eleOrderList', []).find(e => e.key === 'applicantAndInsuredSame')
|
|
313
|
+
if (!(['touHuomian', 'shuangHuomian'].includes(insurance.huomian) && element.isDisabled)) {
|
|
314
|
+
return ''
|
|
315
|
+
}
|
|
316
|
+
if (!_get(applicationTitle, 'value')) {
|
|
317
|
+
return '<em>设置</em>投保人信息后选择'
|
|
318
|
+
}
|
|
319
|
+
if (_get(applicationSame, 'value') && !insurance.allowSamePerson) {
|
|
320
|
+
return '投被保人为同一人,<em>修改</em>投保人信息后选择'
|
|
321
|
+
}
|
|
322
|
+
return '当前投保人不能加该险种,<em>修改</em>投保人信息后选择'
|
|
323
|
+
}
|
|
324
|
+
getAmountUnit(ele) {
|
|
325
|
+
let digits = isNaN(ele.value * 1) ? 0 : Math.floor(Math.log10(ele.value) + 1)
|
|
326
|
+
switch (digits) {
|
|
327
|
+
case 5:
|
|
328
|
+
return '万'
|
|
329
|
+
case 6:
|
|
330
|
+
return '十万'
|
|
331
|
+
case 7:
|
|
332
|
+
return '百万'
|
|
333
|
+
case 8:
|
|
334
|
+
return '千万'
|
|
335
|
+
case 9:
|
|
336
|
+
return '亿'
|
|
337
|
+
default:
|
|
338
|
+
return ''
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
getRecommendValues(ele) {
|
|
342
|
+
if (!['baoe', 'baof'].includes(ele.key) || ele.isDisabled) {
|
|
343
|
+
return null
|
|
344
|
+
}
|
|
345
|
+
const insurance = convertEleOrderListToObj(this.ins)
|
|
346
|
+
return this.recommendValues && this.recommendValues[insurance.key]
|
|
347
|
+
}
|
|
348
|
+
onClickRecommendValue(value, ele) {
|
|
349
|
+
ele.value = value
|
|
350
|
+
this.emitChange(ele)
|
|
351
|
+
this.$nextTick(() => {
|
|
352
|
+
const ref: any = this.$refs[this.ins.key + ele.key + 'item']
|
|
353
|
+
const ref0 = Array.isArray(ref) ? ref[0] : ref
|
|
354
|
+
if (ref0 && ref0.validate) {
|
|
355
|
+
ref0.validate()
|
|
356
|
+
}
|
|
357
|
+
})
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
</script>
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<script lang="ts">
|
|
7
7
|
import Vue from 'vue'
|
|
8
8
|
import { Component } from 'vue-property-decorator'
|
|
9
|
+
import { Toast } from 'vant'
|
|
9
10
|
import QS from 'qs'
|
|
10
11
|
import { getPlanbookData } from '../../../src/api/planbook.js'
|
|
11
12
|
import { get as _get } from 'lodash'
|
|
@@ -56,7 +57,7 @@ export default class ProductInfoDemo extends Vue {
|
|
|
56
57
|
}
|
|
57
58
|
cgProduct(product, obj, inst) {
|
|
58
59
|
if (obj.type === 'change') {
|
|
59
|
-
|
|
60
|
+
Toast(`${_get(obj, 'insData.eleOrderList[0].labelName')} -> ${_get(obj, 'eleData.labelName')}: ${_get(obj, 'eleData.value')}`)
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
}
|