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
0d1e3a08
Commit
0d1e3a08
authored
Mar 03, 2021
by
王鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增节假日
parent
a01ecd68
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
3 deletions
+121
-3
holidays.js
src/api/holidays/holidays.js
+11
-1
HolidaysDetail.vue
src/views/holidays/HolidaysDetail.vue
+103
-0
HolidaysList.vue
src/views/holidays/HolidaysList.vue
+7
-2
No files found.
src/api/holidays/holidays.js
View file @
0d1e3a08
...
...
@@ -4,7 +4,8 @@ const api = {
getPage
:
'/holidays/page'
,
synchronousVacation
:
'/holidays/synchronousVacation'
,
deleteHoliday
:
'/holidays/'
,
batchDeleteHoliday
:
'/holidays/batchDelete'
batchDeleteHoliday
:
'/holidays/batchDelete'
,
addHoliday
:
'/holidays/add'
}
export
default
api
...
...
@@ -43,3 +44,12 @@ export function batchDeleteHoliday(parameter) {
useFullLoading
:
true
})
}
export
function
addHoliday
(
parameter
)
{
return
axios
({
url
:
api
.
addHoliday
,
method
:
'post'
,
data
:
parameter
,
useFullLoading
:
true
})
}
\ No newline at end of file
src/views/holidays/HolidaysDetail.vue
0 → 100644
View file @
0d1e3a08
<
template
>
<a-modal
:title=
"modalTitle"
v-model=
"visible"
@
ok=
"handleOk"
:maskClosable=
"false"
:width=
"modalWidth"
class=
"cust-modal"
okText=
"保存"
>
<a-form>
<a-row>
<a-col
:span=
"12"
>
<a-form-item
label=
'假期名称'
:labelCol=
"
{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input
v-model=
"submitInfo.name"
placeholder=
"双休日请输入星期六或星期日"
/>
</a-form-item>
</a-col>
<a-col
:span=
"12"
>
<a-form-item
label=
'假期类型'
:labelCol=
"
{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-select
:default-value=
"(holidayTypes[0]||
{}).valueInt" @change="handleChange">
<a-select-option
v-for=
"item in holidayTypes"
:value=
"item.valueInt"
:key=
"item.id"
>
{{
item
.
name
}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col
:span=
"12"
>
<a-form-item
v-if=
"durationInput"
label=
'假期时间'
:labelCol=
"
{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-date-picker
style=
"width: 100%"
/>
</a-form-item>
<a-form-item
v-else
label=
'假期范围'
:labelCol=
"
{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-range-picker
@
change=
"onChange"
/>
</a-form-item>
</a-col>
<a-col
:span=
"12"
>
<a-form-item
label=
'假期时长'
:labelCol=
"
{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input
disabled=
"disabled"
v-model=
"submitInfo.duration"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</
template
>
<
script
>
import
{
addHoliday
}
from
"@api/holidays/holidays"
;
export
default
{
name
:
'SysBusinessDetail'
,
props
:[
'holidayTypes'
,
'year'
],
data
()
{
return
{
parentName
:
""
,
//父业务名称
optType
:
0
,
sysBusiness
:{},
isChildBusiness
:
false
,
visible
:
false
,
modalTitle
:
"新建假期"
,
modalWidth
:
800
,
durationInput
:
false
,
submitInfo
:{
name
:
""
,
dayCode
:
(
this
.
holidayTypes
[
0
]
||
{}).
valueInt
,
startDate
:
null
,
endDate
:
null
,
duration
:
0
,
year
:
this
.
year
}
}
},
methods
:
{
handleOk
()
{
addHoliday
(
this
.
submitInfo
).
then
(
response
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
this
.
visible
=
false
;
this
.
loadData
();
}
});
},
onChange
(
date
,
dateStr
)
{
this
.
submitInfo
.
duration
=
date
[
1
].
diff
(
date
[
0
],
'day'
)
+
1
;
this
.
submitInfo
.
startDate
=
dateStr
[
0
];
this
.
submitInfo
.
endDate
=
dateStr
[
1
];
},
handleChange
(
value
)
{
this
.
submitInfo
.
dayCode
=
value
if
(
value
===
SYS_CONST
.
HOLIDAY_TYPE
.
WEEKEND
){
this
.
durationInput
=
true
this
.
submitInfo
.
duration
=
1
}
else
{
this
.
durationInput
=
false
this
.
submitInfo
.
duration
=
0
}
}
}
}
</
script
>
\ No newline at end of file
src/views/holidays/HolidaysList.vue
View file @
0d1e3a08
...
...
@@ -40,7 +40,7 @@
</span>
<div
class=
"cust-table-operator"
>
<a-button-group>
<a-button
type=
"primary"
>
新建
</a-button>
<a-button
type=
"primary"
@
click=
"addNew"
>
新建
</a-button>
<a-button
@
click=
"onBatchDelete"
type=
"danger"
>
批量删除
</a-button>
</a-button-group>
</div>
...
...
@@ -83,12 +83,13 @@
:
showTotal
=
"$showTotal"
/>
<
/div
>
<
/a-table
>
<
holidays
-
detail
ref
=
"holidayDetail"
:
holidayTypes
=
"holidayTypes"
:
year
=
"query.year"
><
/holidays-detail
>
<
/a-card
>
<
/template
>
<
script
>
import
{
getCommonCode
}
from
"@api/system/sysCode"
;
import
{
getPage
,
synchronousVacation
,
deleteHoliday
,
batchDeleteHoliday
}
from
"@api/holidays/holidays"
;
import
HolidaysDetail
from
"@views/holidays/HolidaysDetail"
;
const
columns
=
[
{
title
:
'名称'
,
width
:
100
,
dataIndex
:
'name'
}
,
{
title
:
'类型'
,
width
:
80
,
dataIndex
:
'dayCode'
,
scopedSlots
:
{
customRender
:
'dayCode'
}}
,
...
...
@@ -102,6 +103,7 @@ const columns = [
const
dataSource
=
[]
export
default
{
name
:
'HolidaysList'
,
components
:
{
HolidaysDetail
}
,
data
()
{
return
{
query
:
{
...
...
@@ -222,6 +224,9 @@ export default {
}
)
}
this
.
query
.
year
=
current
}
,
addNew
(){
this
.
$refs
.
holidayDetail
.
visible
=
true
}
}
,
mounted
()
{
...
...
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