Merge branch 'develop' into 'devops-staging'

Perbaikan Project PPOB

See merge request empatnusabangsa/ppob/ppob-frontend!35
This commit is contained in:
ajat sudrajat 2022-01-03 05:16:22 +00:00
commit 93b466ad7a
4 changed files with 472 additions and 134 deletions

View File

@ -75,4 +75,8 @@ code {
.profile-container .ant-popover-inner-content {
padding: 0 !important;
}
.ant-menu-item-divider{
border-style: transparent !important;
}

View File

@ -8,6 +8,7 @@ import {
BarChartOutlined,
} from "@ant-design/icons";
import { ModalLoaderContext } from "../../utils/modal";
import Title from "antd/lib/skeleton/Title";
export const Home = observer(() => {
const modalLoader = useContext(ModalLoaderContext);
@ -20,7 +21,7 @@ export const Home = observer(() => {
await getData();
await store.membership.getDataBySuperior();
await store.partner.getData();
if(isAdmin){
if (isAdmin) {
await store.transaction.getDataTransaction();
await store.transaction.getDataTransactionB2B();
} else {
@ -99,152 +100,230 @@ export const Home = observer(() => {
];
return (
<div>
{store.ui.mediaQuery.isDesktop && store.authentication.userData.role === "Admin" && (
<Row
style={{
marginTop: 30,
marginLeft: 30,
}}
>
<Card
className={"shadow"}
hoverable
style={{
marginLeft: 20,
height: 200,
marginBottom: 10,
borderColor: "salmon",
width: "45%",
}}
>
<Row>
{/*<BarChartOutlined style={{ fontSize: 25 ,marginRight:80}} />*/}
<PageHeader title={<span>{store.transaction.dataTransaction.total_transaction} Transaksi B2C</span>}>
<p>
<h4>Total Penjualan : { new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(store.transaction.dataTransaction.total_amount)}</h4>
<h4>Total Modal : { new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(store.transaction.dataTransaction.total_modal)}</h4>
<h4>Total Profit : { new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(store.transaction.dataTransaction.total_profit)}</h4>
<h4>Total Komisi : { new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(store.transaction.dataTransaction.total_commission)}</h4>
</p>
</PageHeader>
</Row>
</Card>
<Card
className={"shadow"}
hoverable
style={{
marginLeft: 20,
height: 200,
marginBottom: 10,
borderColor: "salmon",
width: "45%",
}}
>
<Row>
<PageHeader title={<span>{store.transaction.dataTransactionB2B.total_transaction} Transaksi B2B</span>}>
<p>
<h4>Total Penjualan : { new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(store.transaction.dataTransactionB2B.total_amount)}</h4>
<h4>Total Modal : { new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(store.transaction.dataTransactionB2B.total_modal)}</h4>
<h4>Total Profit : { new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(store.transaction.dataTransactionB2B.total_profit)}</h4>
</p>
</PageHeader>
</Row>
</Card>
{/*<Card*/}
{/* className={"shadow"}*/}
{/* hoverable*/}
{/* style={{*/}
{/* marginLeft: 20,*/}
{/* height: 200,*/}
{/* marginBottom: 10,*/}
{/* borderColor: "salmon",*/}
{/* width: "30%",*/}
{/* }}*/}
{/*>*/}
{/* <Row>*/}
{/* <PageHeader title={<span>Total Keuntungan B2C</span>}>*/}
{/* <span>*/}
{/* {new Intl.NumberFormat("id-ID", {*/}
{/* style: "currency",*/}
{/* currency: "IDR",*/}
{/* }).format(store.authentication.profileData?.wallet || 0)}*/}
{/* </span>*/}
{/* </PageHeader>*/}
{/* </Row>*/}
{/*</Card>*/}
</Row>
)}
{store.ui.mediaQuery.isDesktop && store.authentication.userData.role === "Admin Partner" && (
{store.ui.mediaQuery.isDesktop &&
store.authentication.userData.role === "Admin" && (
<Row
style={{
marginTop: 30,
marginLeft: 30,
}}
style={{
marginTop: 30,
marginLeft: 30,
}}
>
<Card
className={"shadow"}
hoverable
style={{
marginLeft: 20,
height: 200,
marginBottom: 10,
borderColor: "salmon",
width: "45%",
}}
className={"shadow"}
hoverable
title={
<span
style={{
fontSize: 20,
fontStyle: "bold",
textAlign: "center",
}}
>
{store.transaction.dataTransaction.total_transaction}{" "}
Transaksi B2C
</span>
}
style={{
marginLeft: 20,
height: 200,
marginBottom: 10,
borderColor: "salmon",
width: "45%",
}}
>
<Row>
<Row style={{ marginTop: 20 }}>
<Col style={{ marginRight: 40 }}>
<p>
<h4>
Total Penjualan :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransaction.total_amount
)}
</h4>
<h4>
Total Modal :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransaction.total_modal
)}
</h4>
</p>
</Col>
<Col>
<p>
<h4>
Total Profit :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransaction.total_profit
)}
</h4>
<h4>
Total Komisi :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransaction.total_commission
)}
</h4>
</p>
</Col>
</Row>
</Row>
</Card>
<Card
className={"shadow"}
hoverable
title={
<span
style={{
fontSize: 20,
fontStyle: "bold",
textAlign: "center",
}}
>
{store.transaction.dataTransactionB2B.total_transaction}{" "}
Transaksi B2B
</span>
}
style={{
marginLeft: 20,
height: 200,
marginBottom: 10,
borderColor: "salmon",
width: "45%",
}}
>
<Row>
<Row style={{ marginTop: 20 }}>
<Col style={{ marginRight: 40 }}>
<p>
<h4>
Total Penjualan :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransactionB2B.total_amount
)}
</h4>
<h4>
Total Modal :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransactionB2B.total_modal
)}
</h4>
</p>
</Col>
<Col>
<p>
<h4>
Total Profit :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransactionB2B.total_profit
)}
</h4>
</p>
</Col>
</Row>
</Row>
</Card>
{/*<Card*/}
{/* className={"shadow"}*/}
{/* hoverable*/}
{/* style={{*/}
{/* marginLeft: 20,*/}
{/* height: 200,*/}
{/* marginBottom: 10,*/}
{/* borderColor: "salmon",*/}
{/* width: "30%",*/}
{/* }}*/}
{/*>*/}
{/* <Row>*/}
{/* <PageHeader title={<span>Total Keuntungan B2C</span>}>*/}
{/* <span>*/}
{/* {new Intl.NumberFormat("id-ID", {*/}
{/* style: "currency",*/}
{/* currency: "IDR",*/}
{/* }).format(store.authentication.profileData?.wallet || 0)}*/}
{/* </span>*/}
{/* </PageHeader>*/}
{/* </Row>*/}
{/*</Card>*/}
</Row>
)}
{store.ui.mediaQuery.isDesktop &&
store.authentication.userData.role === "Admin Partner" && (
<Row
style={{
marginTop: 30,
marginLeft: 30,
}}
>
<Card
className={"shadow"}
hoverable
style={{
marginLeft: 20,
height: 200,
marginBottom: 10,
borderColor: "salmon",
width: "45%",
}}
>
<Row>
<PageHeader title={<span>Total Transaksi</span>}>
<p>
<h4>{store.transaction.dataTransactionPartner.total_transaction}</h4>
<h4>
{
store.transaction.dataTransactionPartner
.total_transaction
}
</h4>
</p>
</PageHeader>
</Row>
</Card>
<Card
className={"shadow"}
hoverable
style={{
marginLeft: 20,
height: 200,
marginBottom: 10,
borderColor: "salmon",
width: "45%",
}}
className={"shadow"}
hoverable
style={{
marginLeft: 20,
height: 200,
marginBottom: 10,
borderColor: "salmon",
width: "45%",
}}
>
<Row>
<PageHeader title={<span>Total Penjualan</span>}>
<p>
<h4>{ new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(store.transaction.dataTransactionPartner.total_amount)}</h4>
<h4>
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransactionPartner.total_amount
)}
</h4>
</p>
</PageHeader>
</Row>
@ -272,7 +351,258 @@ export const Home = observer(() => {
{/* </Row>*/}
{/*</Card>*/}
</Row>
)}
)}
{store.ui.mediaQuery.isMobile &&
store.authentication.userData.role === "Admin" && (
<Row
style={{
marginTop: 20,
marginLeft: 10,
}}
>
<Card
className={"shadow"}
hoverable
title={
<span
style={{
fontSize: 20,
fontStyle: "bold",
textAlign: "center",
}}
>
{store.transaction.dataTransaction.total_transaction}{" "}
Transaksi B2C
</span>
}
style={{
marginLeft: 10,
height: 220,
marginBottom: 10,
borderColor: "salmon",
width: "90%",
}}
>
<Row>
<Row>
<Col style={{ marginRight: 40 }}>
<p>
<h4>
Total Penjualan :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransaction.total_amount
)}
</h4>
<h4>
Total Modal :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransaction.total_modal
)}
</h4>
</p>
</Col>
<Col>
<p>
<h4>
Total Profit :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransaction.total_profit
)}
</h4>
<h4>
Total Komisi :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransaction.total_commission
)}
</h4>
</p>
</Col>
</Row>
</Row>
</Card>
<Card
className={"shadow"}
hoverable
title={
<span
style={{
fontSize: 20,
fontStyle: "bold",
textAlign: "center",
}}
>
{store.transaction.dataTransactionB2B.total_transaction}{" "}
Transaksi B2B
</span>
}
style={{
marginLeft: 10,
height: 200,
borderColor: "salmon",
width: "90%",
}}
>
<Row>
<Row>
<Col style={{ marginRight: 40 }}>
<p>
<h4>
Total Penjualan :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransactionB2B.total_amount
)}
</h4>
<h4>
Total Modal :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransactionB2B.total_modal
)}
</h4>
</p>
</Col>
<Col>
<p>
<h4>
Total Profit :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransactionB2B.total_profit
)}
</h4>
</p>
</Col>
</Row>
</Row>
</Card>
{/*<Card*/}
{/* className={"shadow"}*/}
{/* hoverable*/}
{/* style={{*/}
{/* marginLeft: 20,*/}
{/* height: 200,*/}
{/* marginBottom: 10,*/}
{/* borderColor: "salmon",*/}
{/* width: "30%",*/}
{/* }}*/}
{/*>*/}
{/* <Row>*/}
{/* <PageHeader title={<span>Total Keuntungan B2C</span>}>*/}
{/* <span>*/}
{/* {new Intl.NumberFormat("id-ID", {*/}
{/* style: "currency",*/}
{/* currency: "IDR",*/}
{/* }).format(store.authentication.profileData?.wallet || 0)}*/}
{/* </span>*/}
{/* </PageHeader>*/}
{/* </Row>*/}
{/*</Card>*/}
</Row>
)}
{store.ui.mediaQuery.isMobile &&
store.authentication.userData.role === "Admin Partner" && (
<Row
style={{
marginTop: 20,
marginLeft: 10,
}}
>
<Card
className={"shadow"}
hoverable
style={{
marginLeft: 10,
height: 200,
marginBottom: 10,
borderColor: "salmon",
width: "90%",
}}
>
<Row>
<PageHeader title={<span>Total Transaksi</span>}>
<p>
<h4>
{
store.transaction.dataTransactionPartner
.total_transaction
}
</h4>
</p>
</PageHeader>
</Row>
</Card>
<Card
className={"shadow"}
hoverable
style={{
marginLeft: 10,
height: 200,
marginBottom: 10,
borderColor: "salmon",
width: "90%",
}}
>
<Row>
<PageHeader title={<span>Total Penjualan</span>}>
<p>
<h4>
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(
store.transaction.dataTransactionPartner.total_amount
)}
</h4>
</p>
</PageHeader>
</Row>
</Card>
{/*<Card*/}
{/* className={"shadow"}*/}
{/* hoverable*/}
{/* style={{*/}
{/* marginLeft: 20,*/}
{/* height: 200,*/}
{/* marginBottom: 10,*/}
{/* borderColor: "salmon",*/}
{/* width: "30%",*/}
{/* }}*/}
{/*>*/}
{/* <Row>*/}
{/* <PageHeader title={<span>Total Keuntungan B2C</span>}>*/}
{/* <span>*/}
{/* {new Intl.NumberFormat("id-ID", {*/}
{/* style: "currency",*/}
{/* currency: "IDR",*/}
{/* }).format(store.authentication.profileData?.wallet || 0)}*/}
{/* </span>*/}
{/* </PageHeader>*/}
{/* </Row>*/}
{/*</Card>*/}
</Row>
)}
{/*{store.authentication.userData.role === "Admin" &&*/}
{/* store.ui.mediaQuery.isDesktop && (*/}
{/* <Row style={{ marginLeft: 50, marginTop: 10 }}>*/}

View File

@ -224,7 +224,7 @@ export const DetailUser = observer(() => {
<Card>
<Row style={{marginBottom:10}}>
<Title strong level={2} >Detail User</Title>
<Col lg={20} xs={20} style={{ textAlign: "right" }}>
<Col lg={20} xs={20} style={{textAlign: "right" }}>
{store.authentication.userData.role === "Admin" && (
<Space
size="middle"

View File

@ -377,7 +377,11 @@ export const Membership = observer(() => {
current: store.membership.page + 1,
style: { marginBottom: "1rem", marginRight: "1rem" },
}}
dataSource={store.membership.data}
dataSource={
store.authentication.userData.role === "Admin"
? store.membership.dataMember
: store.membership.data
}
style={{ padding: 0 }}
renderItem={(item) => {
return (