fix: add membership owner

This commit is contained in:
rarsyansyahr 2021-12-17 06:01:12 +07:00
parent 068444fb07
commit 4f82f9d978
5 changed files with 173 additions and 138 deletions

View File

@ -257,6 +257,19 @@ export const PartnerComponent = observer((props) => {
<Input />
</Form.Item>
)}
{!idData && (
<Form.Item
name="owner"
label="Owner"
rules={[
idData
? { required: false }
: { required: true, message: "Please input password owner!" },
]}
>
<Input />
</Form.Item>
)}
{((idData && isChangePassword) || !idData) && (
<Form.Item
name="password_account"
@ -289,7 +302,7 @@ export const PartnerComponent = observer((props) => {
</Form.Item>
<Form.Item
name="address"
label="address"
label="Address"
rules={[
idData
? { required: false }

View File

@ -65,6 +65,11 @@ export const SupplierComponent = observer((props) => {
dataIndex: ["coa", "amount"],
key: ["coa", "amount"],
width: "20%",
render: (text, record) =>
new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(text),
},
{
title: "Status",
@ -212,7 +217,7 @@ export const SupplierComponent = observer((props) => {
>
<Input />
</Form.Item>
{!idData &&
{!idData && (
<Form.Item
name="code"
label="Kode"
@ -220,7 +225,7 @@ export const SupplierComponent = observer((props) => {
>
<Input />
</Form.Item>
}
)}
</Form>
</Modal>
<TopupsaldoModal code={store.supplier.code} />

View File

@ -209,7 +209,6 @@ export const Membership = observer(() => {
data.superior = true;
if (initialData.id) {
setInitialData({});
setConfirmLoading(true);
try {
await store.membership.update(initialData.id, data);
@ -229,7 +228,6 @@ export const Membership = observer(() => {
setConfirmLoading(false);
setVisibleModal(false);
} else {
setInitialData({});
setConfirmLoading(true);
try {
await store.membership.create(data);
@ -241,6 +239,7 @@ export const Membership = observer(() => {
}
setConfirmLoading(false);
setVisibleModal(false);
setInitialData({});
}
};

View File

@ -31,26 +31,28 @@ export const Product = observer(() => {
// data
useEffect(() => {
console.log('⚡ transaction data store', store.transaction.data)
setProductData(store.transaction.data)
}, [store.transaction.data])
console.log("⚡ transaction data store", store.transaction.data);
setProductData(store.transaction.data);
}, [store.transaction.data]);
// Subcategory
useEffect(() => {
console.log('⚡ transaction subcategory store', store.transaction.dataSubCategories)
}, [store.transaction.dataSubCategories])
console.log(
"⚡ transaction subcategory store",
store.transaction.dataSubCategories
);
}, [store.transaction.dataSubCategories]);
const handleChangeSubcategory = async (item) => {
console.log('item', item);
console.log("item", item);
store.transaction.filterSubCategory = item;
await store.transaction.getData();
}
};
const handleBuyProduct = (data) => {
setData(data);
store.transaction.visibleModalTransaction = true;
}
};
return (
<div>
@ -66,10 +68,11 @@ export const Product = observer(() => {
allowClear={true}
onChange={(val) => {
if (val) {
handleChangeSubcategory(val)
handleChangeSubcategory(val);
}
}}
style={{marginBottom: "10px", width: "100%"}}>
style={{ marginBottom: "10px", width: "100%" }}
>
{store.transaction.dataSubCategories.map((item, index) => (
<Option key={item.id} value={item.id}>
{item.name}
@ -79,7 +82,10 @@ export const Product = observer(() => {
</Col>
</Row>
<Row justify={"center"} align={"center"} style={{ marginBottom: "1rem" }}>
<Col span={12} style={{fontWeight: "bold", display: "flex", alignItems: "center"}}>
<Col
span={12}
style={{ fontWeight: "bold", display: "flex", alignItems: "center" }}
>
Produk & Nominal
</Col>
<Col span={12} style={{ textAlign: "right" }}>
@ -89,22 +95,34 @@ export const Product = observer(() => {
/>
</Col>
</Row>
{productData.length != 0 && <Row>
{productData.length != 0 && (
<Row>
{productData.map((item, index) => (
<Col key={index} xs={24} md={16} lg={8}>
<Card onClick={() => handleBuyProduct(item)} style={{cursor: "pointer"}}>
<Card
onClick={() => handleBuyProduct(item)}
style={{ cursor: "pointer" }}
>
<span style={{ color: "black" }}>{item.name}</span>
<br />
<span style={{color: "grey", fontSize: 10}}>{item?.currentPrice?.mark_up_price}</span>
<span style={{ color: "grey", fontSize: 10 }}>
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(item?.currentPrice?.mark_up_price)}
</span>
</Card>
</Col>
))}
</Row>}
{productData.length != 0 && <Col style={{textAlign: "right"}}>
</Row>
)}
{productData.length !== 0 && (
<Col style={{ textAlign: "right" }}>
<Button style={{ backgroundColor: "#2D9CDB", color: "white" }}>
Beli Sekarang
</Button>
</Col>}
</Col>
)}
<BuyProductModal initialData={data} />
</div>
);

View File

@ -13,7 +13,7 @@ export class UI {
}
setTestValue() {
this.testValue = "yo dayo";
this.testValue = "yoshahhh #!";
}
setMediaQuery(data) {