Bug Fixing
This commit is contained in:
parent
f6cc7ee359
commit
198063a7d9
|
@ -220,8 +220,6 @@ export const ProductComponent = observer((props) => {
|
||||||
const handleCancelFilter = async () => {
|
const handleCancelFilter = async () => {
|
||||||
store.product.filterSubCategory = null;
|
store.product.filterSubCategory = null;
|
||||||
store.product.filterSupplier = null;
|
store.product.filterSupplier = null;
|
||||||
// setFilterSubCategories([]);
|
|
||||||
// setFilterSupplier([]);
|
|
||||||
store.product.visibleModalFilterProduct = false;
|
store.product.visibleModalFilterProduct = false;
|
||||||
await store.product.getData();
|
await store.product.getData();
|
||||||
};
|
};
|
||||||
|
@ -232,21 +230,9 @@ export const ProductComponent = observer((props) => {
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
await store.product.getData();
|
await store.product.getData();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
// setFilterSupplier([]);
|
|
||||||
// setFilterSubCategories([]);
|
|
||||||
store.product.visibleModalFilterProduct = false;
|
store.product.visibleModalFilterProduct = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// const handleFilterCategory = async (value) => {
|
|
||||||
// if (value) {
|
|
||||||
// store.product.filterCategory = value;
|
|
||||||
// await store.product.getDataSubCategories();
|
|
||||||
// } else {
|
|
||||||
// store.product.filterCategory = null;
|
|
||||||
// await store.product.getDataSubCategories();
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
const footerLayoutFilter = [
|
const footerLayoutFilter = [
|
||||||
<Button
|
<Button
|
||||||
key={"remove"}
|
key={"remove"}
|
||||||
|
|
|
@ -292,10 +292,6 @@ export const DetailUser = observer(() => {
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
}
|
}
|
||||||
: null;
|
: null;
|
||||||
// console.log(
|
|
||||||
// JSON.parse(store.authentication.dataProfit.userDetail?.image_store),
|
|
||||||
// " ini dia"
|
|
||||||
// );
|
|
||||||
const data = store.authentication.listImage;
|
const data = store.authentication.listImage;
|
||||||
console.log(data, "ini data");
|
console.log(data, "ini data");
|
||||||
console.log(
|
console.log(
|
||||||
|
@ -464,44 +460,6 @@ export const DetailUser = observer(() => {
|
||||||
: "Inactive"}
|
: "Inactive"}
|
||||||
</Text>
|
</Text>
|
||||||
</Col>
|
</Col>
|
||||||
{/* {store.authentication.userData.role === "Sales" && (
|
|
||||||
<Row>
|
|
||||||
<Col span={12}>
|
|
||||||
<Text strong>Foto Identitas</Text>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}></Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Text>
|
|
||||||
<Image
|
|
||||||
src={
|
|
||||||
store.authentication.dataProfit.userDetail
|
|
||||||
?.image_identity
|
|
||||||
? `${appConfig.apiUrl}/config/image/${store.authentication.dataProfit.userDetail?.image_identity}`
|
|
||||||
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
|
||||||
}
|
|
||||||
style={{ width: "10vw",marginLeft:10 }}
|
|
||||||
/>
|
|
||||||
</Text>
|
|
||||||
</Col>
|
|
||||||
<Col span={24}>
|
|
||||||
<Text strong>Foto Toko</Text>
|
|
||||||
<Text>
|
|
||||||
<Row>
|
|
||||||
{store.authentication.listImage.map((item) => (
|
|
||||||
<Image
|
|
||||||
src={
|
|
||||||
item
|
|
||||||
? `${appConfig.apiUrl}/config/image/${item}`
|
|
||||||
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
|
||||||
}
|
|
||||||
style={{ width: "10vw",marginRight:15 }}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</Row>
|
|
||||||
</Text>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
)} */}
|
|
||||||
{store.authentication.userData.role === "Admin" &&
|
{store.authentication.userData.role === "Admin" &&
|
||||||
store.authentication.dataProfit.roles?.name !==
|
store.authentication.dataProfit.roles?.name !==
|
||||||
"Admin Partner" && (
|
"Admin Partner" && (
|
||||||
|
@ -587,7 +545,6 @@ export const DetailUser = observer(() => {
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{store.authentication.userData.role === "Supervisor" && (
|
{store.authentication.userData.role === "Supervisor" && (
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
|
@ -664,7 +621,6 @@ export const DetailUser = observer(() => {
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Tabs defaultActiveKey="1">
|
<Tabs defaultActiveKey="1">
|
||||||
<TabPane tab="History Top Up" key="1">
|
<TabPane tab="History Top Up" key="1">
|
||||||
{/* {store.ui.mediaQuery.isDesktop && ( */}
|
|
||||||
<Table
|
<Table
|
||||||
key="1"
|
key="1"
|
||||||
hasEmpty
|
hasEmpty
|
||||||
|
@ -687,36 +643,9 @@ export const DetailUser = observer(() => {
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* )} */}
|
|
||||||
{/* <Table
|
|
||||||
columns={columns}
|
|
||||||
dataSource={store.transaction.dataHistoryTopUp}
|
|
||||||
bordered
|
|
||||||
/> */}
|
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane tab="History Transaction" key="2">
|
<TabPane tab="History Transaction" key="2">
|
||||||
{store.ui.mediaQuery.isDesktop && (
|
{store.ui.mediaQuery.isDesktop && (
|
||||||
// <Table
|
|
||||||
// columns={columns}
|
|
||||||
// bordered
|
|
||||||
// dataSource={store.transaction.dataHistoryTransaction}
|
|
||||||
// pagination={{
|
|
||||||
// pageSize: store.transaction.pageSizeHistoryTransaction,
|
|
||||||
// total: store.transaction.total_dataHistoryTransaction,
|
|
||||||
// current: store.transaction.pageHistoryTransaction + 1,
|
|
||||||
// showSizeChanger: true,
|
|
||||||
// simple: false,
|
|
||||||
// }}
|
|
||||||
// onChange={async (page) => {
|
|
||||||
// let pageNumber = page.current;
|
|
||||||
// store.transaction.pageSizeHistoryTransaction =
|
|
||||||
// page.pageSize;
|
|
||||||
// store.transaction.pageHistoryTransaction = pageNumber - 1;
|
|
||||||
// modalLoader.setLoading(true);
|
|
||||||
// await store.transaction.getDataHistoryTransaction();
|
|
||||||
// modalLoader.setLoading(false);
|
|
||||||
// }}
|
|
||||||
// />
|
|
||||||
<Table
|
<Table
|
||||||
key="1"
|
key="1"
|
||||||
hasEmpty
|
hasEmpty
|
||||||
|
@ -843,11 +772,6 @@ export const DetailUser = observer(() => {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{/* <Table
|
|
||||||
columns={column}
|
|
||||||
dataSource={store.transaction.dataDetailHistoryTransaction}
|
|
||||||
bordered
|
|
||||||
/> */}
|
|
||||||
</TabPane>
|
</TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { Form, Input, Modal, Select, InputNumber,Row,Title,Col,Option } from "antd";
|
import {
|
||||||
|
Form,
|
||||||
|
Input,
|
||||||
|
Modal,
|
||||||
|
Select,
|
||||||
|
InputNumber,
|
||||||
|
Row,
|
||||||
|
Title,
|
||||||
|
Col,
|
||||||
|
Option,
|
||||||
|
} from "antd";
|
||||||
import { useStore } from "../../utils/useStore";
|
import { useStore } from "../../utils/useStore";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
|
|
||||||
|
|
||||||
export const FilterUser = observer(() => {
|
export const FilterUser = observer(() => {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
// const [form] = Form.useForm();
|
|
||||||
// const { Option } = Select;
|
|
||||||
// const store = useStore();
|
|
||||||
// const [value, setValue] = useState();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
visible={store.membership.visibleModalFilterMembership}
|
visible={store.membership.visibleModalFilterMembership}
|
||||||
|
@ -25,11 +29,7 @@ export const FilterUser = observer(() => {
|
||||||
<Select
|
<Select
|
||||||
mode={"multiple"}
|
mode={"multiple"}
|
||||||
placeholder="Choose Supplier"
|
placeholder="Choose Supplier"
|
||||||
// onChange={(val) => {
|
|
||||||
// setFilterSupplier(val);
|
|
||||||
// }}
|
|
||||||
style={{ marginBottom: "20px", width: "100%" }}
|
style={{ marginBottom: "20px", width: "100%" }}
|
||||||
// value={filterSupplier}
|
|
||||||
>
|
>
|
||||||
{store.supplier.data.map((item) => (
|
{store.supplier.data.map((item) => (
|
||||||
<Option value={item.id} key={item.id}>
|
<Option value={item.id} key={item.id}>
|
||||||
|
@ -45,7 +45,6 @@ export const FilterUser = observer(() => {
|
||||||
<Select
|
<Select
|
||||||
mode={"multiple"}
|
mode={"multiple"}
|
||||||
placeholder="Choose Category"
|
placeholder="Choose Category"
|
||||||
// onChange={async (val) => handleFilterCategory(val)}
|
|
||||||
style={{ marginBottom: "20px", width: "100%" }}
|
style={{ marginBottom: "20px", width: "100%" }}
|
||||||
value={store.product.filterCategory || []}
|
value={store.product.filterCategory || []}
|
||||||
>
|
>
|
||||||
|
@ -63,11 +62,7 @@ export const FilterUser = observer(() => {
|
||||||
<Select
|
<Select
|
||||||
mode={"multiple"}
|
mode={"multiple"}
|
||||||
placeholder="Choose Sub-Category"
|
placeholder="Choose Sub-Category"
|
||||||
// onChange={(val) => {
|
|
||||||
// setFilterSubCategories(val);
|
|
||||||
// }}
|
|
||||||
style={{ marginBottom: "20px", width: "100%" }}
|
style={{ marginBottom: "20px", width: "100%" }}
|
||||||
// value={filterSubCategories}
|
|
||||||
>
|
>
|
||||||
{store.product.dataSubCategories.map((item) => (
|
{store.product.dataSubCategories.map((item) => (
|
||||||
<Option value={item.id} key={item.id}>
|
<Option value={item.id} key={item.id}>
|
||||||
|
|
|
@ -93,24 +93,11 @@ export const Konfirmasi = observer(() => {
|
||||||
dataIndex: "image_prove",
|
dataIndex: "image_prove",
|
||||||
key: "image_prove",
|
key: "image_prove",
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
// <Image
|
|
||||||
// src={`${appConfig.apiUrl}/config/image/${text}`}
|
|
||||||
// style={{ width: "5vw" }}
|
|
||||||
// alt={record.id}
|
|
||||||
// />
|
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
// await store.transaction.getDataHistoryTopUp(record.id);
|
|
||||||
// await store.transaction.getDetailHistoryTransaction(record.id);
|
|
||||||
// await store.authentication.getProfit(record.id);
|
|
||||||
//await store.transaction.getDataHistoryTransaction()
|
|
||||||
// history.push(LINKS.USER_DETAIL.replace(":id", record.id));
|
|
||||||
// console.log(record.id);
|
|
||||||
setToko(record);
|
setToko(record);
|
||||||
setVisibleModalToko(true);
|
setVisibleModalToko(true);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
// type="primary"
|
|
||||||
>
|
>
|
||||||
Lihat Foto
|
Lihat Foto
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -272,42 +259,6 @@ export const Konfirmasi = observer(() => {
|
||||||
store.payback.visibleModalFilterPayback = false;
|
store.payback.visibleModalFilterPayback = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFilterCategory = async (value) => {
|
|
||||||
if (value) {
|
|
||||||
store.product.filterCategory = value;
|
|
||||||
await store.product.getDataSubCategories();
|
|
||||||
} else {
|
|
||||||
store.product.filterCategory = null;
|
|
||||||
await store.product.getDataSubCategories();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const footerLayoutFilter = [
|
|
||||||
<Button
|
|
||||||
key={"remove"}
|
|
||||||
onClick={handleRemoveFilter}
|
|
||||||
style={{
|
|
||||||
backgroundColor: "#e74e5e",
|
|
||||||
color: "#fff",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Remove Filter
|
|
||||||
</Button>,
|
|
||||||
<Button key={"cancel"} onClick={handleCancelFilter}>
|
|
||||||
Cancel
|
|
||||||
</Button>,
|
|
||||||
<Button
|
|
||||||
key={"submit"}
|
|
||||||
onClick={handleSubmitFilter}
|
|
||||||
style={{
|
|
||||||
backgroundColor: "#4e79e7",
|
|
||||||
color: "#fff",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Apply
|
|
||||||
</Button>,
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={["ppob-container"].join(" ")}>
|
<div className={["ppob-container"].join(" ")}>
|
||||||
<BreadcumbComponent
|
<BreadcumbComponent
|
||||||
|
@ -317,28 +268,6 @@ export const Konfirmasi = observer(() => {
|
||||||
/>
|
/>
|
||||||
<Card>
|
<Card>
|
||||||
<div style={{ marginTop: 30 }}>
|
<div style={{ marginTop: 30 }}>
|
||||||
{/* <Row style={{ marginBottom: 20 }}> */}
|
|
||||||
{/* <Col span={12}>
|
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
store.payback.visibleModalFilterPayback = true;
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<FilterOutlined />
|
|
||||||
Filter
|
|
||||||
</Button>
|
|
||||||
</Col> */}
|
|
||||||
{/* <Col span={12} style={{ textAlign: "right" }}> */}
|
|
||||||
{/* <Search
|
|
||||||
placeholder="input search text"
|
|
||||||
style={{
|
|
||||||
width: store.ui.mediaQuery.isMobile ? 160 : 200,
|
|
||||||
marginRight: store.ui.mediaQuery.isMobile ? 0 : 10,
|
|
||||||
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 0,
|
|
||||||
}}
|
|
||||||
/> */}
|
|
||||||
{/* </Col> */}
|
|
||||||
{/* </Row> */}
|
|
||||||
{store.ui.mediaQuery.isDesktop && (
|
{store.ui.mediaQuery.isDesktop && (
|
||||||
<Table
|
<Table
|
||||||
key="1"
|
key="1"
|
||||||
|
@ -400,7 +329,6 @@ export const Konfirmasi = observer(() => {
|
||||||
>
|
>
|
||||||
<List.Item.Meta
|
<List.Item.Meta
|
||||||
className={[""].join(" ")}
|
className={[""].join(" ")}
|
||||||
// title={item.username}
|
|
||||||
description={
|
description={
|
||||||
<div style={{}}>
|
<div style={{}}>
|
||||||
<p>
|
<p>
|
||||||
|
@ -418,7 +346,6 @@ export const Konfirmasi = observer(() => {
|
||||||
okType: "primary",
|
okType: "primary",
|
||||||
onOk() {
|
onOk() {
|
||||||
handleApprove(item.id);
|
handleApprove(item.id);
|
||||||
//console.log(record.id);
|
|
||||||
},
|
},
|
||||||
onCancel() {
|
onCancel() {
|
||||||
console.log("Cancel");
|
console.log("Cancel");
|
||||||
|
@ -481,12 +408,6 @@ export const Konfirmasi = observer(() => {
|
||||||
: { marginLeft: 10, marginTop: 5 }
|
: { marginLeft: 10, marginTop: 5 }
|
||||||
}
|
}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
// await store.transaction.getDataHistoryTopUp(record.id);
|
|
||||||
// await store.transaction.getDetailHistoryTransaction(record.id);
|
|
||||||
// await store.authentication.getProfit(record.id);
|
|
||||||
//await store.transaction.getDataHistoryTransaction()
|
|
||||||
// history.push(LINKS.USER_DETAIL.replace(":id", record.id));
|
|
||||||
// console.log(record.id);
|
|
||||||
setIdentitas(item);
|
setIdentitas(item);
|
||||||
setVisibleModalIdentitas(true);
|
setVisibleModalIdentitas(true);
|
||||||
}}
|
}}
|
||||||
|
@ -497,9 +418,9 @@ export const Konfirmasi = observer(() => {
|
||||||
style={
|
style={
|
||||||
item.is_active === true
|
item.is_active === true
|
||||||
? {
|
? {
|
||||||
marginLeft:10,
|
marginLeft: 10,
|
||||||
}
|
}
|
||||||
: {marginTop: 10 }
|
: { marginTop: 10 }
|
||||||
}
|
}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setToko(item);
|
setToko(item);
|
||||||
|
@ -512,19 +433,7 @@ export const Konfirmasi = observer(() => {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<div style={{ marginRight: 16 }}>
|
<div style={{ marginRight: 16 }}></div>
|
||||||
{/* <p
|
|
||||||
style={{
|
|
||||||
fontSize: 9,
|
|
||||||
margin: 0,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
src={`${appConfig.apiUrl}/config/image/${item.image_prove}`}
|
|
||||||
style={{ width: "10vw" }}
|
|
||||||
/>
|
|
||||||
</p> */}
|
|
||||||
</div>
|
|
||||||
</List.Item>
|
</List.Item>
|
||||||
<Divider plain style={{ margin: 0 }} />
|
<Divider plain style={{ margin: 0 }} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -230,7 +230,6 @@ export const Membership = observer(() => {
|
||||||
await store.transaction.getDataHistoryTopUp(record.id);
|
await store.transaction.getDataHistoryTopUp(record.id);
|
||||||
await store.transaction.getDetailHistoryTransaction(record.id);
|
await store.transaction.getDetailHistoryTransaction(record.id);
|
||||||
await store.authentication.getProfit(record.id);
|
await store.authentication.getProfit(record.id);
|
||||||
//await store.transaction.getDataHistoryTransaction()
|
|
||||||
history.push(LINKS.USER_DETAIL.replace(":id", record.id));
|
history.push(LINKS.USER_DETAIL.replace(":id", record.id));
|
||||||
console.log(record.id);
|
console.log(record.id);
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -114,13 +114,11 @@ export const MembershipModal = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const uploadHandler = async (args) => {
|
const uploadHandler = async (args) => {
|
||||||
// if (fileList === "") {
|
|
||||||
const file = args.file;
|
const file = args.file;
|
||||||
const res = await store.payback.uploadImages(file);
|
const res = await store.payback.uploadImages(file);
|
||||||
console.log(res, "ini respon 1");
|
console.log(res, "ini respon 1");
|
||||||
setImage(`${appConfig.apiUrl}/config/image/${res.body.filename}`);
|
setImage(`${appConfig.apiUrl}/config/image/${res.body.filename}`);
|
||||||
//setResponseFilename(res.body.filename);
|
console.log(initialData.image_identity);
|
||||||
console.log(initialData.image_identity)
|
|
||||||
initialData.image_identity !== ""
|
initialData.image_identity !== ""
|
||||||
? file === ""
|
? file === ""
|
||||||
? setResponseFilename(initialData.image_identity)
|
? setResponseFilename(initialData.image_identity)
|
||||||
|
@ -135,15 +133,6 @@ export const MembershipModal = ({
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
// } else {
|
|
||||||
// const file = args.file;
|
|
||||||
// const res = await store.payback.uploadImages(file);
|
|
||||||
// console.log(res, "ini respon 1");
|
|
||||||
// setImage(`${appConfig.apiUrl}/config/image/${initialData.image_identity}`);
|
|
||||||
// setResponseFilename(initialData.image_identity);
|
|
||||||
// setFileList([initialData.image_identity]);
|
|
||||||
// setLoading(false);
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const uploadHandlerStore = async (args) => {
|
const uploadHandlerStore = async (args) => {
|
||||||
|
@ -335,9 +324,6 @@ export const MembershipModal = ({
|
||||||
<Upload
|
<Upload
|
||||||
listType="picture-card"
|
listType="picture-card"
|
||||||
fileList={fileList}
|
fileList={fileList}
|
||||||
// onPreview={(file) => {
|
|
||||||
// setPreviewImage(file.url || file.filename);
|
|
||||||
// }}
|
|
||||||
showUploadList={true}
|
showUploadList={true}
|
||||||
onPreview={handlePreviewData}
|
onPreview={handlePreviewData}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
@ -496,8 +482,6 @@ export const MembershipModal = ({
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{/* <Row>
|
|
||||||
<Col> */}
|
|
||||||
<Form.Item label="Upload Identity Image" name="image_identity">
|
<Form.Item label="Upload Identity Image" name="image_identity">
|
||||||
<div>
|
<div>
|
||||||
<Upload
|
<Upload
|
||||||
|
|
|
@ -35,8 +35,7 @@ import { capitalize } from "lodash";
|
||||||
import { PAYBACK_STATUS } from "../../constants/payback";
|
import { PAYBACK_STATUS } from "../../constants/payback";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
|
||||||
const { Search } = Input;
|
|
||||||
const { RangePicker } = DatePicker;
|
|
||||||
export const Payback = observer(() => {
|
export const Payback = observer(() => {
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
const { Title } = Typography;
|
const { Title } = Typography;
|
||||||
|
@ -246,16 +245,6 @@ export const Payback = observer(() => {
|
||||||
store.payback.visibleModalFilterPayback = false;
|
store.payback.visibleModalFilterPayback = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFilterCategory = async (value) => {
|
|
||||||
if (value) {
|
|
||||||
store.product.filterCategory = value;
|
|
||||||
await store.product.getDataSubCategories();
|
|
||||||
} else {
|
|
||||||
store.product.filterCategory = null;
|
|
||||||
await store.product.getDataSubCategories();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const footerLayoutFilter = [
|
const footerLayoutFilter = [
|
||||||
<Button
|
<Button
|
||||||
key={"remove"}
|
key={"remove"}
|
||||||
|
|
|
@ -28,11 +28,8 @@ import { appConfig } from "../../config/app";
|
||||||
import { PAYBACK_STATUS } from "../../constants/payback";
|
import { PAYBACK_STATUS } from "../../constants/payback";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
|
||||||
const { Search } = Input;
|
|
||||||
|
|
||||||
export const PaybackCreated = observer(() => {
|
export const PaybackCreated = observer(() => {
|
||||||
const { Option } = Select;
|
|
||||||
const { Title } = Typography;
|
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const [filterMembership, setFilterMembership] = useState([]);
|
const [filterMembership, setFilterMembership] = useState([]);
|
||||||
|
@ -167,16 +164,6 @@ export const PaybackCreated = observer(() => {
|
||||||
store.payback.visibleModalFilterCreate = false;
|
store.payback.visibleModalFilterCreate = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// const handleFilterCategory = async (value) => {
|
|
||||||
// if (value) {
|
|
||||||
// store.product.filterCategory = value;
|
|
||||||
// await store.product.getDataSubCategories();
|
|
||||||
// } else {
|
|
||||||
// store.product.filterCategory = null;
|
|
||||||
// await store.product.getDataSubCategories();
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
const footerLayoutFilter = [
|
const footerLayoutFilter = [
|
||||||
<Button
|
<Button
|
||||||
key={"remove"}
|
key={"remove"}
|
||||||
|
|
|
@ -50,21 +50,7 @@ export const Category = observer(() => {
|
||||||
<BreadcumbComponent data={routeData} />
|
<BreadcumbComponent data={routeData} />
|
||||||
<Card>
|
<Card>
|
||||||
<Row style={{ marginBottom: 20 }}>
|
<Row style={{ marginBottom: 20 }}>
|
||||||
{/* <Col span={12}>
|
|
||||||
<Button>
|
|
||||||
<FilterOutlined />
|
|
||||||
Filter
|
|
||||||
</Button>
|
|
||||||
</Col> */}
|
|
||||||
<Col span={24} style={{ textAlign: "right" }}>
|
<Col span={24} style={{ textAlign: "right" }}>
|
||||||
{/* <Search
|
|
||||||
placeholder="input search text"
|
|
||||||
style={{
|
|
||||||
width: store.ui.mediaQuery.isMobile ? 160 : 200,
|
|
||||||
marginRight: store.ui.mediaQuery.isMobile ? 0 : 10,
|
|
||||||
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 0,
|
|
||||||
}}
|
|
||||||
/> */}
|
|
||||||
<Button
|
<Button
|
||||||
onClick={() => (store.category.visibleModalCategory = true)}
|
onClick={() => (store.category.visibleModalCategory = true)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import React, {useContext, useEffect} from "react";
|
import React, { useContext, useEffect } from "react";
|
||||||
import {Button, Card, Col, Input, message, Row} 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/SubcategoryComponent";
|
import { SubcategoryComponent } from "../../component/SubcategoryComponent";
|
||||||
import {ModalLoaderContext} from "../../utils/modal";
|
import { ModalLoaderContext } from "../../utils/modal";
|
||||||
|
|
||||||
const {Search} = Input;
|
const { Search } = Input;
|
||||||
|
|
||||||
export const Subcategory = observer(() => {
|
export const Subcategory = observer(() => {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
|
@ -45,38 +45,24 @@ export const Subcategory = observer(() => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
route: LINKS.SUBCATEGORY,
|
route: LINKS.SUBCATEGORY,
|
||||||
name: <span style={{fontWeight: "bold"}}>Sub Kategori</span>,
|
name: <span style={{ fontWeight: "bold" }}>Sub Kategori</span>,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={["ppob-container"].join(" ")}>
|
<div className={["ppob-container"].join(" ")}>
|
||||||
<BreadcumbComponent data={routeData}/>
|
<BreadcumbComponent data={routeData} />
|
||||||
<Card>
|
<Card>
|
||||||
<Row style={{marginBottom: 20}}>
|
<Row style={{ marginBottom: 20 }}>
|
||||||
{/* <Col span={12}>
|
<Col span={24} style={{ textAlign: "right" }}>
|
||||||
<Button>
|
|
||||||
<FilterOutlined />
|
|
||||||
Filter
|
|
||||||
</Button>
|
|
||||||
</Col> */}
|
|
||||||
<Col span={24} style={{textAlign: "right"}}>
|
|
||||||
{/* <Search
|
|
||||||
placeholder="input search text"
|
|
||||||
style={{
|
|
||||||
width: store.ui.mediaQuery.isMobile ? 160 : 200,
|
|
||||||
marginRight: store.ui.mediaQuery.isMobile ? 0 : 10,
|
|
||||||
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 0,
|
|
||||||
}}
|
|
||||||
/> */}
|
|
||||||
<Button
|
<Button
|
||||||
onClick={() => (store.subcategory.visibleModalSubcategory = true)}
|
onClick={() => (store.subcategory.visibleModalSubcategory = true)}
|
||||||
>
|
>
|
||||||
<PlusSquareOutlined/> New
|
<PlusSquareOutlined /> New
|
||||||
</Button>
|
</Button>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<SubcategoryComponent/>
|
<SubcategoryComponent />
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -306,27 +306,6 @@ export const Profile = observer(() => {
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
{/* {store.authentication.userData.role === "Supervisor" && (
|
|
||||||
<Row>
|
|
||||||
<Col span={12}>
|
|
||||||
<Text strong>Foto Identitas</Text>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}></Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Text>
|
|
||||||
<Image
|
|
||||||
src={
|
|
||||||
store.authentication.dataProfit.profileData
|
|
||||||
?.image_identity
|
|
||||||
? `${appConfig.apiUrl}/config/image/${store.authentication.profileData.userDetail?.image_identity}`
|
|
||||||
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
|
||||||
}
|
|
||||||
style={{ width: "10vw" }}
|
|
||||||
/>
|
|
||||||
</Text>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
)} */}
|
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={store.ui.mediaQuery.isMobile ? 24 : 5}>
|
<Col span={store.ui.mediaQuery.isMobile ? 24 : 5}>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import {makeAutoObservable} from "mobx";
|
import { makeAutoObservable } from "mobx";
|
||||||
import {http} from "../utils/http";
|
import { http } from "../utils/http";
|
||||||
|
|
||||||
export class Supplier {
|
export class Supplier {
|
||||||
page = 0;
|
page = 0;
|
||||||
pageSize = 10
|
pageSize = 10;
|
||||||
data = [];
|
data = [];
|
||||||
total_data = 0;
|
total_data = 0;
|
||||||
filterCategory = null;
|
filterCategory = null;
|
||||||
|
@ -12,12 +12,12 @@ export class Supplier {
|
||||||
code = "";
|
code = "";
|
||||||
|
|
||||||
pageCategories = 0;
|
pageCategories = 0;
|
||||||
pageSizeCategories = 10
|
pageSizeCategories = 10;
|
||||||
dataCategories = [];
|
dataCategories = [];
|
||||||
total_dataCategories = 0;
|
total_dataCategories = 0;
|
||||||
|
|
||||||
pageSubCategories = 0;
|
pageSubCategories = 0;
|
||||||
pageSizeSubCategories = 10
|
pageSizeSubCategories = 10;
|
||||||
dataSubCategories = [];
|
dataSubCategories = [];
|
||||||
total_dataSubCategories = 0;
|
total_dataSubCategories = 0;
|
||||||
|
|
||||||
|
@ -28,27 +28,26 @@ export class Supplier {
|
||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
try {
|
try {
|
||||||
const response = await http.get(`/users/supplier?page=${this.page}&pageSize=${this.pageSize}`);
|
const response = await http.get(
|
||||||
|
`/users/supplier?page=${this.page}&pageSize=${this.pageSize}`
|
||||||
|
);
|
||||||
//console.log(response)
|
//console.log(response)
|
||||||
this.data = response.body.data ?? []
|
this.data = response.body.data ?? [];
|
||||||
this.total_data = response.body.count ?? 0
|
this.total_data = response.body.count ?? 0;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async create(data) {
|
async create(data) {
|
||||||
// try {
|
const response = await http.post("/users/supplier").send(data);
|
||||||
const response = await http.post('/users/supplier').send(data);
|
|
||||||
//await this.getData();
|
|
||||||
return response;
|
return response;
|
||||||
// } catch (e) {
|
|
||||||
// console.error(e);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
async createTransaction(data) {
|
async createTransaction(data) {
|
||||||
try {
|
try {
|
||||||
const response = await http.post('/transaction/add-saldo-supplier').send(data);
|
const response = await http
|
||||||
|
.post("/transaction/add-saldo-supplier")
|
||||||
|
.send(data);
|
||||||
await this.getData();
|
await this.getData();
|
||||||
return response;
|
return response;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -72,7 +71,7 @@ export class Supplier {
|
||||||
await this.getData();
|
await this.getData();
|
||||||
return response;
|
return response;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,5 +85,3 @@ export class Supplier {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user