Merge branch 'develop' of https://gitlab.com/empatnusabangsa/ppob/ppob-frontend into devops-production
This commit is contained in:
commit
70b5bbb8a4
|
@ -33,6 +33,7 @@ export const ProductComponent = observer((props) => {
|
||||||
const [filterSupplier, setFilterSupplier] = useState([]);
|
const [filterSupplier, setFilterSupplier] = useState([]);
|
||||||
const [filterSubCategories, setFilterSubCategories] = useState([]);
|
const [filterSubCategories, setFilterSubCategories] = useState([]);
|
||||||
const modalLoader = useContext(ModalLoaderContext);
|
const modalLoader = useContext(ModalLoaderContext);
|
||||||
|
const role = store.authentication.userData.role
|
||||||
|
|
||||||
const handleEditButton = (data) => {
|
const handleEditButton = (data) => {
|
||||||
console.log(data, "isi data");
|
console.log(data, "isi data");
|
||||||
|
@ -61,8 +62,8 @@ export const ProductComponent = observer((props) => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Harga Beli",
|
title: "Harga Beli",
|
||||||
dataIndex: "current_price_price",
|
dataIndex: "price",
|
||||||
key: "current_price_price",
|
key: "price",
|
||||||
render: (text) =>
|
render: (text) =>
|
||||||
new Intl.NumberFormat("id-ID", {
|
new Intl.NumberFormat("id-ID", {
|
||||||
style: "currency",
|
style: "currency",
|
||||||
|
@ -89,6 +90,26 @@ export const ProductComponent = observer((props) => {
|
||||||
currency: "IDR",
|
currency: "IDR",
|
||||||
}).format(text),
|
}).format(text),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "Biaya Admin",
|
||||||
|
dataIndex: "admin_price",
|
||||||
|
key: "admin_price",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Fee Jual",
|
||||||
|
dataIndex: "partner_fee",
|
||||||
|
key: "partner_fee",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "Supplier",
|
title: "Supplier",
|
||||||
dataIndex: "supplier_name",
|
dataIndex: "supplier_name",
|
||||||
|
@ -115,6 +136,7 @@ export const ProductComponent = observer((props) => {
|
||||||
{
|
{
|
||||||
title: "Tindakan",
|
title: "Tindakan",
|
||||||
key: "action",
|
key: "action",
|
||||||
|
fixed: 'right',
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
@ -128,14 +150,15 @@ export const ProductComponent = observer((props) => {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
//if (store.authentication.userData.role !== "Admin") columns.pop();
|
|
||||||
//if (store.authentication.userData.role === "Admin Partner") delete columns[2];
|
//if (store.authentication.userData.role === "Admin Partner") delete columns[2];
|
||||||
|
if (store.authentication.userData.role === "Admin Partner") delete columns[10];
|
||||||
if (store.authentication.userData.role === "Admin Partner") delete columns[3];
|
if (store.authentication.userData.role === "Admin Partner") delete columns[3];
|
||||||
if (store.authentication.userData.role != "Admin Partner") delete columns[4];
|
if (store.authentication.userData.role !== "Admin Partner") delete columns[4];
|
||||||
|
if (store.authentication.userData.role !== "Admin") delete columns[9];
|
||||||
if (store.authentication.userData.role !== "Admin") delete columns[6];
|
if (store.authentication.userData.role !== "Admin") delete columns[6];
|
||||||
|
if (store.authentication.userData.role !== "Admin") delete columns[7];
|
||||||
if (store.authentication.userData.role !== "Admin") delete columns[2];
|
if (store.authentication.userData.role !== "Admin") delete columns[2];
|
||||||
if (store.authentication.userData.role !== "Admin") delete columns[5];
|
if (store.authentication.userData.role === "Admin Partner") delete columns[8];
|
||||||
if (store.authentication.userData.role === "Admin Partner") delete columns[7];
|
|
||||||
//if (store.authentication.userData.role !== "Admin") delete columns[8];
|
//if (store.authentication.userData.role !== "Admin") delete columns[8];
|
||||||
//if (store.authentication.userData.role === "Admin Partner") delete columns[5];
|
//if (store.authentication.userData.role === "Admin Partner") delete columns[5];
|
||||||
|
|
||||||
|
@ -208,43 +231,35 @@ export const ProductComponent = observer((props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRemoveFilter = async () => {
|
const handleRemoveFilter = async () => {
|
||||||
|
store.product.pageProductPartner = 0
|
||||||
|
store.product.visibleModalFilterProduct = false;
|
||||||
store.product.filterSupplier = null;
|
store.product.filterSupplier = null;
|
||||||
store.product.filterSubCategory = null;
|
store.product.filterSubCategory = null;
|
||||||
setFilterSupplier([]);
|
setFilterSupplier([]);
|
||||||
setFilterSubCategories([]);
|
setFilterSubCategories([]);
|
||||||
store.authentication.userData.role === "Admin Partner"
|
store.authentication.userData.role === "Admin Partner"
|
||||||
? await store.product.getProductPartner(
|
? await store.product.getProductPartner()
|
||||||
store.authentication.profileData.id
|
|
||||||
)
|
|
||||||
: await store.product.getData();
|
: await store.product.getData();
|
||||||
//await store.product.getData();
|
//await store.product.getData();
|
||||||
store.product.visibleModalFilterProduct = false;
|
modalLoader.setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCancelFilter = async () => {
|
const handleCancelFilter = async () => {
|
||||||
store.product.filterSubCategory = null;
|
|
||||||
store.product.filterSupplier = null;
|
|
||||||
store.product.visibleModalFilterProduct = false;
|
store.product.visibleModalFilterProduct = false;
|
||||||
store.authentication.userData.role === "Admin Partner"
|
|
||||||
? await store.product.getProductPartner(
|
|
||||||
store.authentication.profileData.id
|
|
||||||
)
|
|
||||||
: await store.product.getData();
|
|
||||||
//await store.product.getData();
|
//await store.product.getData();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSubmitFilter = async () => {
|
const handleSubmitFilter = async () => {
|
||||||
|
store.product.pageProductPartner = 0
|
||||||
|
store.product.visibleModalFilterProduct = false;
|
||||||
store.product.filterSupplier = filterSupplier;
|
store.product.filterSupplier = filterSupplier;
|
||||||
store.product.filterSubCategory = filterSubCategories;
|
store.product.filterSubCategory = filterSubCategories;
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
store.authentication.userData.role === "Admin Partner"
|
store.authentication.userData.role === "Admin Partner"
|
||||||
? await store.product.getProductPartner(
|
? await store.product.getProductPartner(filterSubCategories)
|
||||||
store.authentication.profileData.id
|
|
||||||
)
|
|
||||||
: await store.product.getData();
|
: await store.product.getData();
|
||||||
//await store.product.getData();
|
//await store.product.getData();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
store.product.visibleModalFilterProduct = false;
|
|
||||||
//store.product.page=1
|
//store.product.page=1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -276,7 +291,7 @@ export const ProductComponent = observer((props) => {
|
||||||
|
|
||||||
const handleClickRow = (record, index) => ({
|
const handleClickRow = (record, index) => ({
|
||||||
onClick: (event) => {
|
onClick: (event) => {
|
||||||
history.push(LINKS.PRODUCT_DETAIL.replace(":id", record.product_id));
|
history.push(LINKS.PRODUCT_DETAIL.replace(":id", record.product_id))
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
|
@ -288,29 +303,35 @@ export const ProductComponent = observer((props) => {
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
width: store.ui.mediaQuery.isMobile ? 250 : "",
|
width: store.ui.mediaQuery.isMobile ? 250 : "",
|
||||||
}}
|
}}
|
||||||
|
scroll={role === "Admin Partner" ? false : { x: 1300 }}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={
|
dataSource={
|
||||||
store.authentication.userData.role === "Admin Partner"
|
store.authentication.userData.role === "Admin Partner"
|
||||||
? store.product.dataProductPartner
|
? store.product.dataProductPartner
|
||||||
: store.product.data
|
: store.product.data
|
||||||
}
|
}
|
||||||
onRow={handleClickRow}
|
onRow={role === "Admin Partner" ? false : handleClickRow}
|
||||||
pagination={{
|
pagination={{
|
||||||
pageSize: store.product.pageSize,
|
pageSize: store.authentication.userData.role === "Admin" ? store.product.pageSize : store.product.pageSizeProductPartner,
|
||||||
total:
|
total:
|
||||||
store.authentication.userData.role === "Admin Partner"
|
store.authentication.userData.role === "Admin Partner"
|
||||||
? store.product.total_data_partner
|
? store.product.total_data_partner
|
||||||
: store.product.total_data,
|
: store.product.total_data,
|
||||||
current: store.product.page + 1,
|
current: store.authentication.userData.role === "Admin" ? store.product.page + 1 : store.product.pageProductPartner + 1,
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
simple: false,
|
simple: false,
|
||||||
}}
|
}}
|
||||||
onChange={async (page) => {
|
onChange={async (page) => {
|
||||||
let pageNumber = page.current;
|
let pageNumber = page.current;
|
||||||
store.product.pageSize = page.pageSize;
|
store.authentication.userData.role === "Admin" ? store.product.pageSize = page.pageSize : store.product.pageSizeProductPartner = page.pageSize;
|
||||||
store.product.page = pageNumber - 1;
|
store.authentication.userData.role === "Admin" ? store.product.page = pageNumber - 1 : store.product.pageProductPartner = pageNumber - 1
|
||||||
|
store.product.filterSubCategory = filterSubCategories
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
await store.product.getData();
|
store.authentication.userData.role === "Admin Partner"
|
||||||
|
? await store.product.getProductPartner(
|
||||||
|
filterSubCategories
|
||||||
|
)
|
||||||
|
: await store.product.getData();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -321,23 +342,29 @@ export const ProductComponent = observer((props) => {
|
||||||
position={"top"}
|
position={"top"}
|
||||||
pagination={{
|
pagination={{
|
||||||
onChange: async (page, pageSize) => {
|
onChange: async (page, pageSize) => {
|
||||||
store.product.pageSize = pageSize;
|
store.authentication.userData.role === "Admin" ? store.product.pageSize = pageSize : store.product.pageSizeProductPartner = pageSize;
|
||||||
store.product.page = page - 1;
|
store.authentication.userData.role === "Admin" ? store.product.page = page - 1 : store.product.pageProductPartner = page - 1
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
store.authentication.userData.role === "Admin Partner"
|
store.authentication.userData.role === "Admin Partner"
|
||||||
? await store.product.getProductPartner(
|
? await store.product.getProductPartner(
|
||||||
store.authentication.profileData.id
|
filterSubCategories
|
||||||
)
|
)
|
||||||
: await store.product.getData();
|
: await store.product.getData();
|
||||||
//await store.product.getData();
|
//await store.product.getData();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
},
|
},
|
||||||
pageSize: store.product.pageSize,
|
pageSize: store.authentication.userData.role === "Admin" ? store.product.pageSize : store.product.pageSizeProductPartner,
|
||||||
total: store.product.total_data,
|
total: store.authentication.userData.role === "Admin Partner"
|
||||||
current: store.product.page + 1,
|
? store.product.total_data_partner
|
||||||
|
: store.product.total_data,
|
||||||
|
current: store.authentication.userData.role === "Admin" ? store.product.page + 1 : store.product.pageProductPartner + 1,
|
||||||
style: { marginBottom: "1rem", marginRight: "1rem" },
|
style: { marginBottom: "1rem", marginRight: "1rem" },
|
||||||
}}
|
}}
|
||||||
dataSource={store.product.data}
|
dataSource={
|
||||||
|
store.authentication.userData.role === "Admin Partner"
|
||||||
|
? store.product.dataProductPartner
|
||||||
|
: store.product.data
|
||||||
|
}
|
||||||
style={{ padding: 0 }}
|
style={{ padding: 0 }}
|
||||||
renderItem={(item) => {
|
renderItem={(item) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -367,10 +367,45 @@ export const SupplierComponent = observer((props) => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Form form={form} layout="vertical">
|
<Form form={form} layout="vertical">
|
||||||
|
<Form.Item
|
||||||
|
name="irs_id"
|
||||||
|
label="Id"
|
||||||
|
rules={[{ required: true, message: "Please input name!" }]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="name"
|
name="name"
|
||||||
label="Name"
|
label="Name"
|
||||||
rules={[{ required: true, message: "Please input name!" }]}
|
rules={[{ required: true, message: "Please input url!" }]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="url"
|
||||||
|
label="Url"
|
||||||
|
rules={[{ required: true, message: "Please input url!" }]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="irs_pin"
|
||||||
|
label="Pin"
|
||||||
|
rules={[{ required: true, message: "Please input url!" }]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="irs_user"
|
||||||
|
label="User"
|
||||||
|
rules={[{ required: true, message: "Please input url!" }]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="irs_pass"
|
||||||
|
label="Password"
|
||||||
|
rules={[{ required: true, message: "Please input url!" }]}
|
||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
@ -445,6 +445,7 @@ export const DetailUser = observer(() => {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setInitialData({
|
setInitialData({
|
||||||
id: store.membership.dataDetail.id,
|
id: store.membership.dataDetail.id,
|
||||||
|
code: store.membership.dataDetail.partner.code,
|
||||||
name: store.membership.dataDetail.userDetail.name,
|
name: store.membership.dataDetail.userDetail.name,
|
||||||
username: store.membership.dataDetail.username,
|
username: store.membership.dataDetail.username,
|
||||||
identity_number:
|
identity_number:
|
||||||
|
@ -558,6 +559,14 @@ export const DetailUser = observer(() => {
|
||||||
{store.authentication.dataProfit.userDetail?.identity_number}
|
{store.authentication.dataProfit.userDetail?.identity_number}
|
||||||
</Text>
|
</Text>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Text strong>Code</Text>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Text>
|
||||||
|
{store.authentication.dataProfit.partner?.code}
|
||||||
|
</Text>
|
||||||
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text strong>Status</Text>
|
<Text strong>Status</Text>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
|
@ -72,6 +72,25 @@ export const ProductDetail = observer(() => {
|
||||||
currency: "IDR",
|
currency: "IDR",
|
||||||
}).format(text),
|
}).format(text),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "Biaya Admin",
|
||||||
|
dataIndex: "admin_price",
|
||||||
|
key: "admin_price",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
|
}, {
|
||||||
|
title: "Partner fee",
|
||||||
|
dataIndex: "partner_fee",
|
||||||
|
key: "partner_fee",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "Tanggal Berlaku",
|
title: "Tanggal Berlaku",
|
||||||
dataIndex: "startDate",
|
dataIndex: "startDate",
|
||||||
|
|
|
@ -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 Postpaid",
|
||||||
|
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>
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import {makeAutoObservable} from "mobx";
|
import { makeAutoObservable } from "mobx";
|
||||||
import {http} from "../utils/http";
|
import { http } from "../utils/http";
|
||||||
|
|
||||||
export class Product {
|
export class Product {
|
||||||
page = 0;
|
page = 0;
|
||||||
pageSize = 10
|
pageSize = 10
|
||||||
data = [];
|
data = [];
|
||||||
total_data = 0;
|
total_data = 0;
|
||||||
total_data_partner=0;
|
total_data_partner = 0;
|
||||||
filterSupplier = null;
|
filterSupplier = null;
|
||||||
filterSubCategory = null;
|
filterSubCategory = null;
|
||||||
visibleModalProduct = false;
|
visibleModalProduct = false;
|
||||||
|
@ -28,10 +28,11 @@ export class Product {
|
||||||
totalDataPriceHistory = 0;
|
totalDataPriceHistory = 0;
|
||||||
pagePriceHistory = 0;
|
pagePriceHistory = 0;
|
||||||
pageProductPartner = 0;
|
pageProductPartner = 0;
|
||||||
|
pageSizeProductPartner = 10
|
||||||
pageSizePriceHistory = 10
|
pageSizePriceHistory = 10
|
||||||
|
|
||||||
dataDetailProduct = {};
|
dataDetailProduct = {};
|
||||||
dataProductPartner=[]
|
dataProductPartner = []
|
||||||
|
|
||||||
constructor(ctx) {
|
constructor(ctx) {
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
|
@ -54,6 +55,7 @@ export class Product {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async getDataSubCategories() {
|
async getDataSubCategories() {
|
||||||
try {
|
try {
|
||||||
const response = await http.get(`/product/sub-categories?category=${this.filterCategory}&page=${this.pageSubCategories}&pageSize=${this.pageSizeSubCategories}`);
|
const response = await http.get(`/product/sub-categories?category=${this.filterCategory}&page=${this.pageSubCategories}&pageSize=${this.pageSizeSubCategories}`);
|
||||||
|
@ -99,14 +101,27 @@ export class Product {
|
||||||
}
|
}
|
||||||
|
|
||||||
async getProductPartner(id) {
|
async getProductPartner(id) {
|
||||||
|
console.log({ id });
|
||||||
|
if (id === undefined) {
|
||||||
try {
|
try {
|
||||||
const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&pageSize=10&sub-category=${id}`);
|
const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&pageSize=${this.pageSizeProductPartner}&sub-category=`);
|
||||||
console.log(response)
|
console.log(response)
|
||||||
this.dataProductPartner = response.body.data
|
this.dataProductPartner = response.body.data
|
||||||
this.total_data_partner= response?.body?.count ?? 0
|
this.total_data_partner = response?.body?.count ?? 0
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&pageSize=${this.pageSizeProductPartner}&sub-category=${id}`);
|
||||||
|
console.log(response)
|
||||||
|
this.dataProductPartner = response.body.data
|
||||||
|
this.total_data_partner = response?.body?.count ?? 0
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async create(data) {
|
async create(data) {
|
||||||
|
|
|
@ -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