From 65d9e42c4e1aca9db9a73108599d22d8f4f6e709 Mon Sep 17 00:00:00 2001 From: zhouna Date: Sat, 21 Sep 2019 15:54:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6dc=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ebiz/sale/sale.js | 9 + src/assets/js/business-common.js | 1 + src/assets/js/utils/age.js | 12 +- src/assets/js/utils/data-dictionary.js | 480 +++++++++--------- src/assets/js/utils/formatRiskList.js | 4 +- src/assets/js/utils/validator.js | 5 +- src/components/ebiz/SelectRadio.vue | 8 +- .../ebiz/customer/CustomerPicker.vue | 7 + .../ebiz/occipation/OccupationPicker.vue | 7 + src/router/ebiz/sale.js | 2 +- src/views/ebiz/common/AddRiskList.vue | 2 +- src/views/ebiz/common/CalculatePremium.vue | 57 ++- src/views/ebiz/my/UserInfo.vue | 107 ++-- src/views/ebiz/product/ProductDetail.vue | 133 +++-- src/views/ebiz/proposal/Appnt.vue | 24 +- src/views/ebiz/proposal/InsuredPerson.vue | 45 +- src/views/ebiz/proposal/rule.js | 2 +- src/views/ebiz/sale/AccountInformation.vue | 26 +- src/views/ebiz/sale/AddBeneficiaryInfo.vue | 219 +++++--- src/views/ebiz/sale/AttachmentManagement.vue | 301 +++++++++-- src/views/ebiz/sale/Detail.vue | 2 +- src/views/ebiz/sale/InsuranceInformation.vue | 166 +++--- src/views/ebiz/sale/InsuredInfo.vue | 138 +++-- src/views/ebiz/sale/InsuredPerson.vue | 226 ++++++--- src/views/ebiz/sale/js/methods.js | 45 ++ src/views/ebiz/sale/js/verification.js | 52 ++ src/views/ebiz/serve/Detail.vue | 2 +- 27 files changed, 1343 insertions(+), 739 deletions(-) create mode 100644 src/views/ebiz/sale/js/methods.js create mode 100644 src/views/ebiz/sale/js/verification.js diff --git a/src/api/ebiz/sale/sale.js b/src/api/ebiz/sale/sale.js index ee8b8da45..18a0482b8 100644 --- a/src/api/ebiz/sale/sale.js +++ b/src/api/ebiz/sale/sale.js @@ -161,3 +161,12 @@ export function checkSignInvalid(data) { data }) } + +// 提交核保 +export function selfToHuman(data) { + return request({ + url: getUrl('/sale/insure/selfToHuman', 1), + method: 'post', + data + }) +} diff --git a/src/assets/js/business-common.js b/src/assets/js/business-common.js index 3a8807e21..8ed6be2da 100644 --- a/src/assets/js/business-common.js +++ b/src/assets/js/business-common.js @@ -523,6 +523,7 @@ export default { sex: insuredDTO.sex, idType: insuredDTO.idType, age: insuredPersonAge, + marriage: insuredDTO.marriage, relationToAppnt: insuredDTO.relationToAppnt, medical: insuredDTO.medical, occupationName: insuredDTO.occupationName, diff --git a/src/assets/js/utils/age.js b/src/assets/js/utils/age.js index 206bb5d49..373a426ee 100644 --- a/src/assets/js/utils/age.js +++ b/src/assets/js/utils/age.js @@ -1,12 +1,12 @@ export default { - getAge: function(name, today) { + getAge: function (name, today) { return this.getAgeByValue(name, today) }, - getAgeByBirth: function(value, today) { + getAgeByBirth: function (value, today) { return this.getAgeByValue(value, today) }, - getAgeByValue: function(value, today) { + getAgeByValue: function (value, today) { var b = value.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/) if (b == null) { return null @@ -22,7 +22,7 @@ export default { } if (age < 1) { var dayNum = this.getDateDiff(value, nowY + '-' + (today.getMonth() + 1) + '-' + today.getDate()) - if (dayNum <= 28) { + if (dayNum <= 27) { age-- } } @@ -33,7 +33,7 @@ export default { /** * 取得两个日期的时间差 */ - getDateDiff: function(date1, date2) { + getDateDiff: function (date1, date2) { var dt1, dt2 if (date1 instanceof Date) { dt1 = date1 @@ -51,7 +51,7 @@ export default { /** * 字符串转日期 */ - stringToDate: function(string) { + stringToDate: function (string) { return new Date(Date.parse(string.replace(/-/g, '/'))) } } diff --git a/src/assets/js/utils/data-dictionary.js b/src/assets/js/utils/data-dictionary.js index 97e1e7e68..67f43d5ad 100644 --- a/src/assets/js/utils/data-dictionary.js +++ b/src/assets/js/utils/data-dictionary.js @@ -2,246 +2,246 @@ export default { //国家地区 nativeplace: [ - { code: 'CHN', text: '中国' }, - { code: 'HKG', text: '中国香港' }, - { code: 'MAC', text: '澳门' }, - { code: 'TWN', text: '中国台湾' }, - { code: 'ABW', text: '阿鲁巴' }, - { code: 'AFG', text: '阿富汗' }, - { code: 'AGO', text: '安哥拉' }, - { code: 'AIA', text: '安圭拉' }, - { code: 'ALB', text: '阿尔巴尼亚' }, - { code: 'AND', text: '安道尔' }, - { code: 'ANT', text: '荷属安的列斯' }, - { code: 'ARE', text: '阿联酋' }, - { code: 'ARG', text: '阿根廷' }, - { code: 'ARM', text: '亚美尼亚' }, - { code: 'ASM', text: '美属萨摩亚' }, - { code: 'ATA', text: '南极洲' }, - { code: 'ATF', text: '法属南部领土' }, - { code: 'ATG', text: '安提瓜和巴布达' }, - { code: 'AUS', text: '澳大利亚' }, - { code: 'AUT', text: '奥地利' }, - { code: 'AZE', text: '阿塞拜疆' }, - { code: 'BDI', text: '布隆迪' }, - { code: 'BEL', text: '比利时' }, - { code: 'BEN', text: '贝宁' }, - { code: 'BFA', text: '布基纳法索' }, - { code: 'BGD', text: '孟加拉国' }, - { code: 'BGR', text: '保加利亚' }, - { code: 'BHR', text: '巴林' }, - { code: 'BHS', text: '巴哈马' }, - { code: 'BIH', text: '波斯尼亚和黑塞哥维那' }, - { code: 'BLR', text: '白俄罗斯' }, - { code: 'BLZ', text: '伯利兹' }, - { code: 'BMU', text: '百慕大' }, - { code: 'BOL', text: '玻利维亚' }, - { code: 'BRA', text: '巴西' }, - { code: 'BRB', text: '巴巴多斯' }, - { code: 'BRN', text: '文莱' }, - { code: 'BTN', text: '不丹' }, - { code: 'BVT', text: '布维岛' }, - { code: 'BWA', text: '博茨瓦纳' }, - { code: 'CAF', text: '中非' }, - { code: 'CAN', text: '加拿大' }, - { code: 'CCK', text: '科科斯(基林)群岛' }, - { code: 'CHE', text: '瑞士' }, - { code: 'CHL', text: '智利' }, - { code: 'CIV', text: '科特迪瓦' }, - { code: 'CMR', text: '喀麦隆' }, - { code: 'COD', text: '刚果(金)' }, - { code: 'COG', text: '刚果(布)' }, - { code: 'COK', text: '库克群岛' }, - { code: 'COL', text: '哥伦比亚' }, - { code: 'COM', text: '科摩罗' }, - { code: 'CPV', text: '佛得角' }, - { code: 'CRI', text: '哥斯达黎加' }, - { code: 'CUB', text: '古巴' }, - { code: 'CXR', text: '圣诞岛' }, - { code: 'CYM', text: '开曼群岛' }, - { code: 'CYP', text: '塞浦路斯' }, - { code: 'CZE', text: '捷克' }, - { code: 'DEU', text: '德国' }, - { code: 'DJI', text: '吉布提' }, - { code: 'DMA', text: '多米尼克' }, - { code: 'DNK', text: '丹麦' }, - { code: 'DOM', text: '多米尼加共和国' }, - { code: 'DZA', text: '阿尔及利亚' }, - { code: 'ECU', text: '厄瓜多尔' }, - { code: 'EGY', text: '埃及' }, - { code: 'ERI', text: '厄立特里亚' }, - { code: 'ESH', text: '西撒哈拉' }, - { code: 'ESP', text: '西班牙' }, - { code: 'EST', text: '爱沙尼亚' }, - { code: 'ETH', text: '埃塞俄比亚' }, - { code: 'FIN', text: '芬兰' }, - { code: 'FJI', text: '斐济' }, - { code: 'FLK', text: '马尔维纳斯群岛(福克兰群岛)' }, - { code: 'FRA', text: '法国' }, - { code: 'FRO', text: '法罗群岛' }, - { code: 'FSM', text: '密克罗尼西亚' }, - { code: 'GAB', text: '加蓬' }, - { code: 'GBR', text: '英国' }, - { code: 'GEO', text: '格鲁吉亚' }, - { code: 'GHA', text: '加纳' }, - { code: 'GIB', text: '直布罗陀' }, - { code: 'GIN', text: '几内亚' }, - { code: 'GLP', text: '瓜德罗普' }, - { code: 'GMB', text: '冈比亚' }, - { code: 'GNB', text: '几内亚比绍' }, - { code: 'GNQ', text: '赤道几内亚' }, - { code: 'GRC', text: '希腊' }, - { code: 'GRD', text: '格林纳达' }, - { code: 'GRL', text: '格陵兰' }, - { code: 'GTM', text: '危地马拉' }, - { code: 'GUF', text: '法属圭亚那' }, - { code: 'GUM', text: '关岛' }, - { code: 'GUY', text: '圭亚那' }, - { code: 'HMD', text: '赫德岛和麦克唐纳岛' }, - { code: 'HND', text: '洪都拉斯' }, - { code: 'HRV', text: '克罗地亚' }, - { code: 'HTI', text: '海地' }, - { code: 'HUN', text: '匈牙利' }, - { code: 'IDN', text: '印度尼西亚' }, - { code: 'IND', text: '印度' }, - { code: 'IOT', text: '英属印度洋领土' }, - { code: 'IRL', text: '爱尔兰' }, - { code: 'IRN', text: '伊朗' }, - { code: 'IRQ', text: '伊拉克' }, - { code: 'ISL', text: '冰岛' }, - { code: 'ISR', text: '以色列' }, - { code: 'ITA', text: '意大利' }, - { code: 'JAM', text: '牙买加' }, - { code: 'JOR', text: '约旦' }, - { code: 'JPN', text: '日本' }, - { code: 'KAZ', text: '哈萨克斯坦' }, - { code: 'KEN', text: '肯尼亚' }, - { code: 'KGZ', text: '吉尔吉斯斯坦' }, - { code: 'KHM', text: '柬埔寨' }, - { code: 'KIR', text: '基里巴斯' }, - { code: 'KNA', text: '圣基茨和尼维斯' }, - { code: 'KOR', text: '韩国' }, - { code: 'KWT', text: '科威特' }, - { code: 'LAO', text: '老挝' }, - { code: 'LBN', text: '黎巴嫩' }, - { code: 'LBR', text: '利比里亚' }, - { code: 'LBY', text: '利比亚' }, - { code: 'LCA', text: '圣卢西亚' }, - { code: 'LIE', text: '列支敦士登' }, - { code: 'LKA', text: '斯里兰卡' }, - { code: 'LSO', text: '莱索托' }, - { code: 'LTU', text: '立陶宛' }, - { code: 'LUX', text: '卢森堡' }, - { code: 'LVA', text: '拉脱维亚' }, - { code: 'MAR', text: '摩洛哥' }, - { code: 'MCO', text: '摩纳哥' }, - { code: 'MDA', text: '摩尔多瓦' }, - { code: 'MDG', text: '马达加斯加' }, - { code: 'MDV', text: '马尔代夫' }, - { code: 'MEX', text: '墨西哥' }, - { code: 'MHL', text: '马绍尔群岛' }, - { code: 'MKD', text: '马斯顿' }, - { code: 'MLI', text: '马里' }, - { code: 'MLT', text: '马耳他' }, - { code: 'MMR', text: '缅甸' }, - { code: 'MNG', text: '蒙古' }, - { code: 'MNP', text: '北马里亚纳' }, - { code: 'MOZ', text: '莫桑比克' }, - { code: 'MRT', text: '毛里塔尼亚' }, - { code: 'MSR', text: '蒙特塞拉特' }, - { code: 'MTQ', text: '马提尼克' }, - { code: 'MUS', text: '毛里求斯' }, - { code: 'MWI', text: '马拉维' }, - { code: 'MYS', text: '马来西亚' }, - { code: 'MYT', text: '马约特' }, - { code: 'NAM', text: '纳米比亚' }, - { code: 'NCL', text: '新喀里多尼亚' }, - { code: 'NER', text: '尼日尔' }, - { code: 'NFK', text: '诺福克岛' }, - { code: 'NGA', text: '尼日利亚' }, - { code: 'NIC', text: '尼加拉瓜' }, - { code: 'NIU', text: '纽埃' }, - { code: 'NLD', text: '荷兰' }, - { code: 'NOR', text: '挪威' }, - { code: 'NPL', text: '尼泊尔' }, - { code: 'NRU', text: '瑙鲁' }, - { code: 'NZL', text: '新西兰' }, - { code: 'OMN', text: '阿曼' }, - { code: 'PAK', text: '巴基斯坦' }, - { code: 'PAN', text: '巴拿马' }, - { code: 'PCN', text: '皮特凯恩群岛' }, - { code: 'PER', text: '秘鲁' }, - { code: 'PHL', text: '菲律宾' }, - { code: 'PLW', text: '帕劳' }, - { code: 'PNG', text: '巴布亚新几内亚' }, - { code: 'POL', text: '波兰' }, - { code: 'PRI', text: '波多黎各' }, - { code: 'PRK', text: '朝鲜' }, - { code: 'PRT', text: '葡萄牙' }, - { code: 'PRY', text: '巴拉圭' }, - { code: 'PSE', text: '巴勒斯坦' }, - { code: 'PYF', text: '法属波利尼西亚' }, - { code: 'QAT', text: '卡塔尔' }, - { code: 'REU', text: '留尼汪' }, - { code: 'ROM', text: '罗马尼亚' }, - { code: 'RUS', text: '俄罗斯' }, - { code: 'RWA', text: '卢旺达' }, - { code: 'SAU', text: '沙特阿拉伯' }, - { code: 'SCG', text: '塞尔维亚和黑山' }, - { code: 'SDN', text: '苏丹' }, - { code: 'SEN', text: '塞内加尔' }, - { code: 'SGP', text: '新加坡' }, - { code: 'SGS', text: '南乔治亚岛和南桑德韦奇岛' }, - { code: 'SHN', text: '圣赫勒拿' }, - { code: 'SJM', text: '斯瓦尔巴群岛和扬马群岛' }, - { code: 'SLB', text: '所罗门群岛' }, - { code: 'SLE', text: '塞拉利昂' }, - { code: 'SLV', text: '萨尔瓦多' }, - { code: 'SMR', text: '圣马力诺' }, - { code: 'SOM', text: '索马里' }, - { code: 'SPM', text: '圣皮埃尔和密克隆' }, - { code: 'STP', text: '圣多美和普林西比' }, - { code: 'SUR', text: '苏里南' }, - { code: 'SVK', text: '斯洛伐克' }, - { code: 'SVN', text: '斯洛文尼亚' }, - { code: 'SWE', text: '瑞典' }, - { code: 'SWZ', text: '斯威士兰' }, - { code: 'SYC', text: '塞舌尔' }, - { code: 'SYR', text: '叙利亚' }, - { code: 'TCA', text: '特克斯和凯科斯群岛' }, - { code: 'TCD', text: '乍得' }, - { code: 'TGO', text: '多哥' }, - { code: 'THA', text: '泰国' }, - { code: 'TJK', text: '塔吉克斯坦' }, - { code: 'TKL', text: '托克劳' }, - { code: 'TKM', text: '土库曼斯坦' }, - { code: 'TMP', text: '东帝汶' }, - { code: 'TON', text: '汤加' }, - { code: 'TTO', text: '特立尼达和多巴哥' }, - { code: 'TUN', text: '突尼斯' }, - { code: 'TUR', text: '土耳其' }, - { code: 'TUV', text: '图瓦卢' }, - { code: 'TZA', text: '坦桑尼亚' }, - { code: 'UGA', text: '乌干达' }, - { code: 'UKR', text: '乌克兰' }, - { code: 'UMI', text: '美属本土外小岛屿' }, - { code: 'URY', text: '乌拉圭' }, - { code: 'USA', text: '美国' }, - { code: 'UZB', text: '乌兹别克斯坦' }, - { code: 'VAT', text: '梵蒂冈' }, - { code: 'VCT', text: '圣文森特和格林纳丁斯' }, - { code: 'VEN', text: '委内瑞拉' }, - { code: 'VGB', text: '英属维尔京群岛' }, - { code: 'VIR', text: '美属维尔京群岛' }, - { code: 'VNM', text: '越南' }, - { code: 'VUT', text: '瓦努阿图' }, - { code: 'WLF', text: '瓦利斯和富图纳群岛' }, - { code: 'WSM', text: '西萨摩亚' }, - { code: 'YEM', text: '也门' }, - { code: 'ZAF', text: '南非' }, - { code: 'ZAR', text: '扎伊尔' }, - { code: 'ZMB', text: '赞比亚' }, - { code: 'ZWE', text: '津巴布韦' } + { code: 'CHN', text: '中国' } + // { code: 'HKG', text: '中国香港' }, + // { code: 'MAC', text: '澳门' }, + // { code: 'TWN', text: '中国台湾' }, + // { code: 'ABW', text: '阿鲁巴' }, + // { code: 'AFG', text: '阿富汗' }, + // { code: 'AGO', text: '安哥拉' }, + // { code: 'AIA', text: '安圭拉' }, + // { code: 'ALB', text: '阿尔巴尼亚' }, + // { code: 'AND', text: '安道尔' }, + // { code: 'ANT', text: '荷属安的列斯' }, + // { code: 'ARE', text: '阿联酋' }, + // { code: 'ARG', text: '阿根廷' }, + // { code: 'ARM', text: '亚美尼亚' }, + // { code: 'ASM', text: '美属萨摩亚' }, + // { code: 'ATA', text: '南极洲' }, + // { code: 'ATF', text: '法属南部领土' }, + // { code: 'ATG', text: '安提瓜和巴布达' }, + // { code: 'AUS', text: '澳大利亚' }, + // { code: 'AUT', text: '奥地利' }, + // { code: 'AZE', text: '阿塞拜疆' }, + // { code: 'BDI', text: '布隆迪' }, + // { code: 'BEL', text: '比利时' }, + // { code: 'BEN', text: '贝宁' }, + // { code: 'BFA', text: '布基纳法索' }, + // { code: 'BGD', text: '孟加拉国' }, + // { code: 'BGR', text: '保加利亚' }, + // { code: 'BHR', text: '巴林' }, + // { code: 'BHS', text: '巴哈马' }, + // { code: 'BIH', text: '波斯尼亚和黑塞哥维那' }, + // { code: 'BLR', text: '白俄罗斯' }, + // { code: 'BLZ', text: '伯利兹' }, + // { code: 'BMU', text: '百慕大' }, + // { code: 'BOL', text: '玻利维亚' }, + // { code: 'BRA', text: '巴西' }, + // { code: 'BRB', text: '巴巴多斯' }, + // { code: 'BRN', text: '文莱' }, + // { code: 'BTN', text: '不丹' }, + // { code: 'BVT', text: '布维岛' }, + // { code: 'BWA', text: '博茨瓦纳' }, + // { code: 'CAF', text: '中非' }, + // { code: 'CAN', text: '加拿大' }, + // { code: 'CCK', text: '科科斯(基林)群岛' }, + // { code: 'CHE', text: '瑞士' }, + // { code: 'CHL', text: '智利' }, + // { code: 'CIV', text: '科特迪瓦' }, + // { code: 'CMR', text: '喀麦隆' }, + // { code: 'COD', text: '刚果(金)' }, + // { code: 'COG', text: '刚果(布)' }, + // { code: 'COK', text: '库克群岛' }, + // { code: 'COL', text: '哥伦比亚' }, + // { code: 'COM', text: '科摩罗' }, + // { code: 'CPV', text: '佛得角' }, + // { code: 'CRI', text: '哥斯达黎加' }, + // { code: 'CUB', text: '古巴' }, + // { code: 'CXR', text: '圣诞岛' }, + // { code: 'CYM', text: '开曼群岛' }, + // { code: 'CYP', text: '塞浦路斯' }, + // { code: 'CZE', text: '捷克' }, + // { code: 'DEU', text: '德国' }, + // { code: 'DJI', text: '吉布提' }, + // { code: 'DMA', text: '多米尼克' }, + // { code: 'DNK', text: '丹麦' }, + // { code: 'DOM', text: '多米尼加共和国' }, + // { code: 'DZA', text: '阿尔及利亚' }, + // { code: 'ECU', text: '厄瓜多尔' }, + // { code: 'EGY', text: '埃及' }, + // { code: 'ERI', text: '厄立特里亚' }, + // { code: 'ESH', text: '西撒哈拉' }, + // { code: 'ESP', text: '西班牙' }, + // { code: 'EST', text: '爱沙尼亚' }, + // { code: 'ETH', text: '埃塞俄比亚' }, + // { code: 'FIN', text: '芬兰' }, + // { code: 'FJI', text: '斐济' }, + // { code: 'FLK', text: '马尔维纳斯群岛(福克兰群岛)' }, + // { code: 'FRA', text: '法国' }, + // { code: 'FRO', text: '法罗群岛' }, + // { code: 'FSM', text: '密克罗尼西亚' }, + // { code: 'GAB', text: '加蓬' }, + // { code: 'GBR', text: '英国' }, + // { code: 'GEO', text: '格鲁吉亚' }, + // { code: 'GHA', text: '加纳' }, + // { code: 'GIB', text: '直布罗陀' }, + // { code: 'GIN', text: '几内亚' }, + // { code: 'GLP', text: '瓜德罗普' }, + // { code: 'GMB', text: '冈比亚' }, + // { code: 'GNB', text: '几内亚比绍' }, + // { code: 'GNQ', text: '赤道几内亚' }, + // { code: 'GRC', text: '希腊' }, + // { code: 'GRD', text: '格林纳达' }, + // { code: 'GRL', text: '格陵兰' }, + // { code: 'GTM', text: '危地马拉' }, + // { code: 'GUF', text: '法属圭亚那' }, + // { code: 'GUM', text: '关岛' }, + // { code: 'GUY', text: '圭亚那' }, + // { code: 'HMD', text: '赫德岛和麦克唐纳岛' }, + // { code: 'HND', text: '洪都拉斯' }, + // { code: 'HRV', text: '克罗地亚' }, + // { code: 'HTI', text: '海地' }, + // { code: 'HUN', text: '匈牙利' }, + // { code: 'IDN', text: '印度尼西亚' }, + // { code: 'IND', text: '印度' }, + // { code: 'IOT', text: '英属印度洋领土' }, + // { code: 'IRL', text: '爱尔兰' }, + // { code: 'IRN', text: '伊朗' }, + // { code: 'IRQ', text: '伊拉克' }, + // { code: 'ISL', text: '冰岛' }, + // { code: 'ISR', text: '以色列' }, + // { code: 'ITA', text: '意大利' }, + // { code: 'JAM', text: '牙买加' }, + // { code: 'JOR', text: '约旦' }, + // { code: 'JPN', text: '日本' }, + // { code: 'KAZ', text: '哈萨克斯坦' }, + // { code: 'KEN', text: '肯尼亚' }, + // { code: 'KGZ', text: '吉尔吉斯斯坦' }, + // { code: 'KHM', text: '柬埔寨' }, + // { code: 'KIR', text: '基里巴斯' }, + // { code: 'KNA', text: '圣基茨和尼维斯' }, + // { code: 'KOR', text: '韩国' }, + // { code: 'KWT', text: '科威特' }, + // { code: 'LAO', text: '老挝' }, + // { code: 'LBN', text: '黎巴嫩' }, + // { code: 'LBR', text: '利比里亚' }, + // { code: 'LBY', text: '利比亚' }, + // { code: 'LCA', text: '圣卢西亚' }, + // { code: 'LIE', text: '列支敦士登' }, + // { code: 'LKA', text: '斯里兰卡' }, + // { code: 'LSO', text: '莱索托' }, + // { code: 'LTU', text: '立陶宛' }, + // { code: 'LUX', text: '卢森堡' }, + // { code: 'LVA', text: '拉脱维亚' }, + // { code: 'MAR', text: '摩洛哥' }, + // { code: 'MCO', text: '摩纳哥' }, + // { code: 'MDA', text: '摩尔多瓦' }, + // { code: 'MDG', text: '马达加斯加' }, + // { code: 'MDV', text: '马尔代夫' }, + // { code: 'MEX', text: '墨西哥' }, + // { code: 'MHL', text: '马绍尔群岛' }, + // { code: 'MKD', text: '马斯顿' }, + // { code: 'MLI', text: '马里' }, + // { code: 'MLT', text: '马耳他' }, + // { code: 'MMR', text: '缅甸' }, + // { code: 'MNG', text: '蒙古' }, + // { code: 'MNP', text: '北马里亚纳' }, + // { code: 'MOZ', text: '莫桑比克' }, + // { code: 'MRT', text: '毛里塔尼亚' }, + // { code: 'MSR', text: '蒙特塞拉特' }, + // { code: 'MTQ', text: '马提尼克' }, + // { code: 'MUS', text: '毛里求斯' }, + // { code: 'MWI', text: '马拉维' }, + // { code: 'MYS', text: '马来西亚' }, + // { code: 'MYT', text: '马约特' }, + // { code: 'NAM', text: '纳米比亚' }, + // { code: 'NCL', text: '新喀里多尼亚' }, + // { code: 'NER', text: '尼日尔' }, + // { code: 'NFK', text: '诺福克岛' }, + // { code: 'NGA', text: '尼日利亚' }, + // { code: 'NIC', text: '尼加拉瓜' }, + // { code: 'NIU', text: '纽埃' }, + // { code: 'NLD', text: '荷兰' }, + // { code: 'NOR', text: '挪威' }, + // { code: 'NPL', text: '尼泊尔' }, + // { code: 'NRU', text: '瑙鲁' }, + // { code: 'NZL', text: '新西兰' }, + // { code: 'OMN', text: '阿曼' }, + // { code: 'PAK', text: '巴基斯坦' }, + // { code: 'PAN', text: '巴拿马' }, + // { code: 'PCN', text: '皮特凯恩群岛' }, + // { code: 'PER', text: '秘鲁' }, + // { code: 'PHL', text: '菲律宾' }, + // { code: 'PLW', text: '帕劳' }, + // { code: 'PNG', text: '巴布亚新几内亚' }, + // { code: 'POL', text: '波兰' }, + // { code: 'PRI', text: '波多黎各' }, + // { code: 'PRK', text: '朝鲜' }, + // { code: 'PRT', text: '葡萄牙' }, + // { code: 'PRY', text: '巴拉圭' }, + // { code: 'PSE', text: '巴勒斯坦' }, + // { code: 'PYF', text: '法属波利尼西亚' }, + // { code: 'QAT', text: '卡塔尔' }, + // { code: 'REU', text: '留尼汪' }, + // { code: 'ROM', text: '罗马尼亚' }, + // { code: 'RUS', text: '俄罗斯' }, + // { code: 'RWA', text: '卢旺达' }, + // { code: 'SAU', text: '沙特阿拉伯' }, + // { code: 'SCG', text: '塞尔维亚和黑山' }, + // { code: 'SDN', text: '苏丹' }, + // { code: 'SEN', text: '塞内加尔' }, + // { code: 'SGP', text: '新加坡' }, + // { code: 'SGS', text: '南乔治亚岛和南桑德韦奇岛' }, + // { code: 'SHN', text: '圣赫勒拿' }, + // { code: 'SJM', text: '斯瓦尔巴群岛和扬马群岛' }, + // { code: 'SLB', text: '所罗门群岛' }, + // { code: 'SLE', text: '塞拉利昂' }, + // { code: 'SLV', text: '萨尔瓦多' }, + // { code: 'SMR', text: '圣马力诺' }, + // { code: 'SOM', text: '索马里' }, + // { code: 'SPM', text: '圣皮埃尔和密克隆' }, + // { code: 'STP', text: '圣多美和普林西比' }, + // { code: 'SUR', text: '苏里南' }, + // { code: 'SVK', text: '斯洛伐克' }, + // { code: 'SVN', text: '斯洛文尼亚' }, + // { code: 'SWE', text: '瑞典' }, + // { code: 'SWZ', text: '斯威士兰' }, + // { code: 'SYC', text: '塞舌尔' }, + // { code: 'SYR', text: '叙利亚' }, + // { code: 'TCA', text: '特克斯和凯科斯群岛' }, + // { code: 'TCD', text: '乍得' }, + // { code: 'TGO', text: '多哥' }, + // { code: 'THA', text: '泰国' }, + // { code: 'TJK', text: '塔吉克斯坦' }, + // { code: 'TKL', text: '托克劳' }, + // { code: 'TKM', text: '土库曼斯坦' }, + // { code: 'TMP', text: '东帝汶' }, + // { code: 'TON', text: '汤加' }, + // { code: 'TTO', text: '特立尼达和多巴哥' }, + // { code: 'TUN', text: '突尼斯' }, + // { code: 'TUR', text: '土耳其' }, + // { code: 'TUV', text: '图瓦卢' }, + // { code: 'TZA', text: '坦桑尼亚' }, + // { code: 'UGA', text: '乌干达' }, + // { code: 'UKR', text: '乌克兰' }, + // { code: 'UMI', text: '美属本土外小岛屿' }, + // { code: 'URY', text: '乌拉圭' }, + // { code: 'USA', text: '美国' }, + // { code: 'UZB', text: '乌兹别克斯坦' }, + // { code: 'VAT', text: '梵蒂冈' }, + // { code: 'VCT', text: '圣文森特和格林纳丁斯' }, + // { code: 'VEN', text: '委内瑞拉' }, + // { code: 'VGB', text: '英属维尔京群岛' }, + // { code: 'VIR', text: '美属维尔京群岛' }, + // { code: 'VNM', text: '越南' }, + // { code: 'VUT', text: '瓦努阿图' }, + // { code: 'WLF', text: '瓦利斯和富图纳群岛' }, + // { code: 'WSM', text: '西萨摩亚' }, + // { code: 'YEM', text: '也门' }, + // { code: 'ZAF', text: '南非' }, + // { code: 'ZAR', text: '扎伊尔' }, + // { code: 'ZMB', text: '赞比亚' }, + // { code: 'ZWE', text: '津巴布韦' } ], //证件类型 -- 未改动 idType: [ diff --git a/src/assets/js/utils/formatRiskList.js b/src/assets/js/utils/formatRiskList.js index 0319ff907..92fd32f8c 100644 --- a/src/assets/js/utils/formatRiskList.js +++ b/src/assets/js/utils/formatRiskList.js @@ -8,7 +8,7 @@ export function formatRiskList(list, insureList, riskList) { insured[riskList] = [] } insured[riskList].forEach(main => { - list.firstPrem = ((list.firstPrem * 100 + main.prem * 100) / 100).toFixed(2) //保留两位小数 + list.firstPrem = ((list.firstPrem * 10000 + main.prem * 10000) / 10000).toFixed(2) //保留两位小数 if (main.isMainRisk == '0') { //此时为主险 insured.mainRisk.push(main) @@ -44,7 +44,7 @@ export function formatAllRisk(list) { if (risk.isMainRisk == '1') { if (main.mainRiskCode == risk.mainRiskCode) { main.addtion.push(risk) - main.prem += risk.prem + main.prem = (main.prem * 10000 + risk.prem * 10000) / 10000 } } }) diff --git a/src/assets/js/utils/validator.js b/src/assets/js/utils/validator.js index bab6112e4..8f532603d 100644 --- a/src/assets/js/utils/validator.js +++ b/src/assets/js/utils/validator.js @@ -24,6 +24,9 @@ Validator.extend('required', { return field + '不能为空' }, validate(value) { + if (value != null && value != undefined) { + value = String(value) + } if (value) { return true } @@ -131,6 +134,6 @@ Validator.extend('stature', { Validator.extend('avoirdupois', { getMessage: () => '体重输入有误', validate: value => { - return /^[0-9]{0,3}([.]{1}[0-9]{1})?$/.test(value) && value > 0.1 + return /^[0-9]+([.]{1}[0-9]{1})?$/.test(value) && value > 0.1 } }) diff --git a/src/components/ebiz/SelectRadio.vue b/src/components/ebiz/SelectRadio.vue index 9be593065..cf33b37ba 100644 --- a/src/components/ebiz/SelectRadio.vue +++ b/src/components/ebiz/SelectRadio.vue @@ -5,10 +5,10 @@
{{ label }}
- - + +
- {{ itemRadio.label }} + {{ itemRadio.label }}
@@ -47,7 +47,7 @@ export default { mounted() {}, methods: { handleChoose(value) { - if(this.disabled) { + if (this.disabled) { return } this.$emit('update:value', value) diff --git a/src/components/ebiz/customer/CustomerPicker.vue b/src/components/ebiz/customer/CustomerPicker.vue index cd32abc29..88debf8f3 100644 --- a/src/components/ebiz/customer/CustomerPicker.vue +++ b/src/components/ebiz/customer/CustomerPicker.vue @@ -67,6 +67,10 @@ export default { readonly: { type: Boolean, default: false + }, + disabled: { + type: Boolean, + default: false } }, data() { @@ -112,6 +116,9 @@ export default { this.$emit('on-choose', data) }, chooseCustomer() { + if (this.disabled) { + return + } this.showPicker = true this.$emit('on-click') }, diff --git a/src/components/ebiz/occipation/OccupationPicker.vue b/src/components/ebiz/occipation/OccupationPicker.vue index cb8a56716..e02b803f3 100644 --- a/src/components/ebiz/occipation/OccupationPicker.vue +++ b/src/components/ebiz/occipation/OccupationPicker.vue @@ -31,6 +31,10 @@ export default { type: String, default: '11' }, + disabled: { + type: Boolean, + default: false + }, value: { type: String, default: '' @@ -111,6 +115,9 @@ export default { this.showPicker = false }, openOccupation() { + if (this.disabled) { + return + } this.$emit('on-click') this.showPicker = true }, diff --git a/src/router/ebiz/sale.js b/src/router/ebiz/sale.js index ca525948c..b0f7d3f62 100644 --- a/src/router/ebiz/sale.js +++ b/src/router/ebiz/sale.js @@ -119,7 +119,7 @@ export default [ name: 'insuranceInformation', component: insuranceInformation, meta: { - title: '阅读投保须知' + title: '阅读人身保险投保提示' } }, { diff --git a/src/views/ebiz/common/AddRiskList.vue b/src/views/ebiz/common/AddRiskList.vue index 7e3d3b2f5..cef5a4d45 100644 --- a/src/views/ebiz/common/AddRiskList.vue +++ b/src/views/ebiz/common/AddRiskList.vue @@ -66,7 +66,7 @@ export default { //930折中方案,豁免险选择 let chooseProducts = JSON.parse(localStorage.chooseProducts) for (let i = 0; i < chooseProducts.length; i++) { - if (chooseProducts[i].productCode == 'DCRS_A0001') { + if (chooseProducts[i].productCode == 'DCRS_A0001' && this.result.productCode == 'DCRS_A0001') { this.$toast('豁免险已选!') return } diff --git a/src/views/ebiz/common/CalculatePremium.vue b/src/views/ebiz/common/CalculatePremium.vue index eab4e9713..6daea9908 100644 --- a/src/views/ebiz/common/CalculatePremium.vue +++ b/src/views/ebiz/common/CalculatePremium.vue @@ -29,10 +29,7 @@ :min="riskFactor.minAmt" :max="riskFactor.maxAmt" class="ml10" - @change="stepperChange" - @plus="plus(index, riskFactorIndex)" - @minus="minus(index, riskFactorIndex)" - @focus="focus(index, riskFactorIndex)" + @change="stepperChange(item.calFactorLst[riskFactorIndex].defaultValue, index, riskFactorIndex)" input-width="100" :integer="true" /> @@ -73,7 +70,7 @@ {{ trialList[index].prem.toFixed(2) | moneyFormat }} - 完成 + 完成 @@ -185,6 +182,10 @@ export default { this.popupShow = false return false } + if (currentEle.code == 'insuYear' && this.ageInfluenceInsuYear(value.value, currentEle)) { + this.popupShow = false + return false + } currentEle.showContent = value.text let name = currentEle.code @@ -218,7 +219,7 @@ export default { payEndYearVal = this.getPayEndYearOrInsuYear('payEndYear', currentFactor) } if (payEndYearVal > insuYearVal) { - this.$toast('交费期限不能超过保险期间') + this.$toast('交费期间不能超过保险期间') return true } else { return false @@ -238,7 +239,18 @@ export default { let age = Number(this.saleInsuredPersonInfo.age) for (let i = 0; i < currentEle.rules.length; i++) { if (currentEle.rules[i].payEndYear == value && age > currentEle.rules[i].maxAge) { - this.$toast('被保人年龄不适合该交费期限!') + this.$toast('被保人年龄不适合该交费期间!') + return true + } + } + return false + }, + //年龄对保险期间的影响 + ageInfluenceInsuYear(value, currentEle) { + let age = Number(this.saleInsuredPersonInfo.age) + for (let i = 0; i < currentEle.rules.length; i++) { + if (currentEle.rules[i].insuYear == value && age > currentEle.rules[i].maxAge) { + this.$toast('被保人年龄不适合该保险期间!') return true } } @@ -254,8 +266,8 @@ export default { let mainAddRelation = influences.amtInfluence[0].mainAddRelation let amtTimes = influences.amtInfluence[0].amtTimes let mainRiskAmt = this.getMainRiskAmt() - if (mainAddRelation == 3 && amtTimes == 1) { - this.setInputAddtionRiskMaxAmt(mainRiskAmt, index) + if (mainAddRelation == 3 && (amtTimes == 1 || amtTimes == 5)) { + this.setInputAddtionRiskMaxAmt(mainRiskAmt * amtTimes, index) } else if (mainAddRelation == 3 && amtTimes == 0.2) { this.setAddtionRiskMaxAmt(mainRiskAmt * amtTimes, index) } @@ -304,9 +316,8 @@ export default { this.chooseProducts[index].calFactorLst.forEach(item => { if (item.type == 1) { item.maxAmt = Math.min(mainRiskAmt, item.oldMaxAmt) - + //减保额份数 if (item.maxAmt < item.defaultValue) { - //减保额份数 item.defaultValue = item.maxAmt } } @@ -556,22 +567,14 @@ export default { }) }, //保额份数变化 - stepperChange(value) { - let currentEle = this.chooseProducts[this.productIndex].calFactorLst[this.calFactorIndex] - currentEle.defaultValue = value + stepperChange(value, productIndex, calFactorIndex) { + // let currentEle = this.chooseProducts[this.productIndex].calFactorLst[this.calFactorIndex] + // currentEle.defaultValue = value + let currentEle = this.chooseProducts[productIndex].calFactorLst[calFactorIndex] this.mainRiskInfluenceAddRisk() currentEle['amt'] = Number(currentEle.defaultValue) * Number(currentEle.moneyUnit) this.getTrial() }, - focus(index, index1) { - ;[this.productIndex, this.calFactorIndex] = [index, index1] - }, - minus(index, index1) { - ;[this.productIndex, this.calFactorIndex] = [index, index1] - }, - plus(index, index1) { - ;[this.productIndex, this.calFactorIndex] = [index, index1] - }, //下一步 async nextStep() { //组装险种提交数据 @@ -594,9 +597,14 @@ export default { //930折中方案,责任险分档 riskItem['amt'] = this.trialList[index].amt } + //豁免险保额处理 + if (item.isRemit == '0') { + this.trialInfos[index].amt = this.trialList[0].prem + } riskItem = Object.assign(riskItem, this.trialInfos[index]) riskDTOLst.push(riskItem) }) + console.log('riskDTOLst', riskDTOLst) //建议书需要添加全部投保人信息,电投只需要投保人ID let insuredDTOItem = Object.assign(this.saleInsuredPersonInfo, { riskDTOLst: riskDTOLst }) let params = { @@ -663,5 +671,8 @@ export default { .prem:last-child { border: none; } + /deep/.van-action-sheet__name { + font-size: 12px; + } } diff --git a/src/views/ebiz/my/UserInfo.vue b/src/views/ebiz/my/UserInfo.vue index 2ff5825c1..8e37c3da5 100644 --- a/src/views/ebiz/my/UserInfo.vue +++ b/src/views/ebiz/my/UserInfo.vue @@ -1,50 +1,31 @@ @@ -93,29 +76,31 @@ export default { .user-info-container { .user-info-item { line-height: 40px; - color: #999; - border-bottom: 1px solid #f1f1f1; - van-col[span] { - // line-height: 40px; - color: #000; - margin-left: 100px; - } + border-bottom: 1px solid #dadada; } - .active { - padding: 0; - .collapse-down { - padding: 0; - } + /deep/.van-cell:not(:last-child)::after { + position: absolute; + box-sizing: border-box; + content: ' '; + pointer-events: none; + right: 0; + bottom: 0; + left: 0; + border-bottom: 1px solid #dadada; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); } - .black { - color: black; + /deep/.van-hairline--top-bottom::after { + border: 0; } - /deep/ .van-cell { - padding-left: 0; - padding-right: 0; + /deep/ .van-cell__value { + text-align: left !important; } /deep/ .van-collapse-item__content { - padding: 0; + padding-top: 0; + } + /deep/.van-collapse-item__title { + padding-left: 30px; } } diff --git a/src/views/ebiz/product/ProductDetail.vue b/src/views/ebiz/product/ProductDetail.vue index 473afadc6..5392a0b5f 100644 --- a/src/views/ebiz/product/ProductDetail.vue +++ b/src/views/ebiz/product/ProductDetail.vue @@ -1,23 +1,25 @@ @@ -117,19 +135,26 @@ export default { diff --git a/src/views/ebiz/proposal/Appnt.vue b/src/views/ebiz/proposal/Appnt.vue index 0dcb33b9c..491ace15a 100644 --- a/src/views/ebiz/proposal/Appnt.vue +++ b/src/views/ebiz/proposal/Appnt.vue @@ -129,19 +129,17 @@ export default { }, closeBtn() { // 筛选按钮的显示 - setTimeout(()=> { - this.$jump({ - flag: 'webview_right_button', - extra: { - btns: [ - { - img: this.$assetsUrl + 'images/del-close.png', - route: { flag: '', extra: {} } - } - ] - } - }) - }, 500) + this.$jump({ + flag: 'webview_right_button', + extra: { + btns: [ + { + img: this.$assetsUrl + 'images/del-close.png', + route: { flag: '', extra: {} } + } + ] + } + }) }, appCallBack() { // 筛选按钮的点击事件 diff --git a/src/views/ebiz/proposal/InsuredPerson.vue b/src/views/ebiz/proposal/InsuredPerson.vue index c9c22ab66..d333a1da7 100644 --- a/src/views/ebiz/proposal/InsuredPerson.vue +++ b/src/views/ebiz/proposal/InsuredPerson.vue @@ -11,15 +11,18 @@ v-validate="'required'" name="被保人" required + :readonly="disabled" label="姓名" @on-click="selectClick('1')" :parentShowPicker.sync="customerShowPicker" :value.sync="insured.name" + :disabled="disabled" > - + -
+
- + 下一步 @@ -88,7 +92,7 @@ export default { value: '1' } ], - currentTime: beforeDate.getBeforeDays(28), + currentTime: beforeDate.getBeforeDays(27), insured: { name: '', age: '', @@ -106,7 +110,8 @@ export default { localInfo: '', customerShowPicker: false, occupationShowPicker: false, - currentPopupIndex: '' + currentPopupIndex: '', + disabled: false } }, @@ -125,6 +130,7 @@ export default { this.insured.relationLabel = relationName if (this.insured.relationToAppnt == '1') { //如果是投被同人 就将投保人信息存入被保人信息 + this.disabled = true this.insured = Object.assign(this.insured, JSON.parse(localStorage.proposalAppnt)) this.insured.age = getAge.getAge(this.insured.birthday, new Date()) this.insured.medical = '0' @@ -152,19 +158,17 @@ export default { }, closeBtn() { // 筛选按钮的显示 - setTimeout(() => { - this.$jump({ - flag: 'webview_right_button', - extra: { - btns: [ - { - img: this.$assetsUrl + 'images/del-close.png', - route: { flag: '', extra: {} } - } - ] - } - }) - }, 500) + this.$jump({ + flag: 'webview_right_button', + extra: { + btns: [ + { + img: this.$assetsUrl + 'images/del-close.png', + route: { flag: '', extra: {} } + } + ] + } + }) }, appCallBack() { // 筛选按钮的点击事件 @@ -245,7 +249,7 @@ export default { className: 'dialog-delete', title: '提示', message: '当前信息已经发生改变,有可能影响险种费率,是否确认修改并清除险种信息?', - cancelButtonColor: '#E9332E', + cancelButtonColor: '#4FC6B3', confirmButtonColor: '#FFFFFF' }) .then(() => { @@ -292,7 +296,6 @@ export default { }, //选择客户列表中的客户 chooseCustomer(data) { - console.log(data) this.customerShowPicker = false this.$jump({ flag: 'navigation', @@ -312,7 +315,7 @@ export default { occupationCode, lifeGrade, healthGrade, - medical: socialSecurity + medical: socialSecurity ? socialSecurity : '0' } Object.assign(this.insured, insured) } diff --git a/src/views/ebiz/proposal/rule.js b/src/views/ebiz/proposal/rule.js index 645b3e399..df6562b60 100644 --- a/src/views/ebiz/proposal/rule.js +++ b/src/views/ebiz/proposal/rule.js @@ -8,7 +8,7 @@ export function checkSex(cacheSex, localSex, relation) { } export function checkRelation(relation, age) { //当被保人年龄小于8岁 被保人与投保人关系必须为父母 - if (age < 8 && relation != '3') { + if (age < 8 && relation != '4') { return false } else { return true diff --git a/src/views/ebiz/sale/AccountInformation.vue b/src/views/ebiz/sale/AccountInformation.vue index 8210bbd04..59deb4b05 100644 --- a/src/views/ebiz/sale/AccountInformation.vue +++ b/src/views/ebiz/sale/AccountInformation.vue @@ -26,7 +26,7 @@ @@ -198,19 +198,17 @@ export default { }, closeBtn() { // 筛选按钮的显示 - setTimeout(()=> { - this.$jump({ - flag: 'webview_right_button', - extra: { - btns: [ - { - img: this.$assetsUrl + 'images/del-close.png', - route: { flag: '', extra: {} } - } - ] - } - }) - }, 500) + this.$jump({ + flag: 'webview_right_button', + extra: { + btns: [ + { + img: this.$assetsUrl + 'images/del-close.png', + route: { flag: '', extra: {} } + } + ] + } + }) }, appCallBack() { this.isclear = true diff --git a/src/views/ebiz/sale/AddBeneficiaryInfo.vue b/src/views/ebiz/sale/AddBeneficiaryInfo.vue index e59ad7458..cc3b9ed44 100644 --- a/src/views/ebiz/sale/AddBeneficiaryInfo.vue +++ b/src/views/ebiz/sale/AddBeneficiaryInfo.vue @@ -44,6 +44,7 @@ clearable :readonly="isInsured" v-validate="'required'" + @blur="getRelatedData(userInfo.idNo)" >
长期 @@ -185,6 +186,9 @@ import utilsAge from '@/assets/js/utils/age' import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan' import CustomerPicker from '@/components/ebiz/customer/CustomerPicker' import idNoCheck from '@/assets/js/utils/idNoCheck' +import { idToData } from './js/verification' +import { selectComp } from './js/methods' +let relationToInsured = [{ id: 2, text: '配偶' }, { id: 3, text: '父母' }, { id: 4, text: '子女' }, { id: 5, text: '其他' }] export default { name: 'insuredInfo', @@ -215,6 +219,7 @@ export default { value: '1' } ], + currentPopupIndex: '', relationToAppnt: '', popupShow: false, areaShow: false, @@ -231,7 +236,6 @@ export default { certiexpiredateRequired: true, //证件截止日期是否需要校验 certiexpiredateShow: true, //证件截止日期是否可以选择 marriage: '', - tempUser: {}, userInfo: { name: '', sex: '0', @@ -265,16 +269,15 @@ export default { occupationShowPicker: false, customerShowPicker: false, //客户列表展示 isInsured: false, //是被保人本人, + idLimit: false //证件起止日期是否只读 // 开飞机的小历悦 - area: '', - city: '', - province: '' + // area: '', + // city: '', + // province: '' } }, - created() {}, mounted() { window.appCallBack = this.appCallBack - this.tempUser = this.userInfo }, methods: { //监听名字变化 @@ -286,40 +289,41 @@ export default { if (this.isInsured) { return } - let title = '' - if (index == 1) { - ;[this.customerShowPicker, title] = [true, '客户列表'] - } else if (index == 2) { - ;[this.occupationShowPicker, title] = [true, '职业类别'] - } + // this.currentPopupIndex = index + // let title = '' + // if (index == 1) { + // ;[this.customerShowPicker, title] = [true, '客户列表'] + // } else if (index == 2) { + // ;[this.occupationShowPicker, title] = [true, '职业类别'] + // } - setTimeout(() => { - this.$jump({ - flag: 'navigation', - extra: { - title, - hiddenLeft: '1' - } - }) - this.closeBtn() - }, 400) - }, - closeBtn() { - // 筛选按钮的显示 - setTimeout(()=> { - this.$jump({ - flag: 'webview_right_button', - extra: { - btns: [ - { - img: this.$assetsUrl + 'images/del-close.png', - route: { flag: '', extra: {} } - } - ] - } - }) - }, 500) + // setTimeout(() => { + // this.$jump({ + // flag: 'navigation', + // extra: { + // title, + // hiddenLeft: '1' + // } + // }) + // this.closeBtn() + // }, 400) + // let that = this + selectComp(this, index, '3') }, + // closeBtn() { + // // 筛选按钮的显示 + // this.$jump({ + // flag: 'webview_right_button', + // extra: { + // btns: [ + // { + // img: this.$assetsUrl + 'images/del-close.png', + // route: { flag: '', extra: {} } + // } + // ] + // } + // }) + // }, appCallBack() { this.$jump({ flag: 'navigation', @@ -328,7 +332,11 @@ export default { hiddenRight: '1' } }) - this.occupationShowPicker = false + if (this.currentPopupIndex == 1) { + this.customerShowPicker = false + } else if (this.currentPopupIndex == 2) { + this.occupationShowPicker = false + } }, chooseOccupation() { this.$jump({ @@ -362,7 +370,7 @@ export default { } else if (pickerType == '6') { this.columns = DataDictionary.marriage } else if (pickerType == '7') { - this.columns = DataDictionary.relationToAppnt + this.columns = relationToInsured } }, //确认选择字段 @@ -372,14 +380,20 @@ export default { if (this.pickerType == '1') { ;[this.userInfo.nativeplace, this.nativeplace] = [value.id, value.text] } else if (this.pickerType == '2') { + this.idLimit = false + this.userInfo.idNo = this.userInfo.certificateValidate = this.userInfo.certiexpiredate = this.userInfo.birthday = '' + this.userInfo.sex = '0' + this.effectiveDateTypeAble = false console.log(value.id) //身份证以外的证件类型可以使用长期 - if (value.id != '1') { - this.effectiveDateTypeAble = false - } else { + if (value.id == '1') { console.log('123') let age = utilsAge.getAge(this.userInfo.birthday, new Date()) - this.effectiveDateTypeAble = !(age >= 45) + this.effectiveDateTypeAble = age <= 45 + } else if (value.id == 2 || value.id == 3) { + this.effectiveDateTypeAble = true + } else { + this.effectiveDateTypeAble = false } ;[this.userInfo.idType, this.idType] = [value.id, value.text] } else if (this.pickerType == '3') { @@ -399,13 +413,6 @@ export default { this.isInsured = true //获取被保人信息 let insuredInfo = res.orderDTO.insuredDTOs[0] - // let newUserInfo = this.userInfo - // newUserInfo = Object.assign(newUserInfo, insuredInfo) - // console.log(this.userInfo) - // console.log(res.orderDTO.insuredDTOs[0]) - // for (let key in this.userInfo) { - // this.userInfo[key] = newUserInfo[key] - // } for (let key in this.userInfo) { this.userInfo[key] = insuredInfo[key] } @@ -431,7 +438,7 @@ export default { // 计算年龄 let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // 长期按钮是否禁用 - this.effectiveDateTypeAble = age >= 16 && age <= 45 + this.effectiveDateTypeAble = age <= 45 } } else { this.$toast(res.resultMessage) @@ -450,7 +457,6 @@ export default { } } this.areaName = '' - // this.userInfo = this.tempUser ;[this.userInfo.relationToInsured, this.relationToAppnt] = [value.id, value.text] } // ;[this.userInfo.relationToInsured, this.relationToAppnt] = [value.id, value.text] @@ -472,7 +478,7 @@ export default { // 计算年龄 let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // 长期按钮是否禁用 - this.effectiveDateTypeAble = age >= 16 && age <= 45 + this.effectiveDateTypeAble = age <= 45 } break case '1': @@ -505,7 +511,15 @@ export default { //长期判断 if (this.userInfo.idType == '1') { let age = utilsAge.getAge(this.userInfo.birthday, new Date()) - this.effectiveDateTypeAble = !(age >= 45) + this.effectiveDateTypeAble = age <= 45 + } + //出生证有效期 + if (this.userInfo.idType == '3') { + if (Date.parse(this.userInfo.certiexpiredate) - Date.parse(val) > Date.parse('1973-01-01')) { + this.userInfo.birthday = '' + this.$refs.birthday.date = '' + return this.$toast('出生证有效期或出生日期有误') + } } } break @@ -558,31 +572,48 @@ export default { //计算年龄 let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // 长期按钮是否禁用 - this.effectiveDateTypeAble = age >= 16 && age <= 45 + this.effectiveDateTypeAble = age <= 45 //数据是否从客户列表拉取 this.fromCustomer = true }, nextStep() { - //与被保人关系是配偶 - // if (this.userInfo.relationToInsured == '2') { - // //被保人不是已婚 - // if (this.insuredMarriage != '1') { - // return this.$toast('与投保人关系不正确') - // } - // let insuredSex = JSON.parse(localStorage.saleInsuredPersonInfo).sex - // let appntSex = JSON.parse(localStorage.saleInsuredInfo).sex - // //投被保人性别相同 - // if (insuredSex == appntSex) { - // return this.$toast('性别输入有误') - // } + // 计算年龄 + let age = utilsAge.getAge(this.userInfo.birthday, new Date()) + + // //被保人不是已婚 + // if (this.insuredMarriage != '1') { + // return this.$toast('与投保人关系不正确') // } - // console.log(this.userInfo.idType) + // let insuredSex = JSON.parse(localStorage.saleInsuredPersonInfo).sex + // let appntSex = JSON.parse(localStorage.saleInsuredInfo).sex + // //投被保人性别相同 + // if (insuredSex == appntSex) { + // return this.$toast('性别输入有误') + // } + + console.log(this.userInfo.idType) // 页面跳转 this.$validator.validate().then(valid => { if (true === valid) { - // 计算年龄 - let age = utilsAge.getAge(this.userInfo.birthday, new Date()) + //与被保人关系是配偶 + if (this.userInfo.relationToInsured == '2') { + let insuredInfo = JSON.parse(localStorage.saleInsuredPersonInfo) + //如果被保人是投保人的配偶 或者 投保人不是已婚 + if (insuredInfo.relationToAppnt == '2' || insuredInfo.marriage != '1') { + return this.$toast('与被保人关系有误') + } + //如果被保人与投保人性别相同 + if (insuredInfo.sex == this.userInfo.sex) { + return this.$toast('性别录入与婚姻状况不符') + } + + //如果性别男小于22岁 或者 性别女小于20岁 + if ((this.userInfo.sex == '0' && age < 22) || (this.userInfo.sex == '1' && age < 20)) { + return this.$toast('年龄与婚姻状况不符') + } + } + //如果证件类型是身份证 if (this.userInfo.idType == '1') { //校验性别是否与身份证号码位相符 @@ -766,7 +797,7 @@ export default { //同投保人联系地址 this.areaName = getAreaName([{ code: this.userInfo.province }, { code: this.userInfo.city }, { code: this.userInfo.area }]) //详细地址 - this.userInfo.village = res.orderDTO.appntDTO.homeAddress + this.userInfo.village = res.orderDTO.appntDTO.village } else { this.$toast(res.resultMessage) } @@ -807,6 +838,46 @@ export default { let day = date.getDate() day = day.toString().padStart(2, '0') return `${year}-${month}-${day}` + }, + getRelatedData(val) { + // if (this.userInfo.idType != '1') { + // return + // } + // //如果证件校验不通过,恢复默认值 + // if (idToData(val).text) { + // ;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false] + // return this.$toast(idToData(val).text) + // } + // this.effectiveDateTypeAble = idToData(val).age < 45 + // this.userInfo.birthday = idToData(val).birthday + // this.userInfo.sex = idToData(val).sex + if (!['1', '2', '3', 1, 2, 3].includes(this.userInfo.idType)) { + return + } + //如果证件校验不通过,恢复默认值 + if (idToData(val).text) { + ;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false] + return this.$toast(idToData(val).text) + } + this.userInfo.effectiveDateType = false + this.effectiveDateTypeAble = idToData(val).age < 45 + this.userInfo.birthday = idToData(val).birthday + this.userInfo.sex = idToData(val).sex + //如果选择户口本 + if (this.userInfo.idType == '2') { + let exipreDate = Date.parse(this.userInfo.birthday) + Date.parse('1985-12-31') + this.userInfo.certificateValidate = this.userInfo.birthday + this.userInfo.certiexpiredate = this.timeStampFormat(exipreDate) + this.idLimit = true + //如果选择出生证明 + } else if (this.userInfo.idType == '3') { + let exipreDate = Date.parse(this.userInfo.birthday) + Date.parse('1972-12-31') + this.userInfo.certificateValidate = this.userInfo.birthday + this.userInfo.certiexpiredate = this.timeStampFormat(exipreDate) + this.idLimit = true + } else { + this.idLimit = false + } } }, filters: { diff --git a/src/views/ebiz/sale/AttachmentManagement.vue b/src/views/ebiz/sale/AttachmentManagement.vue index 36ad08d4b..7ee3de2c6 100644 --- a/src/views/ebiz/sale/AttachmentManagement.vue +++ b/src/views/ebiz/sale/AttachmentManagement.vue @@ -15,13 +15,29 @@
- +
- +
@@ -29,7 +45,15 @@
- +
@@ -37,7 +61,31 @@
- + +
+
+
+ + + +
+
@@ -46,7 +94,15 @@
- +
@@ -65,13 +121,29 @@
- +
- +
@@ -79,15 +151,47 @@
- +
-
- +
+ +
+
+
+ + + +
+
@@ -96,7 +200,15 @@
- +
@@ -109,8 +221,34 @@ 其他
-
- +
+ + +
@@ -146,6 +284,10 @@ export default { fileListIdBack: [], // 其他类型页面 fileLIstImg: [], + // 投保人选择的必选其他 + saleInsuredInfoOther: [], + // 被保人选择的必选其他 + saleInsuredPersonInfoOther: [], // 银行账户 fileListBank: [], // 被保人身份证正面 @@ -156,8 +298,11 @@ export default { fileListBankInsured: [], // 被保人其他类型页面 fileLIstImgInsured: [], + // fileLIstImgInsrued // 其他 - fileListOther: [], + fileListOtherOne: [], + fileListOtherTwo: [], + fileListOtherThree: [], // 单选框 radio: '', // 是否可以点击下一步 @@ -340,32 +485,40 @@ export default { Dialog.confirm({ title: '提示', message: '您确定要删除吗' - }).then(() => { - if (detail.name == 'fileListIdFront') { - this.fileListIdFront = [] - } else if (detail.name == 'fileListIdBack') { - this.fileListIdBack = [] - } else if (detail.name == 'fileLIstImg') { - this.fileLIstImg = [] - } else if (detail.name == 'fileListBank') { - this.fileListBank = [] - } else if (detail.name == 'fileListIdFrontInsured') { - this.fileListIdFrontInsured = [] - } else if (detail.name == 'fileListIdBackInsured') { - this.fileListIdBackInsured = [] - } else if (detail.name == 'fileListBankInsured') { - this.fileListBankInsured = [] - } else if (detail.name == 'fileLIstImgInsured') { - this.fileLIstImgInsured = [] - } else if (detail.name == 'fileListOther') { - this.fileListOther = [] - } - this.deleteImg(file) - }).catch(() => { - // on cancel }) - - + .then(() => { + if (detail.name == 'fileListIdFront') { + this.fileListIdFront = [] + } else if (detail.name == 'fileListIdBack') { + this.fileListIdBack = [] + } else if (detail.name == 'fileLIstImg') { + this.fileLIstImg = [] + } else if (detail.name == 'fileListBank') { + this.fileListBank = [] + } else if (detail.name == 'fileListIdFrontInsured') { + this.fileListIdFrontInsured = [] + } else if (detail.name == 'fileListIdBackInsured') { + this.fileListIdBackInsured = [] + } else if (detail.name == 'fileListBankInsured') { + this.fileListBankInsured = [] + } else if (detail.name == 'fileLIstImgInsured') { + this.fileLIstImgInsured = [] + } else if (detail.name == 'fileListOtherOne') { + this.fileListOtherOne = [] + } else if (detail.name == 'fileListOtherTwo') { + this.fileListOtherTwo = [] + } else if (detail.name == 'fileListOtherThree') { + this.fileListOtherThree = [] + } else if (detail.name == 'saleInsuredInfoOther') { + this.saleInsuredInfoOther = [] + } else if (detail.name == 'saleInsuredPersonInfoOther') { + this.saleInsuredPersonInfoOther = [] + } + this.deleteImg(file) + }) + .catch(() => { + // on cancel + }) }, test(type, id) { let that = this @@ -400,6 +553,12 @@ export default { case 'fileLIstImgInsured': that.type = type break + case 'saleInsuredPersonInfoOther': + that.type = type + break + case 'saleInsuredInfoOther': + that.type = type + break } }, // 删除图片 @@ -458,7 +617,13 @@ export default { if (res.result == '0') { this.$toast.clear() // res.responseObject.imgList.map(item => { - if (that.type == 'fileListIdFront' || that.type == 'fileListIdBack' || that.type == 'fileLIstImg' || that.type == 'fileListBank') { + if ( + that.type == 'fileListIdFront' || + that.type == 'fileListIdBack' || + that.type == 'fileLIstImg' || + that.type == 'fileListBank' || + that.type == 'saleInsuredInfoOther' + ) { // 是投保人 // console.log(that.file) // 证件类型 @@ -481,6 +646,8 @@ export default { imageInfoType = '9' } else if (that.type == 'fileLIstImg' && that.id == '6') { imageInfoType = '10' + } else if (that.type == 'saleInsuredInfoOther' && that.id == '7') { + imageInfoType = '11' } let obj = { businessNo: that.orderNo, @@ -499,7 +666,8 @@ export default { that.type == 'fileListIdFrontInsured' || that.type == 'fileListIdBackInsured' || that.type == 'fileListBankInsured' || - that.type == 'fileLIstImgInsured' + that.type == 'fileLIstImgInsured' || + that.type == 'saleInsuredPersonInfoOther' ) { // 是被保人 // 证件类型 @@ -524,6 +692,8 @@ export default { imageInfoType = '9' } else if (that.type == 'fileLIstImgInsured' && that.id == '6') { imageInfoType = '10' + } else if (that.type == 'saleInsuredPersonInfoOther' && that.id == '7') { + imageInfoType = '11' } let obj = { @@ -585,6 +755,12 @@ export default { case 'fileLIstImgInsured': that.fileLIstImgInsured = [] break + case 'saleInsuredInfoOther': + that.saleInsuredInfoOther = [] + break + case 'saleInsuredPersonInfoOther': + that.saleInsuredPersonInfoOther = [] + break } this.$toast.clear() this.$toast(res.resultMessage) @@ -682,7 +858,9 @@ export default { fileListIdFrontInsured, fileListIdBackInsured, fileListBankInsured, - fileLIstImgInsured + fileLIstImgInsured, + saleInsuredPersonInfoOther, + saleInsuredInfoOther } = this return { fileListIdFront, @@ -693,7 +871,9 @@ export default { fileListIdBackInsured, fileListBankInsured, fileLIstImgInsured, - fileLIstImg + fileLIstImg, + saleInsuredPersonInfoOther, + saleInsuredInfoOther } } }, @@ -735,8 +915,39 @@ export default { val.radio !== '') || (val.fileListBank.length != '0' && val.fileLIstImg.length != '0' && val.fileLIstImgInsured.length != '0' && val.radio !== '') || (val.fileLIstImg.length != '0' && val.fileLIstImgInsured.length != '0' && val.fileListBankInsured.length != '0' && val.radio !== '') || - (val.fileListIdFront.length != '0' && val.fileListIdBack.length != '0' && val.fileListBank.length != '0' && val.radio !== '') || - (val.fileLIstImg.length != '0' && val.fileListBank.length != '0' && val.radio !== '') + (val.fileListIdFront.length != '0' && + val.fileListIdBack.length != '0' && + val.fileListBank.length != '0' && + val.radio !== '' && + this.relationToAppnt == '1') || + (val.fileLIstImg.length != '0' && val.fileListBank.length != '0' && val.radio !== '' && this.relationToAppnt == '1') || + (val.saleInsuredInfoOther.length != '0' && + val.fileListBank.length != '0' && + val.fileListIdFrontInsured.length != '0' && + val.fileListIdBackInsured.length != '0' && + val.radio !== '') || + (val.saleInsuredInfoOther.length != '0' && val.fileListBank.length != '0' && val.fileLIstImgInsured.length != '0' && val.radio !== '') || + (val.saleInsuredPersonInfoOther.length != '0' && + val.fileListBankInsured.length != '0' && + val.fileListIdFront.length != '0' && + val.fileListIdBack.length != '0' && + val.radio !== '') || + (val.saleInsuredInfoOther.length != '0' && val.fileListBank.length != '0' && val.fileLIstImg.length != '0' && val.radio !== '') || + (val.saleInsuredInfoOther.length != '0' && + val.fileListBankInsured.length != '0' && + val.fileListIdFrontInsured.length != '0' && + val.fileListIdBackInsured.length != '0' && + val.radio !== '') || + (val.saleInsuredInfoOther.length != '0' && val.fileListBankInsured.length != '0' && val.fileLIstImg.length != '0' && val.radio !== '') || + (val.fileListBank.length != '0' && + val.fileListIdFront.length != '0' && + val.fileListIdBack.length != '0' && + val.saleInsuredPersonInfoOther.length != '0' && + val.radio !== '') || + (val.fileListBank.length != '0' && val.fileLIstImg.length != '0' && val.saleInsuredPersonInfoOther.length != '0' && val.radio !== '') || + (val.saleInsuredInfoOther.length != '0' && val.fileListBank.length != '0' && val.saleInsuredPersonInfoOther.length != '0' && val.radio !== '') || + (val.saleInsuredInfoOther.length != '0' && val.saleInsuredPersonInfoOther.length != '0' && val.fileListBankInsured.length != '0' && val.radio !== '') || + (val.saleInsuredInfoOther.length != '0' && val.fileListBank.length != '0' && val.radio !== '' && this.relationToAppnt == '1') ) { that.isDisabled = false } else { diff --git a/src/views/ebiz/sale/Detail.vue b/src/views/ebiz/sale/Detail.vue index 87b6c74e0..ccca45d58 100644 --- a/src/views/ebiz/sale/Detail.vue +++ b/src/views/ebiz/sale/Detail.vue @@ -55,7 +55,7 @@
- + diff --git a/src/views/ebiz/sale/InsuranceInformation.vue b/src/views/ebiz/sale/InsuranceInformation.vue index 59b7a4ab0..da5016e1f 100644 --- a/src/views/ebiz/sale/InsuranceInformation.vue +++ b/src/views/ebiz/sale/InsuranceInformation.vue @@ -1,74 +1,74 @@ - + diff --git a/src/views/ebiz/sale/InsuredInfo.vue b/src/views/ebiz/sale/InsuredInfo.vue index 96c1b628b..a3ddefb83 100644 --- a/src/views/ebiz/sale/InsuredInfo.vue +++ b/src/views/ebiz/sale/InsuredInfo.vue @@ -24,8 +24,8 @@ @click="toSelect('2')" /> - - + + - + @@ -178,7 +187,7 @@ 设为联系地址
- + @@ -218,7 +227,7 @@ 设为联系地址 - +
下一步 @@ -259,6 +268,8 @@ import getAreaName from '@/assets/js/utils/get-area-name' import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan' import idNoCheck from '@/assets/js/utils/idNoCheck' import beforeDate from '@/assets/js/utils/getBeforeDate.js' +import { idToData } from './js/verification' +import { selectComp } from './js/methods' export default { name: 'insuredInfo', @@ -409,44 +420,44 @@ export default { this.userInfo.name = name }, selectClick(index) { - this.currentPopupIndex = index - let title = '' - if (index == 1) { - ;[this.customerShowPicker, title] = [true, '客户列表'] - } else if (index == 2) { - ;[this.occupationShowPicker, title] = [true, '职业类别'] - } else if (index == 3) { - localStorage.scanFromInsured = 'true' - ;[this.isScan, title] = [true, '身份证扫描'] - } + // this.currentPopupIndex = index + // let title = '' + // if (index == 1) { + // ;[this.customerShowPicker, title] = [true, '客户列表'] + // } else if (index == 2) { + // ;[this.occupationShowPicker, title] = [true, '职业类别'] + // } else if (index == 3) { + // localStorage.scanFromInsured = 'true' + // ;[this.isScan, title] = [true, '身份证扫描'] + // } - setTimeout(() => { - this.$jump({ - flag: 'navigation', - extra: { - title, - hiddenLeft: '1' - } - }) - this.closeBtn() - }, 400) - }, - closeBtn() { - // 筛选按钮的显示 - setTimeout(() => { - this.$jump({ - flag: 'webview_right_button', - extra: { - btns: [ - { - img: this.$assetsUrl + 'images/del-close.png', - route: { flag: '', extra: {} } - } - ] - } - }) - }, 500) + // setTimeout(() => { + // this.$jump({ + // flag: 'navigation', + // extra: { + // title, + // hiddenLeft: '1' + // } + // }) + // this.closeBtn() + // }, 400) + // let that = this + selectComp(this, index, '1') }, + // closeBtn() { + // // 筛选按钮的显示 + // this.$jump({ + // flag: 'webview_right_button', + // extra: { + // btns: [ + // { + // img: this.$assetsUrl + 'images/del-close.png', + // route: { flag: '', extra: {} } + // } + // ] + // } + // }) + // }, appCallBack() { // 筛选按钮的点击事件 this.$jump({ @@ -538,7 +549,7 @@ export default { // 计算年龄 let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // 长期按钮是否禁用 - this.effectiveDateTypeAble = age >= 16 && age <= 45 + this.effectiveDateTypeAble = age <= 45 } break case '1': @@ -667,7 +678,7 @@ export default { // 计算年龄 let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // 长期按钮是否禁用 - this.effectiveDateTypeAble = age >= 16 && age <= 45 + this.effectiveDateTypeAble = age <= 45 }, nextStep() { // console.log(this.userInfo.idType) @@ -779,7 +790,7 @@ export default { //如果是已婚 if ((this.userInfo.sex == '0' && age < 22) || (this.userInfo.sex == '1' && age < 20)) { if (this.userInfo.marriage != '2') { - return this.$toast('年龄与婚姻状况不符') + return this.$toast('投保人不符合国家婚姻法定年龄') } } // if (this.userInfo.marriage == '1') { @@ -980,6 +991,45 @@ export default { hiddenRight: '1' } }) + }, + //校验身高 + checkStature(val) { + console.log(val) + if (val.trim().length == 0) { + return this.$toast('身高不能为空') + } + + let res = /^[0-9]{0,3}([.]{1}[0-9]{1})?$/.test(val) && val < 300 && val > 10 + if (!res) { + this.userInfo.stature = '' + return this.$toast('身高输入有误') + } + }, + //校验体重 + checkAvoirdupois(val) { + if (val.trim().length == 0) { + return this.$toast('体重不能为空') + } + + let res = /^[0-9]+([.]{1}[0-9]{1})?$/.test(val) && val > 0.1 + if (!res) { + this.userInfo.avoirdupois = '' + return this.$toast('体重输入有误') + } + }, + getRelatedData(val) { + if (this.userInfo.idType != '1') { + return + } + //如果证件校验不通过,恢复默认值 + if (idToData(val).text) { + ;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false] + return this.$toast(idToData(val).text) + } + this.userInfo.effectiveDateType = false + this.effectiveDateTypeAble = idToData(val).age < 45 + this.userInfo.birthday = idToData(val).birthday + this.userInfo.sex = idToData(val).sex } }, beforeDestroy() { diff --git a/src/views/ebiz/sale/InsuredPerson.vue b/src/views/ebiz/sale/InsuredPerson.vue index aed80ffef..643579924 100644 --- a/src/views/ebiz/sale/InsuredPerson.vue +++ b/src/views/ebiz/sale/InsuredPerson.vue @@ -44,10 +44,11 @@ clearable :readonly="isAppnt" v-validate="'required'" + @blur="getRelatedData(userInfo.idNo)" > - - - + 证件扫描
长期 @@ -142,6 +143,7 @@ clearable maxlength="5" :readonly="isAppnt" + @blur="checkStature(userInfo.stature)" /> @@ -271,7 +274,7 @@ clearable :readonly="isAppnt" /> - + @@ -326,7 +329,7 @@ clearable :readonly="isAppnt" /> - + 下一步 @@ -368,6 +371,8 @@ import getAreaName from '@/assets/js/utils/get-area-name' import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan' import idNoCheck from '@/assets/js/utils/idNoCheck' import beforeDate from '@/assets/js/utils/getBeforeDate.js' +import { idToData } from './js/verification' +import { selectComp } from './js/methods' export default { name: 'insuredInfo', @@ -408,7 +413,7 @@ export default { value: '1' } ], - currentTime: beforeDate.getBeforeDays(28), + currentTime: beforeDate.getBeforeDays(27), fromCustomer: false, //是否从客户列表拉取的数据 codeDisabled: false, //获取验证码是否禁用 countDown: 60, //倒计时 @@ -427,9 +432,9 @@ export default { userInfo: { name: '', sex: '0', - nativeplace: 'CHN', //国家地区 + nativeplace: '1', //国家地区 birthday: '', - idType: '0', //证件类型 + idType: '1', //证件类型 idNo: '', //证件号码 certificateValidate: '', //证件起始日期 certiexpiredate: '', //证件到期时间 @@ -475,13 +480,13 @@ export default { householdCity: '', //户籍市 addressStatus: '' //是否是联系地址 }, - tempUserInfo: {}, //临时变量用来置空userinfo areaList: areaList, currentPopupIndex: '', customerShowPicker: false, occupationShowPicker: false, isAppnt: false, // 是否投被同人 - appntMarriage: '' //投保人婚姻状况 + appntMarriage: '', //投保人婚姻状况 + idLimit: false //证件起止日期是否只读 } }, created() { @@ -491,7 +496,7 @@ export default { getOrderDetail({ orderNo: localStorage.orderNo }).then(res => { if (res.result == 0) { //投被同人 - if (res.orderDTO.insuredDTOs[0].relationToAppnt == '1') { + if (res.orderDTO.insuredDTOs.length && res.orderDTO.insuredDTOs[0].relationToAppnt == '1') { this.$nextTick(() => { this.isAppnt = true //获取投保人信息 @@ -520,13 +525,13 @@ export default { // this.userInfo.effectiveDateType = insuredInfo.effectiveDateType == 'false' ? false : true //数据不是从用户列表拉取 this.fromCustomer = false - this.userInfo.relationToAppnt = '00' + this.userInfo.relationToAppnt = '1' //长期判断 - if (this.userInfo.idType == '0') { + if (this.userInfo.idType == '1') { // 计算年龄 let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // 长期按钮是否禁用 - this.effectiveDateTypeAble = age >= 16 && age <= 45 + this.effectiveDateTypeAble = age <= 45 } }) } @@ -544,9 +549,9 @@ export default { //设为联系地址 this.userInfo.addressStatus = '0' //证件类型 - this.userInfo.idType = '0' + this.userInfo.idType = '1' //国家/地区 - this.userInfo.nativeplace = 'CHN' + this.userInfo.nativeplace = '1' if (this.$route.query.isShow) { //户籍 if (insuredPersonInfo.householdProvince.length) { @@ -593,7 +598,6 @@ export default { }, mounted() { window.appCallBack = this.appCallBack - this.tempUserInfo = this.userInfo // document.body.style.backgroundColor = '#F5F5F5' }, methods: { @@ -606,27 +610,29 @@ export default { if (this.isAppnt) { return } - this.currentPopupIndex = index - let title = '' - if (index == 1) { - ;[this.customerShowPicker, title] = [true, '客户列表'] - } else if (index == 2) { - ;[this.occupationShowPicker, title] = [true, '职业类别'] - } else if (index == 3) { - localStorage.scanFromInsured = 'false' - ;[this.isScan, title] = [true, '身份证扫描'] - } + // this.currentPopupIndex = index + // let title = '' + // if (index == 1) { + // ;[this.customerShowPicker, title] = [true, '客户列表'] + // } else if (index == 2) { + // ;[this.occupationShowPicker, title] = [true, '职业类别'] + // } else if (index == 3) { + // localStorage.scanFromInsured = 'false' + // ;[this.isScan, title] = [true, '身份证扫描'] + // } - setTimeout(() => { - this.$jump({ - flag: 'navigation', - extra: { - title, - hiddenLeft: '1' - } - }) - this.closeBtn() - }, 400) + // setTimeout(() => { + // this.$jump({ + // flag: 'navigation', + // extra: { + // title, + // hiddenLeft: '1' + // } + // }) + // this.closeBtn() + // }, 400) + // let that = this + selectComp(this, index, '2') }, chooseOccupation() { this.$jump({ @@ -638,23 +644,20 @@ export default { }) this.occupationShowPicker = false }, - closeBtn() { - // 筛选按钮的显示 - setTimeout(()=> { - this.$jump({ - flag: 'webview_right_button', - extra: { - btns: [ - { - img: this.$assetsUrl + 'images/del-close.png', - route: { flag: '', extra: {} } - } - ] - } - }) - }, 500) - - }, + // closeBtn() { + // // 筛选按钮的显示 + // this.$jump({ + // flag: 'webview_right_button', + // extra: { + // btns: [ + // { + // img: this.$assetsUrl + 'images/del-close.png', + // route: { flag: '', extra: {} } + // } + // ] + // } + // }) + // }, //弹框选择 toSelect(pickerType, valueKey) { // 投被同人不允许编辑 @@ -689,22 +692,31 @@ export default { if (this.pickerType == '1') { this.userInfo.nativeplace = value.id } else if (this.pickerType == '2') { + this.idLimit = false + this.userInfo.idNo = this.userInfo.certificateValidate = this.userInfo.certiexpiredate = this.userInfo.birthday = '' + this.userInfo.sex = '0' + this.effectiveDateTypeAble = false console.log(value.id) //身份证以外的证件类型可以使用长期 - if (value.id != '1') { - this.effectiveDateTypeAble = false - } else { + if (value.id == '1') { console.log('123') let age = utilsAge.getAge(this.userInfo.birthday, new Date()) - this.effectiveDateTypeAble = !(age >= 45) + this.effectiveDateTypeAble = age <= 45 + } else if (value.id == 2 || value.id == 3) { + this.effectiveDateTypeAble = true + } else { + this.effectiveDateTypeAble = false } - //出生证明返显证件截止日期 + // //出生证明返显证件截止日期 // if (value.id == 3 && this.userInfo.birthday != '') { // let exipreDate = Date.parse(this.userInfo.birthday) + Date.parse('1972-12-31') // this.userInfo.certiexpiredate = this.timeStampFormat(exipreDate) // this.certiexpiredateShow = false // } - //户口本返显证件截止日期 + // if (value.id == 2 || value.id == 3) { + // this.effectiveDateTypeAble = true + // } + // //户口本返显证件截止日期 // else if (value.id == 2 && this.userInfo.birthday != '') { // let exipreDate = Date.parse(this.userInfo.birthday) + Date.parse('1986-01-01') // this.userInfo.certiexpiredate = this.timeStampFormat(exipreDate) @@ -768,7 +780,7 @@ export default { // 计算年龄 let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // 长期按钮是否禁用 - this.effectiveDateTypeAble = age >= 16 && age <= 45 + this.effectiveDateTypeAble = age <= 45 } } else { this.$toast(res.resultMessage) @@ -788,6 +800,8 @@ export default { this.userInfo[key] = '' } } + this.userInfo.effectiveDateType = false + this.effectiveDateTypeAble = false this.areaName = this.homeName = this.census = '' this.userInfo.relationToAppnt = value.id } @@ -812,7 +826,7 @@ export default { let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // 长期按钮是否禁用 - this.effectiveDateTypeAble = age >= 16 && age <= 45 + this.effectiveDateTypeAble = age <= 45 } break case '1': @@ -831,6 +845,7 @@ export default { this.$refs.certiexpiredate.date = '' return this.$toast('您的证件已过期') } + //不同证件类型的判断 // if (this.userInfo.idType) { // //获取年龄 @@ -868,8 +883,16 @@ export default { //长期判断 if (this.userInfo.idType == '1') { let age = utilsAge.getAge(this.userInfo.birthday, new Date()) - this.effectiveDateTypeAble = !(age >= 45) + this.effectiveDateTypeAble = age <= 45 } + //出生证有效期 + // if (this.userInfo.idType == '3') { + // if (Date.parse(this.userInfo.certiexpiredate) - Date.parse(val) > Date.parse('1973-01-01')) { + // this.userInfo.birthday = '' + // this.$refs.birthday.date = '' + // return this.$toast('出生证有效期或出生日期有误') + // } + // } } break } @@ -955,7 +978,7 @@ export default { //计算年龄 let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // 长期按钮是否禁用 - this.effectiveDateTypeAble = age >= 16 && age <= 45 + this.effectiveDateTypeAble = age <= 45 //数据是否从客户列表拉取 this.fromCustomer = true }, @@ -968,8 +991,8 @@ export default { //投被保人关系是配偶 if (this.userInfo.relationToAppnt == '2') { - //投保人不是已婚 - if (this.appntMarriage != '1') { + //投保人或者被保人不是已婚 + if (this.appntMarriage != '1' || this.userInfo.marriage != '1') { return this.$toast('投被保人婚姻状况有误') } let insuredSex = this.userInfo.sex @@ -989,7 +1012,7 @@ export default { // } //如果证件类型是身份证 - if (this.userInfo.idType == '0') { + if (this.userInfo.idType == '1') { //校验性别是否与身份证号码位相符 if (this.userInfo.idNo.length == '15') { //15位身份证第15位是性别位, 奇男偶女 @@ -1057,14 +1080,14 @@ export default { } } //证件类型是户口本 - } else if (this.userInfo.idType == '1') { + } else if (this.userInfo.idType == '2') { if (age >= 16) { return this.$toast('客户年龄在16周岁及以上,不能使用户口本作为有效证件') } else if (this.userInfo.idNo.length != 18) { return this.$toast('户口本的证件号码长度应等于18位') } //证件类型是出生证明 - } else if (this.userInfo.idType == '2') { + } else if (this.userInfo.idType == '3') { if (age >= 3) { return this.$toast('客户年龄在3周岁及以上,不能使用出生证作为有效证件') } else if (this.userInfo.idNo.length < 3) { @@ -1093,7 +1116,7 @@ export default { //如果是已婚 if ((this.userInfo.sex == '0' && age < 22) || (this.userInfo.sex == '1' && age < 20)) { if (this.userInfo.marriage != '2') { - return this.$toast('年龄与婚姻状况不符') + return this.$toast('被保人不符合国家婚姻法定年龄') } } // this.save() @@ -1125,7 +1148,7 @@ export default { className: 'dialog-delete', title: '提示', message: '当前信息已经发生改变,有可能影响险种费率,是否确认修改并清除险种信息?', - cancelButtonColor: '#E9332E', + cancelButtonColor: '#4FC6B3', confirmButtonColor: '#FFFFFF' }) .then(() => { @@ -1298,6 +1321,63 @@ export default { default: break } + }, + //校验身高 + checkStature(val) { + console.log(val) + if (val.trim().length == 0) { + return this.$toast('身高不能为空') + } + + let res = /^[0-9]{0,3}([.]{1}[0-9]{1})?$/.test(val) && val < 300 && val > 10 + if (!res) { + this.userInfo.stature = '' + return this.$toast('身高输入有误') + } + }, + //校验体重 + checkAvoirdupois(val) { + if (val.trim().length == 0) { + return this.$toast('体重不能为空') + } + + let res = /^[0-9]+([.]{1}[0-9]{1})?$/.test(val) && val > 0.1 + if (!res) { + this.userInfo.avoirdupois = '' + return this.$toast('体重输入有误') + } + }, + getRelatedData(val) { + // if (this.userInfo.idType != '1') { + // return + // } + if (!['1', '2', '3', 1, 2, 3].includes(this.userInfo.idType)) { + return + } + //如果证件校验不通过,恢复默认值 + if (idToData(val).text) { + ;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false] + return this.$toast(idToData(val).text) + } + this.userInfo.effectiveDateType = false + this.effectiveDateTypeAble = idToData(val).age < 45 + this.userInfo.birthday = idToData(val).birthday + this.userInfo.sex = idToData(val).sex + //如果选择户口本 + if (this.userInfo.idType == '2') { + let exipreDate = Date.parse(this.userInfo.birthday) + Date.parse('1985-12-31') + this.userInfo.certificateValidate = this.userInfo.birthday + this.userInfo.certiexpiredate = this.timeStampFormat(exipreDate) + this.idLimit = true + //如果选择出生证明 + } else if (this.userInfo.idType == '3') { + let exipreDate = Date.parse(this.userInfo.birthday) + Date.parse('1972-12-31') + this.userInfo.certificateValidate = this.userInfo.birthday + this.userInfo.certiexpiredate = this.timeStampFormat(exipreDate) + this.idLimit = true + } else { + this.idLimit = false + } } }, beforeDestroy() { diff --git a/src/views/ebiz/sale/js/methods.js b/src/views/ebiz/sale/js/methods.js new file mode 100644 index 000000000..7740c8f54 --- /dev/null +++ b/src/views/ebiz/sale/js/methods.js @@ -0,0 +1,45 @@ +//点击弹出组件 +export function selectComp(that, index, type = '') { + that.currentPopupIndex = index + let title = '' + if (index == 1) { + ;[that.customerShowPicker, title] = [true, '客户列表'] + } else if (index == 2) { + ;[that.occupationShowPicker, title] = [true, '职业类别'] + } else if (index == 3) { + if (type == '1') { + //投保人 + localStorage.scanFromInsured = 'true' + } else if (type == '2') { + //被保人 + localStorage.scanFromInsured = 'false' + } + ;[that.isScan, title] = [true, '身份证扫描'] + } + + setTimeout(() => { + that.$jump({ + flag: 'navigation', + extra: { + title, + hiddenLeft: '1' + } + }) + closeBtn(that) + }, 400) +} + +// 关闭按钮的显示 +function closeBtn(that) { + that.$jump({ + flag: 'webview_right_button', + extra: { + btns: [ + { + img: that.$assetsUrl + 'images/del-close.png', + route: { flag: '', extra: {} } + } + ] + } + }) +} diff --git a/src/views/ebiz/sale/js/verification.js b/src/views/ebiz/sale/js/verification.js new file mode 100644 index 000000000..b42c40b4b --- /dev/null +++ b/src/views/ebiz/sale/js/verification.js @@ -0,0 +1,52 @@ +import changeFifteenToEighteen from '@/assets/js/utils/changeFifteenToEighteen' +import idNoCheck from '@/assets/js/utils/idNoCheck' +import utilsAge from '@/assets/js/utils/age' + +//身份证带出出生日期,性别,年龄 +export function idToData(idNo) { + //非空 + if (!idNo.trim()) { + return { + text: '证件号码不能为空' + } + } + + // 证件号码规则校验 + if (!idNoCheck.isIdno(idNo)) { + return { + text: '您填写的证件号码有误' + } + } + + //如果是15位身份证号先转为18位 + if (idNo.length == 15) { + idNo = changeFifteenToEighteen(idNo) + } + let birthday = getBirthById(idNo) + let age = utilsAge.getAge(birthday, new Date()) + let sex = getSexById(idNo) + return { + birthday, + age, + sex + } +} + +function getBirthById(idNo) { + // 获取生日 + var year = idNo.substr(6, 4) + var month = idNo.substr(10, 2) + var day = idNo.substr(12, 2) + return year + '-' + month + '-' + day +} + +function getSexById(idNo) { + // 获取性别 + if (idNo.charAt(16) >= '0' && idNo.charAt(16) <= '9') { + if (parseInt(idNo.charAt(16)) % 2 == 0) { + return '1' + } else { + return '0' + } + } +} diff --git a/src/views/ebiz/serve/Detail.vue b/src/views/ebiz/serve/Detail.vue index f7e249d3f..6a01f2bf9 100644 --- a/src/views/ebiz/serve/Detail.vue +++ b/src/views/ebiz/serve/Detail.vue @@ -52,7 +52,7 @@
- +