Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-task
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a1080986
authored
Nov 23, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
11月版本需求
1 parent
6c5b1c5c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
13 deletions
src/views/task/addTask/components/activityDate.vue
src/views/task/addTask/components/activityDia.vue
src/views/task/addTask/index.vue
src/views/task/taskList/index.vue
src/views/task/addTask/components/activityDate.vue
0 → 100644
View file @
a108098
<
template
>
<div>
<el-dialog
title=
"选择任务开始日期"
:visible
.
sync=
"activityDateVisible"
width=
"800px"
:before-close=
"handleClose"
>
<div>
修改任务开始日期不能晚于活动开始日期且不能早于当前日期。
</div>
<el-date-picker
v-model=
"selectDateItem"
type=
"date"
placeholder=
"选择日期"
:picker-options=
"pickerOptions"
@
change=
"selectDateChange"
>
</el-date-picker>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"activityDateVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"confirmActivityDate"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
export
default
{
name
:
'activityDia'
,
data
()
{
return
{
activityDateVisible
:
false
,
selectDateItem
:
''
,
time
:
''
,
pickerOptions
:
{
disabledDate
:
(
time
)
=>
{
return
(
time
.
getTime
()
<
Date
.
now
()
-
8.64e7
||
time
.
getTime
()
>
this
.
time
)
},
},
}
},
methods
:
{
init
(
time
)
{
this
.
activityDateVisible
=
true
var
date
=
new
Date
(
time
)
var
time1
=
date
.
setDate
(
date
.
getDate
()
-
1
)
console
.
log
(
time1
)
this
.
time
=
time1
},
selectDateChange
()
{
console
.
log
(
this
.
selectDateItem
)
},
// 关闭弹窗
handleClose
()
{
this
.
selectDateItem
=
''
this
.
activityDateVisible
=
false
},
confirmActivityDate
()
{
var
time
=
new
Date
(
this
.
selectDateItem
)
var
newTime
=
time
.
getFullYear
()
+
'-'
+
(
time
.
getMonth
()
+
1
)
+
'-'
+
time
.
getDate
()
console
.
log
(
newTime
)
this
.
$emit
(
'selectActivityDate'
,
newTime
)
this
.
handleClose
()
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
src/views/task/addTask/components/activityDia.vue
View file @
a108098
...
...
@@ -100,23 +100,23 @@ export default {
this
.
activityData
.
map
((
item
)
=>
{
item
.
startTime
=
dayjs
(
item
.
startTime
).
format
(
'YYYY-MM-DD'
)
item
.
endTime
=
dayjs
(
item
.
endTime
).
format
(
'YYYY-MM-DD'
)
if
(
this
.
isClone
)
{
let
activityDays
=
this
.
getDateByDays
(
item
.
startTime
,
item
.
endTime
)
if
(
activityDays
!=
this
.
taskDateNum
)
{
item
.
taskStatus
=
1
}
}
//
if (this.isClone) {
//
let activityDays = this.getDateByDays(item.startTime, item.endTime)
//
if (activityDays != this.taskDateNum) {
//
item.taskStatus = 1
//
}
//
}
})
})
},
// 根据日期获取天数
getDateByDays
(
startDate
,
endDdate
)
{
let
d1
=
Date
.
parse
(
new
Date
(
startDate
))
let
d2
=
Date
.
parse
(
new
Date
(
endDdate
))
// 时间戳相减 / 天数
let
day
=
parseInt
((
d2
-
d1
)
/
(
1000
*
60
*
60
*
24
))
+
1
return
day
},
//
getDateByDays(startDate, endDdate) {
//
let d1 = Date.parse(new Date(startDate))
//
let d2 = Date.parse(new Date(endDdate))
//
// 时间戳相减 / 天数
//
let day = parseInt((d2 - d1) / (1000 * 60 * 60 * 24)) + 1
//
return day
//
},
handleSelectItem
(
item
)
{
this
.
selectItem
=
item
},
...
...
src/views/task/addTask/index.vue
View file @
a108098
This diff is collapsed.
Click to expand it.
src/views/task/taskList/index.vue
View file @
a108098
...
...
@@ -50,6 +50,18 @@
>
添加任务
</el-button
>
</div>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleTabClick"
>
<el-tab-pane
label=
"全部"
name=
""
></el-tab-pane>
<el-tab-pane
label=
"未发布"
:name=
"statusNum.UNPUBLISH"
></el-tab-pane
>
<el-tab-pane
label=
"已发布"
:name=
"statusNum.PUBLISHED"
></el-tab-pane
>
<el-tab-pane
label=
"已结束"
:name=
"statusNum.FINISHIED"
></el-tab-pane
>
</el-tabs>
<div>
<d2-table
ref=
"taskTable"
...
...
@@ -240,6 +252,7 @@ export default {
// 获取订单列表
getListApi
:
taskApi
.
findMissionList
,
status
:
false
,
activeName
:
''
,
}
},
methods
:
{
...
...
@@ -259,6 +272,13 @@ export default {
this
.
$refs
.
taskTable
.
refreshTable
()
})
},
// tab切换
handleTabClick
(
tab
,
event
)
{
this
.
searchForm
.
activityStatus
=
tab
.
name
this
.
$nextTick
(()
=>
{
this
.
$refs
.
taskTable
.
refreshTable
()
})
},
// 编辑
handleEdit
(
item
,
type
)
{
this
.
status
=
true
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment