Merge branch 'develop' into 'devops-staging'
Develop See merge request empatnusabangsa/ppob/ppob-frontend!7
This commit is contained in:
commit
f332e7da80
|
@ -139,7 +139,7 @@ export const CategoryComponent = observer((props) => {
|
||||||
store.category.pageSize = page.pageSize;
|
store.category.pageSize = page.pageSize;
|
||||||
store.category.page = pageNumber - 1;
|
store.category.page = pageNumber - 1;
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
//await store.category.getData();
|
await store.category.getData();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import React, {useContext, useEffect, useState} from "react";
|
import React, {useContext, useState} from "react";
|
||||||
import {Button, Form, Input, message, Modal, Select, Space, Table,} from "antd";
|
import {Button, Form, Input, message, Modal, Space, Table,} from "antd";
|
||||||
import {observer} from "mobx-react-lite";
|
import {observer} from "mobx-react-lite";
|
||||||
import {useHistory} from "react-router-dom";
|
import {useHistory} from "react-router-dom";
|
||||||
import {useStore} from "../utils/useStore";
|
import {useStore} from "../utils/useStore";
|
||||||
import {LINKS} from "../routes/app";
|
|
||||||
import {ModalLoaderContext} from "../utils/modal";
|
import {ModalLoaderContext} from "../utils/modal";
|
||||||
|
|
||||||
export const CommissionComponent = observer((props) => {
|
export const CommissionComponent = observer((props) => {
|
||||||
|
@ -32,6 +31,7 @@ export const CommissionComponent = observer((props) => {
|
||||||
title: "Amount",
|
title: "Amount",
|
||||||
dataIndex: "commission",
|
dataIndex: "commission",
|
||||||
key: "commission",
|
key: "commission",
|
||||||
|
render: (text) => <span>{text}%</span>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Action",
|
title: "Action",
|
||||||
|
@ -82,7 +82,7 @@ export const CommissionComponent = observer((props) => {
|
||||||
store.commission.pageSize = page.pageSize;
|
store.commission.pageSize = page.pageSize;
|
||||||
store.commission.page = pageNumber - 1;
|
store.commission.page = pageNumber - 1;
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
//await store.commission.getData();
|
await store.commission.getData();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -211,7 +211,7 @@ export const PartnerComponent = observer((props) => {
|
||||||
store.partner.pageSize = page.pageSize;
|
store.partner.pageSize = page.pageSize;
|
||||||
store.partner.page = pageNumber - 1;
|
store.partner.page = pageNumber - 1;
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
//await store.partner.getData();
|
await store.partner.getData();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,5 +1,20 @@
|
||||||
import React, {useContext, useState} from "react";
|
import React, {useContext, useState} from "react";
|
||||||
import {Button, Col, Divider, Form, Input, List, message, Modal, Row, Select, Table, Tag, Typography,} from "antd";
|
import {
|
||||||
|
Button,
|
||||||
|
Col,
|
||||||
|
Divider,
|
||||||
|
Form,
|
||||||
|
Input,
|
||||||
|
InputNumber,
|
||||||
|
List,
|
||||||
|
message,
|
||||||
|
Modal,
|
||||||
|
Row,
|
||||||
|
Select,
|
||||||
|
Table,
|
||||||
|
Tag,
|
||||||
|
Typography,
|
||||||
|
} from "antd";
|
||||||
import {observer} from "mobx-react-lite";
|
import {observer} from "mobx-react-lite";
|
||||||
import {ExclamationCircleOutlined} from "@ant-design/icons";
|
import {ExclamationCircleOutlined} from "@ant-design/icons";
|
||||||
import {useHistory} from "react-router-dom";
|
import {useHistory} from "react-router-dom";
|
||||||
|
@ -48,11 +63,21 @@ export const ProductComponent = observer((props) => {
|
||||||
title: "Harga Beli",
|
title: "Harga Beli",
|
||||||
dataIndex: "current_price_price",
|
dataIndex: "current_price_price",
|
||||||
key: "current_price_price",
|
key: "current_price_price",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Harga Jual",
|
title: "Harga Jual",
|
||||||
dataIndex: "mark_up_price",
|
dataIndex: "mark_up_price",
|
||||||
key: "mark_up_price",
|
key: "mark_up_price",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: "Gangguan",
|
// title: "Gangguan",
|
||||||
|
@ -73,10 +98,10 @@ export const ProductComponent = observer((props) => {
|
||||||
key: "tersedia",
|
key: "tersedia",
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Tag
|
<Tag
|
||||||
color={record?.status === "ACTIVE" ? "blue" : "#E3E8EE"}
|
color={record?.product_status === "ACTIVE" ? "blue" : "#E3E8EE"}
|
||||||
style={{ color: "#4F566B" }}
|
style={{ color: "#4F566B" }}
|
||||||
>
|
>
|
||||||
{record?.status === "ACTIVE" ? " Tersedia" : "Tidak"}
|
{record?.product_status === "ACTIVE" ? " Tersedia" : "Tidak"}
|
||||||
</Tag>
|
</Tag>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
@ -86,7 +111,7 @@ export const ProductComponent = observer((props) => {
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
history.push(LINKS.DETAILPRODUCT.replace(":id", record.id));
|
history.push(LINKS.PRODUCT_DETAIL.replace(":id", record.id));
|
||||||
//console.log(record.id)
|
//console.log(record.id)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -285,16 +310,14 @@ export const ProductComponent = observer((props) => {
|
||||||
>
|
>
|
||||||
<List.Item.Meta
|
<List.Item.Meta
|
||||||
className={["cariparkir-container"].join(" ")}
|
className={["cariparkir-container"].join(" ")}
|
||||||
title={item.code}
|
title={item.product_code}
|
||||||
description={
|
description={
|
||||||
<div style={{}}>
|
<div style={{}}>
|
||||||
<p>
|
<p>
|
||||||
<small>Nama Produk : {item.name}</small> <br />
|
<small>{item.product_name}</small> <br />
|
||||||
<small>Harga Beli : {item.currentPrice.price}</small>
|
<small>Harga Beli : {item.current_price_price}</small>
|
||||||
<br />
|
<br />
|
||||||
<small>
|
<small>Harga Jual : {item.mark_up_price}</small>
|
||||||
Harga Jual : {item.currentPrice.mark_up_price}
|
|
||||||
</small>
|
|
||||||
</p>
|
</p>
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -308,10 +331,14 @@ export const ProductComponent = observer((props) => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Tag
|
<Tag
|
||||||
color={item?.status === "ACTIVE" ? "blue" : "#E3E8EE"}
|
color={
|
||||||
|
item?.product_status === "ACTIVE" ? "blue" : "#E3E8EE"
|
||||||
|
}
|
||||||
style={{ color: "#4F566B" }}
|
style={{ color: "#4F566B" }}
|
||||||
>
|
>
|
||||||
{item?.status === "ACTIVE" ? " Tersedia" : "Tidak"}
|
{item?.product_status === "ACTIVE"
|
||||||
|
? " Tersedia"
|
||||||
|
: "Tidak"}
|
||||||
</Tag>
|
</Tag>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -357,14 +384,26 @@ export const ProductComponent = observer((props) => {
|
||||||
label="Price"
|
label="Price"
|
||||||
rules={[{ required: true, message: "Please input price!" }]}
|
rules={[{ required: true, message: "Please input price!" }]}
|
||||||
>
|
>
|
||||||
<Input />
|
<InputNumber
|
||||||
|
style={{ width: "100%" }}
|
||||||
|
formatter={(value) =>
|
||||||
|
`Rp. ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
|
||||||
|
}
|
||||||
|
parser={(value) => value.replace(/\Rp.\s?|(,*)/g, "")}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="markUpPrice"
|
name="markUpPrice"
|
||||||
label="Mark Up Price"
|
label="Mark Up Price"
|
||||||
rules={[{ required: true, message: "Please input mark up price!" }]}
|
rules={[{ required: true, message: "Please input mark up price!" }]}
|
||||||
>
|
>
|
||||||
<Input />
|
<InputNumber
|
||||||
|
style={{ width: "100%" }}
|
||||||
|
formatter={(value) =>
|
||||||
|
`Rp. ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
|
||||||
|
}
|
||||||
|
parser={(value) => value.replace(/\Rp.\s?|(,*)/g, "")}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="code"
|
name="code"
|
||||||
|
|
|
@ -1,19 +1,6 @@
|
||||||
import React, { useContext, useState,useEffect } from "react";
|
import React, {useContext, useEffect, useState} from "react";
|
||||||
import {
|
import {Button, Divider, Form, Input, List, message, Modal, Select, Space, Table,} from "antd";
|
||||||
Button,
|
|
||||||
Form,
|
|
||||||
Input,
|
|
||||||
message,
|
|
||||||
Modal,
|
|
||||||
Select,
|
|
||||||
Space,
|
|
||||||
Table,
|
|
||||||
List,
|
|
||||||
Tag,
|
|
||||||
Divider,
|
|
||||||
} from "antd";
|
|
||||||
import {observer} from "mobx-react-lite";
|
import {observer} from "mobx-react-lite";
|
||||||
import { useHistory } from "react-router-dom";
|
|
||||||
import {useStore} from "../utils/useStore";
|
import {useStore} from "../utils/useStore";
|
||||||
import {ModalLoaderContext} from "../utils/modal";
|
import {ModalLoaderContext} from "../utils/modal";
|
||||||
|
|
||||||
|
@ -126,7 +113,7 @@ export const SubcategoryComponent = observer((props) => {
|
||||||
store.subcategory.pageSize = page.pageSize;
|
store.subcategory.pageSize = page.pageSize;
|
||||||
store.subcategory.page = pageNumber - 1;
|
store.subcategory.page = pageNumber - 1;
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
// await getData();
|
await getData();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
|
@ -219,7 +219,7 @@ export const SupplierComponent = observer((props) => {
|
||||||
store.supplier.pageSize = page.pageSize;
|
store.supplier.pageSize = page.pageSize;
|
||||||
store.supplier.page = pageNumber - 1;
|
store.supplier.page = pageNumber - 1;
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
//await store.supplier.getData();
|
await store.supplier.getData();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useContext } from "react";
|
import React, { useContext } from "react";
|
||||||
import {Form, Input, message, Modal} from "antd";
|
import { Form, Input, message, Modal, InputNumber } from "antd";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { useStore } from "../utils/useStore";
|
import { useStore } from "../utils/useStore";
|
||||||
import { ModalLoaderContext } from "../utils/modal";
|
import { ModalLoaderContext } from "../utils/modal";
|
||||||
|
@ -69,7 +69,13 @@ export const TopupsaldoModal = observer((props) => {
|
||||||
label="Amount"
|
label="Amount"
|
||||||
rules={[{ required: true, message: "Please input amount!" }]}
|
rules={[{ required: true, message: "Please input amount!" }]}
|
||||||
>
|
>
|
||||||
<Input/>
|
<InputNumber
|
||||||
|
style={{ width: "100%" }}
|
||||||
|
formatter={(value) =>
|
||||||
|
`Rp. ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
|
||||||
|
}
|
||||||
|
parser={(value) => value.replace(/\Rp.\s?|(,*)/g, "")}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -63,6 +63,7 @@ code {
|
||||||
.ant-menu-submenu-arrow{
|
.ant-menu-submenu-arrow{
|
||||||
padding-right: 40px !important;
|
padding-right: 40px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-breadcrumb {
|
.ant-breadcrumb {
|
||||||
margin-bottom: 10px !important;
|
margin-bottom: 10px !important;
|
||||||
}
|
}
|
||||||
|
@ -71,3 +72,7 @@ code {
|
||||||
color: #ed1f24 !important;
|
color: #ed1f24 !important;
|
||||||
border-color: #ed1f24 !important;
|
border-color: #ed1f24 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.profile-container .ant-popover-inner-content {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
|
@ -3,17 +3,18 @@ import { Button, Drawer, Layout, Menu, Popover, Typography } from "antd";
|
||||||
import {MenuList} from "./MenuList";
|
import {MenuList} from "./MenuList";
|
||||||
import {Link, useHistory} from "react-router-dom";
|
import {Link, useHistory} from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
HomeOutlined,
|
AlipayOutlined,
|
||||||
MenuOutlined,
|
|
||||||
UserOutlined,
|
|
||||||
ProfileOutlined,
|
|
||||||
DatabaseOutlined,
|
DatabaseOutlined,
|
||||||
FileAddOutlined,
|
FileAddOutlined,
|
||||||
FileSyncOutlined,
|
|
||||||
FileProtectOutlined,
|
FileProtectOutlined,
|
||||||
|
FileSyncOutlined,
|
||||||
|
HomeOutlined,
|
||||||
|
LogoutOutlined,
|
||||||
|
MenuOutlined,
|
||||||
|
PayCircleOutlined,
|
||||||
|
ProfileOutlined,
|
||||||
ShoppingCartOutlined,
|
ShoppingCartOutlined,
|
||||||
AlipayOutlined,
|
UserOutlined
|
||||||
PayCircleOutlined
|
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import {AppRoute, LINKS} from "../../routes/app";
|
import {AppRoute, LINKS} from "../../routes/app";
|
||||||
import {useStore} from "../../utils/useStore";
|
import {useStore} from "../../utils/useStore";
|
||||||
|
@ -219,7 +220,7 @@ export const DesktopLayout = observer(() => {
|
||||||
)}
|
)}
|
||||||
{store.authentication.userData.role !== "Admin" && (
|
{store.authentication.userData.role !== "Admin" && (
|
||||||
<Menu.Item key="payback-from-user">
|
<Menu.Item key="payback-from-user">
|
||||||
<Link to={LINKS.PAYBACKFROMUSER}>
|
<Link to={LINKS.PAYBACK_FROM_USER}>
|
||||||
<AlipayOutlined/>
|
<AlipayOutlined/>
|
||||||
<span>Payback</span>
|
<span>Payback</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -363,17 +364,20 @@ export const DesktopLayout = observer(() => {
|
||||||
}}
|
}}
|
||||||
mode="inline"
|
mode="inline"
|
||||||
>
|
>
|
||||||
<Menu.Item>
|
{store.authentication.userData.role !== "Admin" && <Menu.Item>
|
||||||
<Link to={LINKS.PROFILE}>
|
<Link to={LINKS.PROFILE}>
|
||||||
|
<UserOutlined/>
|
||||||
<span>Profile</span>
|
<span>Profile</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
}
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
store.authentication.logout();
|
store.authentication.logout();
|
||||||
history.push("/login");
|
history.push("/login");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<LogoutOutlined/>
|
||||||
<span>Sign out</span>
|
<span>Sign out</span>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
@ -382,8 +386,9 @@ export const DesktopLayout = observer(() => {
|
||||||
<Text>
|
<Text>
|
||||||
{store.user.data.username}
|
{store.user.data.username}
|
||||||
<Paragraph
|
<Paragraph
|
||||||
style={{ fontWeight: 400 }}
|
style={{fontWeight: 400, marginTop: '0.5rem'}}
|
||||||
type={"secondary-dark"}
|
type={"secondary-dark"}
|
||||||
|
strong
|
||||||
>
|
>
|
||||||
{store.authentication.userData.username}
|
{store.authentication.userData.username}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
|
@ -460,11 +465,14 @@ export const DesktopLayout = observer(() => {
|
||||||
}}
|
}}
|
||||||
mode="inline"
|
mode="inline"
|
||||||
>
|
>
|
||||||
<Menu.Item key={"profile"}>
|
{store.authentication.userData.role !== "Admin" && (
|
||||||
|
<Menu.Item key="profile">
|
||||||
<Link to={LINKS.PROFILE}>
|
<Link to={LINKS.PROFILE}>
|
||||||
|
<UserOutlined/>
|
||||||
<span>Profile</span>
|
<span>Profile</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
)}
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
key={"logout"}
|
key={"logout"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -472,16 +480,17 @@ export const DesktopLayout = observer(() => {
|
||||||
history.push("/login");
|
history.push("/login");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<LogoutOutlined/>
|
||||||
<span>Sign out</span>
|
<span>Sign out</span>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
}
|
}
|
||||||
title={
|
title={
|
||||||
<Text>
|
<Text>
|
||||||
{store.user.data.email}{" "}
|
|
||||||
<Paragraph
|
<Paragraph
|
||||||
style={{ fontWeight: 400 }}
|
style={{fontWeight: 400, marginTop: '0.5rem'}}
|
||||||
type={"secondary-dark"}
|
type={"secondary-dark"}
|
||||||
|
strong
|
||||||
>
|
>
|
||||||
{store.authentication.userData.username}
|
{store.authentication.userData.username}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
|
||||||
import {Menu} from "antd";
|
import {Menu} from "antd";
|
||||||
import {Link} from "react-router-dom";
|
import {Link} from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
|
AlipayOutlined,
|
||||||
AppstoreOutlined,
|
AppstoreOutlined,
|
||||||
DatabaseOutlined,
|
DatabaseOutlined,
|
||||||
FileAddOutlined,
|
FileAddOutlined,
|
||||||
|
@ -10,12 +11,11 @@ import {
|
||||||
HomeOutlined,
|
HomeOutlined,
|
||||||
MenuUnfoldOutlined,
|
MenuUnfoldOutlined,
|
||||||
MoneyCollectOutlined,
|
MoneyCollectOutlined,
|
||||||
|
PayCircleOutlined,
|
||||||
ProfileOutlined,
|
ProfileOutlined,
|
||||||
ProjectOutlined,
|
ProjectOutlined,
|
||||||
ShoppingCartOutlined,
|
ShoppingCartOutlined,
|
||||||
UserOutlined,
|
UserOutlined,
|
||||||
AlipayOutlined,
|
|
||||||
PayCircleOutlined,
|
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import {observer} from "mobx-react-lite";
|
import {observer} from "mobx-react-lite";
|
||||||
import {useStore} from "../../utils/useStore";
|
import {useStore} from "../../utils/useStore";
|
||||||
|
@ -25,7 +25,8 @@ const { SubMenu } = Menu;
|
||||||
|
|
||||||
export const MenuList = observer((props) => {
|
export const MenuList = observer((props) => {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
useEffect(() => {}, []);
|
useEffect(() => {
|
||||||
|
}, []);
|
||||||
|
|
||||||
const [setKeys, setSetKeys] = useState(["dashboard"]);
|
const [setKeys, setSetKeys] = useState(["dashboard"]);
|
||||||
|
|
||||||
|
@ -137,7 +138,7 @@ export const MenuList = observer((props) => {
|
||||||
)}
|
)}
|
||||||
{store.authentication.userData.role !== "Admin" && (
|
{store.authentication.userData.role !== "Admin" && (
|
||||||
<Menu.Item key="payback-from-user">
|
<Menu.Item key="payback-from-user">
|
||||||
<Link to={LINKS.PAYBACKFROMUSER}>
|
<Link to={LINKS.PAYBACK_FROM_USER}>
|
||||||
<AlipayOutlined/>
|
<AlipayOutlined/>
|
||||||
<span>Payback</span>
|
<span>Payback</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
@ -7,12 +7,14 @@ import {observer} from "mobx-react-lite";
|
||||||
import {FilterOutlined} from "@ant-design/icons";
|
import {FilterOutlined} from "@ant-design/icons";
|
||||||
import {format, parseISO} from "date-fns";
|
import {format, parseISO} from "date-fns";
|
||||||
import {ModalLoaderContext} from "../../utils/modal";
|
import {ModalLoaderContext} from "../../utils/modal";
|
||||||
|
import {useParams} from "react-router-dom";
|
||||||
|
|
||||||
const {Title, Text} = Typography;
|
const {Title, Text} = Typography;
|
||||||
|
|
||||||
export const DetailUser = observer(() => {
|
export const DetailUser = observer(() => {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const modalLoader = useContext(ModalLoaderContext);
|
const modalLoader = useContext(ModalLoaderContext);
|
||||||
|
const { id } = useParams();
|
||||||
|
|
||||||
const routeData = [
|
const routeData = [
|
||||||
{
|
{
|
||||||
|
@ -20,16 +22,17 @@ export const DetailUser = observer(() => {
|
||||||
name: "Home",
|
name: "Home",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
route: LINKS.DETAILUSER,
|
route: LINKS.USER_DETAIL,
|
||||||
name: <span style={{fontWeight: 'bold'}}>Detail User</span>,
|
name: <span style={{fontWeight: 'bold'}}>Detail User</span>,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
console.log(id)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
await Promise.allSettled([
|
await Promise.allSettled([
|
||||||
store.authentication.getProfile(),
|
store.authentication.getProfile(),
|
||||||
|
store.transaction.getDataHistoryTopUp(id),
|
||||||
store.transaction.getDataHistoryTransaction(),
|
store.transaction.getDataHistoryTransaction(),
|
||||||
]);
|
]);
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
|
@ -83,7 +86,7 @@ export const DetailUser = observer(() => {
|
||||||
<Text strong>Name</Text>
|
<Text strong>Name</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text>{store.authentication.profileData?.userDetail?.name}</Text>
|
<Text>{store.transaction.data.name}</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text strong>Role</Text>
|
<Text strong>Role</Text>
|
||||||
|
@ -125,7 +128,7 @@ export const DetailUser = observer(() => {
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<div>
|
<div>
|
||||||
<Title strong level={3}>History User Transaction</Title>
|
<Title strong level={3}>History Top Up</Title>
|
||||||
|
|
||||||
<Button style={{marginBottom: '1rem'}} onClick={() => {
|
<Button style={{marginBottom: '1rem'}} onClick={() => {
|
||||||
console.log('clicked filter')
|
console.log('clicked filter')
|
||||||
|
|
|
@ -1,8 +1,24 @@
|
||||||
import React, {useContext, useEffect, useState} from "react";
|
import React, {useContext, useEffect, useState} from "react";
|
||||||
import {Button, Card, Col, Divider, Form, Input, List, message, Modal, Row, Select, Space, Table, Tag,} from "antd";
|
import {
|
||||||
|
Button,
|
||||||
|
Card,
|
||||||
|
Col,
|
||||||
|
Divider,
|
||||||
|
Form,
|
||||||
|
Input,
|
||||||
|
InputNumber,
|
||||||
|
List,
|
||||||
|
message,
|
||||||
|
Modal,
|
||||||
|
Row,
|
||||||
|
Select,
|
||||||
|
Space,
|
||||||
|
Table,
|
||||||
|
Tag,
|
||||||
|
} from "antd";
|
||||||
import {useStore} from "../../utils/useStore";
|
import {useStore} from "../../utils/useStore";
|
||||||
import {observer} from "mobx-react-lite";
|
import {observer} from "mobx-react-lite";
|
||||||
import {DownloadOutlined, PlusSquareOutlined,} from "@ant-design/icons";
|
import {DownloadOutlined, PlusSquareOutlined} from "@ant-design/icons";
|
||||||
import {MembershipModal} from "./MembershipModal";
|
import {MembershipModal} from "./MembershipModal";
|
||||||
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
||||||
import {LINKS} from "../../routes/app";
|
import {LINKS} from "../../routes/app";
|
||||||
|
@ -30,7 +46,6 @@ export const Membership = observer(() => {
|
||||||
|
|
||||||
await getData();
|
await getData();
|
||||||
await store.role.getData(isAdmin);
|
await store.role.getData(isAdmin);
|
||||||
await store.supplier.getData();
|
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
@ -85,10 +100,16 @@ export const Membership = observer(() => {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let response = null;
|
||||||
|
|
||||||
(await store.authentication.userData.role) === "Admin"
|
(await store.authentication.userData.role) === "Admin"
|
||||||
? store.transaction.distributeAdmin(data)
|
? (response = await store.transaction.distributeAdmin(data))
|
||||||
: store.transaction.distribute(data);
|
: (response = await store.transaction.distribute(data));
|
||||||
message.success("Success Top Up");
|
|
||||||
|
response?.body?.statusCode === 200
|
||||||
|
? message.success("Success Top Up")
|
||||||
|
: message.error("Failed Top Up");
|
||||||
|
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
//await store.supplier.getData()
|
//await store.supplier.getData()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -115,7 +136,7 @@ export const Membership = observer(() => {
|
||||||
key: "role",
|
key: "role",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Saldo di Supplier",
|
title: "Saldo",
|
||||||
dataIndex: ["coa", "amount"],
|
dataIndex: ["coa", "amount"],
|
||||||
key: ["coa", "amount"],
|
key: ["coa", "amount"],
|
||||||
width: "20%",
|
width: "20%",
|
||||||
|
@ -125,17 +146,6 @@ export const Membership = observer(() => {
|
||||||
currency: "IDR",
|
currency: "IDR",
|
||||||
}).format(text),
|
}).format(text),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "Saldo di System",
|
|
||||||
dataIndex: ["coa_undistribute", "amount"],
|
|
||||||
key: ["coa_undistribute", "amount"],
|
|
||||||
width: "20%",
|
|
||||||
render: (text) =>
|
|
||||||
new Intl.NumberFormat("id-ID", {
|
|
||||||
style: "currency",
|
|
||||||
currency: "IDR",
|
|
||||||
}).format(text),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "Status",
|
title: "Status",
|
||||||
dataIndex: "isActive",
|
dataIndex: "isActive",
|
||||||
|
@ -201,8 +211,9 @@ export const Membership = observer(() => {
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
history.push(LINKS.DETAILUSER.replace(":id", record.id));
|
await store.transaction.getDataHistoryTopUp(record.id)
|
||||||
//console.log(record.id)
|
history.push(LINKS.USER_DETAIL.replace(":id", record.id));
|
||||||
|
console.log(record.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Detail
|
Detail
|
||||||
|
@ -212,6 +223,7 @@ export const Membership = observer(() => {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (store.authentication.userData.role !== "Admin") columns.pop();
|
||||||
const routeData = [
|
const routeData = [
|
||||||
{
|
{
|
||||||
route: LINKS.HOME,
|
route: LINKS.HOME,
|
||||||
|
@ -265,29 +277,6 @@ export const Membership = observer(() => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDetail = (record) => {
|
|
||||||
// Modal.confirm({
|
|
||||||
// title: "Are you sure delete this record?",
|
|
||||||
// icon: <ExclamationCircleOutlined/>,
|
|
||||||
// okText: "Yes",
|
|
||||||
// okType: "primary",
|
|
||||||
// cancelText: "Cancel",
|
|
||||||
// async onOk() {
|
|
||||||
// try {
|
|
||||||
// //TODO: minta apinya ke ka ilham ya, jangan di uncomment kalo pake api reconcile, nanti beneran ke apus datanya
|
|
||||||
// await store.membership.delete(record);
|
|
||||||
// message.success("Success Delete Data");
|
|
||||||
// await getData();
|
|
||||||
// } catch (e) {
|
|
||||||
// message.error("Failed Delete Data");
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// onCancel() {
|
|
||||||
// console.log("Cancel");
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={["ppob-container"].join(" ")}>
|
<div className={["ppob-container"].join(" ")}>
|
||||||
<BreadcumbComponent data={routeData} />
|
<BreadcumbComponent data={routeData} />
|
||||||
|
@ -385,9 +374,14 @@ export const Membership = observer(() => {
|
||||||
<div style={{}}>
|
<div style={{}}>
|
||||||
<p>
|
<p>
|
||||||
<small>Role : {item.roleName}</small> <br />
|
<small>Role : {item.roleName}</small> <br />
|
||||||
<small>Saldo Supplier : {item.amount}</small>{" "}
|
<small>
|
||||||
|
Saldo Supplier : {item.coa.amount}
|
||||||
|
</small>{" "}
|
||||||
|
<br />
|
||||||
|
<small>
|
||||||
|
Saldo System : {item.coa.amount}
|
||||||
|
</small>{" "}
|
||||||
<br />
|
<br />
|
||||||
<small>Saldo System : {item.amount}</small> <br />
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@ -443,25 +437,18 @@ export const Membership = observer(() => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Form form={form} layout="vertical">
|
<Form form={form} layout="vertical">
|
||||||
<Form.Item
|
|
||||||
name="supplier"
|
|
||||||
label="Supplier"
|
|
||||||
rules={[{ required: true, message: "Please input supplier!" }]}
|
|
||||||
>
|
|
||||||
<Select placeholder="Select Code Supplier" allowClear>
|
|
||||||
{store.supplier.data.map((item) => (
|
|
||||||
<Option value={item.code} key={item.code}>
|
|
||||||
{item.code}
|
|
||||||
</Option>
|
|
||||||
))}
|
|
||||||
</Select>
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="amount"
|
name="amount"
|
||||||
label="Amount"
|
label="Amount"
|
||||||
rules={[{ required: true, message: "Please input amount!" }]}
|
rules={[{ required: true, message: "Please input amount!" }]}
|
||||||
>
|
>
|
||||||
<Input />
|
<InputNumber
|
||||||
|
style={{ width: "100%" }}
|
||||||
|
formatter={(value) =>
|
||||||
|
`Rp. ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
|
||||||
|
}
|
||||||
|
parser={(value) => value.replace(/\Rp.\s?|(,*)/g, "")}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {CheckCircleOutlined, CloseOutlined, FilterOutlined,} from "@ant-design/i
|
||||||
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
||||||
import {LINKS} from "../../routes/app";
|
import {LINKS} from "../../routes/app";
|
||||||
import {ModalLoaderContext} from "../../utils/modal";
|
import {ModalLoaderContext} from "../../utils/modal";
|
||||||
|
import {appConfig} from "../../config/app";
|
||||||
|
|
||||||
const {Search} = Input;
|
const {Search} = Input;
|
||||||
|
|
||||||
|
@ -40,10 +41,9 @@ export const Payback = observer(() => {
|
||||||
key: "image_prove",
|
key: "image_prove",
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Image
|
<Image
|
||||||
src={record.picture}
|
src={`${appConfig.apiUrl}/config/image/${text}`}
|
||||||
style={{width: 50, height: 50}}
|
style={{width: '5vw'}}
|
||||||
shape="circle"
|
alt={record.id}
|
||||||
alt="avatar"
|
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
@ -51,11 +51,18 @@ export const Payback = observer(() => {
|
||||||
title: "Amount",
|
title: "Amount",
|
||||||
dataIndex: "amount",
|
dataIndex: "amount",
|
||||||
key: "amount",
|
key: "amount",
|
||||||
|
width: '20%',
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Action",
|
title: "Action",
|
||||||
dataIndex: "amount",
|
dataIndex: "amount",
|
||||||
key: "action",
|
key: "action",
|
||||||
|
width: '10%',
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Space size="middle">
|
<Space size="middle">
|
||||||
<Button
|
<Button
|
||||||
|
|
|
@ -56,6 +56,11 @@ export const PaybackFromUser = observer(() => {
|
||||||
title: "Amount",
|
title: "Amount",
|
||||||
dataIndex: "amount",
|
dataIndex: "amount",
|
||||||
key: "amount",
|
key: "amount",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -65,7 +70,7 @@ export const PaybackFromUser = observer(() => {
|
||||||
name: "Home",
|
name: "Home",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
route: LINKS.PAYBACKFROMUSER,
|
route: LINKS.PAYBACK_FROM_USER,
|
||||||
name: <span style={{fontWeight: "bold"}}>Payback User</span>,
|
name: <span style={{fontWeight: "bold"}}>Payback User</span>,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -12,7 +12,7 @@ export const PaybackModal = ({initialData}) => {
|
||||||
const [image, setImage] = useState("");
|
const [image, setImage] = useState("");
|
||||||
const [fileList, setFileList] = useState([]);
|
const [fileList, setFileList] = useState([]);
|
||||||
const [previewImage, setPreviewImage] = useState("");
|
const [previewImage, setPreviewImage] = useState("");
|
||||||
const [previewVisible, setPreviewVisible] = useState(false);
|
const [responseFilename, setResponseFilename] = useState("");
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const modalLoader = useContext(ModalLoaderContext);
|
const modalLoader = useContext(ModalLoaderContext);
|
||||||
|
|
||||||
|
@ -34,20 +34,23 @@ export const PaybackModal = ({initialData}) => {
|
||||||
const file = args.file;
|
const file = args.file;
|
||||||
const res = await http.upload(file);
|
const res = await http.upload(file);
|
||||||
setImage(`${appConfig.apiUrl}/config/image/${res.body.filename}`);
|
setImage(`${appConfig.apiUrl}/config/image/${res.body.filename}`);
|
||||||
|
setResponseFilename(res.body.filename);
|
||||||
setFileList([{
|
setFileList([{
|
||||||
uid: '-1',
|
uid: '-1',
|
||||||
name: 'image',
|
name: res.body.filename,
|
||||||
status: 'done',
|
status: 'done',
|
||||||
url: `${appConfig.apiUrl}/config/image/${res.body.filename}`,
|
url: `${appConfig.apiUrl}/config/image/${res.body.filename}`,
|
||||||
}]);
|
}]);
|
||||||
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleChange = (info) => {
|
const handleChange = (info) => {
|
||||||
|
console.log(info, "apa isi onchange")
|
||||||
if (info.file.status === 'uploading') {
|
if (info.file.status === 'uploading') {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const uploadButton = (
|
const uploadButton = (
|
||||||
|
@ -62,7 +65,8 @@ export const PaybackModal = ({initialData}) => {
|
||||||
try {
|
try {
|
||||||
const request = {
|
const request = {
|
||||||
...data,
|
...data,
|
||||||
destination: store.authentication.profileData.superior?.id
|
destination: store.authentication.profileData.superior?.id,
|
||||||
|
image_prove: responseFilename
|
||||||
}
|
}
|
||||||
await store.payback.create(request);
|
await store.payback.create(request);
|
||||||
message.success("Success Add Payback");
|
message.success("Success Add Payback");
|
||||||
|
@ -74,21 +78,21 @@ export const PaybackModal = ({initialData}) => {
|
||||||
message.error(e.message);
|
message.error(e.message);
|
||||||
}
|
}
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
form.resetFields();
|
|
||||||
store.payback.visibleModalPayback = false;
|
store.payback.visibleModalPayback = false;
|
||||||
|
form.resetFields();
|
||||||
setImage("");
|
setImage("");
|
||||||
setFileList([]);
|
setFileList([]);
|
||||||
setPreviewImage("");
|
setPreviewImage("");
|
||||||
setPreviewVisible(false);
|
setResponseFilename("");
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
store.payback.visibleModalPayback = false;
|
|
||||||
setImage("");
|
setImage("");
|
||||||
setFileList([]);
|
setFileList([]);
|
||||||
setPreviewImage("");
|
setPreviewImage("");
|
||||||
setPreviewVisible(false);
|
setResponseFilename("");
|
||||||
|
store.payback.visibleModalPayback = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -126,7 +130,6 @@ export const PaybackModal = ({initialData}) => {
|
||||||
fileList={fileList}
|
fileList={fileList}
|
||||||
onPreview={(file) => {
|
onPreview={(file) => {
|
||||||
setPreviewImage(file.url || file.filename);
|
setPreviewImage(file.url || file.filename);
|
||||||
setPreviewVisible(file.url || file.filename);
|
|
||||||
}}
|
}}
|
||||||
showUploadList={true}
|
showUploadList={true}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import React, { useContext, useEffect } from "react";
|
import React, { useContext, useEffect } from "react";
|
||||||
import { Button, Card, Col, Input, message, Row, Upload } from "antd";
|
import { Button, Card, Col, Input, message, Row, Upload } from "antd";
|
||||||
import {FilterOutlined, PlusSquareOutlined, UploadOutlined,} from "@ant-design/icons";
|
import {
|
||||||
|
FilterOutlined,
|
||||||
|
PlusSquareOutlined,
|
||||||
|
UploadOutlined,
|
||||||
|
} from "@ant-design/icons";
|
||||||
import { BreadcumbComponent } from "../../component/BreadcumbComponent";
|
import { BreadcumbComponent } from "../../component/BreadcumbComponent";
|
||||||
import { useStore } from "../../utils/useStore";
|
import { useStore } from "../../utils/useStore";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
|
@ -55,15 +59,23 @@ export const Product = observer(() => {
|
||||||
<Card>
|
<Card>
|
||||||
<Row style={{ marginBottom: 20 }}>
|
<Row style={{ marginBottom: 20 }}>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Button onClick={() => {
|
<Button
|
||||||
store.product.visibleModalFilterProduct = true
|
onClick={() => {
|
||||||
}}>
|
store.product.visibleModalFilterProduct = true;
|
||||||
|
}}
|
||||||
|
>
|
||||||
<FilterOutlined />
|
<FilterOutlined />
|
||||||
Filter
|
Filter
|
||||||
</Button>
|
</Button>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<div style={{display: store.ui.mediaQuery.isMobile? "" :'flex',justifyContent: 'flex-end',textAlign: "right"}}>
|
<div
|
||||||
|
style={{
|
||||||
|
display: store.ui.mediaQuery.isMobile ? "" : "flex",
|
||||||
|
justifyContent: "flex-end",
|
||||||
|
textAlign: "right",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Search
|
<Search
|
||||||
placeholder="input search text"
|
placeholder="input search text"
|
||||||
style={{
|
style={{
|
||||||
|
@ -72,18 +84,34 @@ export const Product = observer(() => {
|
||||||
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 0,
|
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 0,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
{store.authentication.userData.role === "Admin" && (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: store.ui.mediaQuery.isMobile ? "" : "flex",
|
||||||
|
justifyContent: "flex-end",
|
||||||
|
textAlign: "right",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Upload>
|
<Upload>
|
||||||
<Button disabled={store.product.uploadBtnProduct} style={{
|
<Button
|
||||||
|
disabled={store.product.uploadBtnProduct}
|
||||||
|
style={{
|
||||||
marginRight: store.ui.mediaQuery.isMobile ? 0 : 10,
|
marginRight: store.ui.mediaQuery.isMobile ? 0 : 10,
|
||||||
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 0,
|
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 10,
|
||||||
}} icon={<UploadOutlined/>}>
|
}}
|
||||||
|
icon={<UploadOutlined />}
|
||||||
|
>
|
||||||
Upload Product
|
Upload Product
|
||||||
</Button>
|
</Button>
|
||||||
</Upload>
|
</Upload>
|
||||||
<Button onClick={() => (store.product.visibleModalProduct = true)}>
|
<Button
|
||||||
|
onClick={() => (store.product.visibleModalProduct = true)}
|
||||||
|
>
|
||||||
<PlusSquareOutlined /> New
|
<PlusSquareOutlined /> New
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<ProductComponent />
|
<ProductComponent />
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {ModalLoaderContext} from "../../utils/modal";
|
||||||
|
|
||||||
const {Title, Text} = Typography;
|
const {Title, Text} = Typography;
|
||||||
|
|
||||||
export const DetailProduct = observer(() => {
|
export const ProductDetail = observer(() => {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const modalLoader = useContext(ModalLoaderContext);
|
const modalLoader = useContext(ModalLoaderContext);
|
||||||
|
|
||||||
|
@ -20,8 +20,12 @@ export const DetailProduct = observer(() => {
|
||||||
name: "Home",
|
name: "Home",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
route: LINKS.DETAILPRODUCT,
|
route: LINKS.PRODUCT,
|
||||||
name: <span style={{fontWeight: 'bold'}}>Detail Product</span>,
|
name: <span style={{fontWeight: "bold"}}>Product</span>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
route: LINKS.PRODUCT_DETAIL,
|
||||||
|
name: <span style={{fontWeight: 'bold'}}>Product Detail</span>,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -75,7 +79,7 @@ export const DetailProduct = observer(() => {
|
||||||
<div className={["ppob-container"].join(" ")}>
|
<div className={["ppob-container"].join(" ")}>
|
||||||
<BreadcumbComponent data={routeData}/>
|
<BreadcumbComponent data={routeData}/>
|
||||||
<Card>
|
<Card>
|
||||||
<Title strong>Detail Product</Title>
|
<Title strong>Product Detail</Title>
|
||||||
<Row style={{marginBottom: 20}}>
|
<Row style={{marginBottom: 20}}>
|
||||||
<Col lg={12} xs={24}>
|
<Col lg={12} xs={24}>
|
||||||
<Row>
|
<Row>
|
|
@ -1,11 +1,11 @@
|
||||||
import React, {useContext, useEffect, useState} from "react";
|
import React, {useContext, useEffect} from "react";
|
||||||
import {Button, Card, Col, Input, Row,message} from "antd";
|
import {Button, Card, Col, Input, message, Row} from "antd";
|
||||||
import {PlusSquareOutlined} from "@ant-design/icons";
|
import {PlusSquareOutlined} from "@ant-design/icons";
|
||||||
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
||||||
import {useStore} from "../../utils/useStore";
|
import {useStore} from "../../utils/useStore";
|
||||||
import {observer} from "mobx-react-lite";
|
import {observer} from "mobx-react-lite";
|
||||||
import {LINKS} from "../../routes/app";
|
import {LINKS} from "../../routes/app";
|
||||||
import {SubcategoryComponent} from "../../component/Subcategory";
|
import {SubcategoryComponent} from "../../component/SubcategoryComponent";
|
||||||
import {ModalLoaderContext} from "../../utils/modal";
|
import {ModalLoaderContext} from "../../utils/modal";
|
||||||
|
|
||||||
const {Search} = Input;
|
const {Search} = Input;
|
||||||
|
|
|
@ -42,6 +42,11 @@ export const Profile = observer(() => {
|
||||||
dataIndex: 'mark_up_price',
|
dataIndex: 'mark_up_price',
|
||||||
key: 'mark_up_price',
|
key: 'mark_up_price',
|
||||||
width: '20%',
|
width: '20%',
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Name',
|
title: 'Name',
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {About} from "../pages/About/About";
|
||||||
import {Membership} from "../pages/Membership/Membership";
|
import {Membership} from "../pages/Membership/Membership";
|
||||||
import {DetailUser} from "../pages/Membership/DetailUser";
|
import {DetailUser} from "../pages/Membership/DetailUser";
|
||||||
import {Product} from "../pages/Product/Product";
|
import {Product} from "../pages/Product/Product";
|
||||||
import {DetailProduct} from "../pages/Product/DetailProduct";
|
import {ProductDetail} from "../pages/Product/ProductDetail";
|
||||||
import {Transaction} from "../pages/Transaction/Transaction";
|
import {Transaction} from "../pages/Transaction/Transaction";
|
||||||
import {Profile} from "../pages/Profile/Profile";
|
import {Profile} from "../pages/Profile/Profile";
|
||||||
import {Commission} from "../pages/Config/Commission";
|
import {Commission} from "../pages/Config/Commission";
|
||||||
|
@ -27,10 +27,10 @@ export const LINKS = {
|
||||||
SUPPLIER: "/app/supplier",
|
SUPPLIER: "/app/supplier",
|
||||||
CATEGORY: "/app/category",
|
CATEGORY: "/app/category",
|
||||||
PAYBACK: "/app/payback",
|
PAYBACK: "/app/payback",
|
||||||
PAYBACKFROMUSER: "/app/payback-from-user",
|
PAYBACK_FROM_USER: "/app/payback-from-user",
|
||||||
SUBCATEGORY: "/app/subcategory",
|
SUBCATEGORY: "/app/subcategory",
|
||||||
DETAILUSER: "/app/detail-user",
|
USER_DETAIL: "/app/user-detail",
|
||||||
DETAILPRODUCT: "/app/detail-product",
|
PRODUCT_DETAIL: "/app/product-detail",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AppRoute = () => {
|
export const AppRoute = () => {
|
||||||
|
@ -38,16 +38,16 @@ export const AppRoute = () => {
|
||||||
<Route path={LINKS.HOME}>
|
<Route path={LINKS.HOME}>
|
||||||
<Home/>
|
<Home/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={LINKS.DETAILUSER}>
|
<Route path={LINKS.USER_DETAIL}>
|
||||||
<DetailUser/>
|
<DetailUser/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={LINKS.DETAILPRODUCT}>
|
<Route path={LINKS.PRODUCT_DETAIL}>
|
||||||
<DetailProduct/>
|
<ProductDetail/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={LINKS.COMMISSION}>
|
<Route path={LINKS.COMMISSION}>
|
||||||
<Commission/>
|
<Commission/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={LINKS.PAYBACKFROMUSER}>
|
<Route path={LINKS.PAYBACK_FROM_USER}>
|
||||||
<PaybackFromUser/>
|
<PaybackFromUser/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={LINKS.CATEGORY}>
|
<Route path={LINKS.CATEGORY}>
|
||||||
|
|
|
@ -31,6 +31,7 @@ export class Product {
|
||||||
async getData() {
|
async getData() {
|
||||||
try {
|
try {
|
||||||
const response = await http.get(`/product/all?supplier=${this.filterSupplier}&sub-category=${this.filterSubCategory}&page=${this.page}&pageSize=${this.pageSize}`);
|
const response = await http.get(`/product/all?supplier=${this.filterSupplier}&sub-category=${this.filterSubCategory}&page=${this.page}&pageSize=${this.pageSize}`);
|
||||||
|
//console.log(response)
|
||||||
this.data = response.body.data.map((item, idx) => {
|
this.data = response.body.data.map((item, idx) => {
|
||||||
item.key = idx;
|
item.key = idx;
|
||||||
return item
|
return item
|
||||||
|
|
|
@ -22,10 +22,14 @@ export class Transaction {
|
||||||
filterSubCategory = null;
|
filterSubCategory = null;
|
||||||
|
|
||||||
pageHistoryTransaction = 0;
|
pageHistoryTransaction = 0;
|
||||||
|
pageHistoryTopUp = 0;
|
||||||
// pageSizeHistoryTransaction = 10
|
// pageSizeHistoryTransaction = 10
|
||||||
dataHistoryTransaction = [];
|
dataHistoryTransaction = [];
|
||||||
total_dataHistoryTransaction = 0;
|
total_dataHistoryTransaction = 0;
|
||||||
|
|
||||||
|
dataHistoryTopUp=[];
|
||||||
|
total_dataHistoryTopUp = 0;
|
||||||
|
|
||||||
constructor(ctx) {
|
constructor(ctx) {
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
makeAutoObservable(this);
|
makeAutoObservable(this);
|
||||||
|
@ -76,6 +80,18 @@ export class Transaction {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getDataHistoryTopUp(id) {
|
||||||
|
try {
|
||||||
|
console.log("Top up")
|
||||||
|
const response = await http.get(`/transaction/history-deposit?page=${this.pageHistoryTopUp}&user-destination=${id}`);
|
||||||
|
|
||||||
|
this.dataHistoryTopUp = response.body.data ?? []
|
||||||
|
this.total_dataHistoryTopUp = response?.body?.count ?? 0
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async create(data) {
|
async create(data) {
|
||||||
try {
|
try {
|
||||||
const response = await http.post('/product').send(data);
|
const response = await http.post('/product').send(data);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user