Perbaikan Project PPOB
This commit is contained in:
parent
c95bd3eca3
commit
2f755d2d79
|
@ -10,6 +10,7 @@ import {
|
||||||
Typography,
|
Typography,
|
||||||
Tabs,
|
Tabs,
|
||||||
List,
|
List,
|
||||||
|
Tag,
|
||||||
Divider,
|
Divider,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import { BreadcumbComponent } from "../../component/BreadcumbComponent";
|
import { BreadcumbComponent } from "../../component/BreadcumbComponent";
|
||||||
|
@ -172,7 +173,23 @@ export const DetailUser = observer(() => {
|
||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
key: "status",
|
key: "status",
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return <Text>{record.status === 1 ? "Success" : "Pending"}</Text>;
|
return (
|
||||||
|
<Tag
|
||||||
|
color={
|
||||||
|
record.status === 1
|
||||||
|
? "success"
|
||||||
|
: record.status === 0
|
||||||
|
? "warning"
|
||||||
|
: "processing"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{record.status === 1
|
||||||
|
? "Success"
|
||||||
|
: record.status === 0
|
||||||
|
? "Pending"
|
||||||
|
: "Failed"}
|
||||||
|
</Tag>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -434,6 +451,27 @@ export const DetailUser = observer(() => {
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane tab="History Transaction" key="2">
|
<TabPane tab="History Transaction" key="2">
|
||||||
{store.ui.mediaQuery.isDesktop && (
|
{store.ui.mediaQuery.isDesktop && (
|
||||||
|
// <Table
|
||||||
|
// columns={columns}
|
||||||
|
// bordered
|
||||||
|
// dataSource={store.transaction.dataHistoryTransaction}
|
||||||
|
// pagination={{
|
||||||
|
// pageSize: store.transaction.pageSizeHistoryTransaction,
|
||||||
|
// total: store.transaction.total_dataHistoryTransaction,
|
||||||
|
// current: store.transaction.pageHistoryTransaction + 1,
|
||||||
|
// showSizeChanger: true,
|
||||||
|
// simple: false,
|
||||||
|
// }}
|
||||||
|
// onChange={async (page) => {
|
||||||
|
// let pageNumber = page.current;
|
||||||
|
// store.transaction.pageSizeHistoryTransaction =
|
||||||
|
// page.pageSize;
|
||||||
|
// store.transaction.pageHistoryTransaction = pageNumber - 1;
|
||||||
|
// modalLoader.setLoading(true);
|
||||||
|
// await store.transaction.getDataHistoryTransaction();
|
||||||
|
// modalLoader.setLoading(false);
|
||||||
|
// }}
|
||||||
|
// />
|
||||||
<Table
|
<Table
|
||||||
key="1"
|
key="1"
|
||||||
hasEmpty
|
hasEmpty
|
||||||
|
@ -443,13 +481,9 @@ export const DetailUser = observer(() => {
|
||||||
}
|
}
|
||||||
bordered
|
bordered
|
||||||
pagination={{
|
pagination={{
|
||||||
pageSize:
|
pageSize: store.transaction.pageSize,
|
||||||
store.transaction.pageSizeHistoryTransactionDetailUser,
|
total: store.transaction.total_data,
|
||||||
total:
|
current: store.transaction.page + 1,
|
||||||
store.transaction
|
|
||||||
.total_dataDetailHistoryTransactionDetailUser,
|
|
||||||
current:
|
|
||||||
store.transaction.pageHistoryTransactionDetailUser + 1,
|
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
simple: false,
|
simple: false,
|
||||||
}}
|
}}
|
||||||
|
@ -477,11 +511,13 @@ export const DetailUser = observer(() => {
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
},
|
},
|
||||||
pageSize: store.transaction.pageSize,
|
pageSize: store.transaction.pageSize,
|
||||||
total: store.transaction.totalData,
|
total: store.transaction.total_data,
|
||||||
current: store.transaction.page + 1,
|
current: store.transaction.page + 1,
|
||||||
style: { marginBottom: "1rem", marginRight: "1rem" },
|
style: { marginBottom: "1rem", marginRight: "1rem" },
|
||||||
}}
|
}}
|
||||||
dataSource={store.membership.data}
|
dataSource={
|
||||||
|
store.transaction.dataDetailHistoryTransactionDetailUser
|
||||||
|
}
|
||||||
style={{ padding: 0 }}
|
style={{ padding: 0 }}
|
||||||
renderItem={(item) => {
|
renderItem={(item) => {
|
||||||
return (
|
return (
|
||||||
|
@ -500,66 +536,61 @@ export const DetailUser = observer(() => {
|
||||||
>
|
>
|
||||||
<List.Item.Meta
|
<List.Item.Meta
|
||||||
className={["cariparkir-container"].join(" ")}
|
className={["cariparkir-container"].join(" ")}
|
||||||
title={item.name}
|
title={item.buyer}
|
||||||
description={
|
description={
|
||||||
<div style={{}}>
|
<div style={{}}>
|
||||||
<p>
|
<p>
|
||||||
<small>Saldo System : {item.name}</small>{" "}
|
<small>Price : {item.price}</small> <br />
|
||||||
<br />
|
|
||||||
<small>Role : {item.roleName}</small> <br />
|
|
||||||
<small>
|
<small>
|
||||||
Saldo Supplier : {item.coa?.amount}
|
Tujuan : {item.transaction_destination}
|
||||||
|
</small>{" "}
|
||||||
|
<br />
|
||||||
|
<small>
|
||||||
|
Kode Transaksi : {item.transaction_code}
|
||||||
|
</small>{" "}
|
||||||
|
<br />
|
||||||
|
<small>
|
||||||
|
Status :{" "}
|
||||||
|
{
|
||||||
|
<Tag
|
||||||
|
color={
|
||||||
|
item.status === 1
|
||||||
|
? "success"
|
||||||
|
: item.status === 0
|
||||||
|
? "warning"
|
||||||
|
: "processing"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{item.status === 1
|
||||||
|
? "Success"
|
||||||
|
: item.status === 0
|
||||||
|
? "Pending"
|
||||||
|
: "Failed"}
|
||||||
|
</Tag>
|
||||||
|
}
|
||||||
|
</small>{" "}
|
||||||
|
<br />
|
||||||
|
<small>
|
||||||
|
No.Seri : {item.seri_number}
|
||||||
|
</small>{" "}
|
||||||
|
<br />
|
||||||
|
<small>
|
||||||
|
IDTrx Mitra :{" "}
|
||||||
|
{item.partner_transaction_code}
|
||||||
|
</small>{" "}
|
||||||
|
<br />
|
||||||
|
<small>
|
||||||
|
Transaction Date :{" "}
|
||||||
|
{format(
|
||||||
|
parseISO(item.created_at),
|
||||||
|
"dd-MM-yyyy"
|
||||||
|
)}
|
||||||
</small>{" "}
|
</small>{" "}
|
||||||
<br />
|
<br />
|
||||||
{/* <Button
|
|
||||||
style={{ marginRight: 10 }}
|
|
||||||
onClick={() => {
|
|
||||||
setDestination(item?.id);
|
|
||||||
console.log(item?.id);
|
|
||||||
setIsVisibleTopUpModal(true);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<DownloadOutlined /> Top Up Saldo
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
onClick={async () => {
|
|
||||||
await store.transaction.getDataHistoryTopUp(
|
|
||||||
item.id
|
|
||||||
);
|
|
||||||
history.push(
|
|
||||||
LINKS.USER_DETAIL.replace(
|
|
||||||
":id",
|
|
||||||
item.id
|
|
||||||
)
|
|
||||||
);
|
|
||||||
console.log(item.id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Detail
|
|
||||||
</Button> */}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<div style={{ marginRight: 16 }}>
|
|
||||||
<p
|
|
||||||
style={{
|
|
||||||
fontSize: 9,
|
|
||||||
margin: 0,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* <Button
|
|
||||||
type={
|
|
||||||
item?.isActive === true ? "danger" : "primary"
|
|
||||||
}
|
|
||||||
onClick={() =>
|
|
||||||
changeStatus(item?.id, item?.isActive)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{item?.isActive === true ? "Inactive" : "Active"}
|
|
||||||
</Button> */}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</List.Item>
|
</List.Item>
|
||||||
<Divider plain style={{ margin: 0 }} />
|
<Divider plain style={{ margin: 0 }} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,7 +11,8 @@ import {
|
||||||
Form,
|
Form,
|
||||||
Input,
|
Input,
|
||||||
Divider,
|
Divider,
|
||||||
List
|
List,
|
||||||
|
Tag,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { BreadcumbComponent } from "../../component/BreadcumbComponent";
|
import { BreadcumbComponent } from "../../component/BreadcumbComponent";
|
||||||
|
@ -138,7 +139,23 @@ export const Profile = observer(() => {
|
||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
key: "status",
|
key: "status",
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return <Text>{record.status === 1 ? "Success" : "Pending"}</Text>;
|
return (
|
||||||
|
<Tag
|
||||||
|
color={
|
||||||
|
record.status === 1
|
||||||
|
? "success"
|
||||||
|
: record.status === 0
|
||||||
|
? "warning"
|
||||||
|
: "processing"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{record.status === 1
|
||||||
|
? "Success"
|
||||||
|
: record.status === 0
|
||||||
|
? "Pending"
|
||||||
|
: "Failed"}
|
||||||
|
</Tag>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -300,66 +317,106 @@ export const Profile = observer(() => {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{store.ui.mediaQuery.isMobile && (
|
{store.ui.mediaQuery.isMobile && (
|
||||||
<List
|
<List
|
||||||
itemLayout="horizontal"
|
itemLayout="horizontal"
|
||||||
position={"top"}
|
position={"top"}
|
||||||
dataSource={store.transaction.dataHistoryTransaction}
|
dataSource={store.transaction.dataHistoryTransaction}
|
||||||
pagination={{
|
pagination={{
|
||||||
pageSize: store.transaction.pageSizeHistoryTransaction,
|
pageSize: store.transaction.pageSizeHistoryTransaction,
|
||||||
total: store.transaction.total_dataHistoryTransaction,
|
total: store.transaction.total_dataHistoryTransaction,
|
||||||
current: store.transaction.pageHistoryTransaction + 1,
|
current: store.transaction.pageHistoryTransaction + 1,
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
simple: false,
|
simple: false,
|
||||||
}}
|
}}
|
||||||
onChange={async (page) => {
|
onChange={async (page) => {
|
||||||
let pageNumber = page.current;
|
let pageNumber = page.current;
|
||||||
store.transaction.pageSizeHistoryTransaction =
|
store.transaction.pageSizeHistoryTransaction =
|
||||||
page.pageSize;
|
page.pageSize;
|
||||||
store.transaction.pageHistoryTransaction = pageNumber - 1;
|
store.transaction.pageHistoryTransaction = pageNumber - 1;
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
await store.transaction.getDataHistoryTransaction();
|
await store.transaction.getDataHistoryTransaction();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
}}
|
}}
|
||||||
style={{ padding: 0 }}
|
style={{ padding: 0 }}
|
||||||
renderItem={(item) => {
|
renderItem={(item) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<List.Item
|
<List.Item
|
||||||
key={item.id}
|
key={item.id}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "#ffffff",
|
backgroundColor: "#ffffff",
|
||||||
paddingTop: 0,
|
paddingTop: 0,
|
||||||
paddingBottom: 0,
|
paddingBottom: 0,
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<List.Item.Meta
|
<List.Item.Meta
|
||||||
className={["cariparkir-container"].join(" ")}
|
className={["cariparkir-container"].join(" ")}
|
||||||
title={item.buyer}
|
title={item.buyer}
|
||||||
description={
|
description={
|
||||||
<div style={{}}>
|
<div style={{}}>
|
||||||
<p>
|
<p>
|
||||||
<small>Price : {item.price}</small> <br />
|
<small>Price : {item.price}</small> <br />
|
||||||
<small>Tujuan : {item.transaction_destination}</small> <br />
|
<small>
|
||||||
<small>Kode Transaksi : {item.transaction_code}</small> <br />
|
Tujuan : {item.transaction_destination}
|
||||||
<small>Status : {item.status === 1 ? "Success" : "Pending"}</small> <br />
|
</small>{" "}
|
||||||
<small>No.Seri : {item.seri_number}</small> <br />
|
<br />
|
||||||
<small>IDTrx Mitra : {item.partner_transaction_code}</small> <br />
|
<small>
|
||||||
<small>Transaction Date : {format(parseISO(item.created_at), "dd-MM-yyyy")}</small> <br />
|
Kode Transaksi : {item.transaction_code}
|
||||||
</p>
|
</small>{" "}
|
||||||
</div>
|
<br />
|
||||||
}
|
<small>
|
||||||
/>
|
Status :{" "}
|
||||||
</List.Item>
|
{
|
||||||
<Divider plain style={{ margin: 0 }} />
|
<Tag
|
||||||
</div>
|
color={
|
||||||
);
|
item.status === 1
|
||||||
}}
|
? "success"
|
||||||
/>
|
: item.status === 0
|
||||||
)}
|
? "warning"
|
||||||
|
: "processing"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{item.status === 1
|
||||||
|
? "Success"
|
||||||
|
: item.status === 0
|
||||||
|
? "Pending"
|
||||||
|
: "Failed"}
|
||||||
|
</Tag>
|
||||||
|
}
|
||||||
|
</small>{" "}
|
||||||
|
<br />
|
||||||
|
<small>
|
||||||
|
No.Seri : {item.seri_number}
|
||||||
|
</small>{" "}
|
||||||
|
<br />
|
||||||
|
<small>
|
||||||
|
IDTrx Mitra :{" "}
|
||||||
|
{item.partner_transaction_code}
|
||||||
|
</small>{" "}
|
||||||
|
<br />
|
||||||
|
<small>
|
||||||
|
Transaction Date :{" "}
|
||||||
|
{format(
|
||||||
|
parseISO(item.created_at),
|
||||||
|
"dd-MM-yyyy"
|
||||||
|
)}
|
||||||
|
</small>{" "}
|
||||||
|
<br />
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</List.Item>
|
||||||
|
<Divider plain style={{ margin: 0 }} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
@ -6,9 +6,13 @@ export class Transaction {
|
||||||
pageSize = 10;
|
pageSize = 10;
|
||||||
data = [];
|
data = [];
|
||||||
total_data = 0;
|
total_data = 0;
|
||||||
|
|
||||||
|
|
||||||
filterSubCategory = null;
|
filterSubCategory = null;
|
||||||
visibleModalProduct = false;
|
visibleModalProduct = false;
|
||||||
visibleModalTransaction = false;
|
visibleModalTransaction = false;
|
||||||
|
pageSizeDetail=10;
|
||||||
|
pageDetail=0
|
||||||
|
|
||||||
pageCategories = 0;
|
pageCategories = 0;
|
||||||
pageSizeCategories = 10;
|
pageSizeCategories = 10;
|
||||||
|
@ -39,6 +43,7 @@ export class Transaction {
|
||||||
dataTransaction = [];
|
dataTransaction = [];
|
||||||
dataTransactionB2B = [];
|
dataTransactionB2B = [];
|
||||||
dataTransactionPartner = [];
|
dataTransactionPartner = [];
|
||||||
|
total_dataDetailHistoryTransactionDetailUser=0;
|
||||||
|
|
||||||
|
|
||||||
//filter
|
//filter
|
||||||
|
@ -137,10 +142,10 @@ export class Transaction {
|
||||||
|
|
||||||
async getDetailHistoryTransaction(id) {
|
async getDetailHistoryTransaction(id) {
|
||||||
try {
|
try {
|
||||||
const response = await http.get(`/transaction/history-user/${id}?page=${this.pageHistoryTransactionDetailUser}&pageSize=${this.pageSizeHistoryTransactionDetailUser}&start=${this.filterStartDetailUser}&end=${this.filterEndDetailUser}`);
|
const response = await http.get(`/transaction/history-user/${id}?page=${this.page}&pageSize=${this.pageSize}&start=${this.filterStartDetailUser}&end=${this.filterEndDetailUser}`);
|
||||||
console.log(response,'Data Trans');
|
console.log(response,'Data Trans');
|
||||||
this.dataDetailHistoryTransactionDetailUser = response.body.data ?? [];
|
this.dataDetailHistoryTransactionDetailUser = response.body.data ?? [];
|
||||||
this.total_dataDetailHistoryTransactionDetailUser = response?.body?.count ?? 0;
|
this.total_data = response?.body?.count ?? 0;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user