This commit is contained in:
2023-05-04 02:46:39 +07:00
3 changed files with 63 additions and 51 deletions

View File

@@ -46,9 +46,13 @@ export class Transaction {
dataHistoryTopUp = [];
total_dataHistoryTopUp = 0;
pageHistorybillProfile = 0;
pageSizeHistorybillProfile = 10;
dataHistorybillProfile = [];
total_dataHistorybillProfile = 0;
pageHistoryTopUpProfile = 0;
pageSizeHistoryTopUpProfile = 10;
dataHistoryTopUpProfile = [];
total_dataHistoryTopUpProfile = 0;
@@ -141,12 +145,12 @@ export class Transaction {
async getDataHistoryCheckBill() {
try {
const response = await http.get(
`/transaction/check-bill-history`
);
// const response = await http.get(
// `/transaction/check-bill-history?page=${this.page}&pageSize=${this.pageSize}&start=${this.filterStart}&end=${this.filterEnd}`
// `/transaction/check-bill-history`
// );
const response = await http.get(
`/transaction/check-bill-history?page=${this.pageHistorybillProfile}&pageSize=${this.pageSizeHistorybillProfile}`
);
console.log("bill", response);
this.dataHistorybillProfile = response.body.data ?? [];
this.total_dataHistorybillProfile = response?.body?.count ?? 0;
@@ -183,7 +187,7 @@ export class Transaction {
async getDataHistoryTopUp(id) {
try {
const response = await http.get(
`/transaction/history-deposit?page=${this.page}&pageSize=${this.pageSize}&user-destination=${id}&start=${this.filterStart}&end=${this.filterEnd}`
`/transaction/history-deposit?page=${this.pageHistoryTopUp}&pageSize=${this.pageSizeHistoryTopUp}&user-destination=${id}&start=${this.filterStart}&end=${this.filterEnd}`
);
console.log(response, 'get data history')
this.dataHistoryTopUp = response.body.data ?? [];
@@ -196,7 +200,7 @@ export class Transaction {
async getDataHistoryTopUpProfile(id) {
try {
const response = await http.get(
`/transaction/history-deposit-profile?page=${this.page}&pageSize=${this.pageSize}&user-destination=${id}&start=${this.filterStart}&end=${this.filterEnd}`
`/transaction/history-deposit-profile?page=${this.pageHistoryTopUpProfile}&pageSize=${this.pageSizeHistoryTopUpProfile}&user-destination=${id}&start=${this.filterStart}&end=${this.filterEnd}`
);
console.log(response, 'get data history Profile')
this.dataHistoryTopUpProfile = response.body.data ?? [];
@@ -285,7 +289,7 @@ export class Transaction {
}).then((response) => {
var fileDownload = require('react-file-download');
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;
}).catch(function (error) {
message.error("No data to export");