Perbaikan Project PPOB
This commit is contained in:
parent
8857911dcd
commit
38d744ce2f
|
@ -252,6 +252,17 @@ export const DetailUser = observer(() => {
|
|||
},
|
||||
];
|
||||
|
||||
const dataRoute = [
|
||||
{
|
||||
route: LINKS.MEMBERSHIP,
|
||||
name: "Keanggotaan"
|
||||
},
|
||||
{
|
||||
route: LINKS.USER_DETAIL.replace(":id", id),
|
||||
name: <span style={{ fontWeight: "bold" }}>Detail User</span>,
|
||||
},
|
||||
];
|
||||
|
||||
const styleSaldoTitle = store.ui.mediaQuery.isDesktop
|
||||
? {
|
||||
display: "flex",
|
||||
|
@ -275,13 +286,14 @@ export const DetailUser = observer(() => {
|
|||
store.authentication.dataProfit.userDetail?.image_identity,
|
||||
"detail"
|
||||
);
|
||||
console.log(
|
||||
store.authentication.listImage,
|
||||
"detail gambar"
|
||||
);
|
||||
console.log(store.authentication.listImage, "detail gambar");
|
||||
return (
|
||||
<div className={[""].join(" ")}>
|
||||
<BreadcumbComponent data={routeData} />
|
||||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ? routeData : dataRoute
|
||||
}
|
||||
/>
|
||||
<Card>
|
||||
<Row style={{ marginBottom: 10 }}>
|
||||
<Title strong level={2}>
|
||||
|
@ -338,7 +350,8 @@ export const DetailUser = observer(() => {
|
|||
store.membership.dataDetail.userDetail.image_identity
|
||||
);
|
||||
console.log(
|
||||
store.membership.dataDetail.userDetail.image_store,"ini store"
|
||||
store.membership.dataDetail.userDetail.image_store,
|
||||
"ini store"
|
||||
);
|
||||
console.log(store.membership.dataDetail.username);
|
||||
setVisibleModal(true);
|
||||
|
@ -523,7 +536,6 @@ export const DetailUser = observer(() => {
|
|||
</Space>
|
||||
</Col>
|
||||
)}
|
||||
|
||||
</Row>
|
||||
|
||||
<Row style={{ marginBottom: 20 }}>
|
||||
|
|
|
@ -30,7 +30,6 @@ import { LINKS } from "../../routes/app";
|
|||
import { useHistory } from "react-router-dom";
|
||||
import { ModalLoaderContext } from "../../utils/modal";
|
||||
|
||||
|
||||
export const Membership = observer(() => {
|
||||
const history = useHistory();
|
||||
const { Option } = Select;
|
||||
|
@ -253,12 +252,19 @@ export const Membership = observer(() => {
|
|||
name: <span style={{ fontWeight: "bold" }}>Keanggotaan</span>,
|
||||
},
|
||||
];
|
||||
|
||||
const dataRoute = [
|
||||
{
|
||||
route: LINKS.MEMBERSHIP,
|
||||
name: "Keanggotaan"
|
||||
},
|
||||
];
|
||||
const onSubmit = async (data, image, imageStore) => {
|
||||
data.superior = true;
|
||||
console.log(imageStore, "Apa imageStore")
|
||||
console.log(imageStore, "Apa imageStore");
|
||||
|
||||
if (!imageStore) {
|
||||
imageStore = []
|
||||
imageStore = [];
|
||||
}
|
||||
|
||||
if (initialData.id) {
|
||||
|
@ -325,7 +331,11 @@ export const Membership = observer(() => {
|
|||
};
|
||||
return (
|
||||
<div className={["ppob-container"].join(" ")}>
|
||||
<BreadcumbComponent data={routeData} />
|
||||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ? routeData : dataRoute
|
||||
}
|
||||
/>
|
||||
<Card>
|
||||
<div>
|
||||
<Row style={{ marginBottom: 20 }}>
|
||||
|
|
|
@ -182,6 +182,13 @@ export const Payback = observer(() => {
|
|||
},
|
||||
];
|
||||
|
||||
const dataRoute = [
|
||||
{
|
||||
route: LINKS.PAYBACK,
|
||||
name: "Konfirmasi Pembayaran"
|
||||
},
|
||||
];
|
||||
|
||||
const handleAction = async (id, type) => {
|
||||
modalLoader.setLoading(true);
|
||||
try {
|
||||
|
@ -236,8 +243,12 @@ export const Payback = observer(() => {
|
|||
const data = form.getFieldsValue();
|
||||
//console.log(data);
|
||||
store.payback.filterMembership = filterMembership;
|
||||
store.payback.filterStart = data.start_date ? (moment(data.start_date).format('YYYY-MM-DD') + ' 00:00:00') : null;
|
||||
store.payback.filterEnd = data.end_date ? (moment(data.end_date).format('YYYY-MM-DD') + ' 23:59:59') : null;
|
||||
store.payback.filterStart = data.start_date
|
||||
? moment(data.start_date).format("YYYY-MM-DD") + " 00:00:00"
|
||||
: null;
|
||||
store.payback.filterEnd = data.end_date
|
||||
? moment(data.end_date).format("YYYY-MM-DD") + " 23:59:59"
|
||||
: null;
|
||||
modalLoader.setLoading(true);
|
||||
await store.payback.getDataConfirmation();
|
||||
modalLoader.setLoading(false);
|
||||
|
@ -281,7 +292,11 @@ export const Payback = observer(() => {
|
|||
];
|
||||
return (
|
||||
<div className={["ppob-container"].join(" ")}>
|
||||
<BreadcumbComponent data={routeData} />
|
||||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ? routeData : dataRoute
|
||||
}
|
||||
/>
|
||||
<Card>
|
||||
<div>
|
||||
<Row style={{ marginBottom: 20 }}>
|
||||
|
|
|
@ -133,6 +133,14 @@ export const PaybackCreated = observer(() => {
|
|||
name: <span style={{ fontWeight: "bold" }}>Buat Pembayaran</span>,
|
||||
},
|
||||
];
|
||||
|
||||
const dataRoute = [
|
||||
{
|
||||
route: LINKS.PAYBACK_CREATED,
|
||||
name: "Buat Pembayaran"
|
||||
},
|
||||
];
|
||||
|
||||
const handleRemoveFilter = async () => {
|
||||
store.payback.filterStart = null;
|
||||
store.payback.filterEnd = null;
|
||||
|
@ -209,7 +217,11 @@ export const PaybackCreated = observer(() => {
|
|||
|
||||
return (
|
||||
<div className={["ppob-container"].join(" ")}>
|
||||
<BreadcumbComponent data={routeData} />
|
||||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ? routeData : dataRoute
|
||||
}
|
||||
/>
|
||||
<Card>
|
||||
<div>
|
||||
<Row style={{ marginBottom: 20 }}>
|
||||
|
@ -336,7 +348,6 @@ export const PaybackCreated = observer(() => {
|
|||
: "Rejected"}
|
||||
</Tag>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
|
|
|
@ -1,6 +1,21 @@
|
|||
import React, { useContext, useEffect, useState } from "react";
|
||||
import {Button, Card, Col, Form, Input, message, Modal, Row, Select, Upload} from "antd";
|
||||
import {FilterOutlined, PlusOutlined, UploadOutlined,} from "@ant-design/icons";
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
Col,
|
||||
Form,
|
||||
Input,
|
||||
message,
|
||||
Modal,
|
||||
Row,
|
||||
Select,
|
||||
Upload,
|
||||
} from "antd";
|
||||
import {
|
||||
FilterOutlined,
|
||||
PlusOutlined,
|
||||
UploadOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import { BreadcumbComponent } from "../../component/BreadcumbComponent";
|
||||
import { useStore } from "../../utils/useStore";
|
||||
import { observer } from "mobx-react-lite";
|
||||
|
@ -30,7 +45,7 @@ export const Product = observer(() => {
|
|||
store.supplier.getData(),
|
||||
store.category.getData(),
|
||||
store.product.getDataSubCategories(),
|
||||
store.product.getProductPartner()
|
||||
store.product.getProductPartner(),
|
||||
]);
|
||||
await store.product.getData();
|
||||
modalLoader.setLoading(false);
|
||||
|
@ -62,14 +77,22 @@ export const Product = observer(() => {
|
|||
},
|
||||
];
|
||||
|
||||
const dataRoute = [
|
||||
{
|
||||
route: LINKS.PRODUCT,
|
||||
name: "Produk",
|
||||
},
|
||||
];
|
||||
|
||||
const beforeUpload = (file) => {
|
||||
let isLt2M;
|
||||
let allowedFile = [
|
||||
"text/csv", "application/csv",
|
||||
"text/csv",
|
||||
"application/csv",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"application/vnd.ms-excel.sheet.binary.macroEnabled.12",
|
||||
"application/vnd.ms-excel",
|
||||
"application/vnd.ms-excel.sheet.macroEnabled.12"
|
||||
"application/vnd.ms-excel.sheet.macroEnabled.12",
|
||||
];
|
||||
let isValid = allowedFile.includes(file.type);
|
||||
if (!isValid) {
|
||||
|
@ -93,12 +116,14 @@ export const Product = observer(() => {
|
|||
message.error("Failed upload excel!");
|
||||
}
|
||||
|
||||
setFileList([{
|
||||
uid: '-1',
|
||||
setFileList([
|
||||
{
|
||||
uid: "-1",
|
||||
name: response.body.filename,
|
||||
status: 'done',
|
||||
url: '',
|
||||
}]);
|
||||
status: "done",
|
||||
url: "",
|
||||
},
|
||||
]);
|
||||
setExcel(response.body.filename);
|
||||
} catch (e) {
|
||||
setLoading(false);
|
||||
|
@ -107,10 +132,10 @@ export const Product = observer(() => {
|
|||
};
|
||||
|
||||
const handleChange = (info) => {
|
||||
if (info.file.status === 'uploading') {
|
||||
if (info.file.status === "uploading") {
|
||||
setLoading(true);
|
||||
} else {
|
||||
setLoading(false)
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -140,7 +165,7 @@ export const Product = observer(() => {
|
|||
const handleSubmit = async (data) => {
|
||||
const request = {
|
||||
fileName: excel,
|
||||
supplierCode: data.supplierCode
|
||||
supplierCode: data.supplierCode,
|
||||
};
|
||||
const responseUploadProduct = await handleUploadProduct(request);
|
||||
|
||||
|
@ -153,7 +178,14 @@ export const Product = observer(() => {
|
|||
|
||||
return (
|
||||
<div className={[""].join(" ")}>
|
||||
<BreadcumbComponent data={routeData}/>
|
||||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ||
|
||||
store.authentication.userData.role === "Admin Partner"
|
||||
? routeData
|
||||
: dataRoute
|
||||
}
|
||||
/>
|
||||
<Card>
|
||||
<div>
|
||||
<Row style={{ marginBottom: 20 }}>
|
||||
|
@ -184,7 +216,8 @@ export const Product = observer(() => {
|
|||
}}
|
||||
/> */}
|
||||
|
||||
{store.authentication.userData.role == "Admin" && <div
|
||||
{store.authentication.userData.role == "Admin" && (
|
||||
<div
|
||||
style={{
|
||||
display: store.ui.mediaQuery.isMobile ? "" : "flex",
|
||||
justifyContent: "flex-end",
|
||||
|
@ -202,7 +235,8 @@ export const Product = observer(() => {
|
|||
>
|
||||
Tambah Produk
|
||||
</Button>
|
||||
</div>}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
|
@ -236,7 +270,9 @@ export const Product = observer(() => {
|
|||
<Form.Item
|
||||
name="fileName"
|
||||
label="Upload Excel Product"
|
||||
rules={[{required: true, message: "Please Upload Excel Product!"}]}
|
||||
rules={[
|
||||
{ required: true, message: "Please Upload Excel Product!" },
|
||||
]}
|
||||
>
|
||||
<Upload
|
||||
fileList={fileList}
|
||||
|
@ -274,7 +310,7 @@ export const Product = observer(() => {
|
|||
rules={[{ required: true, message: "Please input Supplier Code!" }]}
|
||||
>
|
||||
<Select>
|
||||
{store.supplier.data.map(data => (
|
||||
{store.supplier.data.map((data) => (
|
||||
<Option key={data.id} value={data.code}>
|
||||
{data.name}
|
||||
</Option>
|
||||
|
|
|
@ -38,7 +38,7 @@ export const Profile = observer(() => {
|
|||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.PROFILE,
|
||||
|
@ -46,6 +46,13 @@ export const Profile = observer(() => {
|
|||
},
|
||||
];
|
||||
|
||||
const dataRoute = [
|
||||
{
|
||||
route: LINKS.PROFILE,
|
||||
name: "Profil",
|
||||
},
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
modalLoader.setLoading(true);
|
||||
|
@ -214,7 +221,14 @@ export const Profile = observer(() => {
|
|||
|
||||
return (
|
||||
<div className={["ppob-container"].join(" ")}>
|
||||
<BreadcumbComponent data={routeData} />
|
||||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ||
|
||||
store.authentication.userData.role === "Admin Partner"
|
||||
? routeData
|
||||
: dataRoute
|
||||
}
|
||||
/>
|
||||
<Card>
|
||||
<Title strong>Profile</Title>
|
||||
<Row style={{ marginBottom: 20 }}>
|
||||
|
|
|
@ -55,13 +55,9 @@ export const Transaction = observer(() => {
|
|||
};
|
||||
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.TRANSACTION,
|
||||
name: <span style={{ fontWeight: "bold" }}>Transaksi</span>,
|
||||
name: "Transaksi"
|
||||
},
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user