Merge branch 'develop' into 'devops-production'
Develop See merge request empatnusabangsa/ppob/ppob-frontend!159
This commit is contained in:
commit
d846499611
|
@ -211,8 +211,8 @@ export const CategoryComponent = observer((props) => {
|
|||
)}
|
||||
<Modal
|
||||
visible={store.category.visibleModalCategory}
|
||||
title={idData ? "Edit Category" : "Create a new Category"}
|
||||
okText={idData ? "Edit" : "Create"}
|
||||
title={idData ? "Edit Kategori" : "Buat Kategori Baru"}
|
||||
okText={idData ? "Edit" : "Buat"}
|
||||
cancelText="Batal"
|
||||
onCancel={() => {
|
||||
form.resetFields();
|
||||
|
|
|
@ -283,21 +283,11 @@ export const ProductComponent = observer((props) => {
|
|||
<div>
|
||||
{store.ui.mediaQuery.isDesktop && (
|
||||
<Table
|
||||
style={
|
||||
// store.authentication.userData.role === "Admin"
|
||||
// ? {
|
||||
{
|
||||
cursor: "pointer",
|
||||
textAlign: "center",
|
||||
width: store.ui.mediaQuery.isMobile ? 250 : "",
|
||||
}
|
||||
|
||||
// }
|
||||
// : {
|
||||
// textAlign: "center",
|
||||
// width: store.ui.mediaQuery.isMobile ? 250 : "",
|
||||
// }
|
||||
}
|
||||
style={{
|
||||
cursor: "pointer",
|
||||
textAlign: "center",
|
||||
width: store.ui.mediaQuery.isMobile ? 250 : "",
|
||||
}}
|
||||
columns={columns}
|
||||
dataSource={
|
||||
store.authentication.userData.role === "Admin Partner"
|
||||
|
|
|
@ -216,8 +216,8 @@ export const SubcategoryComponent = observer((props) => {
|
|||
)}
|
||||
<Modal
|
||||
visible={store.subcategory.visibleModalSubcategory}
|
||||
title={idData ? "Edit Sub Category" : "Create a new sub category"}
|
||||
okText={idData ? "Edit" : "Create"}
|
||||
title={idData ? "Edit Sub Kategori" : "Buat Sub Kategori Baru"}
|
||||
okText={idData ? "Edit" : "Buat"}
|
||||
cancelText="Batal"
|
||||
onCancel={() => {
|
||||
form.resetFields();
|
||||
|
|
|
@ -346,8 +346,8 @@ export const SupplierComponent = observer((props) => {
|
|||
)}
|
||||
<Modal
|
||||
visible={store.supplier.visibleModalSupplier}
|
||||
title={idData ? "Edit Supplier" : "Create a new Supplier"}
|
||||
okText={idData ? "Edit" : "Create"}
|
||||
title={idData ? "Edit Supplier" : "Buat Supplier Baru"}
|
||||
okText={idData ? "Edit" : "Buat"}
|
||||
cancelText="Batal"
|
||||
onCancel={() => {
|
||||
form.resetFields();
|
||||
|
|
|
@ -506,6 +506,7 @@ export const DesktopLayout = observer(() => {
|
|||
onVisibleChange={() => setClicked(!clicked)}
|
||||
>
|
||||
{store.authentication.userData.role !== "Admin" &&
|
||||
store.authentication.userData.role !== "Customer Service" &&
|
||||
new Intl.NumberFormat("id-ID", {
|
||||
style: "currency",
|
||||
currency: "IDR",
|
||||
|
@ -564,30 +565,33 @@ export const DesktopLayout = observer(() => {
|
|||
width: "100%",
|
||||
}}
|
||||
></div>
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Card
|
||||
size="small"
|
||||
title={
|
||||
<span
|
||||
style={{
|
||||
fontStyle: "bold",
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
Saldo :{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
style: "currency",
|
||||
currency: "IDR",
|
||||
}).format(store.authentication.profileData?.wallet || 0)}
|
||||
</span>
|
||||
}
|
||||
style={{
|
||||
marginRight: 10,
|
||||
width: 210,
|
||||
height: 31,
|
||||
}}
|
||||
></Card>
|
||||
)}
|
||||
{store.authentication.userData.role !== "Admin" &&
|
||||
store.authentication.userData.role !== "Customer Service" && (
|
||||
<Card
|
||||
size="small"
|
||||
title={
|
||||
<span
|
||||
style={{
|
||||
fontStyle: "bold",
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
Saldo :{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
style: "currency",
|
||||
currency: "IDR",
|
||||
}).format(
|
||||
store.authentication.profileData?.wallet || 0
|
||||
)}
|
||||
</span>
|
||||
}
|
||||
style={{
|
||||
marginRight: 10,
|
||||
width: 210,
|
||||
height: 31,
|
||||
}}
|
||||
></Card>
|
||||
)}
|
||||
<Popover
|
||||
className={store.ui.mediaQuery.isDesktop ? "shadow" : null}
|
||||
autoAdjustOverflow={true}
|
||||
|
|
|
@ -741,6 +741,7 @@ export const DetailUser = observer(() => {
|
|||
style={{ marginBottom: "1rem", marginLeft: 5 }}
|
||||
onClick={() => {
|
||||
store.transaction.visibleModalFilterTransaction = true;
|
||||
store.transaction.page=0;
|
||||
setAction(true);
|
||||
}}
|
||||
>
|
||||
|
@ -777,6 +778,7 @@ export const DetailUser = observer(() => {
|
|||
style={{ marginBottom: "1rem" }}
|
||||
onClick={() => {
|
||||
store.transaction.visibleModalFilterTransaction = true;
|
||||
store.transaction.page=0;
|
||||
setAction(true);
|
||||
}}
|
||||
>
|
||||
|
@ -858,6 +860,7 @@ export const DetailUser = observer(() => {
|
|||
style={{ marginBottom: "1rem", marginLeft: 5 }}
|
||||
onClick={() => {
|
||||
store.transaction.visibleModalFilterTransaction = true;
|
||||
store.transaction.page=0;
|
||||
}}
|
||||
>
|
||||
<FilterOutlined />
|
||||
|
@ -897,6 +900,7 @@ export const DetailUser = observer(() => {
|
|||
style={{ marginBottom: "1rem" }}
|
||||
onClick={() => {
|
||||
store.transaction.visibleModalFilterTransaction = true;
|
||||
store.transaction.page=0;
|
||||
}}
|
||||
>
|
||||
<FilterOutlined />
|
||||
|
|
|
@ -99,7 +99,7 @@ export const Konfirmasi = observer(() => {
|
|||
render: (text, record) =>
|
||||
record.roles?.name !== "Sales" &&
|
||||
(record.user_detail?.image_store !== "[]" ||
|
||||
record.user_detail?.image_store !== '""') ? (
|
||||
record.user_detail?.image_store !== '""') ? (
|
||||
<Button
|
||||
onClick={async () => {
|
||||
setToko(record);
|
||||
|
@ -236,7 +236,10 @@ export const Konfirmasi = observer(() => {
|
|||
<div className={["ppob-container"].join(" ")}>
|
||||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ? routeData : dataRoute
|
||||
store.authentication.userData.role === "Admin" ||
|
||||
store.authentication.userData.role === "Customer Service"
|
||||
? routeData
|
||||
: dataRoute
|
||||
}
|
||||
/>
|
||||
<Card>
|
||||
|
|
|
@ -323,7 +323,10 @@ export const Membership = observer(() => {
|
|||
<div className={["ppob-container"].join(" ")}>
|
||||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ? routeData : dataRoute
|
||||
store.authentication.userData.role === "Admin" ||
|
||||
store.authentication.userData.role === "Customer Service"
|
||||
? routeData
|
||||
: dataRoute
|
||||
}
|
||||
/>
|
||||
<Card>
|
||||
|
@ -334,6 +337,7 @@ export const Membership = observer(() => {
|
|||
<Button
|
||||
onClick={() => {
|
||||
store.membership.visibleModalFilterMembership = true;
|
||||
store.membership.page = 0;
|
||||
}}
|
||||
>
|
||||
<FilterOutlined />
|
||||
|
@ -595,7 +599,7 @@ export const Membership = observer(() => {
|
|||
</Col>
|
||||
<Col span={24}>
|
||||
<Title level={5} type={"secondary"} strong>
|
||||
Type
|
||||
Tipe
|
||||
</Title>
|
||||
<Select
|
||||
mode={"multiple"}
|
||||
|
|
|
@ -189,10 +189,10 @@ export const MembershipModal = ({
|
|||
visible={visible}
|
||||
title={
|
||||
initialData.isChangePassword
|
||||
? "Change Member Password"
|
||||
? "Ganti Password Anggota"
|
||||
: initialData.id
|
||||
? "Edit Member"
|
||||
: "Create a new Membership"
|
||||
? "Edit Anggota"
|
||||
: "Buat Anggota Baru"
|
||||
}
|
||||
okText={initialData.id ? "Edit" : "Create"}
|
||||
cancelText="Batal"
|
||||
|
|
|
@ -35,7 +35,6 @@ import { capitalize } from "lodash";
|
|||
import { PAYBACK_STATUS } from "../../constants/payback";
|
||||
import moment from "moment";
|
||||
|
||||
|
||||
export const Payback = observer(() => {
|
||||
const { Option } = Select;
|
||||
const { Title } = Typography;
|
||||
|
@ -274,7 +273,10 @@ export const Payback = observer(() => {
|
|||
<div className={["ppob-container"].join(" ")}>
|
||||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ? routeData : dataRoute
|
||||
store.authentication.userData.role === "Admin" ||
|
||||
store.authentication.userData.role === "Customer Service"
|
||||
? routeData
|
||||
: dataRoute
|
||||
}
|
||||
/>
|
||||
<Card>
|
||||
|
@ -501,7 +503,7 @@ export const Payback = observer(() => {
|
|||
label="Dari Tanggal"
|
||||
rules={[{ required: true, message: "Please input Date!" }]}
|
||||
>
|
||||
<DatePicker style={{ width: "100%" }}/>
|
||||
<DatePicker style={{ width: "100%" }} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="end_date"
|
||||
|
|
|
@ -98,8 +98,8 @@ export const PaybackModal = ({ initialData }) => {
|
|||
return (
|
||||
<Modal
|
||||
visible={store.payback.visibleModalPayback}
|
||||
title={"Create a new Created"}
|
||||
okText={"Create"}
|
||||
title={"Buat Pembayaran Baru"}
|
||||
okText={"Buat"}
|
||||
cancelText="Batal"
|
||||
onCancel={handleCancel}
|
||||
onOk={() => {
|
||||
|
|
|
@ -183,7 +183,8 @@ export const Product = observer(() => {
|
|||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ||
|
||||
store.authentication.userData.role === "Admin Partner"
|
||||
store.authentication.userData.role === "Admin Partner" ||
|
||||
store.authentication.userData.role === "Customer Service"
|
||||
? routeData
|
||||
: dataRoute
|
||||
}
|
||||
|
@ -195,7 +196,7 @@ export const Product = observer(() => {
|
|||
<Button
|
||||
onClick={() => {
|
||||
store.product.visibleModalFilterProduct = true;
|
||||
store.product.page=0
|
||||
store.product.page = 0;
|
||||
}}
|
||||
>
|
||||
<FilterOutlined />
|
||||
|
@ -249,8 +250,8 @@ export const Product = observer(() => {
|
|||
|
||||
<Modal
|
||||
visible={visibleModalUpload}
|
||||
title={"Upload Excel Product"}
|
||||
okText={"Create"}
|
||||
title={"Upload Excel Produk"}
|
||||
okText={"Buat"}
|
||||
cancelText="Batal"
|
||||
onCancel={() => {
|
||||
form.resetFields();
|
||||
|
|
|
@ -284,8 +284,8 @@ export const Profile = observer(() => {
|
|||
try {
|
||||
modalLoader.setLoading(true);
|
||||
const response = await store.membership.changePassword(id, data);
|
||||
console.log(id,"id yang masuk")
|
||||
console.log(data,"data yang masuk")
|
||||
console.log(id, "id yang masuk");
|
||||
console.log(data, "data yang masuk");
|
||||
message.success(response?.body?.message || "Berhasil Ganti Password");
|
||||
} catch (e) {
|
||||
console.log(e, "apa errornya");
|
||||
|
@ -301,7 +301,8 @@ export const Profile = observer(() => {
|
|||
<BreadcumbComponent
|
||||
data={
|
||||
store.authentication.userData.role === "Admin" ||
|
||||
store.authentication.userData.role === "Admin Partner"
|
||||
store.authentication.userData.role === "Admin Partner" ||
|
||||
store.authentication.userData.role === "Customer Service"
|
||||
? routeData
|
||||
: dataRoute
|
||||
}
|
||||
|
@ -430,16 +431,11 @@ export const Profile = observer(() => {
|
|||
{store.authentication.userData.role === "Retail" && (
|
||||
<Button
|
||||
onClick={() => {
|
||||
// setInitialData({
|
||||
// id: store.membership.dataDetail.id,
|
||||
// name: store.membership.dataDetail.userDetail.name,
|
||||
// username: store.membership.dataDetail.username,
|
||||
// phone_number:
|
||||
// store.membership.dataDetail.userDetail.phone_number,
|
||||
// roleId: store.membership.dataDetail.roles.id,
|
||||
// isChangePassword: true,
|
||||
console.log(store.authentication.profileData?.id,"id nya")
|
||||
console.log(store.authentication.profileData?.userDetail.id,"id member")
|
||||
console.log(store.authentication.profileData?.id, "id nya");
|
||||
console.log(
|
||||
store.authentication.profileData?.userDetail.id,
|
||||
"id member"
|
||||
);
|
||||
setVisible(true);
|
||||
}}
|
||||
>
|
||||
|
@ -455,6 +451,7 @@ export const Profile = observer(() => {
|
|||
style={{ marginBottom: "1rem", marginLeft: 5 }}
|
||||
onClick={() => {
|
||||
store.transaction.visibleModalFilterTransaction = true;
|
||||
store.transaction.page = 0;
|
||||
setAction(true);
|
||||
}}
|
||||
>
|
||||
|
@ -570,6 +567,7 @@ export const Profile = observer(() => {
|
|||
style={{ marginBottom: "1rem", marginLeft: 5 }}
|
||||
onClick={() => {
|
||||
store.transaction.visibleModalFilterTransaction = true;
|
||||
store.transaction.page = 0;
|
||||
}}
|
||||
>
|
||||
<FilterOutlined />
|
||||
|
@ -583,17 +581,16 @@ export const Profile = observer(() => {
|
|||
//scroll={{ x: 1500, y: 300 }}
|
||||
dataSource={store.transaction.dataHistoryTransaction}
|
||||
pagination={{
|
||||
pageSize: store.transaction.pageSizeHistoryTransaction,
|
||||
pageSize: store.transaction.pageSize,
|
||||
total: store.transaction.total_dataHistoryTransaction,
|
||||
current: store.transaction.pageHistoryTransaction + 1,
|
||||
current: store.transaction.page + 1,
|
||||
showSizeChanger: true,
|
||||
simple: false,
|
||||
}}
|
||||
onChange={async (page) => {
|
||||
let pageNumber = page.current;
|
||||
store.transaction.pageSizeHistoryTransaction =
|
||||
page.pageSize;
|
||||
store.transaction.pageHistoryTransaction = pageNumber - 1;
|
||||
store.transaction.pageSize = page.pageSize;
|
||||
store.transaction.page = pageNumber - 1;
|
||||
modalLoader.setLoading(true);
|
||||
await store.transaction.getDataHistoryTransaction();
|
||||
modalLoader.setLoading(false);
|
||||
|
@ -610,16 +607,15 @@ export const Profile = observer(() => {
|
|||
onChange: async (page, pageSize) => {
|
||||
console.log(page, "Page");
|
||||
console.log(pageSize, "Page size");
|
||||
store.transaction.pageSizeHistoryTransaction =
|
||||
pageSize;
|
||||
store.transaction.pageHistoryTransaction = page - 1;
|
||||
store.transaction.page = pageSize;
|
||||
store.transaction.page = page - 1;
|
||||
modalLoader.setLoading(true);
|
||||
await store.transaction.getDataHistoryTransaction();
|
||||
modalLoader.setLoading(false);
|
||||
},
|
||||
pageSize: store.transaction.pageSizeHistoryTransaction,
|
||||
pageSize: store.transaction.pageSize,
|
||||
total: store.transaction.total_dataHistoryTransaction,
|
||||
current: store.transaction.pageHistoryTransaction + 1,
|
||||
current: store.transaction.page + 1,
|
||||
style: { marginBottom: "1rem", marginRight: "1rem" },
|
||||
}}
|
||||
style={{ padding: 0 }}
|
||||
|
@ -778,7 +774,7 @@ export const Profile = observer(() => {
|
|||
<Form
|
||||
form={form}
|
||||
layout="vertical"
|
||||
initialValues={{ id : store.authentication.profileData?.id }}
|
||||
initialValues={{ id: store.authentication.profileData?.id }}
|
||||
>
|
||||
<Form.Item
|
||||
name="password"
|
||||
|
|
|
@ -133,7 +133,7 @@ export class Transaction {
|
|||
async getDataHistoryTransaction() {
|
||||
try {
|
||||
const response = await http.get(
|
||||
`/transaction/history?page=${this.pageHistoryTransaction}&pageSize=${this.pageSizeHistoryTransaction}&start=${this.filterStart}&end=${this.filterEnd}`
|
||||
`/transaction/history?page=${this.page}&pageSize=${this.pageSize}&start=${this.filterStart}&end=${this.filterEnd}`
|
||||
);
|
||||
console.log(response);
|
||||
this.dataHistoryTransaction = response.body.data ?? [];
|
||||
|
@ -158,7 +158,7 @@ export class Transaction {
|
|||
async getDataHistoryTopUp(id) {
|
||||
try {
|
||||
const response = await http.get(
|
||||
`/transaction/history-deposit?page=${this.pageHistoryTopUp}&pageSize=${this.pageSizeHistoryTopUp}&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')
|
||||
this.dataHistoryTopUp = response.body.data ?? [];
|
||||
|
|
Loading…
Reference in New Issue
Block a user