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
dd351ac1
Commit
dd351ac1
authored
Oct 24, 2022
by
huaying
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bugfix/积分订单导出订单时间限制'
parents
a018291d
360988a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
10 deletions
+64
-10
couponExchange.vue
src/views/order/couponExchange.vue
+30
-9
giftExchange.vue
src/views/order/giftExchange.vue
+34
-1
No files found.
src/views/order/couponExchange.vue
View file @
dd351ac1
...
...
@@ -87,14 +87,6 @@
<i
class=
"iconfont icon-icon_yunxiazai"
style=
"margin-right:5px"
/>
导出订单
</el-button>
<el-button
@
click=
"exportExcel"
v-if=
"integralMallProId && $getButtonLimit($buttonCode.couponExchangeExport)"
type=
"primary"
:limit-code=
"$buttonCode.couponExchangeExport"
>
<i
class=
"iconfont icon-icon_yunxiazai"
style=
"margin-right:5px"
/>
导出订单
</el-button>
<el-button
@
click=
"exportExcelAll"
v-if=
"!integralMallProId && $getButtonLimit($buttonCode.couponExchangeExport)"
type=
"primary"
...
...
@@ -466,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
)
{
...
...
@@ -480,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
,
...
...
src/views/order/giftExchange.vue
View file @
dd351ac1
...
...
@@ -833,6 +833,30 @@ export default {
betachDeliver
()
{
this
.
deliverModal
.
dialogVisible
=
true
;
},
// 计算自然月
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
;
}
});
},
// 导出发货单
exportExcel
()
{
if
(
this
.
dateValue
)
{
...
...
@@ -846,10 +870,19 @@ 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
];
// console.log(this.endTime.split(' '), 'iiii');
// console.log(data, typeof data, '选择时间', this.endTime, typeof this.endTime);
// console.log(new Date(data).getTime(), new Date(this.endTime).getTime());
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
.
params
=
{
orderStatus
:
this
.
orderStatus
,
changeType
:
this
.
changeType
?
this
.
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