Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
13fcdac8
Commit
13fcdac8
authored
Apr 21, 2022
by
lxd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:问题修复
parent
082771f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
index.jsx
src/pages/PaymentMange/index.jsx
+17
-4
No files found.
src/pages/PaymentMange/index.jsx
View file @
13fcdac8
...
...
@@ -6,6 +6,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import
ProTable
from
'
@ant-design/pro-table
'
;
import
{
saveAs
}
from
'
file-saver
'
;
import
{
format
}
from
'
date-fns
'
;
import
moment
from
'
moment
'
;
import
ToExamineModal
from
'
./ToExamine
'
;
import
{
columns
,
toolBarRender
}
from
'
./data
'
;
import
{
...
...
@@ -94,16 +95,28 @@ const PaymentMange = () => {
}
setToExamineModalVisibel
(
false
);
};
const
checkedTime
=
({
dateTimeRange
})
=>
{
const
startTimeStr
=
moment
(
dateTimeRange
?.[
0
]).
format
(
'
YYYY-MM-DD
'
);
const
endTimeStr
=
moment
(
dateTimeRange
?.[
1
]).
format
(
'
YYYY-MM-DD
'
);
const
diffTime
=
moment
(
endTimeStr
).
valueOf
()
-
moment
(
startTimeStr
).
valueOf
();
const
maxTime
=
62
*
3600
*
24
*
1000
;
if
(
!
dateTimeRange
?.[
0
])
{
notification
.
error
({
message
:
'
付款单开始时间不能为空
'
});
return
false
;
}
if
(
diffTime
>
maxTime
)
{
notification
.
error
({
message
:
'
只允许下载2个月的数据
'
});
return
false
;
}
return
true
;
};
const
onExport
=
async
()
=>
{
const
params
=
formRef
.
current
.
getFieldsValue
();
setloading
(
true
);
if
(
params
?.
dateTimeRange
?.[
0
]
)
{
if
(
checkedTime
(
params
)
)
{
const
data
=
await
selfPaymentExport
(
params
);
const
blob
=
new
Blob
([
data
]);
saveAs
(
blob
,
`付款单导出数据-
${
format
(
new
Date
(),
'
yyyyMMddHHmmss
'
)}
.xlsx`
);
}
else
{
notification
.
error
({
message
:
'
付款单开始时间不能为空
'
});
}
setloading
(
false
);
};
...
...
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