Merge branch 'develop' into 'devops-staging'
Develop See merge request empatnusabangsa/ppob/ppob-frontend!178
This commit is contained in:
commit
56c0662f8e
|
@ -101,7 +101,7 @@ export const ProductComponent = observer((props) => {
|
||||||
}).format(text),
|
}).format(text),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Partner fee",
|
title: "Fee Jual",
|
||||||
dataIndex: "partner_fee",
|
dataIndex: "partner_fee",
|
||||||
key: "partner_fee",
|
key: "partner_fee",
|
||||||
render: (text) =>
|
render: (text) =>
|
||||||
|
|
|
@ -66,13 +66,14 @@ export const Profile = observer(() => {
|
||||||
await Promise.allSettled([
|
await Promise.allSettled([
|
||||||
store.authentication.getProfile(),
|
store.authentication.getProfile(),
|
||||||
store.transaction.getDataHistoryTransaction(),
|
store.transaction.getDataHistoryTransaction(),
|
||||||
|
store.transaction.getDataHistoryCheckBill(),
|
||||||
]);
|
]);
|
||||||
await store.transaction.getDataHistoryTopUpProfile(
|
await store.transaction.getDataHistoryTopUpProfile(
|
||||||
store.authentication.profileData?.id
|
store.authentication.profileData?.id
|
||||||
);
|
);
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
})();
|
})();
|
||||||
}, []);
|
}, [store.transaction.filterStart, store.transaction.filterEnd]);
|
||||||
|
|
||||||
const handleRemoveFilter = async () => {
|
const handleRemoveFilter = async () => {
|
||||||
store.transaction.filterStart = null;
|
store.transaction.filterStart = null;
|
||||||
|
@ -81,11 +82,11 @@ export const Profile = observer(() => {
|
||||||
setFilterStart([]);
|
setFilterStart([]);
|
||||||
setFilterEnd([]);
|
setFilterEnd([]);
|
||||||
//await store.transaction.getDataHistoryTransaction();
|
//await store.transaction.getDataHistoryTransaction();
|
||||||
actionFilter === true
|
// actionFilter === true
|
||||||
? await store.transaction.getDataHistoryTopUpProfile(
|
// ? await store.transaction.getDataHistoryTopUpProfile(
|
||||||
store.authentication.profileData?.id
|
// store.authentication.profileData?.id
|
||||||
)
|
// )
|
||||||
: await store.transaction.getDataHistoryTransaction();
|
// : await store.transaction.getDataHistoryTransaction();
|
||||||
store.transaction.visibleModalFilterTransaction = false;
|
store.transaction.visibleModalFilterTransaction = false;
|
||||||
setAction(false);
|
setAction(false);
|
||||||
};
|
};
|
||||||
|
@ -95,11 +96,11 @@ export const Profile = observer(() => {
|
||||||
//form.resetFields();
|
//form.resetFields();
|
||||||
store.transaction.filterEnd = null;
|
store.transaction.filterEnd = null;
|
||||||
store.transaction.visibleModalFilterTransaction = false;
|
store.transaction.visibleModalFilterTransaction = false;
|
||||||
actionFilter === true
|
// actionFilter === true
|
||||||
? await store.transaction.getDataHistoryTopUpProfile(
|
// ? await store.transaction.getDataHistoryTopUpProfile(
|
||||||
store.authentication.profileData?.id
|
// store.authentication.profileData?.id
|
||||||
)
|
// )
|
||||||
: await store.transaction.getDataHistoryTransaction();
|
// : await store.transaction.getDataHistoryTransaction();
|
||||||
setAction(false);
|
setAction(false);
|
||||||
//await store.transaction.getDataHistoryTransaction();
|
//await store.transaction.getDataHistoryTransaction();
|
||||||
};
|
};
|
||||||
|
@ -113,14 +114,14 @@ export const Profile = observer(() => {
|
||||||
"YYYY-MM-DD HH:mm:ss"
|
"YYYY-MM-DD HH:mm:ss"
|
||||||
);
|
);
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
actionFilter === true
|
// actionFilter === true
|
||||||
? await store.transaction.getDataHistoryTopUpProfile(
|
// ? await store.transaction.getDataHistoryTopUpProfile(
|
||||||
store.authentication.profileData?.id
|
// store.authentication.profileData?.id
|
||||||
)
|
// )
|
||||||
: await store.transaction.getDataHistoryTransaction();
|
// : await store.transaction.getDataHistoryTransaction();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
store.transaction.filterStart = null;
|
// store.transaction.filterStart = null;
|
||||||
store.transaction.filterEnd = null;
|
// store.transaction.filterEnd = null;
|
||||||
//form.resetFields();
|
//form.resetFields();
|
||||||
store.transaction.visibleModalFilterTransaction = false;
|
store.transaction.visibleModalFilterTransaction = false;
|
||||||
setAction(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
|
const styleSaldoTitle = store.ui.mediaQuery.isDesktop
|
||||||
? {
|
? {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
@ -605,8 +681,6 @@ export const Profile = observer(() => {
|
||||||
dataSource={store.transaction.dataHistoryTransaction}
|
dataSource={store.transaction.dataHistoryTransaction}
|
||||||
pagination={{
|
pagination={{
|
||||||
onChange: async (page, pageSize) => {
|
onChange: async (page, pageSize) => {
|
||||||
console.log(page, "Page");
|
|
||||||
console.log(pageSize, "Page size");
|
|
||||||
store.transaction.page = pageSize;
|
store.transaction.page = pageSize;
|
||||||
store.transaction.page = page - 1;
|
store.transaction.page = page - 1;
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
|
@ -704,6 +778,118 @@ export const Profile = observer(() => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</TabPane>
|
</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>
|
</Tabs>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
@ -11,8 +11,8 @@ export class Transaction {
|
||||||
filterSubCategory = null;
|
filterSubCategory = null;
|
||||||
visibleModalProduct = false;
|
visibleModalProduct = false;
|
||||||
visibleModalTransaction = false;
|
visibleModalTransaction = false;
|
||||||
pageSizeDetail=10;
|
pageSizeDetail = 10;
|
||||||
pageDetail=0
|
pageDetail = 0
|
||||||
|
|
||||||
pageCategories = 0;
|
pageCategories = 0;
|
||||||
pageSizeCategories = 10;
|
pageSizeCategories = 10;
|
||||||
|
@ -40,13 +40,16 @@ export class Transaction {
|
||||||
dataHistoryTopUp = [];
|
dataHistoryTopUp = [];
|
||||||
total_dataHistoryTopUp = 0;
|
total_dataHistoryTopUp = 0;
|
||||||
|
|
||||||
|
dataHistorybillProfile = [];
|
||||||
|
total_dataHistorybillProfile = 0;
|
||||||
|
|
||||||
dataHistoryTopUpProfile = [];
|
dataHistoryTopUpProfile = [];
|
||||||
total_dataHistoryTopUpProfile = 0;
|
total_dataHistoryTopUpProfile = 0;
|
||||||
|
|
||||||
dataTransaction = [];
|
dataTransaction = [];
|
||||||
dataTransactionB2B = [];
|
dataTransactionB2B = [];
|
||||||
dataTransactionPartner = [];
|
dataTransactionPartner = [];
|
||||||
total_dataDetailHistoryTransactionDetailUser=0;
|
total_dataDetailHistoryTransactionDetailUser = 0;
|
||||||
|
|
||||||
|
|
||||||
//filter
|
//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() {
|
async getDataHistoryTransaction() {
|
||||||
try {
|
try {
|
||||||
const response = await http.get(
|
const response = await http.get(
|
||||||
|
@ -138,7 +158,6 @@ export class Transaction {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
this.dataHistoryTransaction = response.body.data ?? [];
|
this.dataHistoryTransaction = response.body.data ?? [];
|
||||||
this.total_dataHistoryTransaction = response?.body?.count ?? 0;
|
this.total_dataHistoryTransaction = response?.body?.count ?? 0;
|
||||||
console.log(this.total_dataHistoryTransaction)
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
@ -147,7 +166,7 @@ export class Transaction {
|
||||||
async getDetailHistoryTransaction(id) {
|
async getDetailHistoryTransaction(id) {
|
||||||
try {
|
try {
|
||||||
const response = await http.get(`/transaction/history-user/${id}?page=${this.page}&pageSize=${this.pageSize}&start=${this.filterStart}&end=${this.filterEnd}`);
|
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.dataDetailHistoryTransactionDetailUser = response.body.data ?? [];
|
||||||
this.total_data = response?.body?.count ?? 0;
|
this.total_data = response?.body?.count ?? 0;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -160,7 +179,7 @@ export class Transaction {
|
||||||
const response = await http.get(
|
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.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.dataHistoryTopUp = response.body.data ?? [];
|
||||||
this.total_dataHistoryTopUp = response?.body?.count ?? 0;
|
this.total_dataHistoryTopUp = response?.body?.count ?? 0;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -173,7 +192,7 @@ export class Transaction {
|
||||||
const response = await http.get(
|
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.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.dataHistoryTopUpProfile = response.body.data ?? [];
|
||||||
this.total_dataHistoryTopUpProfile = response?.body?.count ?? 0;
|
this.total_dataHistoryTopUpProfile = response?.body?.count ?? 0;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -193,7 +212,7 @@ export class Transaction {
|
||||||
|
|
||||||
async buyProduct(data) {
|
async buyProduct(data) {
|
||||||
const response = await http.post("/transaction/order").send(data);
|
const response = await http.post("/transaction/order").send(data);
|
||||||
console.log(response,'dari store')
|
console.log(response, 'dari store')
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user