BudgetTahunan.js 9.23 KB
Newer Older
Deni Rinaldi's avatar
Deni Rinaldi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
import React, { Component } from 'react';
import { Typography, Paper, TextField, MenuItem } from '@material-ui/core';
import MUIDataTable from 'mui-datatables';
import Images from '../assets/Images';

export default class BudgetTahunan extends Component {
    constructor(props) {
        super(props)
        this.state = {
            periode: '2020',
            perusahaan: 'TAP Group',
            revisi: '0'
        }
    }
    render() {
        const columns = ["#", "Jenis Laporan",
            {
                name: "Status",
                options: {
                    customBodyRender: (val, tableMeta) => {
                        return (
                            <div style={{ display: 'flex' }}>
                                {val == 'done' ?
                                    <img src={Images.ceklis} style={{ width: 31, height: 24 }} /> :
                                    null
                                }
                            </div >
                        );
                    }
                }
            },
            {
                name: "Action",
                options: {
                    customBodyRender: (val, tableMeta) => {
                        return (
                            <div style={{ display: 'flex' }}>
                                <button
                                    style={{
                                        backgroundColor: 'transparent',
                                        cursor: 'pointer',
                                        borderColor: 'transparent'
                                    }}
                                    onClick={() => null}
                                >
                                    <Typography style={{ color: '#5198ea', fontSize: 12, }}>Detail</Typography>
                                </button>
                            </div >
                        );
                    }
                }
            }]
        const dataTable = [
            ["1", "Balance Sheet", "done"],
            ["2", "Profit & Loss", ""],
            ["3", "CAT", "done"],
            ["4", "Fixed Assets Movement", ""],
            ["5", "Tax Planning", "done"],
            ["6", "Balance Sheet", "done"],
            ["7", "Profit & Loss", ""],
            ["8", "CAT", "done"],
            ["9", "Fixed Assets Movement", ""],
            ["10", "Tax Planning", "done"],
            ["11", "Balance Sheet", "done"],
            ["12", "Profit & Loss", "done"],
            ["13", "CAT", "done"],
            ["14", "Fixed Assets Movement", "done"],
            ["15", "Tax Planning", "done"],
        ]
        const options = {
            filter: false,
            sort: false,
            responsive: "scroll",
            print: false,
            download: false,
            selectableRows: false,
            viewColumns: false,
            rowsPerPage: 5,
            rowsPerPageOptions: [5, 25, 100],
            search: false
        }
        const periode = [
            { value: '2020', label: '2020' },
            { value: '2019', label: '2019' },
            { value: '2018', label: '2018' },
            { value: '2017', label: '2017' },
            { value: '2016', label: '2016' },
        ]
        const perusahaan = [
            { value: 'TAP Group', label: 'TAP Group' },
            { value: '2019', label: '2019' },
            { value: '2018', label: '2018' },
            { value: '2017', label: '2017' },
            { value: '2016', label: '2016' },
        ]
        const revisi = [
            { value: '0', label: '0' },
            { value: '1', label: '1' },
        ]
        return (
            <div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
102
                <div style={{ height: 78, backgroundColor: '#354960', display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
103 104
                    <Typography style={{ fontSize: '16px', color: 'white' }}>Pengajuan Budget Tahunan</Typography>
                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
105
                <div style={{ padding: 20, width: '100%' }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
                    <Paper style={{ paddingTop: 10 }}>
                        <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
                            <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan</Typography>
                        </div>
                        <div style={{ padding: 20 }}>
                            <div>
                                <TextField
                                    style={{ width: 250, }}
                                    id="periode"
                                    select
                                    label="Periode"
                                    value={this.state.periode}
                                    onChange={(e) => this.setState({ periode: e.target.value })}
                                >
                                    {periode.map((option) => (
                                        <MenuItem key={option.value} value={option.value}>
                                            {option.label}
                                        </MenuItem>
                                    ))}
                                </TextField>
                            </div>
                            <div style={{ marginTop: 20 }}>
                                <TextField
                                    style={{ width: 250, }}
                                    id="perusahaan"
                                    select
                                    label="Perusahaan"
                                    value={this.state.perusahaan}
                                    onChange={(e) => this.setState({ perusahaan: e.target.value })}
                                >
                                    {perusahaan.map((option) => (
                                        <MenuItem key={option.value} value={option.value}>
                                            {option.label}
                                        </MenuItem>
                                    ))}
                                </TextField>
                            </div>
                            <div style={{ marginTop: 20 }}>
                                <TextField
                                    style={{ width: 250, }}
                                    id="reivisi"
                                    select
                                    label="Revisi"
                                    value={this.state.revisi}
                                    onChange={(e) => this.setState({ revisi: e.target.value })}
                                >
                                    {revisi.map((option) => (
                                        <MenuItem key={option.value} value={option.value}>
                                            {option.label}
                                        </MenuItem>
                                    ))}
                                </TextField>
                            </div>

                            <div style={{ marginTop: 20 }}>
                                <MUIDataTable
                                    data={dataTable}
                                    columns={columns}
                                    options={options}
                                />
                            </div>
                            <div style={{ display: 'flex', marginTop: 20 }}>
                                <div style={{ width: '50%' }}>
                                    <Typography style={{ fontSize: '16px', color: '#4b4b4b', fontWeight: 'bold' }}>Attachment: </Typography>
                                </div>
                                <div style={{ width: '50%' }}>
                                    <Typography style={{ fontSize: '16px', color: '#5198ea' }}>Upload File</Typography>
                                </div>
                            </div>
                            <div style={{ display: 'flex', marginTop: 10 }}>
                                <div style={{ width: '50%', paddingLeft: 20 }}>
                                    <Typography style={{ fontSize: '16px', color: '#4b4b4b' }}>File 1.xls </Typography>
                                    <Typography style={{ fontSize: '16px', color: '#4b4b4b' }}>File 2.xls </Typography>
                                </div>
                                <div style={{ width: '50%' }}>
                                    <Typography style={{ fontSize: '16px', color: '#ff3939' }}>Delete</Typography>
                                    <Typography style={{ fontSize: '16px', color: '#ff3939' }}>Delete</Typography>
                                </div>
                            </div>
                        </div>
                        <div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
                            <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Submit</Typography>
                            </div>
                        </div>
                    </Paper>

                </div>
            </div >
        );
    }
}