bxs-tools-ui 1.3.4 → 1.3.6
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/lib/add-and-take/index.js +6 -7
- package/lib/adjust-baoe/index.js +6 -7
- package/lib/bxs-utils/index.js +464 -465
- package/lib/index.js +68 -43
- package/lib/insure-calculate/index.js +946 -947
- package/lib/person-info/index.js +1290 -1264
- package/lib/product-info/index.js +489 -469
- package/package.json +1 -1
- package/packages/bxs-utils/planbook/person.ts +2 -3
- package/packages/components/form-item/title-item.vue +14 -1
- package/packages/person-info/index.vue +16 -6
- package/packages/product-info/index.vue +1 -2
|
@@ -563,7 +563,7 @@ module.exports = _typeof, module.exports.__esModule = true, module.exports["defa
|
|
|
563
563
|
|
|
564
564
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "z", function() { return _product__WEBPACK_IMPORTED_MODULE_2__["j"]; });
|
|
565
565
|
|
|
566
|
-
/* harmony import */ var _insurance__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
566
|
+
/* harmony import */ var _insurance__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
|
|
567
567
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "m", function() { return _insurance__WEBPACK_IMPORTED_MODULE_3__["a"]; });
|
|
568
568
|
|
|
569
569
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "n", function() { return _insurance__WEBPACK_IMPORTED_MODULE_3__["b"]; });
|
|
@@ -600,7 +600,7 @@ if (document && document.cookie && document.cookie.match('LIZHAO_DEBUG_CONSOLE_F
|
|
|
600
600
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
601
601
|
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
602
602
|
/* harmony import */ var _person__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
|
|
603
|
-
/* harmony import */ var _insurance__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
603
|
+
/* harmony import */ var _insurance__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
|
|
604
604
|
|
|
605
605
|
|
|
606
606
|
|
|
@@ -2337,7 +2337,7 @@ var external_root_bxs_commonjs_bxs_ui_vue_commonjs2_bxs_ui_vue_amd_bxs_ui_vue_ =
|
|
|
2337
2337
|
var lib = __webpack_require__(94);
|
|
2338
2338
|
|
|
2339
2339
|
// EXTERNAL MODULE: ./packages/bxs-utils/index.ts + 3 modules
|
|
2340
|
-
var bxs_utils = __webpack_require__(
|
|
2340
|
+
var bxs_utils = __webpack_require__(6);
|
|
2341
2341
|
|
|
2342
2342
|
// CONCATENATED MODULE: ./node_modules/ts-loader??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/insure-calculate/index.vue?vue&type=script&lang=ts&
|
|
2343
2343
|
var insure_calculatevue_type_script_lang_ts_a;
|
|
@@ -4861,261 +4861,654 @@ module.exports = function dispatchRequest(config) {
|
|
|
4861
4861
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4862
4862
|
|
|
4863
4863
|
"use strict";
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initElementValidateRules; });
|
|
4867
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return restrictElementsInInsurance; });
|
|
4868
|
-
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
4869
|
-
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
4864
|
+
// ESM COMPAT FLAG
|
|
4865
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4870
4866
|
|
|
4867
|
+
// EXPORTS
|
|
4868
|
+
__webpack_require__.d(__webpack_exports__, "convertEleOrderListToObj", function() { return /* reexport */ planbook["d" /* convertEleOrderListToObj */]; });
|
|
4869
|
+
__webpack_require__.d(__webpack_exports__, "calcTotalBaof", function() { return /* reexport */ planbook["a" /* calcTotalBaof */]; });
|
|
4870
|
+
__webpack_require__.d(__webpack_exports__, "getHuomianPeriodValue", function() { return /* reexport */ planbook["j" /* getHuomianPeriodValue */]; });
|
|
4871
|
+
__webpack_require__.d(__webpack_exports__, "getNumberFromYear", function() { return /* reexport */ planbook["l" /* getNumberFromYear */]; });
|
|
4872
|
+
__webpack_require__.d(__webpack_exports__, "converUnit10000", function() { return /* reexport */ planbook["c" /* converUnit10000 */]; });
|
|
4873
|
+
__webpack_require__.d(__webpack_exports__, "deepCopy", function() { return /* reexport */ planbook["g" /* deepCopy */]; });
|
|
4874
|
+
__webpack_require__.d(__webpack_exports__, "getAgeFromBirth", function() { return /* reexport */ planbook["h" /* getAgeFromBirth */]; });
|
|
4875
|
+
__webpack_require__.d(__webpack_exports__, "initPersonData", function() { return /* reexport */ planbook["o" /* initPersonData */]; });
|
|
4876
|
+
__webpack_require__.d(__webpack_exports__, "personDataHandler", function() { return /* reexport */ planbook["s" /* personDataHandler */]; });
|
|
4877
|
+
__webpack_require__.d(__webpack_exports__, "getInsuredAgeRange", function() { return /* reexport */ planbook["k" /* getInsuredAgeRange */]; });
|
|
4878
|
+
__webpack_require__.d(__webpack_exports__, "setPersonAgeOptions", function() { return /* reexport */ planbook["y" /* setPersonAgeOptions */]; });
|
|
4879
|
+
__webpack_require__.d(__webpack_exports__, "convertPersonData", function() { return /* reexport */ planbook["e" /* convertPersonData */]; });
|
|
4880
|
+
__webpack_require__.d(__webpack_exports__, "initProductData", function() { return /* reexport */ planbook["p" /* initProductData */]; });
|
|
4881
|
+
__webpack_require__.d(__webpack_exports__, "productDataHandler", function() { return /* reexport */ planbook["t" /* productDataHandler */]; });
|
|
4882
|
+
__webpack_require__.d(__webpack_exports__, "getElementVerifyFromProductVerify", function() { return /* reexport */ planbook["i" /* getElementVerifyFromProductVerify */]; });
|
|
4883
|
+
__webpack_require__.d(__webpack_exports__, "setCommonInfo", function() { return /* reexport */ planbook["w" /* setCommonInfo */]; });
|
|
4884
|
+
__webpack_require__.d(__webpack_exports__, "setGroupInsurance", function() { return /* reexport */ planbook["x" /* setGroupInsurance */]; });
|
|
4885
|
+
__webpack_require__.d(__webpack_exports__, "isHideProduct", function() { return /* reexport */ planbook["r" /* isHideProduct */]; });
|
|
4886
|
+
__webpack_require__.d(__webpack_exports__, "verifyProductRules", function() { return /* reexport */ planbook["z" /* verifyProductRules */]; });
|
|
4887
|
+
__webpack_require__.d(__webpack_exports__, "restrictInsurancesInProduct", function() { return /* reexport */ planbook["v" /* restrictInsurancesInProduct */]; });
|
|
4888
|
+
__webpack_require__.d(__webpack_exports__, "convertProductData", function() { return /* reexport */ planbook["f" /* convertProductData */]; });
|
|
4889
|
+
__webpack_require__.d(__webpack_exports__, "clearAddAndTakeAndAdjustBaoeData", function() { return /* reexport */ planbook["b" /* clearAddAndTakeAndAdjustBaoeData */]; });
|
|
4890
|
+
__webpack_require__.d(__webpack_exports__, "initInsuranceData", function() { return /* reexport */ planbook["n" /* initInsuranceData */]; });
|
|
4891
|
+
__webpack_require__.d(__webpack_exports__, "insuranceDataHandler", function() { return /* reexport */ planbook["q" /* insuranceDataHandler */]; });
|
|
4892
|
+
__webpack_require__.d(__webpack_exports__, "initElementValidateRules", function() { return /* reexport */ planbook["m" /* initElementValidateRules */]; });
|
|
4893
|
+
__webpack_require__.d(__webpack_exports__, "restrictElementsInInsurance", function() { return /* reexport */ planbook["u" /* restrictElementsInInsurance */]; });
|
|
4894
|
+
__webpack_require__.d(__webpack_exports__, "getAddress", function() { return /* reexport */ getAddress; });
|
|
4895
|
+
__webpack_require__.d(__webpack_exports__, "getUuid", function() { return /* reexport */ getUuid; });
|
|
4896
|
+
__webpack_require__.d(__webpack_exports__, "hasPlanParams", function() { return /* reexport */ hasPlanParams; });
|
|
4897
|
+
__webpack_require__.d(__webpack_exports__, "insureCalculate", function() { return /* reexport */ insureCalculate; });
|
|
4898
|
+
__webpack_require__.d(__webpack_exports__, "checkInsureCalculate", function() { return /* reexport */ checkInsureCalculate; });
|
|
4899
|
+
__webpack_require__.d(__webpack_exports__, "checkInsureCalculateIn", function() { return /* reexport */ checkInsureCalculateIn; });
|
|
4871
4900
|
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4901
|
+
// EXTERNAL MODULE: ./packages/bxs-utils/planbook/index.ts
|
|
4902
|
+
var planbook = __webpack_require__(12);
|
|
4903
|
+
|
|
4904
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
4905
|
+
var asyncToGenerator = __webpack_require__(30);
|
|
4906
|
+
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
4907
|
+
|
|
4908
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/typeof.js
|
|
4909
|
+
var helpers_typeof = __webpack_require__(11);
|
|
4910
|
+
var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
|
|
4911
|
+
|
|
4912
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
|
4913
|
+
var regenerator = __webpack_require__(17);
|
|
4914
|
+
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
|
4915
|
+
|
|
4916
|
+
// EXTERNAL MODULE: ./node_modules/axios/index.js
|
|
4917
|
+
var axios = __webpack_require__(31);
|
|
4918
|
+
var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
|
|
4919
|
+
|
|
4920
|
+
// CONCATENATED MODULE: ./src/js/request.js
|
|
4921
|
+
// import { gotoLogin } from './utils.js'
|
|
4922
|
+
|
|
4923
|
+
var BASE_API = function () {
|
|
4924
|
+
var env = null;
|
|
4925
|
+
|
|
4926
|
+
if (location.hostname.search(/pbf\.winbaoxian\.com/) !== -1) {
|
|
4927
|
+
env = 'https://app.winbaoxian.com';
|
|
4928
|
+
} else if (location.hostname.search(/pbf\.winbaoxian\.cn/) !== -1) {
|
|
4929
|
+
env = 'https://app.winbaoxian.cn';
|
|
4930
|
+
} else if (location.hostname.search(/127\.0\.0\.1|192\.168|localhost/) !== -1) {
|
|
4931
|
+
env = 'https://app.winbaoxian.cn';
|
|
4932
|
+
}
|
|
4933
|
+
|
|
4934
|
+
return env;
|
|
4935
|
+
}(); // 创建axios实例
|
|
4936
|
+
|
|
4937
|
+
|
|
4938
|
+
var service = axios_default.a.create({
|
|
4939
|
+
baseURL: BASE_API,
|
|
4940
|
+
withCredentials: true,
|
|
4941
|
+
timeout: 10000,
|
|
4942
|
+
// 请求超时时间
|
|
4943
|
+
headers: {
|
|
4944
|
+
'X-Requested-With': 'XMLHttpRequest'
|
|
4945
|
+
}
|
|
4946
|
+
});
|
|
4947
|
+
var loadingTimer = null;
|
|
4948
|
+
|
|
4949
|
+
var loading = function loading(show) {
|
|
4950
|
+
if (window.appBridge && appBridge.showLoading) {
|
|
4951
|
+
if (show) {
|
|
4952
|
+
appBridge.showLoading();
|
|
4953
|
+
} else {
|
|
4954
|
+
appBridge.hideLoading();
|
|
4890
4955
|
}
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4956
|
+
}
|
|
4957
|
+
}; // request拦截器
|
|
4958
|
+
|
|
4959
|
+
|
|
4960
|
+
service.interceptors.request.use(function (config) {
|
|
4961
|
+
if (loadingTimer) clearTimeout(loadingTimer);
|
|
4962
|
+
loadingTimer = setTimeout(function () {
|
|
4963
|
+
loading(true);
|
|
4964
|
+
}, 300);
|
|
4965
|
+
return config;
|
|
4966
|
+
}, function (error) {
|
|
4967
|
+
// Do something with request error
|
|
4968
|
+
console.log(error); // for debug
|
|
4969
|
+
|
|
4970
|
+
Promise.reject(error);
|
|
4971
|
+
}); // respone拦截器
|
|
4972
|
+
|
|
4973
|
+
service.interceptors.response.use(function (response) {
|
|
4974
|
+
if (loadingTimer) clearTimeout(loadingTimer);
|
|
4975
|
+
loading(false);
|
|
4976
|
+
var res = response.data;
|
|
4977
|
+
|
|
4978
|
+
if (res.code === 401 || res.status === 401) {
|
|
4979
|
+
// gotoLogin()
|
|
4980
|
+
return Promise.reject('login');
|
|
4981
|
+
}
|
|
4982
|
+
|
|
4983
|
+
return res;
|
|
4984
|
+
}, function (error) {
|
|
4985
|
+
if (loadingTimer) clearTimeout(loadingTimer);
|
|
4986
|
+
loading(false);
|
|
4987
|
+
|
|
4988
|
+
if (error.response && error.response.status == 401) {
|
|
4989
|
+
// gotoLogin()
|
|
4990
|
+
return Promise.reject('login');
|
|
4991
|
+
}
|
|
4992
|
+
|
|
4993
|
+
console.log('err' + error); // for debug
|
|
4994
|
+
|
|
4995
|
+
return Promise.reject(error);
|
|
4996
|
+
});
|
|
4997
|
+
/* harmony default export */ var request = (service);
|
|
4998
|
+
// CONCATENATED MODULE: ./packages/bxs-utils/trade/insureCalculate.js
|
|
4999
|
+
|
|
5000
|
+
|
|
5001
|
+
|
|
5002
|
+
|
|
5003
|
+
/**
|
|
5004
|
+
* @Author: watson
|
|
5005
|
+
* @Date: 2020-12-23
|
|
5006
|
+
* @LastEditors: watson
|
|
5007
|
+
* @description: 保费试算
|
|
5008
|
+
* @param {*} params: 必传
|
|
5009
|
+
* @return {*} 试算结果
|
|
5010
|
+
*/
|
|
5011
|
+
|
|
5012
|
+
|
|
5013
|
+
var baseURL = function () {
|
|
5014
|
+
var env = null;
|
|
5015
|
+
|
|
5016
|
+
if (location.hostname.search(/pbf\.winbaoxian\.com/) !== -1) {
|
|
5017
|
+
env = 'https://insurance2a-api.wyins.net';
|
|
5018
|
+
} else if (location.hostname.search(/pbf\.winbaoxian\.cn/) !== -1) {
|
|
5019
|
+
env = '//insurance2a-api.wyins.net.cn';
|
|
5020
|
+
} else if (location.hostname.search(/127\.0\.0\.1|192\.168|localhost|0\.0\.0\.0/) !== -1) {
|
|
5021
|
+
env = '//insurance2a-api.wyins.net.cn';
|
|
5022
|
+
}
|
|
5023
|
+
|
|
5024
|
+
return env;
|
|
5025
|
+
}();
|
|
5026
|
+
/**
|
|
5027
|
+
* **获取地址信息**
|
|
5028
|
+
* @ignore
|
|
5029
|
+
* @author watson
|
|
5030
|
+
* @date 2022-04-26
|
|
5031
|
+
* @param {string} fetchUrl api url
|
|
5032
|
+
* @param {object} data 接口传参
|
|
5033
|
+
* @returns {object} addressData
|
|
5034
|
+
*/
|
|
5035
|
+
|
|
5036
|
+
|
|
5037
|
+
function getAddress(fetchUrl, data) {
|
|
5038
|
+
return new Promise(function (resolve, reject) {
|
|
5039
|
+
request({
|
|
5040
|
+
baseURL: fetchUrl,
|
|
5041
|
+
url: undefined,
|
|
5042
|
+
method: 'POST',
|
|
5043
|
+
urlParams: undefined,
|
|
5044
|
+
data: data
|
|
5045
|
+
}).then(function (res) {
|
|
5046
|
+
resolve(res);
|
|
5047
|
+
}).catch(function (err) {
|
|
5048
|
+
reject(err);
|
|
5049
|
+
});
|
|
5050
|
+
});
|
|
5051
|
+
}
|
|
5052
|
+
/**
|
|
5053
|
+
* **获取用户信息**
|
|
5054
|
+
* @ignore
|
|
5055
|
+
* @author watson
|
|
5056
|
+
* @date 2022-04-26
|
|
5057
|
+
* @param {string} fetchUrl api url
|
|
5058
|
+
* @returns {promise}
|
|
5059
|
+
*/
|
|
5060
|
+
|
|
5061
|
+
function getUuid(fetchUrl) {
|
|
5062
|
+
return new Promise(function (resolve, reject) {
|
|
5063
|
+
request({
|
|
5064
|
+
baseURL: fetchUrl,
|
|
5065
|
+
url: undefined,
|
|
5066
|
+
method: 'GET',
|
|
5067
|
+
urlParams: undefined,
|
|
5068
|
+
data: null
|
|
5069
|
+
}).then(function (res) {
|
|
5070
|
+
resolve(res);
|
|
5071
|
+
}).catch(function (err) {
|
|
5072
|
+
reject(err);
|
|
5073
|
+
});
|
|
5074
|
+
});
|
|
5075
|
+
}
|
|
5076
|
+
/**
|
|
5077
|
+
* **计划书初始化参数**
|
|
5078
|
+
* @ignore
|
|
5079
|
+
* @author watson
|
|
5080
|
+
* @date 2022-04-26
|
|
5081
|
+
* @param {any} planParams 计划书初始化参数
|
|
5082
|
+
* @param {any} planParams.detail_age 被保人生日
|
|
5083
|
+
* @param {any} planParams.detail_sex 被保人性别
|
|
5084
|
+
* @param {any} planParams.detail_relation 投被保人关系
|
|
5085
|
+
* @param {any} planParams.detail_applicant_age 投保人生日
|
|
5086
|
+
* @param {any} planParams.detail_applicant_sex 投保人性别
|
|
5087
|
+
* @returns {boolean} 是否有计划书参数
|
|
5088
|
+
*/
|
|
5089
|
+
|
|
5090
|
+
function hasPlanParams(planParams) {
|
|
5091
|
+
var type = false;
|
|
5092
|
+
|
|
5093
|
+
if (planParams && (planParams.detail_age || planParams.detail_sex || planParams.detail_relation || planParams.detail_applicant_age || planParams.detail_applicant_sex)) {
|
|
5094
|
+
type = true;
|
|
5095
|
+
}
|
|
5096
|
+
|
|
5097
|
+
return type;
|
|
5098
|
+
}
|
|
5099
|
+
/**
|
|
5100
|
+
* **转换计划书数据**
|
|
5101
|
+
* @ignore
|
|
5102
|
+
* @author watson
|
|
5103
|
+
* @date 2022-04-26
|
|
5104
|
+
* @param {array} widgets 页面渲染数据
|
|
5105
|
+
* @param {object} currentData 试算参数
|
|
5106
|
+
* @param {object} planParams 计划书初始化参数
|
|
5107
|
+
* @returns {void}
|
|
5108
|
+
*/
|
|
5109
|
+
|
|
5110
|
+
function translatePlanData(widgets, currentData, planParams) {
|
|
5111
|
+
widgets.forEach(function (item) {
|
|
5112
|
+
var current; // 增加current字段,保存current_data的数据
|
|
5113
|
+
|
|
5114
|
+
if (item.duty) {
|
|
5115
|
+
current = currentData.find(function (it) {
|
|
5116
|
+
return it.k === item.key && it.risk === item.riskCode && item.duty === it.d;
|
|
5117
|
+
});
|
|
5118
|
+
} else {
|
|
5119
|
+
current = currentData.find(function (it) {
|
|
5120
|
+
return it.k === item.key && it.risk === item.riskCode;
|
|
5121
|
+
});
|
|
4901
5122
|
}
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
5123
|
+
|
|
5124
|
+
if (planParams) {
|
|
5125
|
+
// 被保人生日 / 年龄
|
|
5126
|
+
if (planParams.detail_age && item.key === 'detail_age') {
|
|
5127
|
+
if (/-/.test(planParams.detail_age)) {
|
|
5128
|
+
// 被保人生日
|
|
5129
|
+
item.type = 'v-text';
|
|
5130
|
+
item.name = planParams.detail_age;
|
|
5131
|
+
current.v = planParams.detail_age;
|
|
5132
|
+
} else if (/岁/.test(planParams.detail_age)) {
|
|
5133
|
+
// 被保人年龄
|
|
5134
|
+
item.type = 'v-text';
|
|
5135
|
+
item.name = planParams.detail_age;
|
|
5136
|
+
item.label = item.label + '(年龄)';
|
|
5137
|
+
current.v = planParams.detail_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
|
|
4914
5138
|
}
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
5139
|
+
} // 被保人性别
|
|
5140
|
+
|
|
5141
|
+
|
|
5142
|
+
if (planParams.detail_sex && item.key === 'detail_sex') {
|
|
5143
|
+
item.type = 'v-text';
|
|
5144
|
+
item.name = planParams.detail_sex === '1' ? '男' : '女';
|
|
5145
|
+
current.v = planParams.detail_sex;
|
|
5146
|
+
} // 投被保人关系
|
|
5147
|
+
// 初始化
|
|
5148
|
+
// if (
|
|
5149
|
+
// item.key === 'detail_relation' &&
|
|
5150
|
+
// planParams.detail_sex &&
|
|
5151
|
+
// planParams.detail_applicant_sex &&
|
|
5152
|
+
// String(planParams.detail_sex) ===
|
|
5153
|
+
// String(planParams.detail_applicant_sex)
|
|
5154
|
+
// ) {
|
|
5155
|
+
// let otemp = [];
|
|
5156
|
+
// item.opts[item.key].forEach(i => {
|
|
5157
|
+
// if (
|
|
5158
|
+
// String(planParams.detail_sex) === '1' &&
|
|
5159
|
+
// String(planParams.detail_applicant_sex) === '1'
|
|
5160
|
+
// ) {
|
|
5161
|
+
// // 投被保人 - 男 1
|
|
5162
|
+
// if (['1', '14', '16', '18'].includes(String(i.value))) {
|
|
5163
|
+
// otemp.push(i);
|
|
5164
|
+
// }
|
|
5165
|
+
// } else if (
|
|
5166
|
+
// String(planParams.detail_sex) === '2' &&
|
|
5167
|
+
// String(planParams.detail_applicant_sex) === '2'
|
|
5168
|
+
// ) {
|
|
5169
|
+
// // 投被保人 - 女 2
|
|
5170
|
+
// if (['1', '15', '17', '19'].includes(String(i.value))) {
|
|
5171
|
+
// otemp.push(i);
|
|
5172
|
+
// }
|
|
5173
|
+
// }
|
|
5174
|
+
// });
|
|
5175
|
+
// item.opts[item.key] = otemp;
|
|
5176
|
+
// console.log('otemp', otemp);
|
|
5177
|
+
// }
|
|
5178
|
+
|
|
5179
|
+
|
|
5180
|
+
if (planParams.detail_relation && item.key === 'detail_relation') {
|
|
5181
|
+
// 条件检索
|
|
5182
|
+
if (planParams.detail_relation === '-1' || planParams.detail_relation === -1) {
|
|
5183
|
+
// 非本人
|
|
5184
|
+
var temp = [];
|
|
5185
|
+
item.opts[item.key].forEach(function (i) {
|
|
5186
|
+
if (String(i.value) != '1') {
|
|
5187
|
+
temp.push(i);
|
|
4922
5188
|
}
|
|
4923
|
-
|
|
5189
|
+
});
|
|
5190
|
+
item.name = temp[0] && temp[0].name ? temp[0].name : '';
|
|
5191
|
+
item.opts[item.key] = temp;
|
|
5192
|
+
} else if (planParams.detail_relation) {
|
|
5193
|
+
// 指定人 - 本人 其他人
|
|
5194
|
+
item.type = 'v-text';
|
|
5195
|
+
current.v = planParams.detail_relation;
|
|
5196
|
+
var _temp = [];
|
|
5197
|
+
item.opts[item.key].forEach(function (i) {
|
|
5198
|
+
if (String(i.value) === String(planParams.detail_relation)) {
|
|
5199
|
+
_temp.push(i);
|
|
5200
|
+
|
|
5201
|
+
item.name = i.name;
|
|
5202
|
+
}
|
|
5203
|
+
});
|
|
5204
|
+
item.opts[item.key] = _temp;
|
|
4924
5205
|
}
|
|
4925
|
-
|
|
4926
|
-
|
|
5206
|
+
} // 投保人出生日期
|
|
5207
|
+
|
|
5208
|
+
|
|
5209
|
+
if (planParams.detail_applicant_age && item.key === 'detail_applicant_age') {
|
|
5210
|
+
if (/-/.test(planParams.detail_applicant_age)) {
|
|
5211
|
+
// 被保人生日
|
|
5212
|
+
item.type = 'v-text';
|
|
5213
|
+
item.name = planParams.detail_applicant_age;
|
|
5214
|
+
current.v = planParams.detail_applicant_age;
|
|
5215
|
+
} else if (/岁/.test(planParams.detail_applicant_age)) {
|
|
5216
|
+
// 被保人年龄
|
|
5217
|
+
item.type = 'v-text';
|
|
5218
|
+
item.name = planParams.detail_applicant_age;
|
|
5219
|
+
item.label = item.label + '(年龄)';
|
|
5220
|
+
current.v = planParams.detail_applicant_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
|
|
4927
5221
|
}
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
}
|
|
4937
|
-
insData.eleOrderList.forEach(function (ele) {
|
|
4938
|
-
ele.isDisabled = ele.isDisabled || null;
|
|
4939
|
-
ele.isHide = ele.isHide || null;
|
|
4940
|
-
ele.isIgnoreValidate = ele.isIgnoreValidate || null;
|
|
4941
|
-
ele.rules = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[/* __spreadArrays */ "g"])(initElementValidateRules(ele, productData));
|
|
4942
|
-
});
|
|
4943
|
-
var calMethod = insData.eleOrderList.find(function (e) { return e.key === 'calMethod'; });
|
|
4944
|
-
var baoe = insData.eleOrderList.find(function (e) { return e.key === 'baoe'; });
|
|
4945
|
-
var baof = insData.eleOrderList.find(function (e) { return e.key === 'baof'; });
|
|
4946
|
-
var plan = insData.eleOrderList.find(function (e) { return e.key === 'plan'; });
|
|
4947
|
-
if (!calMethod && baoe && plan) {
|
|
4948
|
-
insData.showPlanDesc = !!baoe.isHide;
|
|
4949
|
-
}
|
|
4950
|
-
if (calMethod && baoe && baof) {
|
|
4951
|
-
baoe.isHide = calMethod.value !== 'baoe2baof';
|
|
4952
|
-
baof.isHide = calMethod.value === 'baoe2baof';
|
|
5222
|
+
} // 投保人性别
|
|
5223
|
+
|
|
5224
|
+
|
|
5225
|
+
if (planParams.detail_applicant_sex && item.key === 'detail_applicant_sex') {
|
|
5226
|
+
item.type = 'v-text';
|
|
5227
|
+
item.name = planParams.detail_applicant_sex === '1' ? '男' : '女';
|
|
5228
|
+
current.v = planParams.detail_applicant_sex;
|
|
5229
|
+
}
|
|
4953
5230
|
}
|
|
4954
|
-
|
|
5231
|
+
});
|
|
4955
5232
|
}
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
var
|
|
4971
|
-
|
|
4972
|
-
if (
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
if (min && max) {
|
|
4981
|
-
message = "\u8BF7\u8F93\u5165" + Object(_common__WEBPACK_IMPORTED_MODULE_1__[/* converUnit10000 */ "b"])(min) + "~" + Object(_common__WEBPACK_IMPORTED_MODULE_1__[/* converUnit10000 */ "b"])(max) + "\u4E4B\u95F4\u7684\u6570\u503C";
|
|
5233
|
+
/**
|
|
5234
|
+
* **试算参数转化**
|
|
5235
|
+
* @ignore
|
|
5236
|
+
* @author watson
|
|
5237
|
+
* @date 2022-04-26
|
|
5238
|
+
* @param {object} currentData
|
|
5239
|
+
* @param {object} planParams
|
|
5240
|
+
* @returns {object}
|
|
5241
|
+
*/
|
|
5242
|
+
|
|
5243
|
+
|
|
5244
|
+
function tranlateCurrentData(currentData, planParams) {
|
|
5245
|
+
var currentDataCopy = JSON.parse(JSON.stringify(currentData));
|
|
5246
|
+
currentDataCopy.forEach(function (item) {
|
|
5247
|
+
var current = item;
|
|
5248
|
+
|
|
5249
|
+
if (planParams) {
|
|
5250
|
+
if (planParams.detail_age && item.k === 'detail_age') {
|
|
5251
|
+
if (/-/.test(planParams.detail_age)) {
|
|
5252
|
+
// 被保人生日
|
|
5253
|
+
current.v = planParams.detail_age;
|
|
5254
|
+
} else if (/岁/.test(planParams.detail_age)) {
|
|
5255
|
+
// 被保人年龄
|
|
5256
|
+
current.v = planParams.detail_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
|
|
4982
5257
|
}
|
|
4983
|
-
|
|
4984
|
-
|
|
5258
|
+
} // 被保人性别
|
|
5259
|
+
|
|
5260
|
+
|
|
5261
|
+
if (planParams.detail_sex && item.k === 'detail_sex') {
|
|
5262
|
+
current.v = planParams.detail_sex;
|
|
5263
|
+
} // 投被保人关系
|
|
5264
|
+
|
|
5265
|
+
|
|
5266
|
+
if (planParams.detail_relation && item.k === 'detail_relation') {
|
|
5267
|
+
if (planParams.detail_relation != -1 || planParams.detail_relation != '-1') {
|
|
5268
|
+
current.v = planParams.detail_relation;
|
|
4985
5269
|
}
|
|
4986
|
-
|
|
4987
|
-
|
|
5270
|
+
} // 投保人出生日期
|
|
5271
|
+
|
|
5272
|
+
|
|
5273
|
+
if (planParams.detail_applicant_age && item.k === 'detail_applicant_age') {
|
|
5274
|
+
if (/-/.test(planParams.detail_applicant_age)) {
|
|
5275
|
+
// 被保人生日
|
|
5276
|
+
current.v = planParams.detail_applicant_age;
|
|
5277
|
+
} else if (/岁/.test(planParams.detail_applicant_age)) {
|
|
5278
|
+
// 被保人年龄
|
|
5279
|
+
current.v = planParams.detail_applicant_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
|
|
4988
5280
|
}
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
return !value || (value >= rule.min && value <= rule.max);
|
|
4996
|
-
}
|
|
4997
|
-
});
|
|
4998
|
-
}
|
|
4999
|
-
if (ele.multi && !isNaN(Number(ele.multi))) {
|
|
5000
|
-
rules.push({
|
|
5001
|
-
multiple: ele.multi,
|
|
5002
|
-
message: "\u8BF7\u8F93\u5165" + ele.multi + "\u500D\u6570",
|
|
5003
|
-
validator: function (rule, value) {
|
|
5004
|
-
return !value || !(value % rule.multiple);
|
|
5005
|
-
}
|
|
5006
|
-
});
|
|
5281
|
+
} // 投保人性别
|
|
5282
|
+
|
|
5283
|
+
|
|
5284
|
+
if (planParams.detail_applicant_sex && item.k === 'detail_applicant_sex') {
|
|
5285
|
+
current.v = planParams.detail_applicant_sex;
|
|
5286
|
+
}
|
|
5007
5287
|
}
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
case '<=':
|
|
5045
|
-
bool = value1 <= value2;
|
|
5046
|
-
break;
|
|
5047
|
-
case '>=':
|
|
5048
|
-
bool = value1 >= value2;
|
|
5049
|
-
break;
|
|
5050
|
-
case '<':
|
|
5051
|
-
bool = value1 < value2;
|
|
5052
|
-
break;
|
|
5053
|
-
case '>':
|
|
5054
|
-
bool = value1 > value2;
|
|
5055
|
-
break;
|
|
5056
|
-
default:
|
|
5057
|
-
bool = value1 <= value2;
|
|
5058
|
-
}
|
|
5059
|
-
return bool;
|
|
5060
|
-
}
|
|
5061
|
-
});
|
|
5062
|
-
}
|
|
5288
|
+
});
|
|
5289
|
+
return currentDataCopy;
|
|
5290
|
+
}
|
|
5291
|
+
/**
|
|
5292
|
+
* 险种计算
|
|
5293
|
+
* @author watson
|
|
5294
|
+
* @date 2022-04-26
|
|
5295
|
+
* @param {object} urlParams 接口URL上面的参数,c端必传uuid
|
|
5296
|
+
* @param {object} postParams 试算用的参数,product_id, current_data 和 scenario: 'h5Widget'
|
|
5297
|
+
* @param {object} planParams 计划书初始化参数
|
|
5298
|
+
* @returns {promise} 试算结果
|
|
5299
|
+
*/
|
|
5300
|
+
|
|
5301
|
+
|
|
5302
|
+
function insureCalculate(urlParams, postParams, planParams) {
|
|
5303
|
+
if (!postParams || typeof_default()(postParams) !== 'object' || !postParams.product_id) {
|
|
5304
|
+
return postParams;
|
|
5305
|
+
}
|
|
5306
|
+
|
|
5307
|
+
if (postParams && !postParams.scenario) {
|
|
5308
|
+
postParams.scenario = 'h5Widget';
|
|
5309
|
+
}
|
|
5310
|
+
|
|
5311
|
+
var url = '/api/product/data/calculate';
|
|
5312
|
+
|
|
5313
|
+
if (urlParams && urlParams.uuid) {
|
|
5314
|
+
url += "?userUuid=".concat(urlParams.uuid);
|
|
5315
|
+
} else if (urlParams && urlParams.openId) {
|
|
5316
|
+
url += "?userUuid=".concat(urlParams.openId);
|
|
5317
|
+
}
|
|
5318
|
+
|
|
5319
|
+
if (urlParams && urlParams.appid) {
|
|
5320
|
+
if (url.indexOf('?') > -1) {
|
|
5321
|
+
url += "&appId=".concat(urlParams.appid);
|
|
5322
|
+
} else {
|
|
5323
|
+
url += "?appId=".concat(urlParams.appid);
|
|
5063
5324
|
}
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5325
|
+
}
|
|
5326
|
+
|
|
5327
|
+
if (hasPlanParams(planParams) && postParams.current_data) {
|
|
5328
|
+
postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
|
|
5329
|
+
}
|
|
5330
|
+
|
|
5331
|
+
return new Promise(function (resolve, reject) {
|
|
5332
|
+
request({
|
|
5333
|
+
baseURL: baseURL,
|
|
5334
|
+
url: url,
|
|
5335
|
+
method: 'POST',
|
|
5336
|
+
urlParams: urlParams,
|
|
5337
|
+
data: postParams
|
|
5338
|
+
}).then(function (res) {
|
|
5339
|
+
if (res.code === 200) {
|
|
5340
|
+
var data = JSON.parse(JSON.stringify(res.data));
|
|
5341
|
+
|
|
5342
|
+
if (hasPlanParams(planParams)) {
|
|
5343
|
+
var widgets = data.widgets;
|
|
5344
|
+
var currentData = data.current_data;
|
|
5345
|
+
translatePlanData(widgets, currentData, planParams);
|
|
5075
5346
|
}
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5347
|
+
|
|
5348
|
+
var cData = {
|
|
5349
|
+
widgets: data.widgets,
|
|
5350
|
+
total_premium: data.total_premium,
|
|
5351
|
+
terms: data.terms,
|
|
5352
|
+
product_id: data.product_id,
|
|
5353
|
+
current_data: data.current_data,
|
|
5354
|
+
risk_premiums: data.risk_premiums
|
|
5355
|
+
};
|
|
5356
|
+
resolve({
|
|
5357
|
+
code: 200,
|
|
5358
|
+
data: cData
|
|
5087
5359
|
});
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5360
|
+
} else {
|
|
5361
|
+
reject(res);
|
|
5362
|
+
}
|
|
5363
|
+
}).catch(function (err) {
|
|
5364
|
+
reject(err);
|
|
5365
|
+
});
|
|
5366
|
+
});
|
|
5367
|
+
}
|
|
5368
|
+
/**
|
|
5369
|
+
* **检查险种计算**
|
|
5370
|
+
* @author watson
|
|
5371
|
+
* @date 2022-04-26
|
|
5372
|
+
* @param {object} urlParams 接口URL上面的参数,c端必传uuid
|
|
5373
|
+
* @param {object} postParams 试算用的参数,product_id, current_data 和 scenario: 'h5Widget'
|
|
5374
|
+
* @param {object} planParams 计划书初始化参数
|
|
5375
|
+
* @returns {promise} 试算结果
|
|
5376
|
+
*/
|
|
5377
|
+
|
|
5378
|
+
function checkInsureCalculate(_x, _x2, _x3) {
|
|
5379
|
+
return _checkInsureCalculate.apply(this, arguments);
|
|
5380
|
+
}
|
|
5381
|
+
/**
|
|
5382
|
+
* 描述
|
|
5383
|
+
* @ignore
|
|
5384
|
+
* @author watson
|
|
5385
|
+
* @date 2022-04-26
|
|
5386
|
+
* @param {object} urlParams
|
|
5387
|
+
* @param {object} postParams
|
|
5388
|
+
* @param {object} planParams
|
|
5389
|
+
* @returns {promise}
|
|
5390
|
+
*/
|
|
5391
|
+
|
|
5392
|
+
function _checkInsureCalculate() {
|
|
5393
|
+
_checkInsureCalculate = asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee(urlParams, postParams, planParams) {
|
|
5394
|
+
var res, data;
|
|
5395
|
+
return regenerator_default.a.wrap(function _callee$(_context) {
|
|
5396
|
+
while (1) {
|
|
5397
|
+
switch (_context.prev = _context.next) {
|
|
5398
|
+
case 0:
|
|
5399
|
+
_context.next = 2;
|
|
5400
|
+
return checkInsureCalculateIn(urlParams, postParams, planParams);
|
|
5401
|
+
|
|
5402
|
+
case 2:
|
|
5403
|
+
res = _context.sent;
|
|
5404
|
+
|
|
5405
|
+
if (!(postParams && !postParams.current_data)) {
|
|
5406
|
+
_context.next = 15;
|
|
5407
|
+
break;
|
|
5100
5408
|
}
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5409
|
+
|
|
5410
|
+
data = JSON.parse(JSON.stringify(res.data));
|
|
5411
|
+
postParams.current_data = data.current_data; // 重新试算
|
|
5412
|
+
|
|
5413
|
+
_context.prev = 6;
|
|
5414
|
+
_context.next = 9;
|
|
5415
|
+
return checkInsureCalculateIn(urlParams, postParams, planParams);
|
|
5416
|
+
|
|
5417
|
+
case 9:
|
|
5418
|
+
res = _context.sent;
|
|
5419
|
+
_context.next = 15;
|
|
5420
|
+
break;
|
|
5421
|
+
|
|
5422
|
+
case 12:
|
|
5423
|
+
_context.prev = 12;
|
|
5424
|
+
_context.t0 = _context["catch"](6);
|
|
5425
|
+
res = _context.t0;
|
|
5426
|
+
|
|
5427
|
+
case 15:
|
|
5428
|
+
if (!(res && res.code === 200)) {
|
|
5429
|
+
_context.next = 19;
|
|
5430
|
+
break;
|
|
5114
5431
|
}
|
|
5432
|
+
|
|
5433
|
+
return _context.abrupt("return", res);
|
|
5434
|
+
|
|
5435
|
+
case 19:
|
|
5436
|
+
return _context.abrupt("return", Promise.reject(res));
|
|
5437
|
+
|
|
5438
|
+
case 20:
|
|
5439
|
+
case "end":
|
|
5440
|
+
return _context.stop();
|
|
5115
5441
|
}
|
|
5442
|
+
}
|
|
5443
|
+
}, _callee, null, [[6, 12]]);
|
|
5444
|
+
}));
|
|
5445
|
+
return _checkInsureCalculate.apply(this, arguments);
|
|
5446
|
+
}
|
|
5447
|
+
|
|
5448
|
+
function checkInsureCalculateIn(urlParams, postParams, planParams) {
|
|
5449
|
+
if (!postParams || typeof_default()(postParams) !== 'object' || !postParams.product_id) {
|
|
5450
|
+
return Promise.reject({
|
|
5451
|
+
code: 400,
|
|
5452
|
+
msg: 'postParams参数非法'
|
|
5453
|
+
});
|
|
5454
|
+
}
|
|
5455
|
+
|
|
5456
|
+
if (postParams && !postParams.scenario) {
|
|
5457
|
+
postParams.scenario = 'h5Widget';
|
|
5458
|
+
}
|
|
5459
|
+
|
|
5460
|
+
var url = '/api/product/data/calculate';
|
|
5461
|
+
|
|
5462
|
+
if (urlParams && urlParams.uuid) {
|
|
5463
|
+
url += "?userUuid=".concat(urlParams.uuid);
|
|
5464
|
+
} else if (urlParams && urlParams.openId) {
|
|
5465
|
+
url += "?userUuid=".concat(urlParams.openId);
|
|
5466
|
+
}
|
|
5467
|
+
|
|
5468
|
+
if (urlParams && urlParams.appid) {
|
|
5469
|
+
if (url.indexOf('?') > -1) {
|
|
5470
|
+
url += "&appId=".concat(urlParams.appid);
|
|
5471
|
+
} else {
|
|
5472
|
+
url += "?appId=".concat(urlParams.appid);
|
|
5116
5473
|
}
|
|
5117
|
-
|
|
5474
|
+
}
|
|
5475
|
+
|
|
5476
|
+
if (hasPlanParams(planParams) && postParams.current_data) {
|
|
5477
|
+
postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
|
|
5478
|
+
}
|
|
5479
|
+
|
|
5480
|
+
return new Promise(function (resolve, reject) {
|
|
5481
|
+
request({
|
|
5482
|
+
baseURL: baseURL,
|
|
5483
|
+
url: url,
|
|
5484
|
+
method: 'POST',
|
|
5485
|
+
urlParams: urlParams,
|
|
5486
|
+
data: postParams
|
|
5487
|
+
}).then(function (res) {
|
|
5488
|
+
if (res.code === 200) {
|
|
5489
|
+
// if (postParams && !postParams.current_data) {
|
|
5490
|
+
// let data = JSON.parse(JSON.stringify(res.data));
|
|
5491
|
+
// postParams.current_data = data.current_data
|
|
5492
|
+
// // 重新试算
|
|
5493
|
+
// checkInsureCalculate(urlParams, postParams, planParams)
|
|
5494
|
+
// }
|
|
5495
|
+
resolve({
|
|
5496
|
+
code: 200,
|
|
5497
|
+
data: res.data
|
|
5498
|
+
});
|
|
5499
|
+
} else {
|
|
5500
|
+
reject(res);
|
|
5501
|
+
}
|
|
5502
|
+
}).catch(function (err) {
|
|
5503
|
+
reject(err);
|
|
5504
|
+
});
|
|
5505
|
+
});
|
|
5118
5506
|
}
|
|
5507
|
+
// CONCATENATED MODULE: ./packages/bxs-utils/trade/index.js
|
|
5508
|
+
|
|
5509
|
+
// CONCATENATED MODULE: ./packages/bxs-utils/index.ts
|
|
5510
|
+
|
|
5511
|
+
|
|
5119
5512
|
|
|
5120
5513
|
|
|
5121
5514
|
/***/ }),
|
|
@@ -5538,756 +5931,363 @@ module.exports = function buildFullPath(baseURL, requestedURL) {
|
|
|
5538
5931
|
|
|
5539
5932
|
|
|
5540
5933
|
/**
|
|
5541
|
-
* Determines whether the specified URL is absolute
|
|
5542
|
-
*
|
|
5543
|
-
* @param {string} url The URL to test
|
|
5544
|
-
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
5545
|
-
*/
|
|
5546
|
-
module.exports = function isAbsoluteURL(url) {
|
|
5547
|
-
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
5548
|
-
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
5549
|
-
// by any combination of letters, digits, plus, period, or hyphen.
|
|
5550
|
-
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
5551
|
-
};
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
/***/ }),
|
|
5555
|
-
|
|
5556
|
-
/***/ 68:
|
|
5557
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
5558
|
-
|
|
5559
|
-
"use strict";
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
/**
|
|
5563
|
-
* Creates a new URL by combining the specified URLs
|
|
5564
|
-
*
|
|
5565
|
-
* @param {string} baseURL The base URL
|
|
5566
|
-
* @param {string} relativeURL The relative URL
|
|
5567
|
-
* @returns {string} The combined URL
|
|
5568
|
-
*/
|
|
5569
|
-
module.exports = function combineURLs(baseURL, relativeURL) {
|
|
5570
|
-
return relativeURL
|
|
5571
|
-
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
5572
|
-
: baseURL;
|
|
5573
|
-
};
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
/***/ }),
|
|
5577
|
-
|
|
5578
|
-
/***/ 69:
|
|
5579
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
5580
|
-
|
|
5581
|
-
"use strict";
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
var utils = __webpack_require__(5);
|
|
5585
|
-
|
|
5586
|
-
// Headers whose duplicates are ignored by node
|
|
5587
|
-
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
5588
|
-
var ignoreDuplicateOf = [
|
|
5589
|
-
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
5590
|
-
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
5591
|
-
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
5592
|
-
'referer', 'retry-after', 'user-agent'
|
|
5593
|
-
];
|
|
5594
|
-
|
|
5595
|
-
/**
|
|
5596
|
-
* Parse headers into an object
|
|
5597
|
-
*
|
|
5598
|
-
* ```
|
|
5599
|
-
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
5600
|
-
* Content-Type: application/json
|
|
5601
|
-
* Connection: keep-alive
|
|
5602
|
-
* Transfer-Encoding: chunked
|
|
5603
|
-
* ```
|
|
5604
|
-
*
|
|
5605
|
-
* @param {String} headers Headers needing to be parsed
|
|
5606
|
-
* @returns {Object} Headers parsed into an object
|
|
5607
|
-
*/
|
|
5608
|
-
module.exports = function parseHeaders(headers) {
|
|
5609
|
-
var parsed = {};
|
|
5610
|
-
var key;
|
|
5611
|
-
var val;
|
|
5612
|
-
var i;
|
|
5613
|
-
|
|
5614
|
-
if (!headers) { return parsed; }
|
|
5615
|
-
|
|
5616
|
-
utils.forEach(headers.split('\n'), function parser(line) {
|
|
5617
|
-
i = line.indexOf(':');
|
|
5618
|
-
key = utils.trim(line.substr(0, i)).toLowerCase();
|
|
5619
|
-
val = utils.trim(line.substr(i + 1));
|
|
5620
|
-
|
|
5621
|
-
if (key) {
|
|
5622
|
-
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
5623
|
-
return;
|
|
5624
|
-
}
|
|
5625
|
-
if (key === 'set-cookie') {
|
|
5626
|
-
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
5627
|
-
} else {
|
|
5628
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
5629
|
-
}
|
|
5630
|
-
}
|
|
5631
|
-
});
|
|
5632
|
-
|
|
5633
|
-
return parsed;
|
|
5634
|
-
};
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
/***/ }),
|
|
5638
|
-
|
|
5639
|
-
/***/ 7:
|
|
5640
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5641
|
-
|
|
5642
|
-
"use strict";
|
|
5643
|
-
// ESM COMPAT FLAG
|
|
5644
|
-
__webpack_require__.r(__webpack_exports__);
|
|
5645
|
-
|
|
5646
|
-
// EXPORTS
|
|
5647
|
-
__webpack_require__.d(__webpack_exports__, "convertEleOrderListToObj", function() { return /* reexport */ planbook["d" /* convertEleOrderListToObj */]; });
|
|
5648
|
-
__webpack_require__.d(__webpack_exports__, "calcTotalBaof", function() { return /* reexport */ planbook["a" /* calcTotalBaof */]; });
|
|
5649
|
-
__webpack_require__.d(__webpack_exports__, "getHuomianPeriodValue", function() { return /* reexport */ planbook["j" /* getHuomianPeriodValue */]; });
|
|
5650
|
-
__webpack_require__.d(__webpack_exports__, "getNumberFromYear", function() { return /* reexport */ planbook["l" /* getNumberFromYear */]; });
|
|
5651
|
-
__webpack_require__.d(__webpack_exports__, "converUnit10000", function() { return /* reexport */ planbook["c" /* converUnit10000 */]; });
|
|
5652
|
-
__webpack_require__.d(__webpack_exports__, "deepCopy", function() { return /* reexport */ planbook["g" /* deepCopy */]; });
|
|
5653
|
-
__webpack_require__.d(__webpack_exports__, "getAgeFromBirth", function() { return /* reexport */ planbook["h" /* getAgeFromBirth */]; });
|
|
5654
|
-
__webpack_require__.d(__webpack_exports__, "initPersonData", function() { return /* reexport */ planbook["o" /* initPersonData */]; });
|
|
5655
|
-
__webpack_require__.d(__webpack_exports__, "personDataHandler", function() { return /* reexport */ planbook["s" /* personDataHandler */]; });
|
|
5656
|
-
__webpack_require__.d(__webpack_exports__, "getInsuredAgeRange", function() { return /* reexport */ planbook["k" /* getInsuredAgeRange */]; });
|
|
5657
|
-
__webpack_require__.d(__webpack_exports__, "setPersonAgeOptions", function() { return /* reexport */ planbook["y" /* setPersonAgeOptions */]; });
|
|
5658
|
-
__webpack_require__.d(__webpack_exports__, "convertPersonData", function() { return /* reexport */ planbook["e" /* convertPersonData */]; });
|
|
5659
|
-
__webpack_require__.d(__webpack_exports__, "initProductData", function() { return /* reexport */ planbook["p" /* initProductData */]; });
|
|
5660
|
-
__webpack_require__.d(__webpack_exports__, "productDataHandler", function() { return /* reexport */ planbook["t" /* productDataHandler */]; });
|
|
5661
|
-
__webpack_require__.d(__webpack_exports__, "getElementVerifyFromProductVerify", function() { return /* reexport */ planbook["i" /* getElementVerifyFromProductVerify */]; });
|
|
5662
|
-
__webpack_require__.d(__webpack_exports__, "setCommonInfo", function() { return /* reexport */ planbook["w" /* setCommonInfo */]; });
|
|
5663
|
-
__webpack_require__.d(__webpack_exports__, "setGroupInsurance", function() { return /* reexport */ planbook["x" /* setGroupInsurance */]; });
|
|
5664
|
-
__webpack_require__.d(__webpack_exports__, "isHideProduct", function() { return /* reexport */ planbook["r" /* isHideProduct */]; });
|
|
5665
|
-
__webpack_require__.d(__webpack_exports__, "verifyProductRules", function() { return /* reexport */ planbook["z" /* verifyProductRules */]; });
|
|
5666
|
-
__webpack_require__.d(__webpack_exports__, "restrictInsurancesInProduct", function() { return /* reexport */ planbook["v" /* restrictInsurancesInProduct */]; });
|
|
5667
|
-
__webpack_require__.d(__webpack_exports__, "convertProductData", function() { return /* reexport */ planbook["f" /* convertProductData */]; });
|
|
5668
|
-
__webpack_require__.d(__webpack_exports__, "clearAddAndTakeAndAdjustBaoeData", function() { return /* reexport */ planbook["b" /* clearAddAndTakeAndAdjustBaoeData */]; });
|
|
5669
|
-
__webpack_require__.d(__webpack_exports__, "initInsuranceData", function() { return /* reexport */ planbook["n" /* initInsuranceData */]; });
|
|
5670
|
-
__webpack_require__.d(__webpack_exports__, "insuranceDataHandler", function() { return /* reexport */ planbook["q" /* insuranceDataHandler */]; });
|
|
5671
|
-
__webpack_require__.d(__webpack_exports__, "initElementValidateRules", function() { return /* reexport */ planbook["m" /* initElementValidateRules */]; });
|
|
5672
|
-
__webpack_require__.d(__webpack_exports__, "restrictElementsInInsurance", function() { return /* reexport */ planbook["u" /* restrictElementsInInsurance */]; });
|
|
5673
|
-
__webpack_require__.d(__webpack_exports__, "getAddress", function() { return /* reexport */ getAddress; });
|
|
5674
|
-
__webpack_require__.d(__webpack_exports__, "getUuid", function() { return /* reexport */ getUuid; });
|
|
5675
|
-
__webpack_require__.d(__webpack_exports__, "hasPlanParams", function() { return /* reexport */ hasPlanParams; });
|
|
5676
|
-
__webpack_require__.d(__webpack_exports__, "insureCalculate", function() { return /* reexport */ insureCalculate; });
|
|
5677
|
-
__webpack_require__.d(__webpack_exports__, "checkInsureCalculate", function() { return /* reexport */ checkInsureCalculate; });
|
|
5678
|
-
__webpack_require__.d(__webpack_exports__, "checkInsureCalculateIn", function() { return /* reexport */ checkInsureCalculateIn; });
|
|
5679
|
-
|
|
5680
|
-
// EXTERNAL MODULE: ./packages/bxs-utils/planbook/index.ts
|
|
5681
|
-
var planbook = __webpack_require__(12);
|
|
5682
|
-
|
|
5683
|
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
5684
|
-
var asyncToGenerator = __webpack_require__(30);
|
|
5685
|
-
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
5686
|
-
|
|
5687
|
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/typeof.js
|
|
5688
|
-
var helpers_typeof = __webpack_require__(11);
|
|
5689
|
-
var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
|
|
5690
|
-
|
|
5691
|
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
|
5692
|
-
var regenerator = __webpack_require__(17);
|
|
5693
|
-
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
|
5694
|
-
|
|
5695
|
-
// EXTERNAL MODULE: ./node_modules/axios/index.js
|
|
5696
|
-
var axios = __webpack_require__(31);
|
|
5697
|
-
var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
|
|
5698
|
-
|
|
5699
|
-
// CONCATENATED MODULE: ./src/js/request.js
|
|
5700
|
-
// import { gotoLogin } from './utils.js'
|
|
5701
|
-
|
|
5702
|
-
var BASE_API = function () {
|
|
5703
|
-
var env = null;
|
|
5704
|
-
|
|
5705
|
-
if (location.hostname.search(/pbf\.winbaoxian\.com/) !== -1) {
|
|
5706
|
-
env = 'https://app.winbaoxian.com';
|
|
5707
|
-
} else if (location.hostname.search(/pbf\.winbaoxian\.cn/) !== -1) {
|
|
5708
|
-
env = 'https://app.winbaoxian.cn';
|
|
5709
|
-
} else if (location.hostname.search(/127\.0\.0\.1|192\.168|localhost/) !== -1) {
|
|
5710
|
-
env = 'https://app.winbaoxian.cn';
|
|
5711
|
-
}
|
|
5712
|
-
|
|
5713
|
-
return env;
|
|
5714
|
-
}(); // 创建axios实例
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
var service = axios_default.a.create({
|
|
5718
|
-
baseURL: BASE_API,
|
|
5719
|
-
withCredentials: true,
|
|
5720
|
-
timeout: 10000,
|
|
5721
|
-
// 请求超时时间
|
|
5722
|
-
headers: {
|
|
5723
|
-
'X-Requested-With': 'XMLHttpRequest'
|
|
5724
|
-
}
|
|
5725
|
-
});
|
|
5726
|
-
var loadingTimer = null;
|
|
5727
|
-
|
|
5728
|
-
var loading = function loading(show) {
|
|
5729
|
-
if (window.appBridge && appBridge.showLoading) {
|
|
5730
|
-
if (show) {
|
|
5731
|
-
appBridge.showLoading();
|
|
5732
|
-
} else {
|
|
5733
|
-
appBridge.hideLoading();
|
|
5734
|
-
}
|
|
5735
|
-
}
|
|
5736
|
-
}; // request拦截器
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
service.interceptors.request.use(function (config) {
|
|
5740
|
-
if (loadingTimer) clearTimeout(loadingTimer);
|
|
5741
|
-
loadingTimer = setTimeout(function () {
|
|
5742
|
-
loading(true);
|
|
5743
|
-
}, 300);
|
|
5744
|
-
return config;
|
|
5745
|
-
}, function (error) {
|
|
5746
|
-
// Do something with request error
|
|
5747
|
-
console.log(error); // for debug
|
|
5748
|
-
|
|
5749
|
-
Promise.reject(error);
|
|
5750
|
-
}); // respone拦截器
|
|
5751
|
-
|
|
5752
|
-
service.interceptors.response.use(function (response) {
|
|
5753
|
-
if (loadingTimer) clearTimeout(loadingTimer);
|
|
5754
|
-
loading(false);
|
|
5755
|
-
var res = response.data;
|
|
5756
|
-
|
|
5757
|
-
if (res.code === 401 || res.status === 401) {
|
|
5758
|
-
// gotoLogin()
|
|
5759
|
-
return Promise.reject('login');
|
|
5760
|
-
}
|
|
5761
|
-
|
|
5762
|
-
return res;
|
|
5763
|
-
}, function (error) {
|
|
5764
|
-
if (loadingTimer) clearTimeout(loadingTimer);
|
|
5765
|
-
loading(false);
|
|
5766
|
-
|
|
5767
|
-
if (error.response && error.response.status == 401) {
|
|
5768
|
-
// gotoLogin()
|
|
5769
|
-
return Promise.reject('login');
|
|
5770
|
-
}
|
|
5771
|
-
|
|
5772
|
-
console.log('err' + error); // for debug
|
|
5773
|
-
|
|
5774
|
-
return Promise.reject(error);
|
|
5775
|
-
});
|
|
5776
|
-
/* harmony default export */ var request = (service);
|
|
5777
|
-
// CONCATENATED MODULE: ./packages/bxs-utils/trade/insureCalculate.js
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
/**
|
|
5783
|
-
* @Author: watson
|
|
5784
|
-
* @Date: 2020-12-23
|
|
5785
|
-
* @LastEditors: watson
|
|
5786
|
-
* @description: 保费试算
|
|
5787
|
-
* @param {*} params: 必传
|
|
5788
|
-
* @return {*} 试算结果
|
|
5789
|
-
*/
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
var baseURL = function () {
|
|
5793
|
-
var env = null;
|
|
5794
|
-
|
|
5795
|
-
if (location.hostname.search(/pbf\.winbaoxian\.com/) !== -1) {
|
|
5796
|
-
env = 'https://insurance2a-api.wyins.net';
|
|
5797
|
-
} else if (location.hostname.search(/pbf\.winbaoxian\.cn/) !== -1) {
|
|
5798
|
-
env = '//insurance2a-api.wyins.net.cn';
|
|
5799
|
-
} else if (location.hostname.search(/127\.0\.0\.1|192\.168|localhost|0\.0\.0\.0/) !== -1) {
|
|
5800
|
-
env = '//insurance2a-api.wyins.net.cn';
|
|
5801
|
-
}
|
|
5802
|
-
|
|
5803
|
-
return env;
|
|
5804
|
-
}();
|
|
5805
|
-
/**
|
|
5806
|
-
* **获取地址信息**
|
|
5807
|
-
* @ignore
|
|
5808
|
-
* @author watson
|
|
5809
|
-
* @date 2022-04-26
|
|
5810
|
-
* @param {string} fetchUrl api url
|
|
5811
|
-
* @param {object} data 接口传参
|
|
5812
|
-
* @returns {object} addressData
|
|
5934
|
+
* Determines whether the specified URL is absolute
|
|
5935
|
+
*
|
|
5936
|
+
* @param {string} url The URL to test
|
|
5937
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
5813
5938
|
*/
|
|
5939
|
+
module.exports = function isAbsoluteURL(url) {
|
|
5940
|
+
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
5941
|
+
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
5942
|
+
// by any combination of letters, digits, plus, period, or hyphen.
|
|
5943
|
+
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
5944
|
+
};
|
|
5814
5945
|
|
|
5815
5946
|
|
|
5816
|
-
|
|
5817
|
-
return new Promise(function (resolve, reject) {
|
|
5818
|
-
request({
|
|
5819
|
-
baseURL: fetchUrl,
|
|
5820
|
-
url: undefined,
|
|
5821
|
-
method: 'POST',
|
|
5822
|
-
urlParams: undefined,
|
|
5823
|
-
data: data
|
|
5824
|
-
}).then(function (res) {
|
|
5825
|
-
resolve(res);
|
|
5826
|
-
}).catch(function (err) {
|
|
5827
|
-
reject(err);
|
|
5828
|
-
});
|
|
5829
|
-
});
|
|
5830
|
-
}
|
|
5831
|
-
/**
|
|
5832
|
-
* **获取用户信息**
|
|
5833
|
-
* @ignore
|
|
5834
|
-
* @author watson
|
|
5835
|
-
* @date 2022-04-26
|
|
5836
|
-
* @param {string} fetchUrl api url
|
|
5837
|
-
* @returns {promise}
|
|
5838
|
-
*/
|
|
5947
|
+
/***/ }),
|
|
5839
5948
|
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
request({
|
|
5843
|
-
baseURL: fetchUrl,
|
|
5844
|
-
url: undefined,
|
|
5845
|
-
method: 'GET',
|
|
5846
|
-
urlParams: undefined,
|
|
5847
|
-
data: null
|
|
5848
|
-
}).then(function (res) {
|
|
5849
|
-
resolve(res);
|
|
5850
|
-
}).catch(function (err) {
|
|
5851
|
-
reject(err);
|
|
5852
|
-
});
|
|
5853
|
-
});
|
|
5854
|
-
}
|
|
5855
|
-
/**
|
|
5856
|
-
* **计划书初始化参数**
|
|
5857
|
-
* @ignore
|
|
5858
|
-
* @author watson
|
|
5859
|
-
* @date 2022-04-26
|
|
5860
|
-
* @param {any} planParams 计划书初始化参数
|
|
5861
|
-
* @param {any} planParams.detail_age 被保人生日
|
|
5862
|
-
* @param {any} planParams.detail_sex 被保人性别
|
|
5863
|
-
* @param {any} planParams.detail_relation 投被保人关系
|
|
5864
|
-
* @param {any} planParams.detail_applicant_age 投保人生日
|
|
5865
|
-
* @param {any} planParams.detail_applicant_sex 投保人性别
|
|
5866
|
-
* @returns {boolean} 是否有计划书参数
|
|
5867
|
-
*/
|
|
5949
|
+
/***/ 68:
|
|
5950
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
5868
5951
|
|
|
5869
|
-
|
|
5870
|
-
var type = false;
|
|
5952
|
+
"use strict";
|
|
5871
5953
|
|
|
5872
|
-
if (planParams && (planParams.detail_age || planParams.detail_sex || planParams.detail_relation || planParams.detail_applicant_age || planParams.detail_applicant_sex)) {
|
|
5873
|
-
type = true;
|
|
5874
|
-
}
|
|
5875
5954
|
|
|
5876
|
-
return type;
|
|
5877
|
-
}
|
|
5878
5955
|
/**
|
|
5879
|
-
*
|
|
5880
|
-
*
|
|
5881
|
-
* @
|
|
5882
|
-
* @
|
|
5883
|
-
* @
|
|
5884
|
-
* @param {object} currentData 试算参数
|
|
5885
|
-
* @param {object} planParams 计划书初始化参数
|
|
5886
|
-
* @returns {void}
|
|
5956
|
+
* Creates a new URL by combining the specified URLs
|
|
5957
|
+
*
|
|
5958
|
+
* @param {string} baseURL The base URL
|
|
5959
|
+
* @param {string} relativeURL The relative URL
|
|
5960
|
+
* @returns {string} The combined URL
|
|
5887
5961
|
*/
|
|
5962
|
+
module.exports = function combineURLs(baseURL, relativeURL) {
|
|
5963
|
+
return relativeURL
|
|
5964
|
+
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
5965
|
+
: baseURL;
|
|
5966
|
+
};
|
|
5888
5967
|
|
|
5889
|
-
function translatePlanData(widgets, currentData, planParams) {
|
|
5890
|
-
widgets.forEach(function (item) {
|
|
5891
|
-
var current; // 增加current字段,保存current_data的数据
|
|
5892
|
-
|
|
5893
|
-
if (item.duty) {
|
|
5894
|
-
current = currentData.find(function (it) {
|
|
5895
|
-
return it.k === item.key && it.risk === item.riskCode && item.duty === it.d;
|
|
5896
|
-
});
|
|
5897
|
-
} else {
|
|
5898
|
-
current = currentData.find(function (it) {
|
|
5899
|
-
return it.k === item.key && it.risk === item.riskCode;
|
|
5900
|
-
});
|
|
5901
|
-
}
|
|
5902
5968
|
|
|
5903
|
-
|
|
5904
|
-
// 被保人生日 / 年龄
|
|
5905
|
-
if (planParams.detail_age && item.key === 'detail_age') {
|
|
5906
|
-
if (/-/.test(planParams.detail_age)) {
|
|
5907
|
-
// 被保人生日
|
|
5908
|
-
item.type = 'v-text';
|
|
5909
|
-
item.name = planParams.detail_age;
|
|
5910
|
-
current.v = planParams.detail_age;
|
|
5911
|
-
} else if (/岁/.test(planParams.detail_age)) {
|
|
5912
|
-
// 被保人年龄
|
|
5913
|
-
item.type = 'v-text';
|
|
5914
|
-
item.name = planParams.detail_age;
|
|
5915
|
-
item.label = item.label + '(年龄)';
|
|
5916
|
-
current.v = planParams.detail_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
|
|
5917
|
-
}
|
|
5918
|
-
} // 被保人性别
|
|
5969
|
+
/***/ }),
|
|
5919
5970
|
|
|
5971
|
+
/***/ 69:
|
|
5972
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
5920
5973
|
|
|
5921
|
-
|
|
5922
|
-
item.type = 'v-text';
|
|
5923
|
-
item.name = planParams.detail_sex === '1' ? '男' : '女';
|
|
5924
|
-
current.v = planParams.detail_sex;
|
|
5925
|
-
} // 投被保人关系
|
|
5926
|
-
// 初始化
|
|
5927
|
-
// if (
|
|
5928
|
-
// item.key === 'detail_relation' &&
|
|
5929
|
-
// planParams.detail_sex &&
|
|
5930
|
-
// planParams.detail_applicant_sex &&
|
|
5931
|
-
// String(planParams.detail_sex) ===
|
|
5932
|
-
// String(planParams.detail_applicant_sex)
|
|
5933
|
-
// ) {
|
|
5934
|
-
// let otemp = [];
|
|
5935
|
-
// item.opts[item.key].forEach(i => {
|
|
5936
|
-
// if (
|
|
5937
|
-
// String(planParams.detail_sex) === '1' &&
|
|
5938
|
-
// String(planParams.detail_applicant_sex) === '1'
|
|
5939
|
-
// ) {
|
|
5940
|
-
// // 投被保人 - 男 1
|
|
5941
|
-
// if (['1', '14', '16', '18'].includes(String(i.value))) {
|
|
5942
|
-
// otemp.push(i);
|
|
5943
|
-
// }
|
|
5944
|
-
// } else if (
|
|
5945
|
-
// String(planParams.detail_sex) === '2' &&
|
|
5946
|
-
// String(planParams.detail_applicant_sex) === '2'
|
|
5947
|
-
// ) {
|
|
5948
|
-
// // 投被保人 - 女 2
|
|
5949
|
-
// if (['1', '15', '17', '19'].includes(String(i.value))) {
|
|
5950
|
-
// otemp.push(i);
|
|
5951
|
-
// }
|
|
5952
|
-
// }
|
|
5953
|
-
// });
|
|
5954
|
-
// item.opts[item.key] = otemp;
|
|
5955
|
-
// console.log('otemp', otemp);
|
|
5956
|
-
// }
|
|
5974
|
+
"use strict";
|
|
5957
5975
|
|
|
5958
5976
|
|
|
5959
|
-
|
|
5960
|
-
// 条件检索
|
|
5961
|
-
if (planParams.detail_relation === '-1' || planParams.detail_relation === -1) {
|
|
5962
|
-
// 非本人
|
|
5963
|
-
var temp = [];
|
|
5964
|
-
item.opts[item.key].forEach(function (i) {
|
|
5965
|
-
if (String(i.value) != '1') {
|
|
5966
|
-
temp.push(i);
|
|
5967
|
-
}
|
|
5968
|
-
});
|
|
5969
|
-
item.name = temp[0] && temp[0].name ? temp[0].name : '';
|
|
5970
|
-
item.opts[item.key] = temp;
|
|
5971
|
-
} else if (planParams.detail_relation) {
|
|
5972
|
-
// 指定人 - 本人 其他人
|
|
5973
|
-
item.type = 'v-text';
|
|
5974
|
-
current.v = planParams.detail_relation;
|
|
5975
|
-
var _temp = [];
|
|
5976
|
-
item.opts[item.key].forEach(function (i) {
|
|
5977
|
-
if (String(i.value) === String(planParams.detail_relation)) {
|
|
5978
|
-
_temp.push(i);
|
|
5977
|
+
var utils = __webpack_require__(5);
|
|
5979
5978
|
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5979
|
+
// Headers whose duplicates are ignored by node
|
|
5980
|
+
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
5981
|
+
var ignoreDuplicateOf = [
|
|
5982
|
+
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
5983
|
+
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
5984
|
+
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
5985
|
+
'referer', 'retry-after', 'user-agent'
|
|
5986
|
+
];
|
|
5986
5987
|
|
|
5988
|
+
/**
|
|
5989
|
+
* Parse headers into an object
|
|
5990
|
+
*
|
|
5991
|
+
* ```
|
|
5992
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
5993
|
+
* Content-Type: application/json
|
|
5994
|
+
* Connection: keep-alive
|
|
5995
|
+
* Transfer-Encoding: chunked
|
|
5996
|
+
* ```
|
|
5997
|
+
*
|
|
5998
|
+
* @param {String} headers Headers needing to be parsed
|
|
5999
|
+
* @returns {Object} Headers parsed into an object
|
|
6000
|
+
*/
|
|
6001
|
+
module.exports = function parseHeaders(headers) {
|
|
6002
|
+
var parsed = {};
|
|
6003
|
+
var key;
|
|
6004
|
+
var val;
|
|
6005
|
+
var i;
|
|
5987
6006
|
|
|
5988
|
-
|
|
5989
|
-
if (/-/.test(planParams.detail_applicant_age)) {
|
|
5990
|
-
// 被保人生日
|
|
5991
|
-
item.type = 'v-text';
|
|
5992
|
-
item.name = planParams.detail_applicant_age;
|
|
5993
|
-
current.v = planParams.detail_applicant_age;
|
|
5994
|
-
} else if (/岁/.test(planParams.detail_applicant_age)) {
|
|
5995
|
-
// 被保人年龄
|
|
5996
|
-
item.type = 'v-text';
|
|
5997
|
-
item.name = planParams.detail_applicant_age;
|
|
5998
|
-
item.label = item.label + '(年龄)';
|
|
5999
|
-
current.v = planParams.detail_applicant_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
|
|
6000
|
-
}
|
|
6001
|
-
} // 投保人性别
|
|
6007
|
+
if (!headers) { return parsed; }
|
|
6002
6008
|
|
|
6009
|
+
utils.forEach(headers.split('\n'), function parser(line) {
|
|
6010
|
+
i = line.indexOf(':');
|
|
6011
|
+
key = utils.trim(line.substr(0, i)).toLowerCase();
|
|
6012
|
+
val = utils.trim(line.substr(i + 1));
|
|
6003
6013
|
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6014
|
+
if (key) {
|
|
6015
|
+
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
6016
|
+
return;
|
|
6017
|
+
}
|
|
6018
|
+
if (key === 'set-cookie') {
|
|
6019
|
+
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
6020
|
+
} else {
|
|
6021
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
6008
6022
|
}
|
|
6009
6023
|
}
|
|
6010
6024
|
});
|
|
6011
|
-
}
|
|
6012
|
-
/**
|
|
6013
|
-
* **试算参数转化**
|
|
6014
|
-
* @ignore
|
|
6015
|
-
* @author watson
|
|
6016
|
-
* @date 2022-04-26
|
|
6017
|
-
* @param {object} currentData
|
|
6018
|
-
* @param {object} planParams
|
|
6019
|
-
* @returns {object}
|
|
6020
|
-
*/
|
|
6021
6025
|
|
|
6026
|
+
return parsed;
|
|
6027
|
+
};
|
|
6022
6028
|
|
|
6023
|
-
function tranlateCurrentData(currentData, planParams) {
|
|
6024
|
-
var currentDataCopy = JSON.parse(JSON.stringify(currentData));
|
|
6025
|
-
currentDataCopy.forEach(function (item) {
|
|
6026
|
-
var current = item;
|
|
6027
6029
|
|
|
6028
|
-
|
|
6029
|
-
if (planParams.detail_age && item.k === 'detail_age') {
|
|
6030
|
-
if (/-/.test(planParams.detail_age)) {
|
|
6031
|
-
// 被保人生日
|
|
6032
|
-
current.v = planParams.detail_age;
|
|
6033
|
-
} else if (/岁/.test(planParams.detail_age)) {
|
|
6034
|
-
// 被保人年龄
|
|
6035
|
-
current.v = planParams.detail_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
|
|
6036
|
-
}
|
|
6037
|
-
} // 被保人性别
|
|
6030
|
+
/***/ }),
|
|
6038
6031
|
|
|
6032
|
+
/***/ 7:
|
|
6033
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6039
6034
|
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6035
|
+
"use strict";
|
|
6036
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return initInsuranceData; });
|
|
6037
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return insuranceDataHandler; });
|
|
6038
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initElementValidateRules; });
|
|
6039
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return restrictElementsInInsurance; });
|
|
6040
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
6041
|
+
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
6043
6042
|
|
|
6044
6043
|
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6044
|
+
function initInsuranceData(insData) {
|
|
6045
|
+
if (!insData || !insData.eleOrderList) {
|
|
6046
|
+
return;
|
|
6047
|
+
}
|
|
6048
|
+
if (insData.account && insData.accountData && insData.accountData.accountPart) {
|
|
6049
|
+
insData.accountData.addAndTakeData = insData.accountData.addAndTakeData || [];
|
|
6050
|
+
if (!insData.accountData.addAndTakeData.length) {
|
|
6051
|
+
insData.accountData.addAndTakeData.push({
|
|
6052
|
+
key: 'add',
|
|
6053
|
+
adjustData: []
|
|
6054
|
+
});
|
|
6055
|
+
if (['addAndTake', 'take'].includes(insData.accountData.accountPart)) {
|
|
6056
|
+
insData.accountData.addAndTakeData.push({
|
|
6057
|
+
key: 'take',
|
|
6058
|
+
adjustData: []
|
|
6059
|
+
});
|
|
6060
|
+
}
|
|
6048
6061
|
}
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6062
|
+
}
|
|
6063
|
+
if (insData.reduceBaof && !insData.reduceBaofData) {
|
|
6064
|
+
insData.reduceBaofData = {
|
|
6065
|
+
accountPart: 'take',
|
|
6066
|
+
addAndTakeData: [
|
|
6067
|
+
{
|
|
6068
|
+
key: 'take',
|
|
6069
|
+
adjustData: []
|
|
6070
|
+
}
|
|
6071
|
+
]
|
|
6072
|
+
};
|
|
6073
|
+
}
|
|
6074
|
+
insData.eleOrderList.forEach(function (e) {
|
|
6075
|
+
switch (e.key) {
|
|
6076
|
+
case 'title':
|
|
6077
|
+
e.isDisabled = e.isDisabled || null;
|
|
6078
|
+
e.isHide = e.isHide || null;
|
|
6079
|
+
break;
|
|
6080
|
+
case 'baoe':
|
|
6081
|
+
e.placeholder = e.placeholder || '请输入保额';
|
|
6082
|
+
break;
|
|
6083
|
+
case 'baof':
|
|
6084
|
+
e.placeholder = e.placeholder || '请输入保费';
|
|
6085
|
+
break;
|
|
6059
6086
|
}
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6087
|
+
if (e.optConf && e.optConf.length && e.optConf[1]) {
|
|
6088
|
+
var options = [];
|
|
6089
|
+
for (var i = e.optConf[0]; i <= e.optConf[1]; i += (e.optConf[2] && e.optConf[2] && e.optConf[2].step) || 1) {
|
|
6090
|
+
options.push({
|
|
6091
|
+
val: e.optConf[2] && e.optConf[2].valfix ? "" + i + e.optConf[2].valfix : i,
|
|
6092
|
+
desc: e.optConf[2] && e.optConf[2].desc ? e.optConf[2].desc.replace(/{{&&}}/, i) : i
|
|
6093
|
+
});
|
|
6094
|
+
}
|
|
6095
|
+
e.opts = options;
|
|
6096
|
+
}
|
|
6097
|
+
if (e.opts && e.opts.length) {
|
|
6098
|
+
e.opts = e.opts.map(function (o) { return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__[/* __assign */ "a"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[/* __assign */ "a"])({}, o), { desc: o.desc || o.val, isHide: o.isHide || null, isDisabled: o.isDisabled || null, isInvalid: o.isInvalid || null })); });
|
|
6099
|
+
}
|
|
6100
|
+
});
|
|
6101
|
+
}
|
|
6102
|
+
function insuranceDataHandler(insData, productData) {
|
|
6103
|
+
if (!insData || !insData.eleOrderList) {
|
|
6104
|
+
return insData;
|
|
6066
6105
|
}
|
|
6067
|
-
|
|
6068
|
-
|
|
6106
|
+
if (insData.reduceBaof) {
|
|
6107
|
+
insData.reduceBaofData = insData.reduceBaofData || null;
|
|
6108
|
+
}
|
|
6109
|
+
insData.eleOrderList.forEach(function (ele) {
|
|
6110
|
+
ele.isDisabled = ele.isDisabled || null;
|
|
6111
|
+
ele.isHide = ele.isHide || null;
|
|
6112
|
+
ele.isIgnoreValidate = ele.isIgnoreValidate || null;
|
|
6113
|
+
ele.rules = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[/* __spreadArrays */ "g"])(initElementValidateRules(ele, productData));
|
|
6114
|
+
});
|
|
6115
|
+
var calMethod = insData.eleOrderList.find(function (e) { return e.key === 'calMethod'; });
|
|
6116
|
+
var baoe = insData.eleOrderList.find(function (e) { return e.key === 'baoe'; });
|
|
6117
|
+
var baof = insData.eleOrderList.find(function (e) { return e.key === 'baof'; });
|
|
6118
|
+
var plan = insData.eleOrderList.find(function (e) { return e.key === 'plan'; });
|
|
6119
|
+
if (!calMethod && baoe && plan) {
|
|
6120
|
+
insData.showPlanDesc = !!baoe.isHide;
|
|
6121
|
+
}
|
|
6122
|
+
if (calMethod && baoe && baof) {
|
|
6123
|
+
baoe.isHide = calMethod.value !== 'baoe2baof';
|
|
6124
|
+
baof.isHide = calMethod.value === 'baoe2baof';
|
|
6125
|
+
}
|
|
6126
|
+
return insData;
|
|
6069
6127
|
}
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6128
|
+
function initElementValidateRules(ele, productData) {
|
|
6129
|
+
var rules = [];
|
|
6130
|
+
if (['cmCommonInput'].indexOf(String(ele.componentName)) !== -1) {
|
|
6131
|
+
rules = [
|
|
6132
|
+
{
|
|
6133
|
+
required: ele.required !== false,
|
|
6134
|
+
message: "\u8BF7\u8F93\u5165" + (ele.labelName || '') + "\u503C"
|
|
6135
|
+
},
|
|
6136
|
+
{
|
|
6137
|
+
pattern: ele.regExp ? eval(String(ele.regExp)) : /^\d*$/,
|
|
6138
|
+
message: ele.regExpMessage || (ele.regExp ? '输入不合法,请重新输入' : '请输入整数值')
|
|
6139
|
+
}
|
|
6140
|
+
];
|
|
6141
|
+
}
|
|
6142
|
+
var min = 0;
|
|
6143
|
+
var max = 0;
|
|
6144
|
+
if (ele.min && !isNaN(Number(ele.min))) {
|
|
6145
|
+
min = ele.min;
|
|
6146
|
+
}
|
|
6147
|
+
if (ele.max && !isNaN(Number(ele.max))) {
|
|
6148
|
+
max = ele.max;
|
|
6149
|
+
}
|
|
6150
|
+
if (min || max) {
|
|
6151
|
+
var message = '';
|
|
6152
|
+
if (min && max) {
|
|
6153
|
+
message = "\u8BF7\u8F93\u5165" + Object(_common__WEBPACK_IMPORTED_MODULE_1__[/* converUnit10000 */ "b"])(min) + "~" + Object(_common__WEBPACK_IMPORTED_MODULE_1__[/* converUnit10000 */ "b"])(max) + "\u4E4B\u95F4\u7684\u6570\u503C";
|
|
6154
|
+
}
|
|
6155
|
+
else if (!min) {
|
|
6156
|
+
message = "\u8BF7\u8F93\u5165\u4E0D\u5927\u4E8E" + Object(_common__WEBPACK_IMPORTED_MODULE_1__[/* converUnit10000 */ "b"])(max) + "\u7684\u6570\u503C";
|
|
6157
|
+
}
|
|
6158
|
+
else if (!max) {
|
|
6159
|
+
message = "\u8BF7\u8F93\u5165\u4E0D\u5C0F\u4E8E" + Object(_common__WEBPACK_IMPORTED_MODULE_1__[/* converUnit10000 */ "b"])(min) + "\u7684\u6570\u503C";
|
|
6160
|
+
}
|
|
6161
|
+
rules.push({
|
|
6162
|
+
type: 'number',
|
|
6163
|
+
min: min || -Infinity,
|
|
6164
|
+
max: max || Infinity,
|
|
6165
|
+
message: message,
|
|
6166
|
+
validator: function (rule, value) {
|
|
6167
|
+
return !value || (value >= rule.min && value <= rule.max);
|
|
6168
|
+
}
|
|
6169
|
+
});
|
|
6170
|
+
}
|
|
6171
|
+
if (ele.multi && !isNaN(Number(ele.multi))) {
|
|
6172
|
+
rules.push({
|
|
6173
|
+
multiple: ele.multi,
|
|
6174
|
+
message: "\u8BF7\u8F93\u5165" + ele.multi + "\u500D\u6570",
|
|
6175
|
+
validator: function (rule, value) {
|
|
6176
|
+
return !value || !(value % rule.multiple);
|
|
6177
|
+
}
|
|
6178
|
+
});
|
|
6179
|
+
}
|
|
6180
|
+
if (ele.compareItem &&
|
|
6181
|
+
ele.compareItem.length &&
|
|
6182
|
+
ele.compareItem.length >= 3 &&
|
|
6183
|
+
productData &&
|
|
6184
|
+
productData.mulInsOrderList) {
|
|
6185
|
+
var item1_1 = ele.compareItem[0].match(/(.{1,})\.(.{1,})/);
|
|
6186
|
+
var item2_1 = ele.compareItem[2].match(/(.{1,})\.(.{1,})/);
|
|
6187
|
+
var insurance1 = void 0, insurance2 = void 0, insTitle1 = void 0, insTitle2 = void 0, itemValue1 = void 0, itemValue2 = void 0;
|
|
6188
|
+
if (item1_1 && item2_1) {
|
|
6189
|
+
insurance1 = productData.mulInsOrderList.find(function (ins) { return ins.key + '' === item1_1[1]; });
|
|
6190
|
+
insurance2 = productData.mulInsOrderList.find(function (ins) { return ins.key + '' === item2_1[1]; });
|
|
6191
|
+
}
|
|
6192
|
+
if (insurance1 && insurance1.eleOrderList) {
|
|
6193
|
+
insTitle1 = insurance1.eleOrderList.find(function (e) { return e.key === 'title'; });
|
|
6194
|
+
if (insTitle1 && insTitle1.value) {
|
|
6195
|
+
itemValue1 = insurance1.eleOrderList.find(function (e) { return e.key === item1_1[2]; });
|
|
6196
|
+
}
|
|
6197
|
+
}
|
|
6198
|
+
if (insurance2 && insurance2.eleOrderList) {
|
|
6199
|
+
insTitle2 = insurance2.eleOrderList.find(function (e) { return e.key === 'title'; });
|
|
6200
|
+
if (insTitle2 && insTitle2.value) {
|
|
6201
|
+
itemValue2 = insurance2.eleOrderList.find(function (e) { return e.key === item2_1[2]; });
|
|
6202
|
+
}
|
|
6203
|
+
}
|
|
6204
|
+
if (itemValue1 && itemValue1.value && itemValue2 && itemValue2.value && ele.compareItem[1]) {
|
|
6205
|
+
rules.push({
|
|
6206
|
+
value1: itemValue1.value,
|
|
6207
|
+
value2: itemValue2.value,
|
|
6208
|
+
operator: ele.compareItem[1],
|
|
6209
|
+
message: ele.compareItem[3] || '数据输入有误',
|
|
6210
|
+
validator: function (rule) {
|
|
6211
|
+
var bool = false;
|
|
6212
|
+
var value1 = rule.value1;
|
|
6213
|
+
var value2 = rule.value2;
|
|
6214
|
+
var operator = rule.operator;
|
|
6215
|
+
switch (operator) {
|
|
6216
|
+
case '<=':
|
|
6217
|
+
bool = value1 <= value2;
|
|
6218
|
+
break;
|
|
6219
|
+
case '>=':
|
|
6220
|
+
bool = value1 >= value2;
|
|
6221
|
+
break;
|
|
6222
|
+
case '<':
|
|
6223
|
+
bool = value1 < value2;
|
|
6224
|
+
break;
|
|
6225
|
+
case '>':
|
|
6226
|
+
bool = value1 > value2;
|
|
6227
|
+
break;
|
|
6228
|
+
default:
|
|
6229
|
+
bool = value1 <= value2;
|
|
6230
|
+
}
|
|
6231
|
+
return bool;
|
|
6232
|
+
}
|
|
6233
|
+
});
|
|
6234
|
+
}
|
|
6103
6235
|
}
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
urlParams: urlParams,
|
|
6116
|
-
data: postParams
|
|
6117
|
-
}).then(function (res) {
|
|
6118
|
-
if (res.code === 200) {
|
|
6119
|
-
var data = JSON.parse(JSON.stringify(res.data));
|
|
6120
|
-
|
|
6121
|
-
if (hasPlanParams(planParams)) {
|
|
6122
|
-
var widgets = data.widgets;
|
|
6123
|
-
var currentData = data.current_data;
|
|
6124
|
-
translatePlanData(widgets, currentData, planParams);
|
|
6236
|
+
return rules;
|
|
6237
|
+
}
|
|
6238
|
+
function restrictElementsInInsurance(_a) {
|
|
6239
|
+
var personOrderList = _a.personOrderList, insData = _a.insData, eleData = _a.eleData;
|
|
6240
|
+
var errorMsg = '';
|
|
6241
|
+
if (insData && eleData && eleData.restrictions) {
|
|
6242
|
+
var insuredInfo = personOrderList && personOrderList.find(function (p) { return p.key === 'insuredInfo'; });
|
|
6243
|
+
var insuranceInfo = Object(_common__WEBPACK_IMPORTED_MODULE_1__[/* convertEleOrderListToObj */ "c"])(insData);
|
|
6244
|
+
var verifyData_1;
|
|
6245
|
+
if (insuredInfo) {
|
|
6246
|
+
verifyData_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[/* __assign */ "a"])({ sex: insuredInfo.sex, age: insuredInfo.age }, insuranceInfo);
|
|
6125
6247
|
}
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
data: cData
|
|
6248
|
+
var eleRestricts = eleData.restrictions.filter(function (restrict) {
|
|
6249
|
+
return Object.keys(restrict).every(function (ele) {
|
|
6250
|
+
return ((ele === 'age' &&
|
|
6251
|
+
verifyData_1[ele] &&
|
|
6252
|
+
verifyData_1[ele] >= restrict[ele][0] &&
|
|
6253
|
+
verifyData_1[ele] <= restrict[ele][1]) ||
|
|
6254
|
+
ele === eleData.key ||
|
|
6255
|
+
((restrict[ele].constructor === String || restrict[ele].constructor === Number) &&
|
|
6256
|
+
verifyData_1[ele] == restrict[ele]) ||
|
|
6257
|
+
(restrict[ele].constructor === Array && restrict[ele].find(function (r) { return r == verifyData_1[ele]; })));
|
|
6258
|
+
});
|
|
6138
6259
|
});
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
}
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
* @param {object} urlParams 接口URL上面的参数,c端必传uuid
|
|
6152
|
-
* @param {object} postParams 试算用的参数,product_id, current_data 和 scenario: 'h5Widget'
|
|
6153
|
-
* @param {object} planParams 计划书初始化参数
|
|
6154
|
-
* @returns {promise} 试算结果
|
|
6155
|
-
*/
|
|
6156
|
-
|
|
6157
|
-
function checkInsureCalculate(_x, _x2, _x3) {
|
|
6158
|
-
return _checkInsureCalculate.apply(this, arguments);
|
|
6159
|
-
}
|
|
6160
|
-
/**
|
|
6161
|
-
* 描述
|
|
6162
|
-
* @ignore
|
|
6163
|
-
* @author watson
|
|
6164
|
-
* @date 2022-04-26
|
|
6165
|
-
* @param {object} urlParams
|
|
6166
|
-
* @param {object} postParams
|
|
6167
|
-
* @param {object} planParams
|
|
6168
|
-
* @returns {promise}
|
|
6169
|
-
*/
|
|
6170
|
-
|
|
6171
|
-
function _checkInsureCalculate() {
|
|
6172
|
-
_checkInsureCalculate = asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee(urlParams, postParams, planParams) {
|
|
6173
|
-
var res, data;
|
|
6174
|
-
return regenerator_default.a.wrap(function _callee$(_context) {
|
|
6175
|
-
while (1) {
|
|
6176
|
-
switch (_context.prev = _context.next) {
|
|
6177
|
-
case 0:
|
|
6178
|
-
_context.next = 2;
|
|
6179
|
-
return checkInsureCalculateIn(urlParams, postParams, planParams);
|
|
6180
|
-
|
|
6181
|
-
case 2:
|
|
6182
|
-
res = _context.sent;
|
|
6183
|
-
|
|
6184
|
-
if (!(postParams && !postParams.current_data)) {
|
|
6185
|
-
_context.next = 15;
|
|
6186
|
-
break;
|
|
6260
|
+
var valRange_1 = eleRestricts && eleRestricts[0] && eleRestricts[0][eleData.key];
|
|
6261
|
+
if (valRange_1 && valRange_1.length) {
|
|
6262
|
+
if (eleData.opts) {
|
|
6263
|
+
eleData.opts.forEach(function (o) {
|
|
6264
|
+
if (!valRange_1.find(function (v) { return v.val === o.val; })) {
|
|
6265
|
+
o.isInvalid = true;
|
|
6266
|
+
}
|
|
6267
|
+
});
|
|
6268
|
+
if (!eleData.opts.find(function (opt) { return !opt.isHide && !opt.isDisabled && !opt.isInvalid && opt.val == eleData.value; })) {
|
|
6269
|
+
var opt = eleData.opts.find(function (o) { return o.val == eleData.value; });
|
|
6270
|
+
errorMsg = "\u5F53\u524D\u6761\u4EF6\u4E0B, \u6CA1\u6709" + eleData.labelName + (opt ? opt.desc : '') + "\u9009\u9879, \u5DF2\u81EA\u52A8\u5207\u6362";
|
|
6271
|
+
}
|
|
6187
6272
|
}
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
case 12:
|
|
6202
|
-
_context.prev = 12;
|
|
6203
|
-
_context.t0 = _context["catch"](6);
|
|
6204
|
-
res = _context.t0;
|
|
6205
|
-
|
|
6206
|
-
case 15:
|
|
6207
|
-
if (!(res && res.code === 200)) {
|
|
6208
|
-
_context.next = 19;
|
|
6209
|
-
break;
|
|
6273
|
+
else if (valRange_1[0] || valRange_1[1]) {
|
|
6274
|
+
var rangeMsg = "\u5F53\u524D\u6761\u4EF6\u4E0B, " + insData.name + "\u7684" + eleData.labelName + "\u503C";
|
|
6275
|
+
var minMsg = "\u4E0D\u5F97\u5C0F\u4E8E" + Object(_common__WEBPACK_IMPORTED_MODULE_1__[/* converUnit10000 */ "b"])(valRange_1[0]);
|
|
6276
|
+
var maxMsg = "\u4E0D\u5F97\u5927\u4E8E" + Object(_common__WEBPACK_IMPORTED_MODULE_1__[/* converUnit10000 */ "b"])(valRange_1[1]);
|
|
6277
|
+
if (valRange_1[0] && valRange_1[1] && (eleData.value < valRange_1[0] || eleData.value > valRange_1[1])) {
|
|
6278
|
+
errorMsg = "" + rangeMsg + minMsg + "\u4E14" + maxMsg;
|
|
6279
|
+
}
|
|
6280
|
+
else if (valRange_1[0] && eleData.value < valRange_1[0]) {
|
|
6281
|
+
errorMsg = "" + rangeMsg + minMsg;
|
|
6282
|
+
}
|
|
6283
|
+
else if (valRange_1[1] && eleData.value > valRange_1[1]) {
|
|
6284
|
+
errorMsg = "" + rangeMsg + maxMsg;
|
|
6285
|
+
}
|
|
6210
6286
|
}
|
|
6211
|
-
|
|
6212
|
-
return _context.abrupt("return", res);
|
|
6213
|
-
|
|
6214
|
-
case 19:
|
|
6215
|
-
return _context.abrupt("return", Promise.reject(res));
|
|
6216
|
-
|
|
6217
|
-
case 20:
|
|
6218
|
-
case "end":
|
|
6219
|
-
return _context.stop();
|
|
6220
6287
|
}
|
|
6221
|
-
}
|
|
6222
|
-
}, _callee, null, [[6, 12]]);
|
|
6223
|
-
}));
|
|
6224
|
-
return _checkInsureCalculate.apply(this, arguments);
|
|
6225
|
-
}
|
|
6226
|
-
|
|
6227
|
-
function checkInsureCalculateIn(urlParams, postParams, planParams) {
|
|
6228
|
-
if (!postParams || typeof_default()(postParams) !== 'object' || !postParams.product_id) {
|
|
6229
|
-
return Promise.reject({
|
|
6230
|
-
code: 400,
|
|
6231
|
-
msg: 'postParams参数非法'
|
|
6232
|
-
});
|
|
6233
|
-
}
|
|
6234
|
-
|
|
6235
|
-
if (postParams && !postParams.scenario) {
|
|
6236
|
-
postParams.scenario = 'h5Widget';
|
|
6237
|
-
}
|
|
6238
|
-
|
|
6239
|
-
var url = '/api/product/data/calculate';
|
|
6240
|
-
|
|
6241
|
-
if (urlParams && urlParams.uuid) {
|
|
6242
|
-
url += "?userUuid=".concat(urlParams.uuid);
|
|
6243
|
-
} else if (urlParams && urlParams.openId) {
|
|
6244
|
-
url += "?userUuid=".concat(urlParams.openId);
|
|
6245
|
-
}
|
|
6246
|
-
|
|
6247
|
-
if (urlParams && urlParams.appid) {
|
|
6248
|
-
if (url.indexOf('?') > -1) {
|
|
6249
|
-
url += "&appId=".concat(urlParams.appid);
|
|
6250
|
-
} else {
|
|
6251
|
-
url += "?appId=".concat(urlParams.appid);
|
|
6252
6288
|
}
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
if (hasPlanParams(planParams) && postParams.current_data) {
|
|
6256
|
-
postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
|
|
6257
|
-
}
|
|
6258
|
-
|
|
6259
|
-
return new Promise(function (resolve, reject) {
|
|
6260
|
-
request({
|
|
6261
|
-
baseURL: baseURL,
|
|
6262
|
-
url: url,
|
|
6263
|
-
method: 'POST',
|
|
6264
|
-
urlParams: urlParams,
|
|
6265
|
-
data: postParams
|
|
6266
|
-
}).then(function (res) {
|
|
6267
|
-
if (res.code === 200) {
|
|
6268
|
-
// if (postParams && !postParams.current_data) {
|
|
6269
|
-
// let data = JSON.parse(JSON.stringify(res.data));
|
|
6270
|
-
// postParams.current_data = data.current_data
|
|
6271
|
-
// // 重新试算
|
|
6272
|
-
// checkInsureCalculate(urlParams, postParams, planParams)
|
|
6273
|
-
// }
|
|
6274
|
-
resolve({
|
|
6275
|
-
code: 200,
|
|
6276
|
-
data: res.data
|
|
6277
|
-
});
|
|
6278
|
-
} else {
|
|
6279
|
-
reject(res);
|
|
6280
|
-
}
|
|
6281
|
-
}).catch(function (err) {
|
|
6282
|
-
reject(err);
|
|
6283
|
-
});
|
|
6284
|
-
});
|
|
6289
|
+
return errorMsg;
|
|
6285
6290
|
}
|
|
6286
|
-
// CONCATENATED MODULE: ./packages/bxs-utils/trade/index.js
|
|
6287
|
-
|
|
6288
|
-
// CONCATENATED MODULE: ./packages/bxs-utils/index.ts
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
6291
|
|
|
6292
6292
|
|
|
6293
6293
|
/***/ }),
|
|
@@ -6598,6 +6598,7 @@ function initPersonData(inputData, verifyData) {
|
|
|
6598
6598
|
return;
|
|
6599
6599
|
}
|
|
6600
6600
|
person.createArchive = person.createArchive || false;
|
|
6601
|
+
person.cid = person.cid || null;
|
|
6601
6602
|
if (!person.eleOrderList.find(function (e) { return e.key === 'name'; })) {
|
|
6602
6603
|
person.eleOrderList.splice(1, 0, {
|
|
6603
6604
|
key: 'name',
|
|
@@ -6747,9 +6748,7 @@ function personDataHandler(allPersonsData) {
|
|
|
6747
6748
|
if (['title', 'applicantAndInsuredSame'].includes(ele.key)) {
|
|
6748
6749
|
return;
|
|
6749
6750
|
}
|
|
6750
|
-
|
|
6751
|
-
person.cid = applicantSame_1.value ? insuredData.cid : undefined;
|
|
6752
|
-
}
|
|
6751
|
+
person.cid = applicantSame_1.value ? insuredData.cid : person.cid;
|
|
6753
6752
|
if (applicantSame_1.value && insuredData.eleOrderList) {
|
|
6754
6753
|
var insuredEle = insuredData.eleOrderList.find(function (e) { return e.key === ele.key; });
|
|
6755
6754
|
if (insuredEle) {
|