Compare commits
85 Commits
Author | SHA1 | Date | |
---|---|---|---|
1b3225bc24 | |||
5840741108 | |||
027fd3d28a | |||
210ef1de0b | |||
601604554d | |||
63bb902eea | |||
6ebee21126 | |||
90078a1767 | |||
b9dc137976 | |||
f79e2c56bf | |||
bd5ced85d8 | |||
758911d3a0 | |||
|
2fecc9bfc3 | ||
|
ed53eaa048 | ||
|
db2dd2d012 | ||
|
468dd7b61a | ||
|
b04fdbcbe4 | ||
|
fb962f2b01 | ||
|
d76407fc60 | ||
e672bdfdba | |||
48dc887fac | |||
|
17561e17e3 | ||
|
f43ceefaeb | ||
|
babef81503 | ||
|
d019b13b78 | ||
|
0351d4a9ad | ||
|
ef86eefa58 | ||
|
f996f63a90 | ||
|
0ecfbf5daa | ||
|
b09d36199c | ||
|
f4a0b1378a | ||
|
ac8641b9d3 | ||
c43c08ffd6 | |||
2bc17bdcac | |||
|
136efb4908 | ||
|
425caac5bf | ||
|
724ffb198a | ||
|
e8e39b1bb3 | ||
|
af8162f558 | ||
|
67611aceb2 | ||
|
32d3a0f4fc | ||
8908d711ec | |||
|
3b7ccd8214 | ||
|
1563ace937 | ||
|
9a739b0bfa | ||
|
8222552ec5 | ||
|
a43a906a64 | ||
|
33bc456032 | ||
|
e593a13990 | ||
|
ada8b1db1a | ||
|
afe12f249b | ||
|
7b78e75900 | ||
61e3c2a30a | |||
1f8b11bf5b | |||
|
7ff83f9463 | ||
a5d6eddb2a | |||
|
9a37e2a65e | ||
490676f5df | |||
37a73aeeeb | |||
24e4f49b0e | |||
|
2916b53cd6 | ||
|
203df99976 | ||
|
5144ba6ce2 | ||
|
80e1e5bf7b | ||
|
ba472aa99f | ||
|
52025e1d65 | ||
90e02e8d9f | |||
240a8d8869 | |||
|
a4160ae2bd | ||
c1f8a79ad7 | |||
|
bd6a8b7c54 | ||
0da2118bec | |||
|
48905225bb | ||
ac948f3dd5 | |||
|
56252bbd53 | ||
|
9c87efc3d2 | ||
|
c46599bdef | ||
|
9e6ce2dbd8 | ||
|
62dfdbe40a | ||
|
b20835257e | ||
|
55a38b77a1 | ||
|
b2ca591fee | ||
|
0ae9495c58 | ||
|
c452e8ed77 | ||
7852e12d42 |
|
@ -174,7 +174,6 @@ export const ProductComponent = observer((props) => {
|
|||
message.error("Gagal menghapus");
|
||||
}
|
||||
};
|
||||
|
||||
const handleDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "Are you sure delete this record?",
|
||||
|
|
|
@ -82,4 +82,4 @@ code {
|
|||
}
|
||||
.ant-table-tbody > tr.ant-table-row-level-0:hover > td {
|
||||
background: #f0faf8 !important;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -375,7 +375,7 @@ export const Konfirmasi = observer(() => {
|
|||
: "Aktif"}
|
||||
</Tag>
|
||||
)}
|
||||
<Button
|
||||
{item.user_detail?.image_identity !== "" ? <Button
|
||||
style={
|
||||
item.is_active === true
|
||||
? {
|
||||
|
@ -389,7 +389,8 @@ export const Konfirmasi = observer(() => {
|
|||
}}
|
||||
>
|
||||
Foto Identitas
|
||||
</Button>
|
||||
</Button>: ""}
|
||||
|
||||
{item.user_detail?.image_store !== '""' ? (
|
||||
<Button
|
||||
style={
|
||||
|
|
213
src/pages/Product/PulsaModal.js
Normal file
213
src/pages/Product/PulsaModal.js
Normal file
|
@ -0,0 +1,213 @@
|
|||
// import React,{useEffect,useState} from "react";
|
||||
// import { Form, Input, Modal, Select } from "antd";
|
||||
|
||||
// export const PulsaModal = ({ visible, onCreate, onCancel, initialData }) => {
|
||||
// const [form] = Form.useForm();
|
||||
// const { Option } = Select;
|
||||
// const [visibleModal, setVisibleModal] = useState(false)
|
||||
// const [initialData, setInitialData] = useState({})
|
||||
// const [confirmLoading, setConfirmLoading] = useState(false);
|
||||
// const [isLoading, setIsLoading] = useState(false);
|
||||
// useEffect(() => {
|
||||
// const init = async () => {
|
||||
// try {
|
||||
// setIsLoading(true);
|
||||
// await store.categories.getData();
|
||||
// setIsLoading(false);
|
||||
// } catch (e) {
|
||||
// setIsLoading(false);
|
||||
// }
|
||||
// };
|
||||
|
||||
// init();
|
||||
// }, []);
|
||||
|
||||
// return (
|
||||
// <Modal
|
||||
// visible={visibleModal}
|
||||
// confirmLoading={confirmLoading}
|
||||
// initialData={initialData}
|
||||
// onCreate={async (data) => {
|
||||
// onSubmit(data)
|
||||
// }}
|
||||
// onCancel={() => {
|
||||
// setInitialData({})
|
||||
// setVisibleModal(false);
|
||||
// }}
|
||||
// visible={visible}
|
||||
// title={initialData.id ? "Edit Member" : "Create a new Member"}
|
||||
// okText={initialData.id ? "Edit" : "Create"}
|
||||
// cancelText="Cancel"
|
||||
// onCancel={() => {
|
||||
// form.resetFields();
|
||||
// onCancel();
|
||||
// }}
|
||||
// onOk={() => {
|
||||
// form
|
||||
// .validateFields()
|
||||
// .then((values) => {
|
||||
// onCreate(values);
|
||||
// form.resetFields();
|
||||
// })
|
||||
// .catch((info) => {
|
||||
// console.log("Validate Failed:", info);
|
||||
// });
|
||||
// }}
|
||||
// >
|
||||
// <Form
|
||||
// form={form}
|
||||
// layout="vertical"
|
||||
// name="form_in_modal"
|
||||
// initialValues={initialData}
|
||||
// >
|
||||
// <Form.Item
|
||||
// name="name"
|
||||
// label="Name"
|
||||
// rules={[{ required: true, message: "Please input name!" }]}
|
||||
// >
|
||||
// <Input />
|
||||
// </Form.Item>
|
||||
// <Form.Item
|
||||
// name="price"
|
||||
// label="Price"
|
||||
// rules={[{ required: true, message: "Please input price!" }]}
|
||||
// >
|
||||
// <Input />
|
||||
// </Form.Item>
|
||||
// <Form.Item
|
||||
// name="markUpPrice"
|
||||
// label="Mark Up Price"
|
||||
// rules={[{ required: true, message: "Please input mark up price!" }]}
|
||||
// >
|
||||
// <Input />
|
||||
// </Form.Item>
|
||||
// <Form.Item
|
||||
// name="code"
|
||||
// label="Code"
|
||||
// rules={[{ required: true, message: "Please input code!" }]}
|
||||
// >
|
||||
// <Input />
|
||||
// </Form.Item>
|
||||
// <Form.Item
|
||||
// name="status"
|
||||
// label="Status"
|
||||
// rules={[{ required: true, message: "Please select Status!" }]}
|
||||
// >
|
||||
// <Select placeholder="Select Status" allowClear>
|
||||
// {store.categories.map(it => {
|
||||
// return <Option value={it.id}>{it.name}</Option>
|
||||
// })}
|
||||
// </Select>
|
||||
// </Form.Item>
|
||||
// </Form>
|
||||
// </Modal>
|
||||
// );
|
||||
// };
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { Form, Input, Modal, Select } from "antd";
|
||||
import { useStore } from "../../utils/useStore";
|
||||
|
||||
export const PulsaModal = ({ visible, onCreate, onCancel }) => {
|
||||
const [form] = Form.useForm();
|
||||
const { Option } = Select;
|
||||
const dataStatus = ["Active", "Inactive"];
|
||||
const store = useStore();
|
||||
const [visibleModal, setVisibleModal] = useState(false);
|
||||
const [initialData, setInitialData] = useState({});
|
||||
const [confirmLoading, setConfirmLoading] = useState(false);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const init = async () => {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
await store.categories.getData();
|
||||
setIsLoading(false);
|
||||
} catch (e) {
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
init();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
visible={visible}
|
||||
title={initialData.id ? "Edit Member" : "Create a new Member"}
|
||||
okText={initialData.id ? "Edit" : "Create"}
|
||||
cancelText="Cancel"
|
||||
onCancel={() => {
|
||||
form.resetFields();
|
||||
onCancel();
|
||||
}}
|
||||
onOk={() => {
|
||||
form
|
||||
.validateFields()
|
||||
.then((values) => {
|
||||
onCreate(values);
|
||||
form.resetFields();
|
||||
})
|
||||
.catch((info) => {
|
||||
console.log("Validate Failed:", info);
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
layout="vertical"
|
||||
name="form_in_modal"
|
||||
initialValues={initialData}
|
||||
>
|
||||
<Form.Item
|
||||
name="name"
|
||||
label="Name"
|
||||
rules={[{ required: true, message: "Please input name!" }]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="price"
|
||||
label="Price"
|
||||
rules={[{ required: true, message: "Please input price!" }]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="markUpPrice"
|
||||
label="Mark Up Price"
|
||||
rules={[{ required: true, message: "Please input mark up price!" }]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="code"
|
||||
label="Code"
|
||||
rules={[{ required: true, message: "Please input code!" }]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="status"
|
||||
label="Status"
|
||||
rules={[{ required: true, message: "Please select Status!" }]}
|
||||
>
|
||||
<Select placeholder="Select Sub Category" allowClear>
|
||||
<Option value="ACTIVE">ACTIVE</Option>
|
||||
<Option value="INACTIVE">INACTIVE</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="subCategoriesId"
|
||||
label="Sub Categories"
|
||||
rules={[{ required: true, message: "Please select Sub Category!" }]}
|
||||
>
|
||||
<Select placeholder="Select Sub Category" allowClear>
|
||||
{store.categories.data.map((it) => {
|
||||
return <Option value={it.id}>{it.name}</Option>;
|
||||
})}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
};
|
121
src/pages/Transaction/Pulsa.js
Normal file
121
src/pages/Transaction/Pulsa.js
Normal file
|
@ -0,0 +1,121 @@
|
|||
import React from "react";
|
||||
import {Button, Card, Col, Dropdown, Menu, message, Modal, Row, Space,} from "antd";
|
||||
import {DownOutlined, TabletOutlined, UserOutlined} from "@ant-design/icons";
|
||||
|
||||
export const Pulsa = () => {
|
||||
|
||||
function handleMenuClick(e) {
|
||||
message.info("Click on menu item.");
|
||||
console.log("click", e);
|
||||
}
|
||||
|
||||
const menu = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1" icon={<UserOutlined/>}>
|
||||
1st menu item
|
||||
</Menu.Item>
|
||||
<Menu.Item key="2" icon={<UserOutlined/>}>
|
||||
2nd menu item
|
||||
</Menu.Item>
|
||||
<Menu.Item key="3" icon={<UserOutlined/>}>
|
||||
3rd menu item
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
function success() {
|
||||
Modal.success({
|
||||
content: 'some messages...some messages...',
|
||||
});
|
||||
}
|
||||
|
||||
const dataCard = [
|
||||
{
|
||||
title: "DATA AXIS BRONET 2GB-60HR",
|
||||
price: "Harga : Rp.6.000",
|
||||
},
|
||||
{
|
||||
title: "DATA AXIS BRONET 2GB-60HR",
|
||||
price: "Harga : Rp.6.000",
|
||||
},
|
||||
{
|
||||
title: "DATA AXIS BRONET 2GB-60HR",
|
||||
price: "Harga : Rp.6.000",
|
||||
},
|
||||
{
|
||||
title: "DATA AXIS BRONET 2GB-60HR",
|
||||
price: "Harga : Rp.6.000",
|
||||
},
|
||||
{
|
||||
title: "DATA AXIS BRONET 2GB-60HR",
|
||||
price: "Harga : Rp.6.000",
|
||||
},
|
||||
{
|
||||
title: "DATA AXIS BRONET 2GB-60HR",
|
||||
price: "Harga : Rp.6.000",
|
||||
},
|
||||
{
|
||||
title: "DATA AXIS BRONET 2GB-60HR",
|
||||
price: "Harga : Rp.6.000",
|
||||
},
|
||||
{
|
||||
title: "DATA AXIS BRONET 2GB-60HR",
|
||||
price: "Harga : Rp.6.000",
|
||||
},
|
||||
{
|
||||
title: "DATA AXIS BRONET 2GB-60HR",
|
||||
price: "Harga : Rp.6.000",
|
||||
},
|
||||
{
|
||||
title: "DATA AXIS BRONET 2GB-60HR",
|
||||
price: "Harga : Rp.6.000",
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Row>
|
||||
<span style={{fontWeight: "bold", marginBottom: "10px"}}>
|
||||
Sub-Category
|
||||
</span>
|
||||
</Row>
|
||||
<Row>
|
||||
<Space wrap>
|
||||
<Dropdown overlay={menu}>
|
||||
<Button
|
||||
style={{
|
||||
marginBottom: "20px",
|
||||
color: "grey",
|
||||
}}
|
||||
>
|
||||
<TabletOutlined/>
|
||||
Select sub-Category
|
||||
<DownOutlined/>
|
||||
</Button>
|
||||
</Dropdown>
|
||||
</Space>
|
||||
</Row>
|
||||
<Row>
|
||||
<span style={{fontWeight: "bold", marginBottom: "10px"}}>
|
||||
Produk & Nominal
|
||||
</span>
|
||||
</Row>
|
||||
<Row>
|
||||
{dataCard.map((item, index) => (
|
||||
<Col key={index} xs={24} md={16} lg={8}>
|
||||
<Card onClick={success}>
|
||||
<span style={{color: "black"}}>{item.title}</span>
|
||||
<br/>
|
||||
<span style={{color: "grey", fontSize: 10}}>{item.price}</span>
|
||||
</Card>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
<Col style={{textAlign: "right"}}>
|
||||
<Button style={{backgroundColor: "#2D9CDB", color: "white"}}>
|
||||
Beli Sekarang
|
||||
</Button>
|
||||
</Col>
|
||||
</div>
|
||||
);
|
||||
};
|
|
@ -2,7 +2,6 @@ import {makeAutoObservable, runInAction} from "mobx";
|
|||
import {TokenUtil} from "../utils/token";
|
||||
import {http} from "../utils/http";
|
||||
|
||||
|
||||
export class Authentication {
|
||||
isLoggedIn = false;
|
||||
isLoginLoading = false;
|
||||
|
|
40
src/store/categories.js
Normal file
40
src/store/categories.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
import {action, makeAutoObservable} from "mobx";
|
||||
import {http} from "../utils/http";
|
||||
|
||||
export class Categories {
|
||||
page = 0;
|
||||
pageSize = 10
|
||||
data = [];
|
||||
total_data = 0
|
||||
|
||||
constructor(ctx) {
|
||||
this.ctx = ctx;
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
@action
|
||||
async getData() {
|
||||
const response = await http.get(`/product/sub-categories?page=${this.page}&pageSize=${this.pageSize}`);
|
||||
console.log(response,'Data cate')
|
||||
console.log(JSON.stringify(response.body.data),'Data')
|
||||
|
||||
this.data = response.body.data ?? []
|
||||
this.total_data = response.body.total_data ?? 0
|
||||
}
|
||||
|
||||
@action
|
||||
async create(data) {
|
||||
return await http.post('/user').send(data)
|
||||
}
|
||||
|
||||
@action
|
||||
async update(id, data) {
|
||||
return await http.put('/user/' + id).send(data);
|
||||
}
|
||||
|
||||
async delete(id) {
|
||||
return await http.del('/product/' + id);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user