|
|
@ -40,7 +40,7 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi |
|
|
|
const [address, setAddress] = useState('') |
|
|
|
const [address, setAddress] = useState('') |
|
|
|
const [divisionId, setDivisionId] = useState('') |
|
|
|
const [divisionId, setDivisionId] = useState('') |
|
|
|
const [statusResource, setStatusResource] = useState('active') |
|
|
|
const [statusResource, setStatusResource] = useState('active') |
|
|
|
|
|
|
|
const [statusRestriction, setStatusRestriction] = useState(false) |
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (typeDialog === "Edit" || typeDialog === "Set") { |
|
|
|
if (typeDialog === "Edit" || typeDialog === "Set") { |
|
|
|
console.log("cel data Edit", dataEdit) |
|
|
|
console.log("cel data Edit", dataEdit) |
|
|
@ -112,8 +112,10 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi |
|
|
|
role_id: roleId, |
|
|
|
role_id: roleId, |
|
|
|
divisi_id: divisionId, |
|
|
|
divisi_id: divisionId, |
|
|
|
address, |
|
|
|
address, |
|
|
|
status_resource: statusResource |
|
|
|
status_resource: statusResource, |
|
|
|
|
|
|
|
status_boundary: statusRestriction |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(data) |
|
|
|
|
|
|
|
|
|
|
|
if (birthDate && birthDate != "") { |
|
|
|
if (birthDate && birthDate != "") { |
|
|
|
data['birth_date'] = birthDate; |
|
|
|
data['birth_date'] = birthDate; |
|
|
@ -154,7 +156,8 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi |
|
|
|
role_id: roleId, |
|
|
|
role_id: roleId, |
|
|
|
divisi_id: divisionId, |
|
|
|
divisi_id: divisionId, |
|
|
|
address, |
|
|
|
address, |
|
|
|
status_resource: statusResource |
|
|
|
status_resource: statusResource, |
|
|
|
|
|
|
|
status_boundary: statusRestriction |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (birthDate && birthDate != "") { |
|
|
|
if (birthDate && birthDate != "") { |
|
|
@ -196,42 +199,30 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi |
|
|
|
const renderForm = () => { |
|
|
|
const renderForm = () => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Form> |
|
|
|
<Form> |
|
|
|
|
|
|
|
<Row> |
|
|
|
|
|
|
|
<Col md={12}> |
|
|
|
|
|
|
|
<span style={{ color: "red" }}>*</span> Wajib diisi. |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
</Row> |
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col md={6}> |
|
|
|
<Col md={6}> |
|
|
|
|
|
|
|
|
|
|
|
<FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<Label className="capitalize">NIK (KTP / ID Card) *</Label> |
|
|
|
<Label className="capitalize">NIK (KTP / ID Card) <span style={{ color: "red" }}>*</span></Label> |
|
|
|
{/* <Input type="text" value={ktpNumber} onChange={(e) => setKtpNumber(e.target.value.replace(/[^0-9]/g, ''))} placeholder={`Input NIK (KTP)...`} maxLength="16" /> */} |
|
|
|
{/* <Input type="text" value={ktpNumber} onChange={(e) => setKtpNumber(e.target.value.replace(/[^0-9]/g, ''))} placeholder={`Input NIK (KTP)...`} maxLength="16" /> */} |
|
|
|
<Input type="text" value={ktpNumber} onChange={(e) => setKtpNumber(e.target.value)} placeholder={`Input NIK (KTP)...`} maxLength="16" /> |
|
|
|
<Input type="text" value={ktpNumber} onChange={(e) => setKtpNumber(e.target.value)} placeholder={`Input NIK (KTP)...`} maxLength="16" /> |
|
|
|
</FormGroup> |
|
|
|
</FormGroup> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
<Col md={6}> |
|
|
|
<Col md={6}> |
|
|
|
<FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<Label className="capitalize">Resource Name *</Label> |
|
|
|
<Label className="capitalize">Resource Name <span style={{ color: "red" }}>*</span></Label> |
|
|
|
<Input type="text" value={resourceName} onChange={(e) => setResourceName(e.target.value)} placeholder={`Input resource name...`} /> |
|
|
|
<Input type="text" value={resourceName} onChange={(e) => setResourceName(e.target.value)} placeholder={`Input resource name...`} /> |
|
|
|
</FormGroup> |
|
|
|
</FormGroup> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
</Row> |
|
|
|
{/* {typeDialog === 'Save' && |
|
|
|
|
|
|
|
<Row> |
|
|
|
|
|
|
|
<Col md={6}> |
|
|
|
|
|
|
|
<FormGroup> |
|
|
|
|
|
|
|
<Label className="capitalize">Password</Label> |
|
|
|
|
|
|
|
<Input type="password" value={password} onChange={(e)=> setPassword(e.target.value)} placeholder={`Password...`} /> |
|
|
|
|
|
|
|
</FormGroup> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col md={6}> |
|
|
|
|
|
|
|
<FormGroup> |
|
|
|
|
|
|
|
<Label className="capitalize">Retry Password</Label> |
|
|
|
|
|
|
|
<Input type="password" value={retryPassword} onChange={(e)=> setRetryPassword(e.target.value)} placeholder={`Retry password...`} /> |
|
|
|
|
|
|
|
</FormGroup> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
</Row> |
|
|
|
|
|
|
|
} */} |
|
|
|
|
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col md={6}> |
|
|
|
<Col md={6}> |
|
|
|
<FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<Label className="capitalize">Employee Type *</Label> |
|
|
|
<Label className="capitalize">Employee Type <span style={{ color: "red" }}>*</span></Label> |
|
|
|
<Select showSearch value={employeeType} defaultValue={employeeType} onChange={(val) => setEmployeeType(val)} placeholder="Select Employee Type" style={{ width: '100%' }}> |
|
|
|
<Select showSearch value={employeeType} defaultValue={employeeType} onChange={(val) => setEmployeeType(val)} placeholder="Select Employee Type" style={{ width: '100%' }}> |
|
|
|
<Option value={'employee'}>Employee</Option> |
|
|
|
<Option value={'employee'}>Employee</Option> |
|
|
|
<Option value={'subcon'}>Subcon</Option> |
|
|
|
<Option value={'subcon'}>Subcon</Option> |
|
|
@ -282,7 +273,7 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi |
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col md={6}> |
|
|
|
<Col md={6}> |
|
|
|
<FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<Label className="capitalize">Role *</Label> |
|
|
|
<Label className="capitalize">Role <span style={{ color: "red" }}>*</span></Label> |
|
|
|
<Select showSearch defaultValue={roleId} onChange={(val) => setRoleId(val)} placeholder="Select Role" style={{ width: '100%' }}> |
|
|
|
<Select showSearch defaultValue={roleId} onChange={(val) => setRoleId(val)} placeholder="Select Role" style={{ width: '100%' }}> |
|
|
|
{setupSelectRole()} |
|
|
|
{setupSelectRole()} |
|
|
|
</Select> |
|
|
|
</Select> |
|
|
@ -290,11 +281,7 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
<Col md={6}> |
|
|
|
<Col md={6}> |
|
|
|
<FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<Label className="capitalize">Division *</Label> |
|
|
|
<Label className="capitalize">Division <span style={{ color: "red" }}>*</span></Label> |
|
|
|
{/* <Select style={{ width: "100%" }} defaultValue={statusResource} onChange={(e) => setStatusResource(e)}> |
|
|
|
|
|
|
|
<Option value={'active'}>Active</Option> |
|
|
|
|
|
|
|
<Option value={'inactive'}>Inactive</Option> |
|
|
|
|
|
|
|
</Select> */} |
|
|
|
|
|
|
|
<Select showSearch defaultValue={divisionId} onChange={(val) => setDivisionId(val)} placeholder="Select Division" style={{ width: '100%' }}> |
|
|
|
<Select showSearch defaultValue={divisionId} onChange={(val) => setDivisionId(val)} placeholder="Select Division" style={{ width: '100%' }}> |
|
|
|
{setupSelectDivisi()} |
|
|
|
{setupSelectDivisi()} |
|
|
|
</Select> |
|
|
|
</Select> |
|
|
@ -310,12 +297,20 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi |
|
|
|
<Option value={'inactive'}>Inactive</Option> |
|
|
|
<Option value={'inactive'}>Inactive</Option> |
|
|
|
</Select> |
|
|
|
</Select> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col md={6}> |
|
|
|
|
|
|
|
<Label className="capitalize">Pembatasan wilayah kerja</Label> |
|
|
|
|
|
|
|
<Select style={{ width: "100%" }} defaultValue={statusRestriction} onChange={(e) => setStatusRestriction(e)}> |
|
|
|
|
|
|
|
<Option value={true}>Ya</Option> |
|
|
|
|
|
|
|
<Option value={false}>Tidak</Option> |
|
|
|
|
|
|
|
</Select> |
|
|
|
|
|
|
|
</Col> |
|
|
|
<Col md={6}> |
|
|
|
<Col md={6}> |
|
|
|
<FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<Label className="capitalize">Address</Label> |
|
|
|
<Label className="capitalize">Address</Label> |
|
|
|
<Input type="textarea" value={address} onChange={(e) => setAddress(e.target.value)} placeholder="Input address..." /> |
|
|
|
<Input type="textarea" value={address} onChange={(e) => setAddress(e.target.value)} placeholder="Input address..." /> |
|
|
|
</FormGroup> |
|
|
|
</FormGroup> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
|
|
|
|
|
|
|
|
</Row> |
|
|
|
</Row> |
|
|
|
</Form> |
|
|
|
</Form> |
|
|
|
) |
|
|
|
) |
|
|
|