Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
任超
/
js.CadastralSystem
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
5871b1ea
authored
2020-12-08 14:26:09 +0800
by
weimo934
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
:to(qlxz):起始时间结束时间验证,
1 parent
af4c6928
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
2 deletions
src/components/formMenu/qlxz.vue
src/components/formMenu/qlxz.vue
View file @
5871b1e
...
...
@@ -105,9 +105,10 @@
:disabled=
"formData.qszt!='0'"
v-model=
"childItem.tdsyqssj"
type=
"date"
:picker-options=
"childItem.pickerStart"
value-format=
"yyyy-MM-dd"
placeholder=
"选择日期"
@
change=
"startTime(index,childIndex)"
>
</el-date-picker>
</li>
...
...
@@ -211,7 +212,8 @@
:disabled=
"formData.qszt!='0'"
v-model=
"childItem.tdsyjssj"
type=
"date"
:picker-options=
"childItem.pickerEnd"
@
change=
"endTime(index,childIndex)"
value-format=
"yyyy-MM-dd"
placeholder=
"选择日期"
>
...
...
@@ -290,6 +292,8 @@ export default {
sjytmj
:
0
,
syqx
:
""
,
tdsyjssj
:
""
,
pickerStart
:{},
pickerEnd
:{},
tdsyqssj
:
""
,
tdzh
:
""
,
},
...
...
@@ -304,6 +308,42 @@ export default {
console
.
log
(
this
.
formData
,
'formData'
);
},
methods
:
{
startTime
(
index
,
childIndex
){
let
startTime
=
this
.
countList
[
index
].
list
[
childIndex
].
tdsyqssj
;
let
endTime
=
this
.
countList
[
index
].
list
[
childIndex
].
tdsyjssj
;
this
.
countList
[
index
].
list
[
childIndex
].
pickerEnd
=
{
disabledDate
:
(
time
)
=>
{
if
(
Object
.
keys
(
startTime
).
length
>
0
)
{
return
new
Date
(
startTime
).
getTime
()
>
time
.
getTime
();
}
else
{
return
time
.
getTime
()
<
Date
.
now
();
}
}
}
if
(
Object
.
keys
(
startTime
).
length
>
0
&&
Object
.
keys
(
endTime
).
length
>
0
)
{
let
startYear
=
new
Date
(
startTime
).
getFullYear
();
let
endYear
=
new
Date
(
endTime
).
getFullYear
();
this
.
countList
[
index
].
list
[
childIndex
].
syqx
=
endYear
-
startYear
;
}
},
endTime
(
index
,
childIndex
){
let
startTime
=
this
.
countList
[
index
].
list
[
childIndex
].
tdsyqssj
;
let
endTime
=
this
.
countList
[
index
].
list
[
childIndex
].
tdsyjssj
;
this
.
countList
[
index
].
list
[
childIndex
].
pickerStart
=
{
disabledDate
:
(
time
)
=>
{
if
(
Object
.
keys
(
endTime
).
length
>
0
)
{
return
new
Date
(
endTime
).
getTime
()
<
time
.
getTime
();
}
else
{
return
time
.
getTime
()
>
Date
.
now
();
}
}
}
if
(
Object
.
keys
(
startTime
).
length
>
0
&&
Object
.
keys
(
endTime
).
length
>
0
)
{
let
startYear
=
new
Date
(
startTime
).
getFullYear
();
let
endYear
=
new
Date
(
endTime
).
getFullYear
();
this
.
countList
[
index
].
list
[
childIndex
].
syqx
=
endYear
-
startYear
;
}
},
//外层操作
handleClick
(
ind
,
type
)
{
let
outsideObj
=
{
...
...
@@ -325,6 +365,8 @@ export default {
sjdjbsm
:
""
,
sjdjmc
:
""
,
sjytdm
:
""
,
pickerStart
:{},
pickerEnd
:{},
sjytmc
:
""
,
sjytmj
:
0
,
syqx
:
""
,
...
...
@@ -360,6 +402,8 @@ export default {
sjytdm
:
""
,
sjytmc
:
""
,
sjytmj
:
0
,
pickerStart
:{},
pickerEnd
:{},
syqx
:
""
,
tdsyjssj
:
""
,
tdsyqssj
:
""
,
...
...
Please
register
or
sign in
to post a comment