StrategiMap.js 15.5 KB
Newer Older
Deni Rinaldi's avatar
Deni Rinaldi committed
1
import React, { Component } from 'react'
d.arizona's avatar
d.arizona committed
2
// import { Paper, Typography } from '@material-ui/core'
Deni Rinaldi's avatar
Deni Rinaldi committed
3
import Images from '../../assets/Images'
d.arizona's avatar
d.arizona committed
4
import { GridList, Paper, Typography, GridListTile, FormControl, FormControlLabel, Radio } from '@material-ui/core'
Deni Rinaldi's avatar
Deni Rinaldi committed
5 6

export default class StrategiMap extends Component {
d.arizona's avatar
d.arizona committed
7 8 9
    constructor(props) {
        super(props)
        this.state = {
d.arizona's avatar
d.arizona committed
10 11
            dataStrategy: this.props.data.strategy_map.category,
            radioValue: true
d.arizona's avatar
d.arizona committed
12 13 14 15 16 17 18 19
        }
    }

    componentDidMount() {
        console.log(this.props.data.strategy_map);

    }

Deni Rinaldi's avatar
Deni Rinaldi committed
20 21 22
    render() {
        return (
            <div style={{ padding: 20 }}>
d.arizona's avatar
d.arizona committed
23
                <div style={{ display: 'flex' }}>
d.arizona's avatar
d.arizona committed
24
                    <FormControl component="fieldset">
d.arizona's avatar
d.arizona committed
25
                        <FormControlLabel value="end" control={<Radio color="primary" checked={this.state.radioValue} onClick={() => this.setState({ radioValue: true })} />} label="Actual vs Prev. Month" />
d.arizona's avatar
d.arizona committed
26 27
                    </FormControl>
                    <FormControl component="fieldset">
d.arizona's avatar
d.arizona committed
28
                        <FormControlLabel value="end" control={<Radio color="primary" checked={!this.state.radioValue} onClick={() => this.setState({ radioValue: false })} />} label="YOY" />
d.arizona's avatar
d.arizona committed
29 30
                    </FormControl>
                </div>
d.arizona's avatar
d.arizona committed
31
                <Paper style={{ borderRadius: 10, boxShadow: '0 0 4px 0 rgba(0, 0, 0, 0.5)', width: '100%' }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
32 33 34 35 36 37 38 39
                    <div style={{ height: 56, borderTopLeftRadius: 10, borderTopRightRadius: 10, backgroundColor: '#f1f1f1', display: 'flex' }}>
                        <div style={{ width: '25%', borderRight: 'solid 1px #d8d8d8', display: 'grid', alignContent: 'center', paddingLeft: 20 }}>
                            <Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 12 }}>Category</Typography>
                        </div>
                        <div style={{ width: '75%', borderRight: 'solid 1px #d8d8d8', display: 'grid', alignContent: 'center', paddingLeft: 20 }}>
                            <Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 12 }}>KPI</Typography>
                        </div>
                    </div>
d.arizona's avatar
d.arizona committed
40 41 42 43 44 45 46

                    {this.state.dataStrategy.map((item, index) => {
                        return (
                            <div style={{ display: 'flex' }}>
                                <div style={{ width: '25%', borderRight: 'solid 1px #d8d8d8', display: 'grid', paddingLeft: 20, paddingTop: 20 }}>
                                    <div style={{ borderBottom: 'solid 1px #d8d8d8' }}>
                                        <Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 14, fontFamily: 'Nunito Sans, sans-serif' }}>{item.category_name}</Typography>
Deni Rinaldi's avatar
Deni Rinaldi committed
47 48
                                    </div>
                                </div>
d.arizona's avatar
d.arizona committed
49 50 51
                                <div style={{ width: '75%', borderRight: 'solid 1px #d8d8d8', paddingRight: 20 }}>
                                    <div style={{ display: 'flex', alignContent: 'center', padding: 20, borderBottom: 'solid 1px #d8d8d8' }}>
                                        <GridList cellHeight={100} cols={3}>
d.arizona's avatar
d.arizona committed
52 53 54 55 56 57 58 59 60 61
                                            {item.nodes.length < 1 ?
                                                <div style={{ height: 75 }} />
                                                :
                                                item.nodes.map((items, indexs) => {
                                                    return (
                                                        <GridListTile key={items} cols={item.nodes.length == 1 ? 3 : item.nodes.length == 2 ? 2 : 1} style={{}}>
                                                            <div style={{ display: 'flex', minWidth: 220, borderRadius: 6, marginLeft: 10 }}>
                                                                <div style={{ display: 'grid', alignContent: 'center', backgroundColor: '#6885a6', width: 155, borderTopLeftRadius: 6, borderBottomLeftRadius: 6, padding: 10 }}>
                                                                    <Typography style={{ color: '#fff', fontSize: 12, textAlign: 'center' }}>{items.item_name}</Typography>
                                                                </div>
d.arizona's avatar
d.arizona committed
62
                                                                <div style={{ backgroundColor: this.state.radioValue ? (items.is_higher_actual == '-' ? '#d8d8d8' : (items.is_higher_actual == 'true' ? '#cbf4a8' : '#faaaaa')) : (items.is_higher_yoy == '-' ? '#d8d8d8' : (items.is_higher_yoy == 'true' ? '#cbf4a8' : '#faaaaa')), width: 68, borderTopRightRadius: 6, borderBottomRightRadius: 6, textAlign: 'center', paddingTop: 10, paddingBottom: 10 }}>
d.arizona's avatar
d.arizona committed
63 64 65 66 67
                                                                    {items.is_higher_actual == '-' ?
                                                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'-'}</Typography>
                                                                        :
                                                                        <img src={this.state.radioValue ? (items.is_higher_actual == 'true' ? Images.up : Images.down) : (items.is_higher_yoy == 'true' ? Images.up : Images.down)} />
                                                                    }
d.arizona's avatar
d.arizona committed
68
                                                                    <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'vs'}</Typography>
d.arizona's avatar
d.arizona committed
69
                                                                    <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{this.state.radioValue ? 'Last Month' : 'YOY'}</Typography>
d.arizona's avatar
d.arizona committed
70
                                                                </div>
d.arizona's avatar
d.arizona committed
71
                                                            </div>
d.arizona's avatar
d.arizona committed
72 73 74
                                                        </GridListTile>
                                                    )
                                                })}
