Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
integral-mall
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
integralMall
integral-mall
Commits
360988a8
Commit
360988a8
authored
Oct 21, 2022
by
huaying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 优惠券导出订单时间限制
parent
b9883a80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletions
+30
-1
couponExchange.vue
src/views/order/couponExchange.vue
+30
-1
No files found.
src/views/order/couponExchange.vue
View file @
360988a8
...
...
@@ -458,7 +458,30 @@ export default {
this
.
dialogVisible
=
true
;
// window.location = `${exportOnlineListExcel}?orderStatus=${this.listParams.orderStatus}&changeType=${this.listParams.changeType}&searchParams=${this.listParams.searchParams}&beginTime=${this.listParams.beginTime}&endTime=${this.listParams.endTime}&requestProject=marketing`;
},
// 计算自然月
natureMonth
(
curDate
,
step
)
{
if
(
!
curDate
||
!
step
)
return
curDate
;
if
(
typeof
curDate
===
'string'
)
curDate
=
new
Date
(
curDate
.
replace
(
/
[\/
|
\.]
/g
,
'-'
));
// new Date(str) 对str格式的,ios只支持yyyy-MM-dd
const
targetDateLastDay
=
new
Date
(
curDate
.
getFullYear
(),
curDate
.
getMonth
()
+
step
+
1
,
0
);
const
targetDate
=
new
Date
(
curDate
.
getFullYear
(),
curDate
.
getMonth
()
+
step
,
Math
.
min
(
curDate
.
getDate
(),
targetDateLastDay
.
getDate
()));
return
this
.
formatDate
(
targetDate
,
'yyyy-MM-dd'
);
},
formatDate
(
dateObj
,
format
)
{
const
month
=
dateObj
.
getMonth
()
+
1
;
const
date
=
dateObj
.
getDate
();
return
format
.
replace
(
/yyyy|MM|dd/g
,
field
=>
{
switch
(
field
)
{
case
'yyyy'
:
return
dateObj
.
getFullYear
();
case
'MM'
:
return
month
<
10
?
'0'
+
month
:
month
;
case
'dd'
:
return
date
<
10
?
'0'
+
date
:
date
;
}
});
},
// 导出列表
exportExcelAll
()
{
if
(
this
.
dateValue
)
{
...
...
@@ -472,10 +495,16 @@ export default {
this
.
$message
.
error
(
'时间不能为空'
);
return
;
}
if
(
new
Date
(
this
.
endTime
).
getTime
()
-
new
Date
(
this
.
beginTime
).
getTime
()
>
90
*
24
*
3600
*
1000
)
{
const
data
=
this
.
natureMonth
(
this
.
beginTime
,
3
);
this
.
endTime
=
this
.
endTime
.
split
(
' '
)[
0
];
if
(
new
Date
(
data
).
getTime
()
-
1
*
24
*
1000
<
new
Date
(
this
.
endTime
).
getTime
())
{
this
.
$message
.
error
(
'导出订单不支持导出超过3个月时长的数据,请重新选择时间'
);
return
;
}
// if (new Date(this.endTime).getTime() - new Date(this.beginTime).getTime() > 90 * 24 * 3600 * 1000) {
// this.$message.error('导出订单不支持导出超过3个月时长的数据,请重新选择时间');
// return;
// }
this
.
paramsAll
=
{
orderStatus
:
this
.
orderStatus
,
changeType
:
-
1
,
...
...
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