Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
Overview
Overview
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
office
haoban-3
Commits
19f5bbee
Commit
19f5bbee
authored
Jul 21, 2022
by
huaying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 时间选择器
parent
93f9dc32
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
90 deletions
+92
-90
staffActCodeRouter.js
src/router/actCodeManageRouter/staffActCodeRouter.js
+1
-1
actCodeDetail.vue
...s/salesleads/actCodeManage/staffActCode/actCodeDetail.vue
+2
-2
dataDetail.vue
src/views/salesleads/components/dataDetail.vue
+89
-87
No files found.
src/router/actCodeManageRouter/staffActCodeRouter.js
View file @
19f5bbee
...
...
@@ -7,7 +7,7 @@ const staffActCodeRouter = [
component
:
_import
(
'salesleads/actCodeManage/staffActCode'
,
'index'
),
meta
:
{
keepAlive
:
true
,
fromPath
:
[
'/actCodeAdd'
,
'/actCodeEdit'
,
'/actCodeBatch'
,
'/actCodeDetail'
]
fromPath
:
[
'/actCodeAdd'
,
'/actCodeEdit'
,
'/actCodeBatch'
,
'/actCodeDetail'
,
'/actCodeDetails'
]
}
},
{
...
...
src/views/salesleads/actCodeManage/staffActCode/actCodeDetail.vue
View file @
19f5bbee
...
...
@@ -50,11 +50,11 @@
</div>
<el-tabs
v-model=
"activeName"
type=
"card"
>
<!--
<el-tab-pane
label=
"详情信息"
name=
"first"
v-if=
"$getButtonLimit($buttonCode.infoActCode)"
:limit-code=
"$buttonCode.infoActCode"
>
-->
<el-tab-pane
label=
"详情信息"
name=
"first"
>
<el-tab-pane
label=
"详情信息"
name=
"first"
v-if=
"$getButtonLimit(this.$buttonCode.infoActCode)"
:limit-code=
"$buttonCode.infoActCode"
>
<act-code-detail-info
:enterprise-id=
"codeInfo.enterpriseId"
:welcome-id=
"codeInfo.welcomeId"
:hm-id=
"$route.query.hmId"
@
useMemberList=
"useMemberData"
></act-code-detail-info>
</el-tab-pane>
<!--
<el-tab-pane
label=
"数据统计"
name=
"second"
v-if=
"$getButtonLimit($buttonCode.dataActCode)"
:limit-code=
"$buttonCode.dataActCode"
>
-->
<el-tab-pane
label=
"数据统计"
name=
"second"
>
<el-tab-pane
label=
"数据统计"
name=
"second"
v-if=
"$getButtonLimit(this.$buttonCode.dataActCode)"
:limit-code=
"$buttonCode.dataActCode"
>
<act-code-detail-statistics
:hm-id=
"$route.query.hmId"
></act-code-detail-statistics>
</el-tab-pane>
</el-tabs>
...
...
src/views/salesleads/components/dataDetail.vue
View file @
19f5bbee
...
...
@@ -8,7 +8,7 @@
<div
class=
"rightBox"
>
<ul
class=
"datebox"
v-for=
"(lis, index) in dateLis"
:key=
"lis.key"
>
<li
:class=
"
active
== index ? 'activeClass' : 'noActive'"
class=
"dateLisBox"
@
click=
"btnChange(index)"
>
{{
lis
.
value
}}
</li>
<li
:class=
"
dateKey
== index ? 'activeClass' : 'noActive'"
class=
"dateLisBox"
@
click=
"btnChange(index)"
>
{{
lis
.
value
}}
</li>
</ul>
<el-date-picker
class=
"w256"
v-model=
"dateDefault"
type=
"daterange"
range-separator=
"~"
start-placeholder=
"创建开始日期"
end-placeholder=
"创建结束日期"
:default-time=
"['00:00:00', '23:59:59']"
value-format=
"yyyy-MM-dd"
:picker-options=
"pickerOptions()"
@
change=
"onDateChange"
:clearable=
"false"
>
</el-date-picker>
</div>
...
...
@@ -55,6 +55,7 @@
<
script
>
import
{
detailClerkList
}
from
'@/api/actCode.js'
;
import
{
_debounce
}
from
'@/common/js/public'
;
import
mixin
from
'../actCodeManage/components/mixin'
;
export
default
{
name
:
'DateDetail'
,
props
:
{
...
...
@@ -71,9 +72,10 @@ export default {
default
:
'code'
}
},
mixins
:
[
mixin
],
data
()
{
return
{
active
:
0
,
dateKey
:
0
,
dateLis
:
[
{
key
:
1
,
value
:
'近7天'
},
{
key
:
2
,
value
:
'近30天'
},
...
...
@@ -95,34 +97,34 @@ export default {
dateDefault
:
[],
totalCount
:
0
,
sortColumn
:
''
,
sortType
:
''
,
pickerOptions
()
{
let
pickerMinDate
;
return
{
onPick
(
obj
)
{
pickerMinDate
=
obj
.
minDate
;
},
disabledDate
(
time
)
{
let
start
=
new
Date
();
start
=
new
Date
(
`
${
start
.
getFullYear
()}
-
${
start
.
getMonth
()
+
1
}
-
${
start
.
getDate
()}
`
);
let
start2
=
new
Date
(
pickerMinDate
);
let
end
=
new
Date
();
end
=
new
Date
(
`
${
end
.
getFullYear
()}
-
${
end
.
getMonth
()
+
1
}
-
${
end
.
getDate
()
+
1
}
`
);
let
end2
=
new
Date
(
pickerMinDate
);
if
(
pickerMinDate
)
{
start
=
start
.
setFullYear
(
start
.
getFullYear
()
-
2
);
start2
=
start2
.
setMonth
(
start2
.
getMonth
()
-
6
);
start
=
start
>
start2
?
start
:
start2
;
end2
=
end2
.
setMonth
(
end2
.
getMonth
()
+
6
);
end
=
end
.
getTime
()
>
end2
?
end2
:
end
.
getTime
();
}
else
{
start
=
start
.
setFullYear
(
start
.
getFullYear
()
-
2
);
end
=
end
.
getTime
();
}
return
time
.
getTime
()
<=
start
||
time
.
getTime
()
>=
end
;
}
};
}
sortType
:
''
//
pickerOptions() {
//
let pickerMinDate;
//
return {
//
onPick(obj) {
//
pickerMinDate = obj.minDate;
//
},
//
disabledDate(time) {
//
let start = new Date();
//
start = new Date(`${start.getFullYear()}-${start.getMonth() + 1}-${start.getDate()}`);
//
let start2 = new Date(pickerMinDate);
//
let end = new Date();
//
end = new Date(`${end.getFullYear()}-${end.getMonth() + 1}-${end.getDate() + 1}`);
//
let end2 = new Date(pickerMinDate);
//
if (pickerMinDate) {
//
start = start.setFullYear(start.getFullYear() - 2);
//
start2 = start2.setMonth(start2.getMonth() - 6);
//
start = start > start2 ? start : start2;
//
end2 = end2.setMonth(end2.getMonth() + 6);
//
end = end.getTime() > end2 ? end2 : end.getTime();
//
} else {
//
start = start.setFullYear(start.getFullYear() - 2);
//
end = end.getTime();
//
}
//
return time.getTime()
<=
start
||
time
.
getTime
()
>=
end
;
//
}
//
};
//
}
};
},
created
()
{
...
...
@@ -133,64 +135,64 @@ export default {
toInput
:
_debounce
(
function
(
e
,
value
)
{
this
.
getTableList
();
},
500
),
getDateRange
(
setEndDate
)
{
const
start
=
new
Date
();
let
end
=
new
Date
();
end
=
setEndDate
(
end
);
function
getDate
(
date
)
{
const
result
=
[];
result
.
push
(
date
.
getFullYear
());
result
.
push
((
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
));
result
.
push
(
date
.
getDate
()
.
toString
()
.
padStart
(
2
,
'0'
)
);
return
result
.
join
(
'-'
);
}
// yyyy-MM-dd
return
[
getDate
(
start
),
getDate
(
end
)];
},
btnChange
(
index
)
{
//把index值赋给active,点击改变样式
this
.
active
=
index
;
this
.
dateDefault
=
[];
let
setDate
;
if
(
index
==
0
)
{
// 近7天
setDate
=
endDate
=>
{
endDate
.
setDate
(
endDate
.
getDate
()
-
6
);
return
new
Date
(
endDate
);
};
}
else
if
(
index
==
1
)
{
// 近30天
setDate
=
endDate
=>
{
endDate
.
setDate
(
endDate
.
getDate
()
-
29
);
return
new
Date
(
endDate
);
};
}
else
if
(
index
==
2
)
{
// 近三个月
setDate
=
endDate
=>
{
endDate
.
setMonth
(
endDate
.
getMonth
()
-
3
);
endDate
.
setDate
(
endDate
.
getDate
()
+
1
);
return
new
Date
(
endDate
);
};
}
else
if
(
index
==
3
)
{
// 近半年
setDate
=
endDate
=>
{
endDate
.
setMonth
(
endDate
.
getMonth
()
-
6
);
endDate
.
setDate
(
endDate
.
getDate
()
+
1
);
return
new
Date
(
endDate
);
};
}
const
[
start
,
end
]
=
this
.
getDateRange
(
setDate
);
this
.
dateDefault
.
push
(
end
);
this
.
dateDefault
.
push
(
start
);
this
.
getTableList
();
},
//
getDateRange(setEndDate) {
//
const start = new Date();
//
let end = new Date();
//
end = setEndDate(end);
//
function getDate(date) {
//
const result = [];
//
result.push(date.getFullYear());
//
result.push((date.getMonth() + 1).toString().padStart(2, '0'));
//
result.push(
//
date
//
.getDate()
//
.toString()
//
.padStart(2, '0')
//
);
//
return result.join('-');
//
}
//
// yyyy-MM-dd
//
return [getDate(start), getDate(end)];
//
},
//
btnChange(index) {
//
//把index值赋给active,点击改变样式
// this.dateKey
= index;
//
this.dateDefault = [];
//
let setDate;
//
if (index == 0) {
//
// 近7天
//
setDate = endDate => {
//
endDate.setDate(endDate.getDate() - 6);
//
return new Date(endDate);
//
};
//
} else if (index == 1) {
//
// 近30天
//
setDate = endDate => {
//
endDate.setDate(endDate.getDate() - 29);
//
return new Date(endDate);
//
};
//
} else if (index == 2) {
//
// 近三个月
//
setDate = endDate => {
//
endDate.setMonth(endDate.getMonth() - 3);
//
endDate.setDate(endDate.getDate() + 1);
//
return new Date(endDate);
//
};
//
} else if (index == 3) {
//
// 近半年
//
setDate = endDate => {
//
endDate.setMonth(endDate.getMonth() - 6);
//
endDate.setDate(endDate.getDate() + 1);
//
return new Date(endDate);
//
};
//
}
//
const [start, end] = this.getDateRange(setDate);
//
this.dateDefault.push(end);
//
this.dateDefault.push(start);
//
this.getTableList();
//
},
onDateChange
()
{
this
.
active
=
-
1
;
this
.
dateKey
=
-
1
;
if
(
this
.
dateDefault
.
length
)
this
.
getTableList
();
},
// 当前页变化
...
...
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