integrasi plant section

This commit is contained in:
2025-10-13 10:17:16 +07:00
parent 54290baaac
commit 577d8c8585
3 changed files with 149 additions and 150 deletions

View File

@@ -4,7 +4,11 @@ import { Modal, Form, Input, ConfigProvider, Button, Typography } from 'antd';
const { Text } = Typography;
const DetailPlantSection = ({ visible, onCancel, onOk, form, editingKey, readOnly }) => {
const modalTitle = readOnly ? 'Preview Plant Section' : (editingKey ? 'Edit Plant Section' : 'Tambah Plant Section');
const modalTitle = readOnly
? 'Preview Sub Section'
: editingKey
? 'Edit Sub Section'
: 'Tambah Sub Section';
return (
<Modal
@@ -45,11 +49,7 @@ const DetailPlantSection = ({ visible, onCancel, onOk, form, editingKey, readOnl
},
}}
>
{!readOnly && (
<Button onClick={onOk}>
Simpan
</Button>
)}
{!readOnly && <Button onClick={onOk}>Simpan</Button>}
</ConfigProvider>
</React.Fragment>,
]}
@@ -57,11 +57,11 @@ const DetailPlantSection = ({ visible, onCancel, onOk, form, editingKey, readOnl
>
<Form form={form} layout="vertical" name="form_in_modal">
<div style={{ marginBottom: 12 }}>
<Text strong>Kode Plant</Text>
<Text strong>Nama Sub Section</Text>
<Text style={{ color: 'red' }}> *</Text>
<Form.Item
name="kode_plant"
rules={[{ required: true, message: 'Silakan masukkan kode plant!' }]}
name="sub_section_name"
rules={[{ required: true, message: 'Silakan masukkan nama sub section!' }]}
style={{ marginBottom: 0 }}
>
<Input readOnly={readOnly} placeholder="Masukkan Kode Plant" />
@@ -91,11 +91,12 @@ const DetailPlantSection = ({ visible, onCancel, onOk, form, editingKey, readOnl
</div>
<div style={{ marginBottom: 12 }}>
<Text strong>Deskripsi</Text>
<Form.Item
name="deskripsi"
style={{ marginBottom: 0 }}
>
<Input.TextArea readOnly={readOnly} placeholder="Masukkan Deskripsi (Opsional)" rows={4} />
<Form.Item name="deskripsi" style={{ marginBottom: 0 }}>
<Input.TextArea
readOnly={readOnly}
placeholder="Masukkan Deskripsi (Opsional)"
rows={4}
/>
</Form.Item>
</div>
</Form>
@@ -103,4 +104,4 @@ const DetailPlantSection = ({ visible, onCancel, onOk, form, editingKey, readOnl
);
};
export default DetailPlantSection;
export default DetailPlantSection;