biz.js
11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
let nationsList = [
{ "v": "10", "n": "HONG KONG,CHINA" },
{ "v": "28", "n": "CHINA" },
{ "v": "401", "n": "AFGHANISTAN" },
{ "v": "403", "n": "ALBANIA" },
{ "v": "405", "n": "ALGERIA" },
{ "v": "407", "n": "AMERICAN SAMOA" },
{ "v": "409", "n": "ANDORRA" },
{ "v": "411", "n": "ANGOLA" },
{ "v": "413", "n": "ANGUILLA" },
{ "v": "415", "n": "ANTARCTICA" },
{ "v": "417", "n": "ANTIGUA AND BARBUDA" },
{ "v": "419", "n": "ARGENTINA" },
{ "v": "421", "n": "ARMENIA" },
{ "v": "423", "n": "ARUBA" },
{ "v": "425", "n": "AUSTRALIA" },
{ "v": "427", "n": "AUSTRIA" },
{ "v": "429", "n": "AZERBAIJAN" },
{ "v": "431", "n": "BAHAMAS" },
{ "v": "433", "n": "BAHRAIN" },
{ "v": "435", "n": "BANGLADESH" },
{ "v": "437", "n": "BARBADOS" },
{ "v": "439", "n": "BELARUS" },
{ "v": "441", "n": "BELGIUM" },
{ "v": "443", "n": "BELIZE" },
{ "v": "445", "n": "BENIN" },
{ "v": "447", "n": "BERMUDA" },
{ "v": "449", "n": "BHUTAN" },
{ "v": "451", "n": "BOLIVIA" },
{ "v": "453", "n": "BOSNIA AND HERZEGOVINA" },
{ "v": "455", "n": "BOTSWANA" },
{ "v": "457", "n": "BOUVET ISLAND" },
{ "v": "459", "n": "BRAZIL" },
{ "v": "461", "n": "BRUNEI DARUSSALAM" },
{ "v": "463", "n": "BULGARIA" },
{ "v": "465", "n": "BURKINA FASO" },
{ "v": "467", "n": "BURUNDI" },
{ "v": "469", "n": "CAMBODIA" },
{ "v": "471", "n": "CAMEROON" },
{ "v": "473", "n": "CANADA" },
{ "v": "475", "n": "CAPE VERDE" },
{ "v": "477", "n": "CAYMAN ISLANDS" },
{ "v": "479", "n": "CENTRAL AFRICAN REPUBLIC" },
{ "v": "481", "n": "CHAD" },
{ "v": "483", "n": "CHILE" },
{ "v": "485", "n": "CHRISTMAS ISLAND" },
{ "v": "487", "n": "COCOS (KEELING) ISLANDS" },
{ "v": "489", "n": "COLOMBIA" },
{ "v": "491", "n": "COMOROS" },
{ "v": "493", "n": "CONGO, REPUBLIC OF" },
{ "v": "495", "n": "COOK ISLANDS" },
{ "v": "497", "n": "COSTA RICA" },
{ "v": "499", "n": "COTE D'IVOIRE" },
{ "v": "501", "n": "CROATIA" },
{ "v": "503", "n": "CUBA" },
{ "v": "505", "n": "CYPRUS" },
{ "v": "507", "n": "CZECH REPUBLIC" },
{ "v": "509", "n": "DENMARK" },
{ "v": "511", "n": "DJIBOUTI" },
{ "v": "513", "n": "DOMINICA" },
{ "v": "515", "n": "EAST TIMOR" },
{ "v": "517", "n": "ECUADOR" },
{ "v": "519", "n": "EGYPT" },
{ "v": "521", "n": "EL SALVADOR" },
{ "v": "523", "n": "EQUATORIAL GUINEA" },
{ "v": "525", "n": "ERITREA" },
{ "v": "527", "n": "ESTONIA" },
{ "v": "529", "n": "ETHIOPIA" },
{ "v": "531", "n": "FALKLAND ISLANDS" },
{ "v": "533", "n": "FAROE ISLANDS" },
{ "v": "535", "n": "FIJI" },
{ "v": "537", "n": "FINLAND" },
{ "v": "539", "n": "FRANCE" },
{ "v": "541", "n": "GABON" },
{ "v": "543", "n": "GAMBIA" },
{ "v": "545", "n": "GEORGIA" },
{ "v": "547", "n": "GERMANY" },
{ "v": "549", "n": "GHANA" },
{ "v": "551", "n": "GIBRALTAR" },
{ "v": "553", "n": "GREECE" },
{ "v": "555", "n": "GREENLAND" },
{ "v": "557", "n": "GRENADA" },
{ "v": "559", "n": "GUADELOUPE" },
{ "v": "561", "n": "GUAM" },
{ "v": "563", "n": "GUATEMALA" },
{ "v": "565", "n": "GUINEA" },
{ "v": "567", "n": "GUINEA-BISSAU" },
{ "v": "569", "n": "GUYANA" },
{ "v": "571", "n": "HAITI" },
{ "v": "573", "n": "HEARD AND MC DONALD ISLANDS" },
{ "v": "575", "n": "HOLY SEE (VATICAN CITY STATE)" },
{ "v": "577", "n": "HONDURAS" },
{ "v": "579", "n": "HUNGARY" },
{ "v": "581", "n": "ICELAND" },
{ "v": "583", "n": "INDIA" },
{ "v": "585", "n": "INDONESIA" },
{ "v": "587", "n": "IRAN" },
{ "v": "589", "n": "IRAQ" },
{ "v": "591", "n": "IRELAND" },
{ "v": "593", "n": "ISRAEL" },
{ "v": "595", "n": "ITALY" },
{ "v": "597", "n": "JAMAICA" },
{ "v": "599", "n": "JAPAN" },
{ "v": "601", "n": "JORDAN" },
{ "v": "603", "n": "KAZAKHSTAN" },
{ "v": "605", "n": "KENYA" },
{ "v": "607", "n": "KIRIBATI" },
{ "v": "609", "n": "KOSOVO" },
{ "v": "611", "n": "KUWAIT" },
{ "v": "613", "n": "KYRGYZSTAN" },
{ "v": "615", "n": "LAOS" },
{ "v": "617", "n": "LATVIA" },
{ "v": "619", "n": "LEBANON" },
{ "v": "621", "n": "LESOTHO" },
{ "v": "623", "n": "LIBERIA" },
{ "v": "625", "n": "LIBYAN ARAB JAMAHIRIYA" },
{ "v": "627", "n": "LIECHTENSTEIN" },
{ "v": "629", "n": "LITHUANIA" },
{ "v": "631", "n": "LUXEMBOURG" },
{ "v": "633", "n": "MADAGASCAR" },
{ "v": "635", "n": "MALAWI" },
{ "v": "637", "n": "MALAYSIA" },
{ "v": "639", "n": "MALDIVES" },
{ "v": "641", "n": "MALI" },
{ "v": "643", "n": "MALTA" },
{ "v": "645", "n": "MARSHALL ISLANDS" },
{ "v": "647", "n": "MARTINIQUE" },
{ "v": "649", "n": "MAURITANIA" },
{ "v": "651", "n": "MAURITIUS" },
{ "v": "653", "n": "MAYOTTE" },
{ "v": "655", "n": "MEXICO" },
{ "v": "657", "n": "MICRONESIA" },
{ "v": "659", "n": "MONACO" },
{ "v": "661", "n": "MONGOLIA" },
{ "v": "663", "n": "MONTENEGRO" },
{ "v": "665", "n": "MONTSERRAT" },
{ "v": "667", "n": "MOROCCO" },
{ "v": "669", "n": "MOZAMBIQUE" },
{ "v": "671", "n": "MYANMAR" },
{ "v": "673", "n": "NAMIBIA" },
{ "v": "675", "n": "NAURU" },
{ "v": "677", "n": "NEPAL" },
{ "v": "679", "n": "NETHERLANDS" },
{ "v": "681", "n": "NEW CALEDONIA" },
{ "v": "683", "n": "NEW ZEALAND" },
{ "v": "685", "n": "NICARAGUA" },
{ "v": "687", "n": "NIGER" },
{ "v": "689", "n": "NIGERIA" },
{ "v": "691", "n": "NIUE" },
{ "v": "693", "n": "NORFOLK ISLAND" },
{ "v": "695", "n": "NORTH KOREA" },
{ "v": "697", "n": "NORTHERN MARIANA ISLANDS" },
{ "v": "699", "n": "NORWAY" },
{ "v": "701", "n": "OMAN" },
{ "v": "703", "n": "PAKISTAN" },
{ "v": "705", "n": "PALAU" },
{ "v": "707", "n": "PALESTINE" },
{ "v": "709", "n": "PANAMA" },
{ "v": "711", "n": "PAPUA NEW GUINEA" },
{ "v": "713", "n": "PARAGUAY" },
{ "v": "715", "n": "PERU" },
{ "v": "717", "n": "PHILIPPINES" },
{ "v": "719", "n": "PITCAIRN" },
{ "v": "721", "n": "POLAND" },
{ "v": "723", "n": "PORTUGAL" },
{ "v": "725", "n": "PUERTO RICO" },
{ "v": "727", "n": "QATAR" },
{ "v": "729", "n": "REPUBLIC OF MACEDONI" },
{ "v": "731", "n": "REPUBLIC OF MOLDOVA" },
{ "v": "733", "n": "REUNION" },
{ "v": "735", "n": "ROMANIA" },
{ "v": "737", "n": "RUSSIA" },
{ "v": "739", "n": "RWANDA" },
{ "v": "741", "n": "SAINT KITTS AND NEVIS" },
{ "v": "743", "n": "SAINT LUCIA" },
{ "v": "745", "n": "SAINT VINCENT AND THE GRENADINES" },
{ "v": "747", "n": "SAMOA" },
{ "v": "749", "n": "SAN MARINO" },
{ "v": "751", "n": "SAO TOME AND PRINCIPE" },
{ "v": "753", "n": "SAUDI ARABIA" },
{ "v": "755", "n": "SENEGAL" },
{ "v": "757", "n": "SERBIA" },
{ "v": "759", "n": "SERBIA AND MONTENEGRO" },
{ "v": "761", "n": "SEYCHELLES" },
{ "v": "763", "n": "SIERRA LEONE" },
{ "v": "765", "n": "SINGAPORE" },
{ "v": "767", "n": "SLOVAKIA" },
{ "v": "769", "n": "SLOVENIA" },
{ "v": "771", "n": "SOLOMON ISLANDS" },
{ "v": "773", "n": "SOMALIA" },
{ "v": "775", "n": "SOUTH AFRICA" },
{ "v": "777", "n": "SOUTH GEORGIA AND THE SOUTH SANDWICH ISL" },
{ "v": "779", "n": "SOUTH KOREA" },
{ "v": "781", "n": "SOUTH YEMEN" },
{ "v": "783", "n": "SPAIN" },
{ "v": "785", "n": "SRI LANKA" },
{ "v": "787", "n": "ST. HELENA" },
{ "v": "789", "n": "ST. PIERRE AND MIQUELON" },
{ "v": "791", "n": "STATELESS" },
{ "v": "793", "n": "SUDAN" },
{ "v": "795", "n": "SURINAME" },
{ "v": "797", "n": "SVALBARD AND JAN MAYEN ISLANDS" },
{ "v": "799", "n": "SWAZILAND" },
{ "v": "801", "n": "SWEDEN" },
{ "v": "803", "n": "SWITZERLAND" },
{ "v": "805", "n": "SYRIAN ARAB REPUBLIC" },
{ "v": "807", "n": "TAIWAN,CHINA" },
{ "v": "809", "n": "TAJIKISTAN" },
{ "v": "811", "n": "THAILAND" },
{ "v": "813", "n": "TIMOR-LESTE" },
{ "v": "815", "n": "TOGO" },
{ "v": "817", "n": "TOKELAU" },
{ "v": "819", "n": "TONGA" },
{ "v": "821", "n": "TRINIDAD AND TOBAGO" },
{ "v": "823", "n": "TUNISIA" },
{ "v": "825", "n": "TURKEY" },
{ "v": "827", "n": "TURKMENISTAN" },
{ "v": "829", "n": "TURKS AND CAICOS ISLANDS" },
{ "v": "831", "n": "TUVALU" },
{ "v": "833", "n": "UGANDA" },
{ "v": "835", "n": "UKRAINE" },
{ "v": "837", "n": "UNITED ARAB EMIRATES" },
{ "v": "839", "n": "UNITED KINGDOM" },
{ "v": "841", "n": "UNITED REPUBLIC OF TANZANIA" },
{ "v": "843", "n": "UPPER VOLTA" },
{ "v": "845", "n": "URUGUAY" },
{ "v": "847", "n": "UZBEKISTAN" },
{ "v": "849", "n": "VANUATU" },
{ "v": "851", "n": "VENEZUELA" },
{ "v": "853", "n": "VIETNAM" },
{ "v": "855", "n": "VIRGIN ISLANDS" },
{ "v": "857", "n": "WALLIS AND FUTUNA ISLANDS" },
{ "v": "859", "n": "WESTERN SAHARA" },
{ "v": "861", "n": "YEMEN" },
{ "v": "863", "n": "YUGOSLAVIA" },
{ "v": "865", "n": "ZAIRE" },
{ "v": "867", "n": "ZAMBIA" },
{ "v": "869", "n": "ZIMBABWE" },
{ "v": "119", "n": "MACAU,CHINA" },
{ "v": "225", "n": "UNITED STATES" },
{ "v": "494", "n": "CONGO, DEMOCRATIC REP" },
{ "v": "906", "n": "REPUBLIC OF SOUTH SUDAN" }
]
let marryList = [
{ "v": "1", "n": "已婚" },
{ "v": "2", "n": "未婚" },
{ "v": "5", "n": "其他" }
];
let policyIdTypeList = [
{ "v": "1", "n": "身份证(旧)" },
{ "v": "36", "n": "身份证(新)" },
{ "v": "33", "n": "香港身份证" },
{ "v": "40", "n": "护照" },
{ "v": "9", "n": "其他" },
];
/**
*
* @param {string} lan 语言
*/
export function gotoVHIS(lan) {
let url = process.env.VUE_APP_VHIS_INDEX;
switch (lan) {
case 'zh':
url += "?language=zh-cn";
break;
case 'en':
url += "?language=en";
break;
default:
url += "?language=zh-hk";
break;
}
url += "&partnerId=PA001&productCode=VHIS001";
window.location.href = url;
}
export function getDateYMD(timestamp) {
let day = new Date(timestamp);
let y = day.getFullYear();
let m = day.getMonth() + 1;
let d = day.getDate();
let s = y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
return s;
}
/**
*
* @param {string} s 金额
* @param {int} type 是否需要小数点;1=需要;0=不需要
*/
export function formatMoney(s, type) {
if (/[^0-9\.]/.test(s))
return "0.00";
if (s == null || s == "null" || s == "")
return "0.00";
s = s.toString().replace(/^(\d*)$/, "$1.");
s = (s + "00").replace(/(\d*\.\d\d)\d*/, "$1");
s = s.replace(".", ",");
var re = /(\d)(\d{3},)/;
while (re.test(s))
s = s.replace(re, "$1,$2");
s = s.replace(/,(\d\d)$/, ".$1");
if (type == 0) {
var a = s.split(".");
if (a[1] == "00") {
s = a[0];
}
}
return s;
}
export function getNationsList() {
return nationsList;
};
export function getMarryList() {
return marryList;
};
export function getPolicyIdTypeList() {
return policyIdTypeList;
}
export function getNationsByCode(code) {
let n = "";
nationsList.forEach(element => {
if (element.v == code) {
n = element.n;
}
});
return n;
}