import React from 'react'; import {inject, observer} from 'mobx-react'; import { Paper, SelectField, CardMedia, Card, CardText, CardTitle, Divider, MenuItem, RaisedButton, Toolbar, ToolbarGroup, ToolbarTitle, FlatButton, Dialog, TextField, DatePicker } from 'material-ui'; import AddIcon from 'material-ui/svg-icons/image/edit'; import moment from "moment"; import {Link} from 'react-router-dom'; import {LINKS} from "../../../routes"; import {DIALOG} from "../../../stores/global_ui"; import UpdateDialog from './UpdateDialog'; import IdentificationPassport from './../../Customers/CustomerDialog/IdentificationPassport'; // import './style.scss'; @inject('appstate') @observer export default class GeneralInformation extends React.Component { constructor(props) { super(props); this.props = props; this.customer = props.appstate.customer; this.state = { value: 1, searchText: '', slideIndex: 0, openedDialog:false, gender:this.customer.CustomerData.gender, marital:this.customer.CustomerData.martial_status, openedDialogPhoto:false }; this.defaultState = Object.assign({}, this.state); this.http = props.appstate.http; this.authStore = props.appstate.auth; this.globalUI = props.appstate.globalUI; } componentDidMount() { console.log('Profile loaded!'); } editData = (id) => { this.customer.update(id); this.setState({openedDialog: false}); this.setState({openedDialogPhoto: false}); }; handleOpenDialog = () => { this.setState({ openedDialog:true }); }; handleCloseDialog = () =>{ this.setState({ openedDialog:false }); } handleOpenPhoto = () => { this.setState({ openedDialogPhoto:true, oldPassportPhoto : this.customer.CustomerData.passport_photo, oldIdPhoto : this.customer.CustomerData.id_photo, }); console.log } handleClosePhoto = () =>{ this.setState({ openedDialogPhoto:false }); this.customer.CustomerData.passport_photo = this.state.oldPassportPhoto; this.customer.CustomerData.id_photo = this.state.oldIdPhoto; } handleUpdateInput = (searchText) => { this.setState({ searchText: searchText, }); }; handleNewRequest = () => { this.setState({ searchText: '', }); }; tabsHandleChange = (value) => { this.setState({ slideIndex: value, }); }; handleChange = (event, index, value) => this.setState({value}); handleChangeName = (event) =>{ this.customer.CustomerData.name = event.target.value; }; handleChangeEmail = (event) =>{ this.customer.CustomerData.email = event.target.value; }; handleChangeDate = (event, value) =>{ this.customer.CustomerData.date_of_birth = value; }; handleChangeGender = (event, index, value) =>{ this.customer.CustomerData.gender = value; }; handleChangePassport = (event) =>{ this.customer.CustomerData.passport_number = event.target.value; }; handleChangeOccupation = (event) =>{ this.customer.CustomerData.occupation = event.target.value; }; handleChangeAddress = (event) =>{ this.customer.CustomerData.address = event.target.value; }; handleChangeBirthPlace = (event) =>{ this.customer.CustomerData.birth_place = event.target.value; }; handleChangePhone = (event) =>{ this.customer.CustomerData.phone = event.target.value; }; handleChangeHandphone = (event) =>{ this.customer.CustomerData.handphone = event.target.value; }; handleChangeMarital = (event, index, value) =>{ this.customer.CustomerData.martial_status = value; }; handleChangeTaxNumber = (event) =>{ this.customer.CustomerData.id_tax_number = event.target.value; }; handleChangeType = (event) =>{ this.customer.CustomerData.id_type = event.target.value; }; handleChangeNumber= (event) =>{ this.customer.CustomerData.id_number = event.target.value; }; render() { const styles = { radioButton: { marginBottom: 16, }, }; const gender = [ , , , ]; const marital_status = [ , , , , , ]; const actions = [ , this.editData(this.customer.CustomerData.id)} />, ]; const actionsPhoto = [ , this.editData(this.customer.CustomerData.id)} />, ]; return (
{this.customer.CustomerData.id}}/> } label="Edit" onClick={this.handleOpenDialog} primary={true}/>
ACCOUNT INFORMATION

}/>

ID

{this.customer.CustomerData.id}

Created

{moment(this.customer.CustomerData.created_at).format('DD MMMM YYYY, HH:mm:ss')}

Email

{this.customer.CustomerData.email}

Birth Place

{this.customer.CustomerData.birth_place}

Date of Birth

{moment(this.customer.CustomerData.date_of_birth).format('DD MMMM YYYY')}

Gender

{this.customer.CustomerData.gender}

Address

{this.customer.CustomerData.address}

Occupation

{this.customer.CustomerData.occupation}

Phone

{this.customer.CustomerData.phone}

Handphone

{this.customer.CustomerData.handphone}

Marital Status

{this.customer.CustomerData.martial_status}

ID Tax Number

{this.customer.CustomerData.id_tax_number}

ID Type

{this.customer.CustomerData.id_type}

ID Number

{this.customer.CustomerData.id_number}

Passport Number

{this.customer.CustomerData.passport_number}

Agent

{this.customer.CustomerData.agent} - {this.customer.CustomerData.agent_id}

} label="Edit" onClick={this.handleOpenPhoto} primary={true}/>
IDENTIFICATION

}/>
PASSPORT

}/>
this.handleCloseDialog()} >

Name

Email

Date of Birth

Gender

{gender}

Passport Number

Occupation

Address

Birth Place

Phone

Handphone

Marital Status

{marital_status}

ID Tax Number

ID Type

ID Number

this.handleClosePhoto()} >
) } }