Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zentao-view
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zentao
zentao-view
Commits
4a35a886
Commit
4a35a886
authored
Mar 07, 2021
by
王鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(节假日): 修复单日期添加
parent
a22c424c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
HolidaysDetail.vue
src/views/holidays/HolidaysDetail.vue
+16
-9
HolidaysList.vue
src/views/holidays/HolidaysList.vue
+2
-1
No files found.
src/views/holidays/HolidaysDetail.vue
View file @
4a35a886
...
@@ -29,13 +29,13 @@
...
@@ -29,13 +29,13 @@
<a-row>
<a-row>
<a-col
:span=
"12"
>
<a-col
:span=
"12"
>
<a-form-item
v-if=
"durationInput"
label=
'假期时间'
:labelCol=
"
{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-form-item
v-if=
"durationInput"
label=
'假期时间'
:labelCol=
"
{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-date-picker
:disabled-date=
"disabledDate"
v-
if=
"isEdit"
v-model=
"dateTime"
style=
"width: 100%
"
/>
<a-date-picker
:disabled-date=
"disabledDate"
v-
decorator=
"['day',
{ initialValue: dateTime,rules: [{ required: true, message: '请选择假期时间' }]}]" style="width: 100%" @change="onChange
" />
<a-date-picker
:disabled-date=
"disabledDate"
v-else
style=
"width: 100%"
/
>
<!--
<a-date-picker
:disabled-date=
"disabledDate"
v-else
style=
"width: 100%"
/>
--
>
</a-form-item>
</a-form-item>
<a-form-item
v-else
label=
'假期范围'
:labelCol=
"
{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-form-item
v-else
label=
'假期范围'
:labelCol=
"
{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-range-picker
v-decorator=
"['dayRange',
{ initialValue: dateRange,rules: [{ required: true, message: '请选择假期范围' }]}]" :disabled-date="disabledDate"
v-if="isEdit" v-model="dateRange"
@change="onChange" />
<a-range-picker
v-decorator=
"['dayRange',
{ initialValue: dateRange,rules: [{ required: true, message: '请选择假期范围' }]}]" :disabled-date="disabledDate" @change="onChange" />
<a-range-picker
v-decorator=
"['dayRange',
{rules: [{ required: true, message: '请选择假期范围' }]}]" :disabled-date="disabledDate" v-else @change="onChange" /
>
<!--
<a-range-picker
v-decorator=
"['dayRange',
{rules: [{ required: true, message: '请选择假期范围' }]}]" :disabled-date="disabledDate" v-else @change="onChange" />--
>
</a-form-item>
</a-form-item>
</a-col>
</a-col>
<a-col
:span=
"12"
>
<a-col
:span=
"12"
>
...
@@ -74,11 +74,11 @@ export default {
...
@@ -74,11 +74,11 @@ export default {
detailData
(){
detailData
(){
this
.
form
.
setFieldsValue
({
this
.
form
.
setFieldsValue
({
name
:
this
.
detailData
.
name
,
name
:
this
.
detailData
.
name
,
dayRange
:
[
moment
(
this
.
detailData
.
startDate
),
moment
(
this
.
detailData
.
endDate
)]
dayRange
:
[
moment
(
this
.
detailData
.
startDate
),
moment
(
this
.
detailData
.
endDate
)],
day
:
moment
(
this
.
detailData
.
startDate
)
})
})
this
.
detailInfo
=
this
.
detailData
this
.
detailInfo
=
this
.
detailData
this
.
durationInput
=
this
.
detailData
.
dayCode
===
SYS_CONST
.
HOLIDAY_TYPE
.
WEEKEND
this
.
durationInput
=
this
.
detailData
.
dayCode
===
SYS_CONST
.
HOLIDAY_TYPE
.
WEEKEND
this
.
dateTime
=
moment
(
this
.
detailData
.
startDate
)
}
}
},
},
methods
:
{
methods
:
{
...
@@ -96,9 +96,16 @@ export default {
...
@@ -96,9 +96,16 @@ export default {
})
})
},
},
onChange
(
date
,
dateStr
)
{
onChange
(
date
,
dateStr
)
{
this
.
detailInfo
.
duration
=
date
[
1
].
diff
(
date
[
0
],
'day'
)
+
1
;
// 单个日期
this
.
detailInfo
.
startDate
=
dateStr
[
0
];
if
(
!
Array
.
isArray
(
date
)){
this
.
detailInfo
.
endDate
=
dateStr
[
1
];
this
.
detailInfo
.
duration
=
1
;
this
.
detailInfo
.
startDate
=
dateStr
;
this
.
detailInfo
.
endDate
=
dateStr
;
}
else
{
this
.
detailInfo
.
duration
=
date
[
1
].
diff
(
date
[
0
],
'day'
)
+
1
;
this
.
detailInfo
.
startDate
=
dateStr
[
0
];
this
.
detailInfo
.
endDate
=
dateStr
[
1
];
}
},
},
handleChange
(
value
)
{
handleChange
(
value
)
{
this
.
detailInfo
.
dayCode
=
value
this
.
detailInfo
.
dayCode
=
value
...
...
src/views/holidays/HolidaysList.vue
View file @
4a35a886
...
@@ -172,7 +172,6 @@ export default {
...
@@ -172,7 +172,6 @@ export default {
this
.
loadData
();
this
.
loadData
();
}
,
}
,
sortChange
(
pagination
,
filters
,
sorter
){
sortChange
(
pagination
,
filters
,
sorter
){
console
.
log
(
sorter
)
this
.
query
.
sort
=
humpToLine
(
sorter
.
field
);
this
.
query
.
sort
=
humpToLine
(
sorter
.
field
);
this
.
query
.
order
=
setOrder
(
sorter
.
order
);
this
.
query
.
order
=
setOrder
(
sorter
.
order
);
this
.
loadData
();
this
.
loadData
();
...
@@ -239,6 +238,8 @@ export default {
...
@@ -239,6 +238,8 @@ export default {
}
,
}
,
addNew
(){
addNew
(){
this
.
isEdit
=
false
this
.
isEdit
=
false
this
.
query
.
order
=
""
;
this
.
query
.
sort
=
""
;
this
.
detailData
=
{
this
.
detailData
=
{
year
:
this
.
query
.
year
,
year
:
this
.
query
.
year
,
name
:
""
,
name
:
""
,
...
...
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