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