Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
ShanghaiGongwei
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
宁路鹏
ShanghaiGongwei
Commits
e937af24
Commit
e937af24
authored
Nov 04, 2022
by
nlp97
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
0a2f4a0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
175 additions
and
259 deletions
+175
-259
src/components/page4.vue
+174
-258
src/lang/zh.js
+1
-1
No files found.
src/components/page4.vue
View file @
e937af24
<!--
* @Author: ninglupeng
* @Date: 2020-11-24 16:18:58
* @LastEditors:
wsq
* @LastEditTime: 2022-11-04 1
6:26:05
* @LastEditors:
ninglupeng
* @LastEditTime: 2022-11-04 1
7:04:04
* @Description:
-->
<
template
>
...
...
@@ -409,282 +409,198 @@ export default {
}
});
},
mounted
()
{
if
(
this
.
$i18n
.
locale
==
"zh"
)
{
this
.
getResource
();
}
else
{
//症状列表
this
.
symptomList
=
[
{
id
:
1
,
element
:
"يۇتقۇنچاق ئاغرىش"
,
sort
:
1
},
{
id
:
2
,
element
:
"بۇرنى پۈتۈپ قىلىش"
,
sort
:
2
},
{
id
:
3
,
element
:
"قىزىتماق"
,
sort
:
3
},
{
id
:
5
,
element
:
"يۆتەل"
,
sort
:
5
},
{
id
:
6
,
element
:
"بەلغەم يۆتەل"
,
sort
:
6
},
{
id
:
7
,
element
:
"بېشى قايماق"
,
sort
:
7
},
{
id
:
8
,
element
:
"باش ئاغرىقى"
,
sort
:
8
},
{
id
:
9
,
element
:
"مۇسكۇل ئاغرىش"
,
sort
:
9
},
{
id
:
10
,
element
:
"ماغدۇرسىزلىق"
,
sort
:
10
},
{
id
:
11
,
element
:
"نەپەس قىيىنلىشىش"
,
sort
:
11
},
{
id
:
12
,
element
:
"بۇرنىدىن سۇ ئېقىش"
,
sort
:
12
},
];
//国籍列表
this
.
nationalityList
=
[
"جۇڭگو"
,
"جۇڭگو شياڭگاڭ"
,
"جۇڭگو ئاۋمېن"
,
"جۇڭگو تەيۋەن"
,
"چەتئەل"
,
];
//医保类型列表
this
.
typeOfMedicalInsuranceList
=
[
"شاڭخەي داۋالىنىش سۇغۇرتىسى"
,
"سىرتتىكى داۋالىنىش سۇغۇرتىسى"
,
"ئۆزى چىقىم قىلىش"
,
];
//职业列表
this
.
occupationList
=
[
"خىزمەتچى"
,
"ئىشچى"
,
"مەمۇرى خادىم"
,
"دېھقان"
,
"دېھقان"
,
"ھەربىي سەپتىن چېكىنگەن"
,
"باشقا خىزمەت"
,
];
}
this
.
setLastValue
();
getLocalStorge
(
key
)
{
return
window
.
localStorage
.
getItem
(
key
);
},
methods
:
{
setLastValue
()
{
if
(
this
.
getLocalStorge
(
"symptom"
))
{
this
.
symptom
=
this
.
getLocalStorge
(
"symptom"
).
split
(
","
);
}
let
arr
=
[
"patientName"
,
//患者姓名
"nationality"
,
//国籍
"passportId"
,
//护照号
"HasSymptom"
,
//是否有症状
"otherSymptom"
,
//其他症状
"otherOccupation"
,
//其他职业
"age"
,
//年龄
"gender"
,
//性别
"height"
,
//身高
"weight"
,
//体重
"maritalStatus"
,
//婚姻状况
"birthday"
,
//出生日期
"isConceive"
,
//怀孕状况
"gestationalWeeks"
,
//怀孕周期
"occupation"
,
//职业
"contactInformation"
,
//联系方式
"FamilyMembersPhone"
,
//家属联系方式
"Registeredresidence"
,
//籍贯 (包括省市)
"province"
,
//籍贯 (省)
"city"
,
//籍贯 (市)
"address"
,
//地址
"idCard"
,
//身份证号
"typeOfMedicalInsurance"
,
//医保类型
"insurance"
,
//商业保险
];
arr
.
map
((
item
)
=>
{
if
(
this
.
getLocalStorge
(
item
))
{
this
[
`
${
item
}
`
]
=
this
.
getLocalStorge
(
item
);
}
});
},
getLocalStorge
(
key
)
{
return
window
.
localStorage
.
getItem
(
key
);
},
setLocalStorge
(
key
)
{
window
.
localStorage
.
setItem
(
key
,
this
[
`
${
key
}
`
]);
},
setValue
(
key
,
value
)
{
window
.
localStorage
.
setItem
(
key
,
value
);
},
onConfirm
(
values
)
{
console
.
log
(
values
);
this
.
Registeredresidence
=
values
.
filter
((
item
)
=>
!!
item
)
.
map
((
item
)
=>
item
.
name
)
.
join
(
"/"
);
setLocalStorge
(
key
)
{
window
.
localStorage
.
setItem
(
key
,
this
[
`
${
key
}
`
]);
},
setValue
(
key
,
value
)
{
window
.
localStorage
.
setItem
(
key
,
value
);
},
onConfirm
(
values
)
{
console
.
log
(
values
);
this
.
Registeredresidence
=
values
.
filter
((
item
)
=>
!!
item
)
.
map
((
item
)
=>
item
.
name
)
.
join
(
"/"
);
this
.
province
=
values
[
0
].
name
;
this
.
city
=
values
[
1
].
name
;
this
.
province
=
values
[
0
].
name
;
this
.
city
=
values
[
1
].
name
;
this
.
setLocalStorge
(
"Registeredresidence"
);
this
.
setLocalStorge
(
"province"
);
this
.
setLocalStorge
(
"city"
);
this
.
setLocalStorge
(
"Registeredresidence"
);
this
.
setLocalStorge
(
"province"
);
this
.
setLocalStorge
(
"city"
);
this
.
showArea
=
false
;
},
this
.
showArea
=
false
;
},
validator
(
val
)
{
const
card15
=
/^
[
1-9
]\d{5}\d{2}((
0
[
1-9
])
|
(
10|11|12
))(([
0-2
][
1-9
])
|10|20|30|31
)\d{2}[
0-9Xx
]
$/
;
const
card18
=
/^
[
1-9
]\d{5}(
18|19|
([
23
]\d))\d{2}((
0
[
1-9
])
|
(
10|11|12
))(([
0-2
][
1-9
])
|10|20|30|31
)\d{3}[
0-9Xx
]
$/
;
return
card15
.
test
(
val
)
||
card18
.
test
(
val
);
},
validator
(
val
)
{
const
card15
=
/^
[
1-9
]\d{5}\d{2}((
0
[
1-9
])
|
(
10|11|12
))(([
0-2
][
1-9
])
|10|20|30|31
)\d{2}[
0-9Xx
]
$/
;
const
card18
=
/^
[
1-9
]\d{5}(
18|19|
([
23
]\d))\d{2}((
0
[
1-9
])
|
(
10|11|12
))(([
0-2
][
1-9
])
|10|20|30|31
)\d{3}[
0-9Xx
]
$/
;
return
card15
.
test
(
val
)
||
card18
.
test
(
val
);
},
getResource
()
{
this
.
setLoading
(
true
);
this
.
$http
.
get
(
`/Research/Resource`
,
{}).
then
((
data
)
=>
{
let
arr
=
data
.
filter
((
item
)
=>
{
return
item
.
category
==
"国籍"
;
});
getResource
()
{
this
.
setLoading
(
true
);
this
.
$http
.
get
(
`/Research/Resource`
,
{}).
then
((
data
)
=>
{
let
arr
=
data
.
filter
((
item
)
=>
{
return
item
.
category
==
"国籍"
;
});
let
arr1
=
data
.
filter
((
item
)
=>
{
return
item
.
category
==
"医保类型"
;
});
let
arr2
=
data
.
filter
((
item
)
=>
{
return
item
.
category
==
"职业"
;
});
this
.
symptomList
=
data
.
filter
((
item
)
=>
{
return
item
.
category
==
"症状"
;
});
//国籍列表
this
.
nationalityList
=
arr
.
map
((
item
)
=>
{
return
item
.
element
;
});
//医保类型列表
this
.
typeOfMedicalInsuranceList
=
arr1
.
map
((
item
)
=>
{
return
item
.
element
;
});
//职业列表
this
.
occupationList
=
arr2
.
map
((
item
)
=>
{
return
item
.
element
;
});
this
.
setLoading
(
false
);
let
arr1
=
data
.
filter
((
item
)
=>
{
return
item
.
category
==
"医保类型"
;
});
let
arr2
=
data
.
filter
((
item
)
=>
{
return
item
.
category
==
"职业"
;
});
this
.
symptomList
=
data
.
filter
((
item
)
=>
{
return
item
.
category
==
"症状"
;
});
//国籍列表
this
.
nationalityList
=
arr
.
map
((
item
)
=>
{
return
item
.
element
;
});
//医保类型列表
this
.
typeOfMedicalInsuranceList
=
arr1
.
map
((
item
)
=>
{
return
item
.
element
;
});
//职业列表
this
.
occupationList
=
arr2
.
map
((
item
)
=>
{
return
item
.
element
;
});
},
getdate
()
{
let
obj
=
this
.
getInfo
(
this
.
idCard
);
this
.
setLoading
(
false
);
});
},
if
(
this
.
validator
(
this
.
idCard
))
{
this
.
age
=
obj
.
age
;
this
.
birthday
=
obj
.
birth
;
this
.
gender
=
obj
.
sex
==
1
?
"男"
:
"女"
;
getdate
()
{
let
obj
=
this
.
getInfo
(
this
.
idCard
);
this
.
setLocalStorge
(
"idCard"
);
this
.
setLocalStorge
(
"birthday"
);
this
.
setLocalStorge
(
"age"
);
this
.
setLocalStorge
(
"gender"
);
}
},
if
(
this
.
validator
(
this
.
idCard
))
{
this
.
age
=
obj
.
age
;
this
.
birthday
=
obj
.
birth
;
this
.
gender
=
obj
.
sex
==
1
?
"男"
:
"女"
;
//根据身份证号码获取出生年月 年龄 性别
getInfo
(
idCard
)
{
let
sex
=
null
;
let
birth
=
null
;
let
myDate
=
new
Date
();
let
month
=
myDate
.
getMonth
()
+
1
;
let
day
=
myDate
.
getDate
();
let
age
=
0
;
if
(
idCard
.
length
===
18
)
{
age
=
myDate
.
getFullYear
()
-
idCard
.
substring
(
6
,
10
)
-
1
;
sex
=
idCard
.
substring
(
16
,
17
);
birth
=
idCard
.
substring
(
6
,
10
)
+
"-"
+
idCard
.
substring
(
10
,
12
)
+
"-"
+
idCard
.
substring
(
12
,
14
);
if
(
idCard
.
substring
(
10
,
12
)
<
month
||
(
idCard
.
substring
(
10
,
12
)
===
month
&&
idCard
.
substring
(
12
,
14
)
<=
day
)
)
age
++
;
}
if
(
idCard
.
length
===
15
)
{
age
=
myDate
.
getFullYear
()
-
idCard
.
substring
(
6
,
8
)
-
1901
;
sex
=
idCard
.
substring
(
13
,
14
);
birth
=
"19"
+
idCard
.
substring
(
6
,
8
)
+
"-"
+
idCard
.
substring
(
8
,
10
)
+
"-"
+
idCard
.
substring
(
10
,
12
);
if
(
idCard
.
substring
(
8
,
10
)
<
month
||
(
idCard
.
substring
(
8
,
10
)
===
month
&&
idCard
.
substring
(
10
,
12
)
<=
day
)
)
age
++
;
}
this
.
setLocalStorge
(
"idCard"
);
this
.
setLocalStorge
(
"birthday"
);
this
.
setLocalStorge
(
"age"
);
this
.
setLocalStorge
(
"gender"
);
}
},
if
(
sex
%
2
===
0
)
sex
=
0
;
// 性别代码 1代表男,0代表女,暂时不涉及其他类型性别
else
sex
=
1
;
return
{
age
,
sex
,
birth
,
};
},
//根据身份证号码获取出生年月 年龄 性别
getInfo
(
idCard
)
{
let
sex
=
null
;
let
birth
=
null
;
let
myDate
=
new
Date
();
let
month
=
myDate
.
getMonth
()
+
1
;
let
day
=
myDate
.
getDate
();
let
age
=
0
;
if
(
idCard
.
length
===
18
)
{
age
=
myDate
.
getFullYear
()
-
idCard
.
substring
(
6
,
10
)
-
1
;
sex
=
idCard
.
substring
(
16
,
17
);
birth
=
idCard
.
substring
(
6
,
10
)
+
"-"
+
idCard
.
substring
(
10
,
12
)
+
"-"
+
idCard
.
substring
(
12
,
14
);
if
(
idCard
.
substring
(
10
,
12
)
<
month
||
(
idCard
.
substring
(
10
,
12
)
===
month
&&
idCard
.
substring
(
12
,
14
)
<=
day
)
)
age
++
;
}
if
(
idCard
.
length
===
15
)
{
age
=
myDate
.
getFullYear
()
-
idCard
.
substring
(
6
,
8
)
-
1901
;
sex
=
idCard
.
substring
(
13
,
14
);
birth
=
"19"
+
idCard
.
substring
(
6
,
8
)
+
"-"
+
idCard
.
substring
(
8
,
10
)
+
"-"
+
idCard
.
substring
(
10
,
12
);
if
(
idCard
.
substring
(
8
,
10
)
<
month
||
(
idCard
.
substring
(
8
,
10
)
===
month
&&
idCard
.
substring
(
10
,
12
)
<=
day
)
)
age
++
;
}
onbirthday
(
date
)
{
this
.
birthday
=
formatDate
(
date
,
"yyyy-MM-dd "
);
console
.
log
(
"🚀 ~ file: page4.vue ~ line 630 ~ onbirthday ~ this.birthday"
,
this
.
birthday
);
if
(
sex
%
2
===
0
)
sex
=
0
;
// 性别代码 1代表男,0代表女,暂时不涉及其他类型性别
else
sex
=
1
;
return
{
age
,
sex
,
birth
,
};
},
this
.
setLocalStorge
(
"birthday"
);
// this.getdate();
this
.
age
=
this
.
ages
(
formatDate
(
date
,
"yyyy-MM-dd "
));
this
.
showbirthday
=
false
;
},
onbirthday
(
date
)
{
this
.
birthday
=
formatDate
(
date
,
"yyyy-MM-dd "
);
console
.
log
(
"🚀 ~ file: page4.vue ~ line 630 ~ onbirthday ~ this.birthday"
,
this
.
birthday
);
this
.
setLocalStorge
(
"birthday"
);
// this.getdate();
this
.
age
=
this
.
ages
(
formatDate
(
date
,
"yyyy-MM-dd "
));
this
.
showbirthday
=
false
;
},
ages
(
birth
)
{
birth
=
birth
.
replace
(
/-/g
,
"/"
);
//把格式中的"-"替换为"/"
birth
=
new
Date
(
birth
);
//替换后转为Date类型
var
now
=
new
Date
();
//获取当前日期
var
nowYear
=
now
.
getFullYear
();
//当前日期的年份
var
nowMonth
=
now
.
getMonth
();
var
nowDay
=
now
.
getDay
();
var
birthYear
=
birth
.
getFullYear
();
var
birthMonth
=
birth
.
getMonth
();
var
birthDay
=
birth
.
getDay
();
//出生日期的日数
var
age
;
if
(
birth
>
now
)
{
return
false
;
}
else
if
(
nowYear
==
birthYear
||
(
nowYear
>
birthYear
&&
nowMonth
>=
birthMonth
&&
nowDay
>=
birthDay
)
)
{
age
=
nowYear
-
birthYear
;
}
else
{
age
=
nowYear
-
birthYear
-
1
;
//简而言之,没过生日岁数不能+1
}
return
age
;
},
ages
(
birth
)
{
birth
=
birth
.
replace
(
/-/g
,
"/"
);
//把格式中的"-"替换为"/"
birth
=
new
Date
(
birth
);
//替换后转为Date类型
var
now
=
new
Date
();
//获取当前日期
var
nowYear
=
now
.
getFullYear
();
//当前日期的年份
var
nowMonth
=
now
.
getMonth
();
var
nowDay
=
now
.
getDay
();
var
birthYear
=
birth
.
getFullYear
();
var
birthMonth
=
birth
.
getMonth
();
var
birthDay
=
birth
.
getDay
();
//出生日期的日数
var
age
;
if
(
birth
>
now
)
{
return
false
;
}
else
if
(
nowYear
==
birthYear
||
(
nowYear
>
birthYear
&&
nowMonth
>=
birthMonth
&&
nowDay
>=
birthDay
)
)
{
age
=
nowYear
-
birthYear
;
}
else
{
age
=
nowYear
-
birthYear
-
1
;
//简而言之,没过生日岁数不能+1
}
return
age
;
},
formatter
(
type
,
val
)
{
if
(
type
===
"year"
)
{
return
`
${
val
}
年`
;
}
if
(
type
===
"month"
)
{
return
`
${
val
}
月`
;
}
else
if
(
type
===
"day"
)
{
return
`
${
val
}
日`
;
}
else
if
(
type
===
"hour"
)
{
return
`
${
val
}
时`
;
}
else
if
(
type
===
"minute"
)
{
return
`
${
val
}
分`
;
}
return
val
;
},
formatter
(
type
,
val
)
{
if
(
type
===
"year"
)
{
return
`
${
val
}
年`
;
}
if
(
type
===
"month"
)
{
return
`
${
val
}
月`
;
}
else
if
(
type
===
"day"
)
{
return
`
${
val
}
日`
;
}
else
if
(
type
===
"hour"
)
{
return
`
${
val
}
时`
;
}
else
if
(
type
===
"minute"
)
{
return
`
${
val
}
分`
;
}
return
val
;
},
computed
:
{},
};
},
computed
:
{},
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/lang/zh.js
View file @
e937af24
...
...
@@ -2,7 +2,7 @@
* @Author: ninglupeng
* @Date: 2022-10-31 14:22:35
* @LastEditors: ninglupeng
* @LastEditTime: 2022-11-04 16:
41:00
* @LastEditTime: 2022-11-04 16:
59:35
* @Description:
*/
module
.
exports
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment