- added form for between dates transaction history excel export
This commit is contained in:
parent
f3eefae54e
commit
e1ce45848a
|
@ -167,7 +167,8 @@ export const DetailUser = observer(() => {
|
||||||
const handleSubmitExport = async () => {
|
const handleSubmitExport = async () => {
|
||||||
const date = formExport.getFieldsValue();
|
const date = formExport.getFieldsValue();
|
||||||
const dataDate ={
|
const dataDate ={
|
||||||
dateStart: moment(date.tanggal_export).format("YYYY-MM-DD")
|
dateStart: moment(date.start_date).format("YYYY-MM-DD"),
|
||||||
|
dateEnd: moment(date.end_date).format("YYYY-MM-DD")
|
||||||
}
|
}
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
try {
|
try {
|
||||||
|
@ -1149,8 +1150,15 @@ export const DetailUser = observer(() => {
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form layout="vertical" name="filter" form={formExport}>
|
<Form layout="vertical" name="filter" form={formExport}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="tanggal_export"
|
name="start_date"
|
||||||
label="Tanggal"
|
label="Dari"
|
||||||
|
rules={[{ required: true, message: "Please input Date!" }]}
|
||||||
|
>
|
||||||
|
<DatePicker style={{ width: "100%" }} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="end_date"
|
||||||
|
label="Sampai"
|
||||||
rules={[{ required: true, message: "Please input Date!" }]}
|
rules={[{ required: true, message: "Please input Date!" }]}
|
||||||
>
|
>
|
||||||
<DatePicker style={{ width: "100%" }} />
|
<DatePicker style={{ width: "100%" }} />
|
||||||
|
|
|
@ -389,7 +389,8 @@ export const Profile = observer(() => {
|
||||||
const handleSubmitExport = async () => {
|
const handleSubmitExport = async () => {
|
||||||
const date = formExport.getFieldsValue();
|
const date = formExport.getFieldsValue();
|
||||||
const dataDate ={
|
const dataDate ={
|
||||||
dateStart: moment(date.tanggal_export).format("YYYY-MM-DD")
|
dateStart: moment(date.start_date).format("YYYY-MM-DD"),
|
||||||
|
dateEnd: moment(date.end_date).format("YYYY-MM-DD")
|
||||||
}
|
}
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
try {
|
try {
|
||||||
|
@ -1038,8 +1039,16 @@ export const Profile = observer(() => {
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form layout="vertical" name="filter" form={formExport}>
|
<Form layout="vertical" name="filter" form={formExport}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="tanggal_export"
|
name="start_date"
|
||||||
label="Tanggal"
|
label="Dari"
|
||||||
|
rules={[{ required: true, message: "Please input Date!" }]}
|
||||||
|
>
|
||||||
|
<DatePicker style={{ width: "100%" }} />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item
|
||||||
|
name="end_date"
|
||||||
|
label="Sampai"
|
||||||
rules={[{ required: true, message: "Please input Date!" }]}
|
rules={[{ required: true, message: "Please input Date!" }]}
|
||||||
>
|
>
|
||||||
<DatePicker style={{ width: "100%" }} />
|
<DatePicker style={{ width: "100%" }} />
|
||||||
|
|
|
@ -285,7 +285,7 @@ export class Transaction {
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
var fileDownload = require('react-file-download');
|
var fileDownload = require('react-file-download');
|
||||||
message.success("Success export");
|
message.success("Success export");
|
||||||
fileDownload(response.data, `Mutasi Transaki ${data.userDetail.name} ${date.dateStart}.xlsx`);
|
fileDownload(response.data, `Mutasi Transaki ${data.userDetail.name} ${date.dateStart} - ${date.dateEnd}.xlsx`);
|
||||||
return fileDownload;
|
return fileDownload;
|
||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
message.error("No data to export");
|
message.error("No data to export");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user