Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
3241777b
提交
3241777b
编写于
5月 20, 2019
作者:
yi.li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
居民详情编辑
上级
0092d20a
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
53 行增加
和
17 行删除
+53
-17
edit-information.vue
...atients/mypatients-manage/components/edit-information.vue
+53
-17
未找到文件。
src/views/patients/mypatients-manage/components/edit-information.vue
浏览文件 @
3241777b
...
...
@@ -56,6 +56,7 @@
<el-select
v-model=
"labelIdList"
multiple
@
change=
"changeLabels"
placeholder=
"请选择居民分组"
>
<el-option
v-for=
"(item, index) in labelsList"
...
...
@@ -280,6 +281,7 @@
nickname
:
''
,
mobilePhone
:
''
,
diseases
:
[],
patientDiseases
:
[],
customLabels
:
[],
idNo
:
''
,
birthTime
:
''
,
...
...
@@ -336,6 +338,27 @@
}
// this.$refs['patientInfoForm'].clearValidate();
this
.
$forceUpdate
();
}
else
{
// 新增
this
.
patientInfoForm
=
{
nickname
:
''
,
mobilePhone
:
''
,
diseases
:
[],
patientDiseases
:
[],
customLabels
:
[],
idNo
:
''
,
birthTime
:
''
,
age
:
''
,
sex
:
null
,
permanentResidence
:
''
,
nationality
:
''
,
socialCard
:
''
,
fileLocator
:
''
,
isWechatBind
:
null
,
isRemind
:
null
,
wechatNickname
:
''
,
remark
:
''
,
}
}
}
,
checkForm
(
val
){
...
...
@@ -391,17 +414,27 @@
}
)
}
,
changeDiseases
(
val
)
{
// console.log('疾病选择',val)
let
newDiseaseList
=
[];
// this.patientInfoForm.diseases
val
.
forEach
((
valItem
)
=>
{
this
.
diseasesList
.
forEach
((
item2
)
=>
{
if
(
valItem
==
item
.
diseaseId
){
if
(
valItem
==
item
2
.
diseaseId
){
newDiseaseList
.
push
({
parentDiseaseId
:
item2
.
diseaseId
}
);
}
}
)
// console.log('item',valItem)
}
)
}
);
// this.patientInfoForm.diseases = newDiseaseList;
this
.
patientInfoForm
.
patientDiseases
=
newDiseaseList
;
}
,
changeLabels
(
val
){
let
newLabelsList
=
[];
val
.
forEach
((
valItem
)
=>
{
this
.
labelsList
.
forEach
((
item2
)
=>
{
if
(
valItem
==
item2
.
labelId
){
newLabelsList
.
push
(
item2
);
}
}
)
}
);
this
.
patientInfoForm
.
customLabels
=
newLabelsList
;
}
,
//提醒绑定
remindBind
()
{
...
...
@@ -415,6 +448,7 @@
}
).
then
(
data
=>
{
if
(
data
.
code
==
'000000'
)
{
this
.
$message
.
success
(
data
.
data
.
respMsg
);
this
.
$router
.
go
(
-
1
);
}
else
{
this
.
$message
.
error
(
data
.
message
);
}
...
...
@@ -423,14 +457,22 @@
saveInfoData
()
{
this
.
$refs
[
'patientInfoForm'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
console
.
log
(
'对象'
,
this
.
patientInfoForm
)
this
.
$emit
(
'addListenSave'
,{
status
:
true
,
patientInfoForm
:
this
.
patientInfoForm
patientInfoForm
:
{
...
this
.
patientInfoForm
,
birthTime
:
this
.
patientInfoForm
.
birthTime
?
`${this.patientInfoForm.birthTime
}
00:00:00`
:
''
,
}
}
)
}
else
{
this
.
$emit
(
'addListenSave'
,{
status
:
false
,
patientInfoForm
:
this
.
patientInfoForm
,
// patientInfoForm: this.patientInfoForm,
patientInfoForm
:
{
...
this
.
patientInfoForm
,
birthTime
:
this
.
patientInfoForm
.
birthTime
?
`${this.patientInfoForm.birthTime
}
00:00:00`
:
''
,
}
}
)
}
}
);
...
...
@@ -470,16 +512,10 @@
}
,
getAge
(
val
)
{
if
(
val
)
{
let
birthdays
=
new
Date
(
this
.
patientInfoForm
.
birthTime
.
replace
(
/-/g
,
"/"
));
// let birthdays = new Date(this.patientInfoForm.birthTime.replace(/-/g, "/"));
let
birthdays
=
new
Date
(
val
.
replace
(
/-/g
,
"/"
));
let
d
=
new
Date
();
let
age
=
d
.
getFullYear
()
-
birthdays
.
getFullYear
()
-
(
d
.
getMonth
()
<
birthdays
.
getMonth
()
||
(
d
.
getMonth
()
==
birthdays
.
getMonth
()
&&
d
.
getDate
()
<
birthdays
.
getDate
())
?
1
:
0
);
let
age
=
d
.
getFullYear
()
-
birthdays
.
getFullYear
()
-
(
d
.
getMonth
()
<
birthdays
.
getMonth
()
||
(
d
.
getMonth
()
==
birthdays
.
getMonth
()
&&
d
.
getDate
()
<
birthdays
.
getDate
())
?
1
:
0
);
this
.
patientInfoForm
.
age
=
age
;
}
else
{
this
.
patientInfoForm
.
age
=
null
;
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录