Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
agcs2.0-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liang
agcs2.0-web
Commits
21d83817
Commit
21d83817
authored
May 05, 2023
by
miaojiale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入选标准增加校验
parent
730d022e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
4 deletions
+35
-4
date.vue
packages/config/date.vue
+16
-4
FormContent.vue
src/components/FormComponents/CustomForm/FormContent.vue
+4
-0
FormItemSelf.vue
src/components/FormComponents/CustomForm/FormItemSelf.vue
+4
-0
index.vue
src/components/FormComponents/CustomForm/index.vue
+11
-0
No files found.
packages/config/date.vue
View file @
21d83817
...
@@ -69,6 +69,10 @@ let checkAge = (rule, value, callback) => {
...
@@ -69,6 +69,10 @@ let checkAge = (rule, value, callback) => {
if
(
!
value
)
{
if
(
!
value
)
{
return
callback
(
new
Error
(
"
请选择出生日期
"
))
return
callback
(
new
Error
(
"
请选择出生日期
"
))
}
}
let
sex
=
sessionStorage
.
getItem
(
"
addSex
"
)
if
(
!
sex
)
{
return
}
let
birthday
=
new
Date
(
value
.
replace
(
/-/g
,
"
/
"
))
let
birthday
=
new
Date
(
value
.
replace
(
/-/g
,
"
/
"
))
let
d
=
new
Date
()
let
d
=
new
Date
()
let
age
=
let
age
=
...
@@ -78,11 +82,19 @@ let checkAge = (rule, value, callback) => {
...
@@ -78,11 +82,19 @@ let checkAge = (rule, value, callback) => {
(
d
.
getMonth
()
==
birthday
.
getMonth
()
&&
d
.
getDate
()
<
birthday
.
getDate
())
(
d
.
getMonth
()
==
birthday
.
getMonth
()
&&
d
.
getDate
()
<
birthday
.
getDate
())
?
1
?
1
:
0
)
:
0
)
console
.
log
(
age
)
console
.
log
(
sex
)
if
(
age
<
40
||
age
>
80
)
{
if
(
sex
==
1
)
{
callback
(
new
Error
(
"
年龄不符合筛查条件
"
))
if
(
age
<
40
||
age
>
79
)
{
callback
(
new
Error
(
"
年龄不符合筛查条件
"
))
}
else
{
callback
()
}
}
else
{
}
else
{
callback
()
if
(
age
<
50
||
age
>
79
)
{
callback
(
new
Error
(
"
年龄不符合筛查条件
"
))
}
else
{
callback
()
}
}
}
}
}
export
default
{
export
default
{
...
...
src/components/FormComponents/CustomForm/FormContent.vue
View file @
21d83817
...
@@ -119,6 +119,7 @@
...
@@ -119,6 +119,7 @@
:columns=
"columns.column || columns.children.column"
:columns=
"columns.column || columns.children.column"
:group=
"options.group"
:group=
"options.group"
@
formChange=
"formChange"
@
formChange=
"formChange"
@
validateForm=
"validateForm"
></form-item-self>
></form-item-self>
</el-col>
</el-col>
</
template
>
</
template
>
...
@@ -186,6 +187,9 @@ export default {
...
@@ -186,6 +187,9 @@ export default {
this
.
$refs
.
formSelf
[
i
].
age
=
""
this
.
$refs
.
formSelf
[
i
].
age
=
""
}
}
},
},
validateForm
()
{
this
.
$emit
(
"
validateForm
"
)
},
handleChange
(
key
,
val
)
{
handleChange
(
key
,
val
)
{
if
(
this
.
form
.
hasOwnProperty
(
key
))
this
.
form
[
key
]
=
val
if
(
this
.
form
.
hasOwnProperty
(
key
))
this
.
form
[
key
]
=
val
},
},
...
...
src/components/FormComponents/CustomForm/FormItemSelf.vue
View file @
21d83817
...
@@ -955,6 +955,10 @@ export default {
...
@@ -955,6 +955,10 @@ export default {
if
(
this
.
item
.
prop
==
"
birthday
"
)
{
if
(
this
.
item
.
prop
==
"
birthday
"
)
{
this
.
getAge
()
this
.
getAge
()
}
}
if
(
this
.
item
.
prop
==
"
sex
"
)
{
sessionStorage
.
setItem
(
"
addSex
"
,
this
.
form
.
sex
)
this
.
$emit
(
"
validateForm
"
)
}
// 该操作判断是否符合筛查条件
// 该操作判断是否符合筛查条件
this
.
$emit
(
"
formChange
"
)
this
.
$emit
(
"
formChange
"
)
// ['is_one_year','is_subtotal_history','is_ppi','is_symptom','is_subtotal_history','is_disease','is_tumour']
// ['is_one_year','is_subtotal_history','is_ppi','is_symptom','is_subtotal_history','is_disease','is_tumour']
...
...
src/components/FormComponents/CustomForm/index.vue
View file @
21d83817
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
:columns=
"
{ column: options.column }"
:columns=
"
{ column: options.column }"
:options="options"
:options="options"
:is-show-important="isShowImportant"
:is-show-important="isShowImportant"
@validateForm="validateForm"
>
</form-content>
>
</form-content>
</
template
>
</
template
>
<
template
v-if=
"options.group && options.group.length > 0"
>
<
template
v-if=
"options.group && options.group.length > 0"
>
...
@@ -34,6 +35,7 @@
...
@@ -34,6 +35,7 @@
:columns=
"g"
:columns=
"g"
:options=
"options"
:options=
"options"
:is-show-important=
"isShowImportant"
:is-show-important=
"isShowImportant"
@
validateForm=
"validateForm"
></form-content>
></form-content>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
...
@@ -61,6 +63,7 @@
...
@@ -61,6 +63,7 @@
:options=
"options"
:options=
"options"
:is-show-important=
"isShowImportant"
:is-show-important=
"isShowImportant"
@
showError=
"showError"
@
showError=
"showError"
@
validateForm=
"validateForm"
></form-content>
></form-content>
</el-collapse-item>
</el-collapse-item>
</template>
</template>
...
@@ -203,6 +206,14 @@ export default {
...
@@ -203,6 +206,14 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
validateForm
()
{
// console.log(88845)
if
(
this
.
form
.
birthday
)
{
this
.
$refs
.
form
.
validateField
(
"
birthday
"
,
(
valid
)
=>
{
console
.
log
(
valid
)
})
}
},
clearAge
()
{
clearAge
()
{
// 去除年龄文本
// 去除年龄文本
for
(
let
i
=
0
;
i
<
this
.
$refs
.
formContent
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
$refs
.
formContent
.
length
;
i
++
)
{
...
...
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