d.arizona's avatar
d.arizona committed
75
                                        </GridList>
Deni Rinaldi's avatar
Deni Rinaldi committed
76 77 78
                                    </div>
                                </div>
                            </div>
d.arizona's avatar
d.arizona committed
79 80
                        )
                    })}
Deni Rinaldi's avatar
Deni Rinaldi committed
81

d.arizona's avatar
d.arizona committed
82
                    {/* <div style={{ display: 'flex' }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 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
                        <div style={{ width: '25%', borderRight: 'solid 1px #d8d8d8', display: 'grid', paddingLeft: 20, paddingTop: 20 }}>
                            <div style={{ borderBottom: 'solid 1px #d8d8d8' }}>
                                <Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 14, fontFamily: 'Nunito Sans, sans-serif' }}>Customer Perspective</Typography>
                            </div>
                        </div>
                        <div style={{ width: '75%', borderRight: 'solid 1px #d8d8d8', paddingRight: 20 }}>
                            <div style={{ display: 'flex', alignContent: 'center', padding: 20, borderBottom: 'solid 1px #d8d8d8' }}>
                                <div style={{ display: 'flex', width: 220, borderRadius: 6 }}>
                                    <div style={{ display: 'grid', alignContent: 'center', backgroundColor: '#6885a6', width: 152, borderTopLeftRadius: 6, borderBottomLeftRadius: 6 }}>
                                        <Typography style={{ color: '#fff', fontSize: 12, justifySelf: 'center' }}>Part Service Rate</Typography>
                                    </div>
                                    <div style={{ backgroundColor: '#cbf4a8', width: 68, borderTopRightRadius: 6, borderBottomRightRadius: 6, textAlign: 'center', paddingTop: 10, paddingBottom: 10 }}>
                                        <img src={Images.up} />
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'vs'}</Typography>
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'Last Month'}</Typography>
                                    </div>
                                </div>
                                <div style={{ display: 'flex', width: 220, borderRadius: 6, marginLeft: 20 }}>
                                    <div style={{ display: 'grid', alignContent: 'center', backgroundColor: '#6885a6', width: 152, borderTopLeftRadius: 6, borderBottomLeftRadius: 6 }}>
                                        <Typography style={{ color: '#fff', fontSize: 12, textAlign: 'center' }}>CSI (Customer Satisfactiomn Index)</Typography>
                                    </div>
                                    <div style={{ backgroundColor: '#fffba5', width: 68, borderTopRightRadius: 6, borderBottomRightRadius: 6, textAlign: 'center', paddingTop: 10, paddingBottom: 10 }}>
                                        <img src={Images.down} />
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'vs'}</Typography>
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'Last Month'}</Typography>
                                    </div>
                                </div>
                                <div style={{ display: 'flex', width: 220, borderRadius: 6, marginLeft: 20 }}>
                                    <div style={{ display: 'grid', alignContent: 'center', backgroundColor: '#6885a6', width: 152, borderTopLeftRadius: 6, borderBottomLeftRadius: 6 }}>
                                        <Typography style={{ color: '#fff', fontSize: 12, justifySelf: 'center' }}>Dealer Productivity</Typography>
                                    </div>
                                    <div style={{ backgroundColor: '#faaaaa', width: 68, borderTopRightRadius: 6, borderBottomRightRadius: 6, textAlign: 'center', paddingTop: 10, paddingBottom: 10 }}>
                                        <img src={Images.down} />
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'vs'}</Typography>
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'Last Month'}</Typography>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div style={{ display: 'flex' }}>
                        <div style={{ width: '25%', borderRight: 'solid 1px #d8d8d8', display: 'grid', paddingLeft: 20, paddingTop: 20 }}>
                            <div style={{ borderBottom: 'solid 1px #d8d8d8' }}>
                                <Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 14, fontFamily: 'Nunito Sans, sans-serif' }}>INTERNAL BUSINESS PROCESS PERSPECTIVE</Typography>
                            </div>
                        </div>
                        <div style={{ width: '75%', borderRight: 'solid 1px #d8d8d8', paddingRight: 20 }}>
                            <div style={{ display: 'flex', alignContent: 'center', padding: 20, borderBottom: 'solid 1px #d8d8d8' }}>
                                <div style={{ display: 'flex', width: 220, borderRadius: 6 }}>
                                    <div style={{ display: 'grid', alignContent: 'center', backgroundColor: '#6885a6', width: 152, borderTopLeftRadius: 6, borderBottomLeftRadius: 6 }}>
                                        <Typography style={{ color: '#fff', fontSize: 12, textAlign: 'center' }}>NSI (Network Satisfaction Index)</Typography>
                                    </div>
                                    <div style={{ backgroundColor: '#cbf4a8', width: 68, borderTopRightRadius: 6, borderBottomRightRadius: 6, textAlign: 'center', paddingTop: 10, paddingBottom: 10 }}>
                                        <img src={Images.up} />
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'vs'}</Typography>
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'Last Month'}</Typography>
                                    </div>
                                </div>
                                <div style={{ display: 'flex', width: 220, borderRadius: 6, marginLeft: 20 }}>
                                    <div style={{ display: 'grid', alignContent: 'center', backgroundColor: '#6885a6', width: 152, borderTopLeftRadius: 6, borderBottomLeftRadius: 6 }}>
                                        <Typography style={{ color: '#fff', fontSize: 12, textAlign: 'center' }}>DEP (Dealer Evaluation Program)</Typography>
                                    </div>
                                    <div style={{ backgroundColor: '#cbf4a8', width: 68, borderTopRightRadius: 6, borderBottomRightRadius: 6, textAlign: 'center', paddingTop: 10, paddingBottom: 10 }}>
                                        <img src={Images.up} />
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'vs'}</Typography>
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'Last Month'}</Typography>
                                    </div>
                                </div>
                                <div style={{ display: 'flex', width: 220, borderRadius: 6, marginLeft: 20 }}>
                                    <div style={{ display: 'grid', alignContent: 'center', backgroundColor: '#6885a6', width: 152, borderTopLeftRadius: 6, borderBottomLeftRadius: 6 }}>
                                        <Typography style={{ color: '#fff', fontSize: 12, textAlign: 'center' }}>AEP  (AHASS Evaluation Program)</Typography>
                                    </div>
                                    <div style={{ backgroundColor: '#cbf4a8', width: 68, borderTopRightRadius: 6, borderBottomRightRadius: 6, textAlign: 'center', paddingTop: 10, paddingBottom: 10 }}>
                                        <img src={Images.up} />
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'vs'}</Typography>
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'Last Month'}</Typography>
                                    </div>
                                </div>
                                <div style={{ display: 'flex', width: 220, borderRadius: 6, marginLeft: 20 }}>
                                    <div style={{ display: 'grid', alignContent: 'center', backgroundColor: '#6885a6', width: 152, borderTopLeftRadius: 6, borderBottomLeftRadius: 6 }}>
                                        <Typography style={{ color: '#fff', fontSize: 12, justifySelf: 'center' }}>TPAT</Typography>
                                    </div>
                                    <div style={{ backgroundColor: '#faaaaa', width: 68, borderTopRightRadius: 6, borderBottomRightRadius: 6, textAlign: 'center', paddingTop: 10, paddingBottom: 10 }}>
                                        <img src={Images.down} />
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'vs'}</Typography>
                                        <Typography style={{ color: '#4b4b4b', fontSize: 10, textAlign: 'center' }}>{'Last Month'}</Typography>
                                    </div>
                                </div>
                            </div>
                        </div>
d.arizona's avatar
d.arizona committed
174
                    </div> */}
Deni Rinaldi's avatar
Deni Rinaldi committed
175 176 177 178 179 180

                </Paper>
            </div>
        )
    }
}