Commit ea77a9f6 authored by EKSAD's avatar EKSAD

Item laporan

parent 82cecfd4
import React, { Component } from 'react'; import React, { Component } from 'react';
import { TextField, Typography } from '@material-ui/core'; import { TextField, Typography } from '@material-ui/core';
const companies = [
{
value: '',
label: '',
},
{
value: 'TIA1',
label: 'TIA',
},
{
value: 'TIA2',
label: 'TIA',
},
{
value: 'TIA3',
label: 'TIA',
},
];
export default class CreateItemLaporan extends Component { export default class CreateItemLaporan extends Component {
render() {
let { type } = this.props
return type === 'edit' ? this.renderEdit() : this.renderCreate()
}
componentDidMount() { componentDidMount() {
console.log(this.props.data); console.log(this.props.data);
} }
renderEdit() { render() {
return ( return (
<div className="test app-popup-show"> <div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}> <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x" style={{ backgroundColor: '#51c6ea', height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}> <div className="popup-panel grid grid-2x" style={{ backgroundColor: '#51c6ea', height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
<div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}> <div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
<div className="popup-title"> <div className="popup-title">
<span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Edit Data</span> <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Tambah Data</span>
</div> </div>
</div> </div>
<div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}> <div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
...@@ -38,7 +53,7 @@ export default class CreateItemLaporan extends Component { ...@@ -38,7 +53,7 @@ export default class CreateItemLaporan extends Component {
<div style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}> <div style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
value={this.props.data.business_unit_id} value={1}
id="status" id="status"
label="ID" label="ID"
disabled disabled
...@@ -57,30 +72,27 @@ export default class CreateItemLaporan extends Component { ...@@ -57,30 +72,27 @@ export default class CreateItemLaporan extends Component {
</div> </div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}> <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} id="standard-select-currency-native"
id="periode" select
value={"1 Januari 2020"} label="Native select"
label="Berlaku Mulai" // onChange={handleChange}
onChange={(e) => null} SelectProps={{
inputProps={{ native: true,
style: { }}
fontSize: 11 helperText="Please select your currency"
} >
}} {companies.map((option) => (
InputLabelProps={{ <option key={option.value} value={option.value}>
style: { {option.label}
fontSize: 11, </option>
color: '#7e8085' ))}
}
}}
>
</TextField> </TextField>
</div> </div>
<div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}> <div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
value={this.props.data.status} // value={this.props.data.status}
id="status" id="status"
label="Status" label="Status"
disabled disabled
...@@ -101,11 +113,11 @@ export default class CreateItemLaporan extends Component { ...@@ -101,11 +113,11 @@ export default class CreateItemLaporan extends Component {
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}> <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<div style={{display: 'flex'}}> <div style={{display: 'flex'}}>
<Typography style={{ fontSize: 11, width: '20%' }}>Dibuat</Typography> <Typography style={{ fontSize: 11, width: '20%' }}>Dibuat</Typography>
<Typography style={{ fontSize: 11 }}>: {this.props.data.created}</Typography> <Typography style={{ fontSize: 11 }}>: Admin - 21 Jul 2020, 18:45</Typography>
</div> </div>
<div style={{display: 'flex'}}> <div style={{display: 'flex'}}>
<Typography style={{ fontSize: 11, width: '20%' }}>Diubah</Typography> <Typography style={{ fontSize: 11, width: '20%' }}>Diubah</Typography>
<Typography style={{ fontSize: 11 }}>: {this.props.data.updated ==- null ? "" : this.props.data.updated}</Typography> <Typography style={{ fontSize: 11 }}>: Admin - 21 Jul 2020, 18:45</Typography>
</div> </div>
</div> </div>
</div> </div>
...@@ -116,7 +128,7 @@ export default class CreateItemLaporan extends Component { ...@@ -116,7 +128,7 @@ export default class CreateItemLaporan extends Component {
style={{ width: '100%' }} style={{ width: '100%' }}
id="unit" id="unit"
label="Unit Bisnis" label="Unit Bisnis"
value={this.props.data.business_unit_name} // value={this.props.data.business_unit_name}
inputProps={{ inputProps={{
style: { style: {
fontSize: 11 fontSize: 11
...@@ -176,145 +188,4 @@ export default class CreateItemLaporan extends Component { ...@@ -176,145 +188,4 @@ export default class CreateItemLaporan extends Component {
</div> </div>
) )
} }
renderCreate() {
return (
<div className="test app-popup-show" style={{ paddingTop: 100 }}>
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x" style={{ backgroundColor: '#51c6ea', height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
<div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
<div className="popup-title">
<span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Create Data</span>
</div>
</div>
<div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
<button
type="button"
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
</button>
</div>
</div>
<div className="border-bottom grid grid-2x grid-mobile-none gap-15px" style={{ padding: 20 }}>
<div className="column-1">
<div style={{ padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
id="periode"
value={"1 Januari 2020"}
label="Berlaku Mulai"
// value={this.state.periode}
onChange={(e) => null}
inputProps={{
style: {
fontSize: 11
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085'
}
}}
>
</TextField>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5, backgroundColor: '#e8e8e8', }}>
<TextField
style={{ width: '100%' }}
defaultValue={"Aktif"}
id="status"
label="Status"
disabled
inputProps={{
style: {
fontSize: 11
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085'
}
}}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<Typography style={{ fontSize: 11 }}>Dibuat : Admin - 21 Jul 2020, 18:45</Typography>
<Typography style={{ fontSize: 11 }}>Diubah : Admin - 21 Jul 2020, 18:45</Typography>
</div>
</div>
<div className="column-2">
<div style={{ padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
id="unit"
label="Unit Bisnis"
defaultValue={"Agrobisnis"}
inputProps={{
style: {
fontSize: 11
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085'
}
}}
>
</TextField>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
id="unit"
label="Berlaku Hingga"
defaultValue={"31 Desember 2100"}
inputProps={{
style: {
fontSize: 11
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085'
}
}}
>
</TextField>
</div>
</div>
</div>
<div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1" style={{ alignSelf: 'center' }}>
<button
type="button"
onClick={() => this.props.onClickClose()}
>
<div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Batal</span>
</div>
</button>
</div>
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Simpan</span>
</div>
</div>
</div>
</div>
</div >
);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment