CreateCompany.js 51 KB
Newer Older
1
import React, { Component } from 'react';
faisalhamdi's avatar
faisalhamdi committed
2
import { TextField, Typography, withStyles, Snackbar } from '@material-ui/core';
faisalhamdi's avatar
faisalhamdi committed
3
import * as R from 'ramda';
faisalhamdi's avatar
faisalhamdi committed
4
import { DatePicker } from "@material-ui/pickers";
faisalhamdi's avatar
faisalhamdi committed
5
import format from "date-fns/format";
6
import Autocomplete from '@material-ui/lab/Autocomplete';
faisalhamdi's avatar
faisalhamdi committed
7
import MuiAlert from '@material-ui/lab/Alert';
8
import api from '../../../api';
d.arizona's avatar
d.arizona committed
9
import Images from '../../../assets/Images';
a.bairuha's avatar
a.bairuha committed
10
import Constant from '../../../library/Constant';
11
import { DataUsage } from '@material-ui/icons';
12

faisalhamdi's avatar
faisalhamdi committed
13 14 15
const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);

16
export default class CreatePerusahaan extends Component {
faisalhamdi's avatar
faisalhamdi committed
17 18 19 20 21
    constructor(props) {
        super(props)
        this.state = {
            id: '',
            company: '',
faisalhamdi's avatar
faisalhamdi committed
22
            companyID: '',
faisalhamdi's avatar
faisalhamdi committed
23 24
            parentCompany: '',
            unitBisnis: '',
faisalhamdi's avatar
faisalhamdi committed
25
            totalReport: '',
faisalhamdi's avatar
faisalhamdi committed
26
            startDate: '',
27
            endDate: '',
faisalhamdi's avatar
faisalhamdi committed
28
            status: '',
29
            types: null,
30 31 32 33
            dataCurrency: [],
            currency: [],
            currencies: [],
            defaultCurrency: null,
34 35 36
            getTypes: null,
            perusahaan: null,
            getPerusahaan: null,
faisalhamdi's avatar
faisalhamdi committed
37 38 39 40 41 42
            errorNP: false,
            errorPC: false,
            errorSD: false,
            errorED: false,
            errorJL: false,
            errorUB: false,
Riri Novita's avatar
Riri Novita committed
43 44
            errorCur: false,
            errorDefCur: false,
faisalhamdi's avatar
faisalhamdi committed
45 46 47 48 49
            msgErrorNP: '',
            msgErrorPC: '',
            msgErrorSD: '',
            msgErrorED: '',
            msgErrorJL: '',
faisalhamdi's avatar
faisalhamdi committed
50
            msgErrorUB: '',
Riri Novita's avatar
Riri Novita committed
51 52
            msgErrorCur: '',
            msgErrorDefCur: '',
faisalhamdi's avatar
faisalhamdi committed
53 54 55
            alert: false,
            tipeAlert: '',
            messageAlert: '',
56
            optionCurrecy: []
faisalhamdi's avatar
faisalhamdi committed
57 58
        }
    }
59

faisalhamdi's avatar
faisalhamdi committed
60 61 62 63 64
    render() {
        let { type } = this.props
        return type === 'edit' ? this.renderEdit() : this.renderCreate()
    }

faisalhamdi's avatar
faisalhamdi committed
65
    componentDidMount() {
Deni Rinaldi's avatar
Deni Rinaldi committed
66
        if (this.props.type === 'edit') {
faisalhamdi's avatar
faisalhamdi committed
67
            this.getDetailPerusahaan()
68
            this.getListCurrency()
faisalhamdi's avatar
faisalhamdi committed
69
            // console.log(this.props.data);
faisalhamdi's avatar
faisalhamdi committed
70
        } else {
a.bairuha's avatar
a.bairuha committed
71 72
            this.getCompanyActive()
            this.getAllUnitBisnis()
73
            this.getListCurrency()
faisalhamdi's avatar
faisalhamdi committed
74 75 76 77 78 79 80
            let date = format(new Date, 'yyyy-MM-dd')
            // console.log(date);
            this.setState({
                startDate: date,
                endDate: date
            })
        }
81 82
    }

faisalhamdi's avatar
faisalhamdi committed
83 84
    getDetailPerusahaan() {
        api.create().getDetailPerusahaan(this.props.data[1]).then(response => {
faisalhamdi's avatar
faisalhamdi committed
85 86
            console.log(response)
            if (response.data) {
a.bairuha's avatar
a.bairuha committed
87 88
                if (response.ok) {
                    if (response.data.status === "success") {
89 90 91 92 93 94 95 96
                        let datas = []
                        if (response.data.data.currency.length > 0) {
                            response.data.data.currency.map((item) => {
                                console.log(item);
                                datas.push({
                                    id: item.currencyId,
                                    value: item.currencyName
                                })
97

98 99 100 101
                            })
                            // console.log(response.data.data.default_currency, datas);
                        }
                        let index = datas.findIndex((val) => val.id == response.data.data.default_currency)
102 103 104
                        let findIdx = datas.findIndex(e => e.id === 2)
                        let bizpar = findIdx >= 0 ? datas.filter(e => e.id === 2) : datas
                        console.log(bizpar);
a.bairuha's avatar
a.bairuha committed
105 106 107 108 109 110 111 112 113 114 115
                        this.setState({
                            businessID: response.data.data.business_unit_id,
                            companyID: response.data.data.company_id,
                            status: response.data.data.status,
                            company: response.data.data.company_name,
                            parentID: response.data.data.parent,
                            parent: response.data.data.parent_name,
                            startDate: response.data.data.start_date,
                            endDate: response.data.data.end_date,
                            totalReport: response.data.data.total_report,
                            created: response.data.data.created,
Riri Novita's avatar
Riri Novita committed
116
                            updated: response.data.data.updated === null ? "" : response.data.data.updated,
117 118
                            defaultCurrencyID: response.data.data.default_currency,
                            currency: datas,
119 120
                            defaultCurrency: index == -1 ? null : datas[index],
                            optionCurrecy: bizpar,
a.bairuha's avatar
a.bairuha committed
121 122
                        }, () => {
                            // setTimeout(() => {
Deni Rinaldi's avatar
Deni Rinaldi committed
123 124
                            this.getAllUnitBisnis()
                            this.getCompanyActive()
a.bairuha's avatar
a.bairuha committed
125 126
                            // }, 1000);
                        })
a.bairuha's avatar
a.bairuha committed
127 128
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
d.arizona's avatar
d.arizona committed
129
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
a.bairuha's avatar
a.bairuha committed
130 131 132 133 134 135 136
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
                    }
faisalhamdi's avatar
faisalhamdi committed
137
                } else {
a.bairuha's avatar
a.bairuha committed
138
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
Deni Rinaldi's avatar
Deni Rinaldi committed
139
                }
faisalhamdi's avatar
faisalhamdi committed
140 141
            } else {
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
Deni Rinaldi's avatar
Deni Rinaldi committed
142
            }
faisalhamdi's avatar
faisalhamdi committed
143 144 145 146
        })
    }

    getCompanyActive() {
a.bairuha's avatar
a.bairuha committed
147
        console.log(this.state.company)
faisalhamdi's avatar
faisalhamdi committed
148 149 150 151
        if (this.state.company !== null) {
            console.log(this.state.company)
            let payload = {
                "company_id": this.state.company.company_id
152
            }
faisalhamdi's avatar
faisalhamdi committed
153 154
            api.create().getPerusahaanActive(payload).then(response => {
                console.log(response)
Deni Rinaldi's avatar
Deni Rinaldi committed
155
                if (response.data) {
a.bairuha's avatar
a.bairuha committed
156
                    if (response.ok) {
Deni Rinaldi's avatar
Deni Rinaldi committed
157
                        if (response.data.status === 'success') {
a.bairuha's avatar
a.bairuha committed
158
                            let data = response.data.data
a.bairuha's avatar
a.bairuha committed
159 160 161 162 163 164 165 166 167
                            let currentIndex = null
                            let perusahaanData = data.map((item, index) => {
                                if (this.state.companyID !== item.company_id) {
                                    return {
                                        company_id: item.company_id,
                                        company_name: item.company_name
                                    }
                                } else {
                                    currentIndex = index
a.bairuha's avatar
a.bairuha committed
168 169
                                }
                            })
a.bairuha's avatar
a.bairuha committed
170 171 172
                            if (currentIndex !== null) {
                                perusahaanData.splice(currentIndex, 1)
                            }
a.bairuha's avatar
a.bairuha committed
173 174 175 176 177
                            let index = perusahaanData.sort((a, b) => a.company_id - b.company_id).findIndex((val) => val.company_id == this.state.parentID)
                            let typeProps = {
                                options: perusahaanData,
                                getOptionLabel: (option) => option.company_name,
                            };
faisalhamdi's avatar
faisalhamdi committed
178 179 180 181 182
                            if (this.props.type === 'edit') {
                                this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index], msgErrorPC: index === -1 ? 'Company has been Inactive' : "", errorPC: index === -1 ? true : false })
                            } else {
                                this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index] })
                            }
a.bairuha's avatar
a.bairuha committed
183 184
                        } else {
                            this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
d.arizona's avatar
d.arizona committed
185
                                if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
a.bairuha's avatar
a.bairuha committed
186 187 188 189 190 191 192
                                    setTimeout(() => {
                                        localStorage.removeItem(Constant.TOKEN)
                                        window.location.reload();
                                    }, 1000);
                                }
                            })
                        }
faisalhamdi's avatar
faisalhamdi committed
193
                    } else {
a.bairuha's avatar
a.bairuha committed
194
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
Deni Rinaldi's avatar
Deni Rinaldi committed
195
                    }
faisalhamdi's avatar
faisalhamdi committed
196 197
                } else {
                    this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
Deni Rinaldi's avatar
Deni Rinaldi committed
198
                }
faisalhamdi's avatar
faisalhamdi committed
199 200
            })
        }
201 202 203 204
    }

    getAllUnitBisnis() {
        api.create().getUnitBisnisActive().then(response => {
faisalhamdi's avatar
faisalhamdi committed
205
            if (response.data) {
a.bairuha's avatar
a.bairuha committed
206 207 208 209 210 211 212 213 214
                if (response.ok) {
                    if (response.data.status === 'success') {
                        let data = response.data.data
                        let typeData = data.map((item) => {
                            return {
                                business_unit_id: item.business_unit_id,
                                business_unit_name: item.business_unit_name
                            }
                        })
215
                        console.log(typeData)
a.bairuha's avatar
a.bairuha committed
216 217 218 219 220
                        let index = typeData.findIndex((val) => val.business_unit_id == this.state.businessID)
                        console.log(index)
                        let typeProps = {
                            options: typeData,
                            getOptionLabel: (option) => option.business_unit_name,
Deni Rinaldi's avatar
Deni Rinaldi committed
221
                        };
faisalhamdi's avatar
faisalhamdi committed
222 223 224 225 226
                        if (this.props.type === 'edit') {
                            this.setState({ types: typeProps, typeData: response.data.data, getTypes: index == -1 ? null : typeData[index], msgErrorUB: index === -1 ? 'Business Unit has been Inactive' : "", errorUB: index === -1 ? true : false })
                        } else {
                            this.setState({ types: typeProps, typeData: response.data.data, getTypes: index == -1 ? null : typeData[index] })
                        }
a.bairuha's avatar
a.bairuha committed
227 228
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
d.arizona's avatar
d.arizona committed
229
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
a.bairuha's avatar
a.bairuha committed
230 231 232 233 234 235 236
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
                    }
faisalhamdi's avatar
faisalhamdi committed
237
                } else {
a.bairuha's avatar
a.bairuha committed
238
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
Deni Rinaldi's avatar
Deni Rinaldi committed
239
                }
faisalhamdi's avatar
faisalhamdi committed
240
            } else {
faisalhamdi's avatar
faisalhamdi committed
241
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
Deni Rinaldi's avatar
Deni Rinaldi committed
242
            }
faisalhamdi's avatar
faisalhamdi committed
243 244 245
        })
    }

246 247 248 249 250 251 252 253 254 255 256 257 258 259
    getListCurrency() {
        api.create().getDataCurrency().then(response => {
            console.log(response);
            if (response.data) {
                let arrayCurrency = []
                response.data.data.map(item => {
                    arrayCurrency.push({
                        id: item.currency_id,
                        value: item.currency_name
                    })
                })
                this.setState({ dataCurrency: arrayCurrency })
            }
        })
Riri Novita's avatar
Riri Novita committed
260 261
    }

faisalhamdi's avatar
faisalhamdi committed
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
    // getParentCompany() {
    //     api.create().getPerusahaanActive().then((response) => {
    //         if (response.data.status === 'success') {
    //             let data = response.data.data
    //             let typeData = data.map((item) => {
    //                 return {
    //                     company_id: item.company_id,
    //                     company_name: item.company_name
    //                 }
    //             })
    //             let typeProps = {
    //                 options: typeData.sort((a, b) => a.company_id - b.company_id),
    //                 getOptionLabel: (option) => option.company_name,
    //             };
    //             this.setState({ perusahaan: typeProps, perusahaanData: response.data.data })
    //         } else {
    //             alert(response.data.message)
    //         }
    //     })
    // }
faisalhamdi's avatar
faisalhamdi committed
282 283 284 285 286

    handleChange(e, type) {
        let data = this.state
        let isDate = type !== '' ? true : false
        if (isDate && type == 'start_date') {
287
            this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => {
faisalhamdi's avatar
faisalhamdi committed
288
                this.clearError()
faisalhamdi's avatar
faisalhamdi committed
289 290 291 292
                console.log(this.state.startDate)
            })
        } else if (isDate && type == 'end_date') {
            this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => {
faisalhamdi's avatar
faisalhamdi committed
293
                this.clearError()
faisalhamdi's avatar
faisalhamdi committed
294 295 296 297 298 299 300 301
                console.log(this.state.endDate)
            })
        } else {
            // this.setState({...data, tempData: {...this.state.tempData, [e.target.name] :  e.target.value}})
        }

    }

faisalhamdi's avatar
faisalhamdi committed
302 303 304 305 306 307 308
    clearError() {
        this.setState({
            errorNP: false,
            errorPC: false,
            errorSD: false,
            errorED: false,
            errorJL: false,
a.bairuha's avatar
a.bairuha committed
309
            errorUB: false,
Riri Novita's avatar
Riri Novita committed
310 311
            errorCur: false,
            errorDefCur: false,
faisalhamdi's avatar
faisalhamdi committed
312 313 314 315 316
            msgErrorNP: '',
            msgErrorPC: '',
            msgErrorSD: '',
            msgErrorED: '',
            msgErrorJL: '',
Riri Novita's avatar
Riri Novita committed
317 318 319
            msgErrorUB: '',
            msgErrorCur: '',
            msgErrorDefCur: ''
faisalhamdi's avatar
faisalhamdi committed
320 321 322 323 324
        })
    }

    validasiEdit() {
        if (R.isEmpty(this.state.company)) {
EKSAD's avatar
EKSAD committed
325
            this.setState({ errorNP: true, msgErrorNP: 'Company Name Cannot be Empty' })
a.bairuha's avatar
a.bairuha committed
326
        } else if (R.isNil(this.state.getTypes)) {
Deni Rinaldi's avatar
Deni Rinaldi committed
327
            this.setState({ errorUB: true, msgErrorUB: 'Business Unit Cannot be Empty' })
Riri Novita's avatar
Riri Novita committed
328 329 330 331 332 333
        } else if (R.isNil(this.state.getPerusahaan)) {
            this.setState({ errorPC: true, msgErrorPC: 'Parent Company Cannot be Empty' })
        } else if (this.state.currency.length === 0) {
            this.setState({ errorCur: true, msgErrorCur: 'Currency Cannot be Empty' })
        } else if (R.isNil(this.state.defaultCurrency)) {
            this.setState({ errorDefCur: true, msgErrorDefCur: 'Default Currency Cannot be Empty' })
faisalhamdi's avatar
faisalhamdi committed
334
        } else if (R.isNil(this.state.startDate)) {
EKSAD's avatar
EKSAD committed
335
            this.setState({ errorSD: true, msgErrorSD: 'Valid From Cannot be Empty' })
faisalhamdi's avatar
faisalhamdi committed
336
        } else if (R.isNil(this.state.endDate)) {
EKSAD's avatar
EKSAD committed
337
            this.setState({ errorED: true, msgErrorED: 'Valid To Cannot be Empty' })
faisalhamdi's avatar
faisalhamdi committed
338
        } else {
339 340 341 342 343 344
            let currencyID = []
            if (this.state.currency.length > 0) {
                this.state.currency.map(item => {
                    currencyID.push(item.id)
                })
            }
Riri Novita's avatar
Riri Novita committed
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367

            // OPSI 1
            // if (this.state.currency.length > 0) {
            //     this.state.currency.map(item => {
            //         currencyID.push({
            //             "currency_id" : item.id,
            //             "status" : true
            //         })
            //     })
            // }

            // OPSI 2
            // let finalCurrency = []
            // console.log(this.state.dataCurrency);
            // this.state.dataCurrency.map(item => {
            //     let index = this.state.currency.findIndex((val) => val.id == item.id)
            //     console.log(index);
            //     finalCurrency.push({
            //         "currency_id" : item.id,
            //         "status" : index == 0 || index == 1 ? true : false
            //     })
            // })

368

faisalhamdi's avatar
faisalhamdi committed
369 370 371 372
            let payload = {
                "company_id": this.state.companyID,
                "company_name": this.state.company,
                "business_unit_id": this.state.getTypes.business_unit_id,
faisalhamdi's avatar
faisalhamdi committed
373 374
                // "parent": this.state.getPerusahaan == null ? null : this.state.getPerusahaan.company_id,
                "parent": this.state.getPerusahaan.company_id,
faisalhamdi's avatar
faisalhamdi committed
375
                "start_date": this.state.startDate,
376
                "end_date": this.state.endDate,
Riri Novita's avatar
Riri Novita committed
377 378
                "currency": currencyID,
                "default_currency": this.state.defaultCurrency.id
faisalhamdi's avatar
faisalhamdi committed
379
            }
Riri Novita's avatar
Riri Novita committed
380
            console.log(payload);
Riri Novita's avatar
Riri Novita committed
381
            this.props.updatePerusahaan(payload)
faisalhamdi's avatar
faisalhamdi committed
382 383 384
        }
    }

faisalhamdi's avatar
faisalhamdi committed
385
    validasi() {
Riri Novita's avatar
Riri Novita committed
386
        console.log(this.state.currency.length);
faisalhamdi's avatar
faisalhamdi committed
387
        if (R.isEmpty(this.state.company)) {
388
            this.setState({ errorNP: true, msgErrorNP: 'Company Name Cannot be Empty.' })
a.bairuha's avatar
a.bairuha committed
389
        } else if (R.isNil(this.state.getTypes)) {
Riri Novita's avatar
Riri Novita committed
390 391 392 393 394 395 396
            this.setState({ errorUB: true, msgErrorUB: 'Business Unit Cannot be Empty' })
        } else if (R.isNil(this.state.getPerusahaan)) {
            this.setState({ errorPC: true, msgErrorPC: 'Parent Company Cannot be Empty' })
        } else if (this.state.currency.length === 0) {
            this.setState({ errorCur: true, msgErrorCur: 'Currency Cannot be Empty' })
        } else if (R.isNil(this.state.defaultCurrency)) {
            this.setState({ errorDefCur: true, msgErrorDefCur: 'Default Currency Cannot be Empty' })
faisalhamdi's avatar
faisalhamdi committed
397
        } else if (R.isNil(this.state.startDate)) {
398
            this.setState({ errorSD: true, msgErrorSD: 'Valid From Cannot be Empty.' })
faisalhamdi's avatar
faisalhamdi committed
399
        } else if (R.isNil(this.state.endDate)) {
400
            this.setState({ errorED: true, msgErrorED: 'Valid To Cannot be Empty.' })
Deni Rinaldi's avatar
Deni Rinaldi committed
401
        }
a.bairuha's avatar
a.bairuha committed
402
        else {
403 404 405 406 407 408
            let currencyID = []
            if (this.state.currency.length > 0) {
                this.state.currency.map(item => {
                    currencyID.push(item.id)
                })
            }
faisalhamdi's avatar
faisalhamdi committed
409 410
            let payload = {
                "company_name": this.state.company,
faisalhamdi's avatar
faisalhamdi committed
411 412
                // "parent": this.state.getPerusahaan == null ? null : this.state.getPerusahaan.company_id,
                "parent": this.state.getPerusahaan.company_id,
faisalhamdi's avatar
faisalhamdi committed
413 414
                "business_unit_id": this.state.getTypes.business_unit_id,
                "start_date": this.state.startDate,
415
                "end_date": this.state.endDate,
Riri Novita's avatar
Riri Novita committed
416
                "currency": currencyID,
417
                "default_currency": this.state.defaultCurrency.id,
faisalhamdi's avatar
faisalhamdi committed
418
            }
419
            // console.log(payload);
faisalhamdi's avatar
faisalhamdi committed
420
            this.props.createPerusahaan(payload)
faisalhamdi's avatar
faisalhamdi committed
421
        }
422 423
    }

faisalhamdi's avatar
faisalhamdi committed
424 425 426 427
    closeAlert() {
        this.setState({ alert: false })
    }

faisalhamdi's avatar
faisalhamdi committed
428
    renderEdit() {
429
        return (
faisalhamdi's avatar
faisalhamdi committed
430
            <div className="test app-popup-show">
faisalhamdi's avatar
faisalhamdi committed
431 432 433 434 435
                <Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
                    <Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
                        {this.state.messageAlert}
                    </Alert>
                </Snackbar>
436
                <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
faisalhamdi's avatar
faisalhamdi committed
437
                    <div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
438 439
                        <div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
                            <div className="popup-title">
faisalhamdi's avatar
faisalhamdi committed
440
                                <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Edit Data</span>
441 442 443 444 445 446 447 448
                            </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()}
                            >
Deni Rinaldi's avatar
Deni Rinaldi committed
449
                                <img src={Images.close} />
450 451 452 453 454
                            </button>
                        </div>
                    </div>


Deni Rinaldi's avatar
Deni Rinaldi committed
455
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: 20 }}>
456
                        <div className="column-1">
faisalhamdi's avatar
faisalhamdi committed
457 458 459
                            <div style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
                                <TextField
                                    style={{ width: '100%' }}
faisalhamdi's avatar
faisalhamdi committed
460
                                    value={this.state.companyID}
faisalhamdi's avatar
faisalhamdi committed
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
                                    id="id"
                                    label="ID"
                                    disabled
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
                                />
                            </div>
faisalhamdi's avatar
faisalhamdi committed
477
                            <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
478 479 480 481
                                <Autocomplete
                                    {...this.state.types}
                                    debug
                                    id="tipe"
Deni Rinaldi's avatar
Deni Rinaldi committed
482 483 484 485 486 487 488 489 490 491
                                    onChange={(event, newInputValue) => this.setState({ getTypes: newInputValue }, () => this.clearError())}
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                            label="Business Unit"
                                            error={this.state.errorUB}
                                            helperText={this.state.msgErrorUB}
                                        />
a.bairuha's avatar
a.bairuha committed
492
                                    }
493 494
                                    value={this.state.getTypes}
                                />
faisalhamdi's avatar
faisalhamdi committed
495
                            </div>
496 497 498 499 500
                            <div style={{ padding: 10, borderRadius: 5 }}>
                                <Autocomplete
                                    multiple
                                    options={this.state.dataCurrency}
                                    getOptionLabel={(option) => option.value}
Riri Novita's avatar
Riri Novita committed
501
                                    getOptionSelected={(option, value) => option.id === value.id}
502 503 504 505 506 507 508 509 510
                                    onChange={(event, newInputValue) => {
                                        let findIdx = newInputValue.findIndex(e => e.id === 2)
                                        let bizpar = findIdx >= 0 ? this.state.dataCurrency.filter(e => e.id === 2) : newInputValue
                                        this.setState({
                                            optionCurrecy: bizpar,
                                            currency: newInputValue
                                        }, () => {
                                            if (this.state.defaultCurrency) {
                                                const result = this.state.currency.find((elem) => elem.id === this.state.defaultCurrency.id)
511
                                                this.setState({ defaultCurrency: "" })
512 513 514

                                            }
                                        })
Riri Novita's avatar
Riri Novita committed
515
                                        this.clearError()
516
                                    }}
517 518 519 520 521 522 523 524 525
                                    renderInput={(params) => (
                                        <TextField
                                            {...params}
                                            variant="standard"
                                            label="Currency"
                                            margin="normal"
                                            style={{ marginTop: 0 }}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
Riri Novita's avatar
Riri Novita committed
526 527
                                            error={this.state.errorCur}
                                            helperText={this.state.msgErrorCur}
528 529 530 531 532
                                        />
                                    )}
                                    value={this.state.currency}
                                />
                            </div>
faisalhamdi's avatar
faisalhamdi committed
533 534 535 536
                            <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
                                <DatePicker
                                    margin="normal"
                                    id="startDate"
537
                                    label="Valid From"
faisalhamdi's avatar
faisalhamdi committed
538
                                    format="dd-MM-yyyy"
faisalhamdi's avatar
faisalhamdi committed
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582
                                    value={this.state.startDate}
                                    onChange={(e) => this.handleChange(e, 'start_date')}
                                    KeyboardButtonProps={{
                                        'aria-label': 'change date',
                                    }}
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
                                    error={this.state.errorSD}
                                    helperText={this.state.msgErrorSD}
                                    style={{ padding: 0, margin: 0, width: '100%' }}
                                />
                            </div>
                            <div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
                                <TextField
                                    style={{ width: '100%' }}
                                    value={this.state.status}
                                    id="status"
                                    label="Status"
                                    disabled
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
                                />
                            </div>
                        </div>

                        <div className="column-2">
faisalhamdi's avatar
faisalhamdi committed
583
                            <div style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
584 585 586
                                <TextField
                                    style={{ width: '100%' }}
                                    id="perusahaan"
faisalhamdi's avatar
faisalhamdi committed
587
                                    label="Company Name"
faisalhamdi's avatar
faisalhamdi committed
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
                                    value={this.state.company}
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
                                    error={this.state.errorNP}
                                    helperText={this.state.msgErrorNP}
                                    onChange={(e) => this.setState({ company: e.target.value }, () => this.clearError())}
                                >
                                </TextField>
                            </div>
                            <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
607
                                <Autocomplete
faisalhamdi's avatar
faisalhamdi committed
608 609 610
                                    {...this.state.perusahaan}
                                    debug
                                    id="tipe"
Deni Rinaldi's avatar
Deni Rinaldi committed
611 612 613 614 615 616 617 618 619 620
                                    onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue }, () => this.clearError())}
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            label="Parent Company"
                                            error={this.state.errorPC}
                                            helperText={this.state.msgErrorPC}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                        />
faisalhamdi's avatar
faisalhamdi committed
621
                                    }
faisalhamdi's avatar
faisalhamdi committed
622 623 624
                                    value={this.state.getPerusahaan}
                                />
                            </div>
625 626 627 628
                            <div style={{ padding: 10, borderRadius: 5 }}>
                                <Autocomplete
                                    debug
                                    id="tipe"
629
                                    options={this.state.optionCurrecy}
630 631 632 633 634 635 636 637 638 639 640 641
                                    getOptionLabel={(option) => option.value}
                                    value={this.state.defaultCurrency}
                                    disableClearable={!this.state.defaultCurrency}
                                    onChange={(event, newInputValue) => this.setState({ defaultCurrency: newInputValue }, () => this.clearError())}
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            label="Default Currency"
                                            margin="normal"
                                            style={{ marginTop: 7 }}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
Riri Novita's avatar
Riri Novita committed
642 643
                                            error={this.state.errorDefCur}
                                            helperText={this.state.msgErrorDefCur}
644 645 646 647 648
                                        />
                                    }

                                />
                            </div>
faisalhamdi's avatar
faisalhamdi committed
649 650 651 652
                            <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
                                <DatePicker
                                    margin="normal"
                                    id="endDate"
653
                                    label="Valid To"
faisalhamdi's avatar
faisalhamdi committed
654
                                    format="dd-MM-yyyy"
faisalhamdi's avatar
faisalhamdi committed
655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679
                                    value={this.state.endDate}
                                    minDate={this.state.startDate}
                                    onChange={(e) => this.handleChange(e, 'end_date')}
                                    KeyboardButtonProps={{
                                        'aria-label': 'change date',
                                    }}
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
                                    style={{ padding: 0, margin: 0, width: '100%' }}
                                    error={this.state.errorED}
                                    helperText={this.state.msgErrorED}
                                />
                            </div>
                        </div>
                    </div>

Deni Rinaldi's avatar
Deni Rinaldi committed
680 681 682 683 684 685 686 687 688 689 690
                    <div className="border-bottom margin-top-10px" style={{ padding: '0px 20px 20px 20px', borderRadius: 5 }}>
                        <div style={{ display: 'flex' }}>
                            <Typography style={{ fontSize: 11, width: '12%' }}>Created By</Typography>
                            <Typography style={{ fontSize: 11 }}>: {this.state.created}</Typography>
                        </div>
                        <div style={{ display: 'flex' }}>
                            <Typography style={{ fontSize: 11, width: '12%' }}>Updated By</Typography>
                            <Typography style={{ fontSize: 11 }}>: {this.state.updated}</Typography>
                        </div>
                    </div>

faisalhamdi's avatar
faisalhamdi committed
691 692 693 694 695 696 697
                    <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' }}>
faisalhamdi's avatar
faisalhamdi committed
698
                                    <span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
faisalhamdi's avatar
faisalhamdi committed
699 700 701 702 703 704 705 706 707
                                </div>
                            </button>
                        </div>
                        <div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
                            <button
                                type="button"
                                onClick={() => this.validasiEdit()}
                            >
                                <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
faisalhamdi's avatar
faisalhamdi committed
708
                                    <span style={{ color: '#fff', fontSize: 11 }}>Save</span>
faisalhamdi's avatar
faisalhamdi committed
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733
                                </div>
                            </button>
                        </div>
                    </div>
                </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 main-color" style={{ 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()}
                            >
Deni Rinaldi's avatar
Deni Rinaldi committed
734
                                <img src={Images.close} />
faisalhamdi's avatar
faisalhamdi committed
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759
                            </button>
                        </div>
                    </div>


                    <div className="border-bottom grid grid-2x grid-mobile-none gap-15px" style={{ padding: 20 }}>
                        <div className="column-1">
                            <div style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
                                <TextField
                                    style={{ width: '100%' }}
                                    id="id"
                                    label="ID"
                                    disabled
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
                                />
760
                            </div>
faisalhamdi's avatar
faisalhamdi committed
761 762 763 764 765
                            <div style={{ padding: 10, borderRadius: 5 }}>
                                <Autocomplete
                                    {...this.state.types}
                                    debug
                                    id="tipe"
Deni Rinaldi's avatar
Deni Rinaldi committed
766 767 768 769 770 771 772 773 774 775 776 777
                                    onChange={(event, newInputValue) => this.setState({ getTypes: newInputValue }, () => this.clearError())}
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            label="Business Unit"
                                            margin="normal"
                                            style={{ marginTop: 7 }}
                                            error={this.state.errorUB}
                                            helperText={this.state.msgErrorUB}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                        />
faisalhamdi's avatar
faisalhamdi committed
778 779 780 781
                                    }
                                    value={this.state.types}

                                />
Deni Rinaldi's avatar
Deni Rinaldi committed
782
                            </div>
Riri Novita's avatar
Riri Novita committed
783 784 785
                            <div style={{ padding: 10, borderRadius: 5 }}>
                                <Autocomplete
                                    multiple
786 787
                                    options={this.state.dataCurrency}
                                    getOptionLabel={(option) => option.value}
Riri Novita's avatar
Riri Novita committed
788 789 790 791 792 793 794 795 796 797 798 799 800 801
                                    renderInput={(params) => (
                                        <TextField
                                            {...params}
                                            variant="standard"
                                            label="Currency"
                                            margin="normal"
                                            style={{ marginTop: 0 }}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                            error={this.state.errorCur}
                                            helperText={this.state.msgErrorCur}
                                        />
                                    )}
                                    value={this.state.currency}
802 803 804 805 806 807 808 809 810
                                    onChange={(event, newInputValue) => {
                                        let findIdx = newInputValue.findIndex(e => e.id === 2)
                                        let bizpar = findIdx >= 0 ? this.state.dataCurrency.filter(e => e.id === 2) : newInputValue
                                        this.setState({
                                            optionCurrecy: bizpar,
                                            currency: newInputValue
                                        }, () => {
                                            if (this.state.defaultCurrency) {
                                                const result = this.state.currency.find((elem) => elem.id === this.state.defaultCurrency.id)
811
                                                this.setState({ defaultCurrency: "" })
812 813

                                            }
Riri Novita's avatar
Riri Novita committed
814
                                            this.clearError()
815 816
                                        })
                                    }}
Riri Novita's avatar
Riri Novita committed
817 818
                                />
                            </div>
faisalhamdi's avatar
faisalhamdi committed
819 820 821 822
                            <div style={{ padding: 10, borderRadius: 5 }}>
                                <DatePicker
                                    margin="normal"
                                    id="startDate"
823
                                    label="Valid From"
faisalhamdi's avatar
faisalhamdi committed
824
                                    format="dd-MM-yyyy"
faisalhamdi's avatar
faisalhamdi committed
825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844
                                    value={this.state.startDate == "" ? null : this.state.startDate}
                                    onChange={(e) => this.handleChange(e, 'start_date')}
                                    KeyboardButtonProps={{
                                        'aria-label': 'change date',
                                    }}
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}

                                    style={{ padding: 0, margin: 0, width: '100%' }}
                                />
                            </div>
faisalhamdi's avatar
faisalhamdi committed
845
                            <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5, backgroundColor: '#e8e8e8', }}>
846 847
                                <TextField
                                    style={{ width: '100%' }}
faisalhamdi's avatar
faisalhamdi committed
848
                                    defaultValue={"Active"}
849 850 851
                                    id="status"
                                    label="Status"
                                    disabled
faisalhamdi's avatar
faisalhamdi committed
852 853 854 855 856 857 858 859 860 861 862
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
863 864 865
                                />
                            </div>

faisalhamdi's avatar
faisalhamdi committed
866
                            <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
867 868
                                <Typography style={{ fontSize: 11, width: '25%' }}>Created By : </Typography>
                                <Typography style={{ fontSize: 11, width: '25%' }}>Updated By : </Typography>
869 870 871 872
                            </div>
                        </div>

                        <div className="column-2">
faisalhamdi's avatar
faisalhamdi committed
873
                            <div style={{ padding: 10, borderRadius: 5 }}>
874 875
                                <TextField
                                    style={{ width: '100%' }}
faisalhamdi's avatar
faisalhamdi committed
876
                                    id="perusahaan"
faisalhamdi's avatar
faisalhamdi committed
877
                                    label="Company Name"
faisalhamdi's avatar
faisalhamdi committed
878
                                    value={this.state.company}
faisalhamdi's avatar
faisalhamdi committed
879 880 881 882 883 884 885 886 887 888 889
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
faisalhamdi's avatar
faisalhamdi committed
890 891 892
                                    error={this.state.errorNP}
                                    helperText={this.state.msgErrorNP}
                                    onChange={(e) => this.setState({ company: e.target.value }, () => this.clearError())}
893 894 895
                                >
                                </TextField>
                            </div>
faisalhamdi's avatar
faisalhamdi committed
896
                            <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
897 898 899 900
                                <Autocomplete
                                    {...this.state.perusahaan}
                                    debug
                                    id="tipe"
Deni Rinaldi's avatar
Deni Rinaldi committed
901 902 903 904 905 906 907 908 909 910
                                    onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue }, () => this.clearError())}
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            label="Parent Company"
                                            error={this.state.errorPC}
                                            helperText={this.state.msgErrorPC}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                        />
faisalhamdi's avatar
faisalhamdi committed
911 912
                                    }
                                    value={this.state.perusahaan}
913
                                />
faisalhamdi's avatar
faisalhamdi committed
914
                            </div>
915

Riri Novita's avatar
Riri Novita committed
916 917 918 919
                            <div style={{ padding: 10, borderRadius: 5 }}>
                                <Autocomplete
                                    debug
                                    id="tipe"
920
                                    options={this.state.optionCurrecy}
921 922 923 924
                                    getOptionLabel={(option) => option.value}
                                    value={this.state.defaultCurrency}
                                    disableClearable={!this.state.defaultCurrency}
                                    onChange={(event, newInputValue) => this.setState({ defaultCurrency: newInputValue }, () => this.clearError())}
Riri Novita's avatar
Riri Novita committed
925 926 927 928 929 930 931 932
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            label="Default Currency"
                                            margin="normal"
                                            style={{ marginTop: 7 }}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
Riri Novita's avatar
Riri Novita committed
933 934
                                            error={this.state.errorDefCur}
                                            helperText={this.state.msgErrorDefCur}
Riri Novita's avatar
Riri Novita committed
935 936 937 938 939
                                        />
                                    }

                                />
                            </div>
faisalhamdi's avatar
faisalhamdi committed
940
                            <div style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
941 942 943
                                <DatePicker
                                    margin="normal"
                                    id="endDate"
944
                                    label="Valid To"
faisalhamdi's avatar
faisalhamdi committed
945
                                    format="dd-MM-yyyy"
faisalhamdi's avatar
faisalhamdi committed
946 947
                                    error={this.state.errorED}
                                    helperText={this.state.msgErrorED}
948
                                    minDate={this.state.startDate}
faisalhamdi's avatar
faisalhamdi committed
949
                                    value={this.state.endDate}
faisalhamdi's avatar
faisalhamdi committed
950 951 952 953
                                    onChange={(e) => this.handleChange(e, 'end_date')}
                                    KeyboardButtonProps={{
                                        'aria-label': 'change date',
                                    }}
faisalhamdi's avatar
faisalhamdi committed
954 955 956 957 958 959 960 961 962 963 964
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
faisalhamdi's avatar
faisalhamdi committed
965 966 967

                                    style={{ padding: 0, margin: 0, width: '100%' }}
                                />
968 969 970 971 972 973 974
                            </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' }}>
faisalhamdi's avatar
faisalhamdi committed
975 976 977 978 979
                            <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' }}>
faisalhamdi's avatar
faisalhamdi committed
980
                                    <span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
faisalhamdi's avatar
faisalhamdi committed
981 982
                                </div>
                            </button>
983 984
                        </div>
                        <div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
faisalhamdi's avatar
faisalhamdi committed
985 986 987 988 989
                            <button
                                type="button"
                                onClick={() => this.validasi()}
                            >
                                <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
faisalhamdi's avatar
faisalhamdi committed
990
                                    <span style={{ color: '#fff', fontSize: 11 }}>Save</span>
faisalhamdi's avatar
faisalhamdi committed
991 992
                                </div>
                            </button>
993 994 995 996 997 998 999
                        </div>
                    </div>
                </div>
            </div>
        );
    }
}