Merge branch 'develop' into 'devops-staging'
Develop See merge request empatnusabangsa/ppob/ppob-frontend!178
This commit is contained in:
commit
3b2d4a0cbc
|
@ -101,7 +101,7 @@ export const ProductComponent = observer((props) => {
|
|||
}).format(text),
|
||||
},
|
||||
{
|
||||
title: "Partner fee",
|
||||
title: "Fee Jual",
|
||||
dataIndex: "partner_fee",
|
||||
key: "partner_fee",
|
||||
render: (text) =>
|
||||
|
|
|
@ -66,13 +66,14 @@ export const Profile = observer(() => {
|
|||
await Promise.allSettled([
|
||||
store.authentication.getProfile(),
|
||||
store.transaction.getDataHistoryTransaction(),
|
||||
store.transaction.getDataHistoryCheckBill(),
|
||||
]);
|
||||
await store.transaction.getDataHistoryTopUpProfile(
|
||||
store.authentication.profileData?.id
|
||||
);
|
||||
modalLoader.setLoading(false);
|
||||
})();
|
||||
}, []);
|
||||
}, [store.transaction.filterStart, store.transaction.filterEnd]);
|
||||
|
||||
const handleRemoveFilter = async () => {
|
||||
store.transaction.filterStart = null;
|
||||
|
@ -81,11 +82,11 @@ export const Profile = observer(() => {
|
|||
setFilterStart([]);
|
||||
setFilterEnd([]);
|
||||
//await store.transaction.getDataHistoryTransaction();
|
||||
actionFilter === true
|
||||
? await store.transaction.getDataHistoryTopUpProfile(
|
||||
store.authentication.profileData?.id
|
||||
)
|
||||
: await store.transaction.getDataHistoryTransaction();
|
||||
// actionFilter === true
|
||||
// ? await store.transaction.getDataHistoryTopUpProfile(
|
||||
// store.authentication.profileData?.id
|
||||
// )
|
||||
// : await store.transaction.getDataHistoryTransaction();
|
||||
store.transaction.visibleModalFilterTransaction = false;
|
||||
setAction(false);
|
||||
};
|
||||
|
@ -95,11 +96,11 @@ export const Profile = observer(() => {
|
|||
//form.resetFields();
|
||||
store.transaction.filterEnd = null;
|
||||
store.transaction.visibleModalFilterTransaction = false;
|
||||
actionFilter === true
|
||||
? await store.transaction.getDataHistoryTopUpProfile(
|
||||
store.authentication.profileData?.id
|
||||
)
|
||||
: await store.transaction.getDataHistoryTransaction();
|
||||
// actionFilter === true
|
||||
// ? await store.transaction.getDataHistoryTopUpProfile(
|
||||
// store.authentication.profileData?.id
|
||||
// )
|
||||
// : await store.transaction.getDataHistoryTransaction();
|
||||
setAction(false);
|
||||
//await store.transaction.getDataHistoryTransaction();
|
||||
};
|
||||
|
@ -113,14 +114,14 @@ export const Profile = observer(() => {
|
|||
"YYYY-MM-DD HH:mm:ss"
|
||||
);
|
||||
modalLoader.setLoading(true);
|
||||
actionFilter === true
|
||||
? await store.transaction.getDataHistoryTopUpProfile(
|
||||
store.authentication.profileData?.id
|
||||
)
|
||||
: await store.transaction.getDataHistoryTransaction();
|
||||
// actionFilter === true
|
||||
// ? await store.transaction.getDataHistoryTopUpProfile(
|
||||
// store.authentication.profileData?.id
|
||||
// )
|
||||
// : await store.transaction.getDataHistoryTransaction();
|
||||
modalLoader.setLoading(false);
|
||||
store.transaction.filterStart = null;
|
||||
store.transaction.filterEnd = null;
|
||||
// store.transaction.filterStart = null;
|
||||
// store.transaction.filterEnd = null;
|
||||
//form.resetFields();
|
||||
store.transaction.visibleModalFilterTransaction = false;
|
||||
setAction(false);
|
||||
|
@ -266,6 +267,81 @@ export const Profile = observer(() => {
|
|||
},
|
||||
},
|
||||
];
|
||||
|
||||
const columnBill = [
|
||||
{
|
||||
title: "Code Product",
|
||||
dataIndex: "product_code",
|
||||
key: "product_code",
|
||||
},
|
||||
{
|
||||
title: "Admin Price",
|
||||
dataIndex: "admin_price",
|
||||
key: "admin_price",
|
||||
render: (text) =>
|
||||
new Intl.NumberFormat("id-ID", {
|
||||
style: "currency",
|
||||
currency: "IDR",
|
||||
}).format(text),
|
||||
},
|
||||
{
|
||||
title: "Tagihan BPJS",
|
||||
dataIndex: "amount",
|
||||
key: "amount",
|
||||
},
|
||||
{
|
||||
title: "Nomor tujuan",
|
||||
dataIndex: "destination",
|
||||
key: "destination",
|
||||
},
|
||||
{
|
||||
title: "Transaction Id",
|
||||
dataIndex: "trx_id",
|
||||
key: "trx_id",
|
||||
},
|
||||
{
|
||||
title: "Partner Transaction Id",
|
||||
dataIndex: "partner_trx_id",
|
||||
key: "partner_trx_id",
|
||||
},
|
||||
{
|
||||
title: "Tanggal Transaksi",
|
||||
dataIndex: "createdAt",
|
||||
key: "createdAt",
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<Text>
|
||||
{format(parseISO(record.createdAt), "dd MMMM yyyy HH:mm:ss")}
|
||||
</Text>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Status",
|
||||
dataIndex: "status",
|
||||
key: "status",
|
||||
render: (text, record) => {
|
||||
console.log("status", record)
|
||||
return (
|
||||
<Tag
|
||||
color={
|
||||
record.status === "SUCCESS"
|
||||
? "success"
|
||||
: record.status === 0
|
||||
? "warning"
|
||||
: "processing"
|
||||
}
|
||||
>
|
||||
{record.status === "SUCCESS"
|
||||
? "Sukses"
|
||||
: record.status === 0
|
||||
? "Dalam Proses"
|
||||
: "Gagal"}
|
||||
</Tag>
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
const styleSaldoTitle = store.ui.mediaQuery.isDesktop
|
||||
? {
|
||||
display: "flex",
|
||||
|
@ -605,8 +681,6 @@ export const Profile = observer(() => {
|
|||
dataSource={store.transaction.dataHistoryTransaction}
|
||||
pagination={{
|
||||
onChange: async (page, pageSize) => {
|
||||
console.log(page, "Page");
|
||||
console.log(pageSize, "Page size");
|
||||
store.transaction.page = pageSize;
|
||||
store.transaction.page = page - 1;
|
||||
modalLoader.setLoading(true);
|
||||
|
@ -704,6 +778,118 @@ export const Profile = observer(() => {
|
|||
</div>
|
||||
)}
|
||||
</TabPane>
|
||||
<TabPane tab="Riwayat Check Bill" key="3">
|
||||
<Button
|
||||
style={{ marginBottom: "1rem", marginLeft: 5 }}
|
||||
onClick={() => {
|
||||
store.transaction.visibleModalFilterTransaction = true;
|
||||
store.transaction.page = 0;
|
||||
setAction(true);
|
||||
}}
|
||||
>
|
||||
<FilterOutlined />
|
||||
Filter
|
||||
</Button>
|
||||
{store.ui.mediaQuery.isDesktop && (
|
||||
<Table
|
||||
key="1"
|
||||
hasEmpty
|
||||
columns={columnBill}
|
||||
dataSource={store.transaction.dataHistorybillProfile}
|
||||
bordered
|
||||
pagination={{
|
||||
pageSize: store.transaction.pageSize,
|
||||
total: store.transaction.total_dataHistorybillProfile,
|
||||
current: store.transaction.page + 1,
|
||||
showSizeChanger: true,
|
||||
simple: false,
|
||||
}}
|
||||
onChange={async (page) => {
|
||||
let pageNumber = page.current;
|
||||
store.transaction.pageSize = page.pageSize;
|
||||
store.transaction.page = pageNumber - 1;
|
||||
modalLoader.setLoading(true);
|
||||
await store.transaction.getDataHistoryCheckBill();
|
||||
modalLoader.setLoading(false);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{store.ui.mediaQuery.isMobile && (
|
||||
<div>
|
||||
<List
|
||||
itemLayout="horizontal"
|
||||
position={"top"}
|
||||
dataSource={store.transaction.dataHistorybillProfile}
|
||||
pagination={{
|
||||
onChange: async (page, pageSize) => {
|
||||
console.log(page, "Page");
|
||||
console.log(pageSize, "Page size");
|
||||
store.transaction.pageSize = pageSize;
|
||||
store.transaction.page = page - 1;
|
||||
modalLoader.setLoading(true);
|
||||
await store.transaction.getDataHistoryCheckBill();
|
||||
modalLoader.setLoading(false);
|
||||
},
|
||||
pageSize: store.transaction.pageSize,
|
||||
total: store.transaction.total_dataHistorybillProfile,
|
||||
current: store.transaction.page + 1,
|
||||
style: { marginBottom: "1rem", marginRight: "1rem" },
|
||||
}}
|
||||
style={{ padding: 0 }}
|
||||
renderItem={(item) => {
|
||||
return (
|
||||
<div>
|
||||
<List.Item
|
||||
key={item.id}
|
||||
style={{
|
||||
backgroundColor: "#ffffff",
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<List.Item.Meta
|
||||
className={["cariparkir-container"].join(" ")}
|
||||
title={item.id}
|
||||
description={
|
||||
<div style={{}}>
|
||||
<p>
|
||||
<small>
|
||||
Pengirim : {item.sender_name}
|
||||
</small>{" "}
|
||||
<br />
|
||||
<small>
|
||||
Amount :{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
style: "currency",
|
||||
currency: "IDR",
|
||||
}).format(item.amount || 0)}
|
||||
</small>{" "}
|
||||
<br />
|
||||
<small>
|
||||
Transaction Date :{" "}
|
||||
{format(
|
||||
parseISO(item.transaction_date),
|
||||
"dd-MM-yyyy"
|
||||
)}
|
||||
</small>{" "}
|
||||
<br />
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</List.Item>
|
||||
<Divider plain style={{ margin: 0 }} />
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
|
@ -11,8 +11,8 @@ export class Transaction {
|
|||
filterSubCategory = null;
|
||||
visibleModalProduct = false;
|
||||
visibleModalTransaction = false;
|
||||
pageSizeDetail=10;
|
||||
pageDetail=0
|
||||
pageSizeDetail = 10;
|
||||
pageDetail = 0
|
||||
|
||||
pageCategories = 0;
|
||||
pageSizeCategories = 10;
|
||||
|
@ -40,13 +40,16 @@ export class Transaction {
|
|||
dataHistoryTopUp = [];
|
||||
total_dataHistoryTopUp = 0;
|
||||
|
||||
dataHistorybillProfile = [];
|
||||
total_dataHistorybillProfile = 0;
|
||||
|
||||
dataHistoryTopUpProfile = [];
|
||||
total_dataHistoryTopUpProfile = 0;
|
||||
|
||||
dataTransaction = [];
|
||||
dataTransactionB2B = [];
|
||||
dataTransactionPartner = [];
|
||||
total_dataDetailHistoryTransactionDetailUser=0;
|
||||
total_dataDetailHistoryTransactionDetailUser = 0;
|
||||
|
||||
|
||||
//filter
|
||||
|
@ -130,6 +133,23 @@ 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}`
|
||||
// );
|
||||
console.log("bill", response);
|
||||
this.dataHistorybillProfile = response.body.data ?? [];
|
||||
this.total_dataHistorybillProfile = response?.body?.count ?? 0;
|
||||
console.log(this.total_dataHistorybillProfile)
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
async getDataHistoryTransaction() {
|
||||
try {
|
||||
const response = await http.get(
|
||||
|
@ -138,7 +158,6 @@ export class Transaction {
|
|||
console.log(response);
|
||||
this.dataHistoryTransaction = response.body.data ?? [];
|
||||
this.total_dataHistoryTransaction = response?.body?.count ?? 0;
|
||||
console.log(this.total_dataHistoryTransaction)
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
@ -147,7 +166,7 @@ export class Transaction {
|
|||
async getDetailHistoryTransaction(id) {
|
||||
try {
|
||||
const response = await http.get(`/transaction/history-user/${id}?page=${this.page}&pageSize=${this.pageSize}&start=${this.filterStart}&end=${this.filterEnd}`);
|
||||
console.log(response,'Data Trans');
|
||||
console.log(response, 'Data Trans');
|
||||
this.dataDetailHistoryTransactionDetailUser = response.body.data ?? [];
|
||||
this.total_data = response?.body?.count ?? 0;
|
||||
} catch (e) {
|
||||
|
@ -160,7 +179,7 @@ export class Transaction {
|
|||
const response = await http.get(
|
||||
`/transaction/history-deposit?page=${this.page}&pageSize=${this.pageSize}&user-destination=${id}&start=${this.filterStart}&end=${this.filterEnd}`
|
||||
);
|
||||
console.log(response,'get data history')
|
||||
console.log(response, 'get data history')
|
||||
this.dataHistoryTopUp = response.body.data ?? [];
|
||||
this.total_dataHistoryTopUp = response?.body?.count ?? 0;
|
||||
} catch (e) {
|
||||
|
@ -173,7 +192,7 @@ export class Transaction {
|
|||
const response = await http.get(
|
||||
`/transaction/history-deposit-profile?page=${this.page}&pageSize=${this.pageSize}&user-destination=${id}&start=${this.filterStart}&end=${this.filterEnd}`
|
||||
);
|
||||
console.log(response,'get data history Profile')
|
||||
console.log(response, 'get data history Profile')
|
||||
this.dataHistoryTopUpProfile = response.body.data ?? [];
|
||||
this.total_dataHistoryTopUpProfile = response?.body?.count ?? 0;
|
||||
} catch (e) {
|
||||
|
@ -193,7 +212,7 @@ export class Transaction {
|
|||
|
||||
async buyProduct(data) {
|
||||
const response = await http.post("/transaction/order").send(data);
|
||||
console.log(response,'dari store')
|
||||
console.log(response, 'dari store')
|
||||
return response;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user