feat: adjust supplier page
This commit is contained in:
parent
787e74419e
commit
7179d8f807
|
@ -1,4 +1,4 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import React, {useState} from "react";
|
||||||
import {Button, Form, Input, message, Modal, Space, Table, Tag} from "antd";
|
import {Button, Form, Input, message, Modal, Space, Table, Tag} from "antd";
|
||||||
import {observer} from "mobx-react-lite";
|
import {observer} from "mobx-react-lite";
|
||||||
import {ExclamationCircleOutlined} from "@ant-design/icons";
|
import {ExclamationCircleOutlined} from "@ant-design/icons";
|
||||||
|
@ -12,14 +12,6 @@ export const SupplierComponent = observer((props) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const [idData, setIdData] = useState("");
|
const [idData, setIdData] = useState("");
|
||||||
const [code, setCode] = useState("");
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const init = async () => {
|
|
||||||
await store.supplier.getData();
|
|
||||||
};
|
|
||||||
init();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleEditButton = (data) => {
|
const handleEditButton = (data) => {
|
||||||
console.log(data, "isi data");
|
console.log(data, "isi data");
|
||||||
|
@ -38,8 +30,9 @@ export const SupplierComponent = observer((props) => {
|
||||||
code: data.code,
|
code: data.code,
|
||||||
});
|
});
|
||||||
store.supplier.visibleModalTransaction = true;
|
store.supplier.visibleModalTransaction = true;
|
||||||
setCode(data.code);
|
store.supplier.code = data.code;
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeStatus = async (id, isActive) => {
|
const changeStatus = async (id, isActive) => {
|
||||||
const status = isActive ? "inactive" : "active";
|
const status = isActive ? "inactive" : "active";
|
||||||
const status2 = isActive ? "Inactivating" : "Activating";
|
const status2 = isActive ? "Inactivating" : "Activating";
|
||||||
|
@ -66,7 +59,6 @@ export const SupplierComponent = observer((props) => {
|
||||||
dataIndex: "code",
|
dataIndex: "code",
|
||||||
key: "code",
|
key: "code",
|
||||||
},
|
},
|
||||||
,
|
|
||||||
{
|
{
|
||||||
title: "Saldo",
|
title: "Saldo",
|
||||||
dataIndex: ["coa","amount"],
|
dataIndex: ["coa","amount"],
|
||||||
|
@ -216,9 +208,7 @@ export const SupplierComponent = observer((props) => {
|
||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{idData ? (
|
{!idData &&
|
||||||
""
|
|
||||||
) : (
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="code"
|
name="code"
|
||||||
label="Kode"
|
label="Kode"
|
||||||
|
@ -226,10 +216,10 @@ export const SupplierComponent = observer((props) => {
|
||||||
>
|
>
|
||||||
<Input/>
|
<Input/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
}
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
<TopupsaldoModal code={code} />
|
<TopupsaldoModal code={store.supplier.code}/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,6 +10,7 @@ export const TopupsaldoModal = observer((props) => {
|
||||||
const handleCancelTransaction = () => {
|
const handleCancelTransaction = () => {
|
||||||
store.supplier.visibleModalTransaction = false;
|
store.supplier.visibleModalTransaction = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSubmitTransaction = async (data) => {
|
const handleSubmitTransaction = async (data) => {
|
||||||
console.log(data, "isi data2");
|
console.log(data, "isi data2");
|
||||||
|
|
||||||
|
@ -51,7 +52,7 @@ export const TopupsaldoModal = observer((props) => {
|
||||||
<Form
|
<Form
|
||||||
form={form}
|
form={form}
|
||||||
layout="vertical"
|
layout="vertical"
|
||||||
initialValues={{ supplier: props.code }}
|
initialValues={{supplier: store.supplier.code}}
|
||||||
>
|
>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="supplier"
|
name="supplier"
|
||||||
|
|
|
@ -9,6 +9,7 @@ export class Supplier {
|
||||||
filterCategory = null;
|
filterCategory = null;
|
||||||
visibleModalSupplier = false;
|
visibleModalSupplier = false;
|
||||||
visibleModalTransaction = false;
|
visibleModalTransaction = false;
|
||||||
|
code = "";
|
||||||
|
|
||||||
pageCategories = 0;
|
pageCategories = 0;
|
||||||
pageSizeCategories = 10
|
pageSizeCategories = 10
|
||||||
|
|
Loading…
Reference in New Issue
Block a user