Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
allCampaign
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
Administrator
allCampaign
Commits
260e14e5
Commit
260e14e5
authored
May 22, 2019
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
孩子疾病
parent
f16774c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
questionnaire/src/app/children-health/children-health.component.ts
+5
-13
No files found.
questionnaire/src/app/children-health/children-health.component.ts
View file @
260e14e5
...
@@ -48,12 +48,11 @@ export class ChildrenHealthComponent implements OnInit {
...
@@ -48,12 +48,11 @@ export class ChildrenHealthComponent implements OnInit {
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
surveyInfo
()
this
.
surveyInfo
()
;
}
}
// 选择健康情况(多选)
// 选择健康情况(多选)
selectedHealth
(
option
,
lastFlag
)
{
selectedHealth
(
option
,
lastFlag
)
{
// debugger;
if
(
lastFlag
===
false
)
{
if
(
lastFlag
===
false
)
{
option
[
'selected'
]
=
!
option
[
'selected'
];
option
[
'selected'
]
=
!
option
[
'selected'
];
}
}
...
@@ -77,8 +76,6 @@ export class ChildrenHealthComponent implements OnInit {
...
@@ -77,8 +76,6 @@ export class ChildrenHealthComponent implements OnInit {
pageId
:
this
.
curPageData
[
'pageId'
],
pageId
:
this
.
curPageData
[
'pageId'
],
questions
:
this
.
childTotalQuestions
,
questions
:
this
.
childTotalQuestions
,
};
};
// console.log(this.pageAnswers);
// console.log(this.curPageData)
if
(
this
.
pageAnswers
.
questions
.
every
(
item
=>
item
.
options
.
length
>
0
))
{
if
(
this
.
pageAnswers
.
questions
.
every
(
item
=>
item
.
options
.
length
>
0
))
{
this
.
nextBtn
=
true
;
this
.
nextBtn
=
true
;
}
else
{
}
else
{
...
@@ -111,16 +108,14 @@ export class ChildrenHealthComponent implements OnInit {
...
@@ -111,16 +108,14 @@ export class ChildrenHealthComponent implements OnInit {
this
.
commonService
.
surveyInfo
().
then
(
res
=>
{
this
.
commonService
.
surveyInfo
().
then
(
res
=>
{
if
(
res
[
'success'
])
{
if
(
res
[
'success'
])
{
this
.
curPageData
=
res
[
'data'
][
'survey'
].
pages
[
'12'
];
this
.
curPageData
=
res
[
'data'
][
'survey'
].
pages
[
'12'
];
// debugger;
this
.
lastQuestions
=
this
.
commonService
.
todosCopy
.
filter
(
item
=>
item
.
pageId
==
13
).
pop
();
this
.
lastQuestions
=
this
.
commonService
.
todosCopy
.
filter
(
item
=>
item
.
pageId
==
13
).
pop
();
console
.
log
(
this
.
lastQuestions
)
this
.
id
=
this
.
route
.
snapshot
.
params
[
'childId'
];
if
(
this
.
lastQuestions
)
{
if
(
this
.
lastQuestions
)
{
this
.
childTotalQuestions
=
this
.
lastQuestions
[
'questions'
];
for
(
let
i
=
0
;
i
<
this
.
lastQuestions
[
'questions'
].
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
lastQuestions
[
'questions'
].
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
this
.
curPageData
[
'questions'
].
length
;
j
++
)
{
for
(
let
j
=
0
;
j
<
this
.
curPageData
[
'questions'
].
length
;
j
++
)
{
if
(
this
.
lastQuestions
[
'questions'
][
i
].
questionId
==
this
.
curPageData
[
'questions'
][
j
].
questionId
)
{
if
(
this
.
lastQuestions
[
'questions'
][
i
].
questionId
==
this
.
curPageData
[
'questions'
][
j
].
questionId
)
{
// console.log(this.lastQuestions)
if
(
this
.
id
==
this
.
lastQuestions
[
'questions'
][
i
][
'childId'
])
{
// console.log(this.curPageData)
if
(
this
.
lastQuestions
[
'questions'
][
i
].
questionSubId
==
this
.
curPageData
[
'questions'
][
j
].
questionSubId
)
{
this
.
lastQuestions
[
'questions'
][
i
][
'options'
].
forEach
(
option
=>
{
this
.
lastQuestions
[
'questions'
][
i
][
'options'
].
forEach
(
option
=>
{
if
(
Object
.
keys
(
option
).
indexOf
(
'optionId'
)
>
-
1
)
{
if
(
Object
.
keys
(
option
).
indexOf
(
'optionId'
)
>
-
1
)
{
const
targetObj
=
option
;
const
targetObj
=
option
;
...
@@ -130,17 +125,13 @@ export class ChildrenHealthComponent implements OnInit {
...
@@ -130,17 +125,13 @@ export class ChildrenHealthComponent implements OnInit {
}
}
});
});
this
.
selectedHealth
(
targetObj
,
true
);
this
.
selectedHealth
(
targetObj
,
true
);
// console.log(this.targetObj);
}
}
});
});
}
}
}
}
}
}
}
}
}
}
console
.
log
(
this
.
curPageData
)
}
}
})
})
}
}
...
@@ -171,6 +162,7 @@ export class ChildrenHealthComponent implements OnInit {
...
@@ -171,6 +162,7 @@ export class ChildrenHealthComponent implements OnInit {
// 上一步
// 上一步
before
()
{
before
()
{
this
.
surveyInfo
();
this
.
commonService
.
before
();
this
.
commonService
.
before
();
}
}
}
}
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