import React from 'react'
import { Table, Row } from 'antd'
import Echarts from 'echarts-for-react'

const columns = [
    { title: '订单号', dataIndex: 'orderID', key: 'orderID', width:'100px' },
    { title: '订单状态', dataIndex: 'status', key: 'status', width:'100px' },
    { title: '客户名称', dataIndex: 'customerName', key: 'customerName', width:'100px'},
    { title: '进度', dataIndex: 'progress', key: 'progress', render: (item, record) => { return (<Echarts style={{ height: '50px', width:'90%' }} option={record.progress}/>)} },
];
const orderColumns = [
    { title: '工段', dataIndex: 'stage', key: 'orderID', width:'100px' },
    { title: '工厂', dataIndex: 'status', key: 'status', width:'100px' },
    { title: '工单号', dataIndex: 'taskID', key: 'taskID', width:'200px'},
    { title: '数量', dataIndex: 'amount', key: 'amount', width:'100px'},
    { title: '完工数', dataIndex: 'finished', key: 'finished', width:'100px'},
    { title: '生产状态', dataIndex: 'status', key: 'status', width:'100px'},
    { title: '发料数', dataIndex: 'amountSupplied', key: 'amountSupplied', width:'100px'},
    { title: '齐套数', dataIndex: 'setComplete', key: 'setComplete', width:'100px'},
    { title: '在途数', dataIndex: 'onWay', key: 'onWay', width:'100px'},
    { title: '未下达数', dataIndex: 'notOrdered', key: 'notOrdered', width:'100px'},
]
const BOMColumns = [
    { title: '序号', dataIndex: 'index', key: 'index', width:'100px' },
    { title: '物料号', dataIndex: 'materialID', key: 'materialID', width:'100px' },
    { title: '名称', dataIndex: 'name', key: 'name', width:'100px' },
    { title: '单位用量', dataIndex: 'APU', key: 'APU', width:'100px' },
    { title: '需求', dataIndex: 'demand', key: 'demand', width:'100px' },
    { title: '已发数', dataIndex: 'distributed', key: 'distributed', width:'100px' },
    { title: '未发数', dataIndex: 'notDistributed', key: 'notDistributed', width:'100px', render: (value, record) => {
        let style; if(value>0 && value > record.availableInStock){style={backgroundColor:'#fdd5b5'}}else{style={}} return <span style={style}>{value}</span>}},
    { title: '库存可用', dataIndex: 'availableInStock', key: 'availableInStock', width:'100px', render: (value, record) => {
        let style; if(value>0 && value < record.notDistributed){style={backgroundColor:'#fdd5b5'}}else{style={}} return <span style={style}>{value}</span>} },
    { title: '在途数', dataIndex: 'onWay', key: 'onWay', width:'100px' },
    { title: '交期回复', dataIndex: 'response', key: 'response', width:'200px' },
]

const stageData = [
    {
        key:1,
        stage:'包装',
        factory:'代工厂A',
        taskID:'MF18080031',
        amount: 1000,
        finished: 200,
        status:'生产中',
        amountSupplied: 500,
        setComplete: 800,
        onWay: 200,
        notOrdered:0
    },
    {
        key:2,
        stage:'组装',
        factory:'代工厂A',
        taskID:'MF18080032',
        amount: 1000,
        finished: 500,
        status:'生产中',
        amountSupplied: 1000,
        setComplete: 1000,
        onWay: 0,
        notOrdered:0
    },    
    {
        key:3,
        stage:'DIP',
        factory:'代工厂A',
        taskID:'MF18080033',
        amount: 1000,
        finished: 800,
        status:'生产中',
        amountSupplied: 1000,
        setComplete: 1000,
        onWay: 0,
        notOrdered:0
    },    {
        key:4,
        stage:'SMT',
        factory:'代工厂A',
        taskID:'MF18080034',
        amount: 1000,
        finished: 1000,
        status:'已完工',
        amountSupplied: 1000,
        setComplete: 1000,
        onWay: 0,
        notOrdered:0
    },
]
const data = [
    { key: 1, orderID: '0000001', status: '包装中', customerName: '客户1', 
        description: {
            packagingStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false,
                    max:'dataMax'
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false},
                    max: 'dataMax'
                },
                series: [
                    {
                        name: '库存齐套',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [400],
                        barWidth:40,
                        color: '#2bd54d',
                    },
                    {
                        name: '在途中',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        color: '#e6b600',
                        data: [200]
                    },
                    {
                        name: '请购下达',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [100]
                    },
                ]
            },
            assemblingStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false}
                },
                series: [
                    {
                        name: '工单齐套',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [360],
                        barWidth:40,
                        color: '#2bd54d',
                    },
            
                    {
                        name: '工单未齐套',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [840]
                    },
                ]
            },
            DIPStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false}
                },
                series: [
                    {
                        name: '已完成',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [340],
                        color: '#2bd54d',
                        barWidth:40
                    },
            
                    {
                        name: '生产中',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        color: '#e6b600',
                        data: [860]
                    },
                    {
                        name: '物料不足',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [300]
                    },
                ]
            },
            SMTStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false}
                },
                series: [
                    {
                        name: '已出货',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [400],
                        color: '#2bd54d',
                        barWidth:40
                    },
            
                    {
                        name: '待出货',
                        type: 'bar',
                        stack: '总量',
                        color: '#93b7e3',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [600]
                    },
                    {
                        name: '未完成',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [200]
                    },
                ]
            }
        },
        packingBOM: [
            {
                index:1,
                materialID:'DE221324',
                name:'电阻',
                APU:1,
                demand:1000,
                distributed:0,
                notDistributed:1000,
                availableInStock:800,
                onWay: 200,
                response:'8月2号可交货1000'

            },{
                index:2,
                materialID:'DE221325',
                name:'电阻',
                APU:1,
                demand:1000,
                distributed:1000,
                notDistributed:0,
                availableInStock:0,
                onWay: 0,
                response:'8月2号可交货1001'
            },{
                index:3,
                materialID:'DE221326',
                name:'电阻',
                APU:1,
                demand:1000,
                distributed:1000,
                notDistributed:0,
                availableInStock:0,
                onWay: 0,
                response:'8月2号可交货1002'
            },{
                index: 4,
                materialID: 'DE221327',
                name: '电阻',
                APU: 1,
                demand: 1000,
                distributed:0,
                notDistributed: 1000,
                availableInStock: 500,
                onWay: 500,
                response: '8月2号可交货1003'
            }, {
                index: 5,
                materialID: 'DE221328',
                name: '电阻',
                APU: 1,
                demand: 1000,
                distributed:0,
                notDistributed: 1000,
                availableInStock: 500,
                onWay: 500,
                response: '8月2号可交货1004'
            }          
        ],
        assemblingBOM: [],
        DIPBOM: [],
        SMTBOM: [],
        progress: {
            silent: true,
            grid: {
                top: 0,
                left: 0,
                right: 0,
                bottom: 0,
                width: '100%',
                containLabel: false
            },
            xAxis:  {
                type: 'value',
                show: false,
                max:'dataMax'
            },
            yAxis: {
                type: 'category',
                data: ['备料'],
                axisLine:{show: false},
                axisLabel: {show: false},
                axisTick: {show: false},
            },
            series: [
                {
                    name: '已出货',
                    type: 'bar',
                    stack: '总量',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    data: [400],
                    color: '#2bd54d',
                    barWidth:40
                },
                {
                    name: '成品库存',
                    type: 'bar',
                    stack: '总量',
                    color: '#93b7e3',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    data: [300]
                },
                {
                    name: '已投产',
                    type: 'bar',
                    stack: '总量',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    color: '#e6b600',
                    data: [100]
                },
                {
                    name: '未生产',
                    type: 'bar',
                    stack: '总量',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    data: [200]
                },
            ]
        }
    },
    { key: 2, orderID: '0000002', status: '包装中', customerName: '客户1', 
        description: {
            packagingStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false,
                    max:'dataMax'
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false},
                    max: 'dataMax'
                },
                series: [
                    {
                        name: '库存齐套',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [380],
                        barWidth:40,
                        color: '#2bd54d',
                    },
                    {
                        name: '在途中',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        color: '#e6b600',
                        data: [820]
                    },
                    {
                        name: '请购下达',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [300]
                    },
                ]
            },
            assemblingStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false}
                },
                series: [
                    {
                        name: '工单齐套',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [360],
                        barWidth:40,
                        color: '#2bd54d',
                    },
            
                    {
                        name: '工单未齐套',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [840]
                    },
                ]
            },
            DIPStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false}
                },
                series: [
                    {
                        name: '已完成',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [340],
                        color: '#2bd54d',
                        barWidth:40
                    },
            
                    {
                        name: '生产中',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        color: '#e6b600',
                        data: [860]
                    },
                    {
                        name: '物料不足',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [300]
                    },
                ]
            },
            SMTStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false}
                },
                series: [
                    {
                        name: '已出货',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [400],
                        color: '#2bd54d',
                        barWidth:40
                    },
            
                    {
                        name: '待出货',
                        type: 'bar',
                        stack: '总量',
                        color: '#93b7e3',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [600]
                    },
                    {
                        name: '未完成',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [200]
                    },
                ]
            }
        },
        packingBOM: [
            {
                index:1,
                materialID:'DE221324',
                name:'电阻',
                APU:1,
                demand:1000,
                distributed:0,
                notDistributed:1000,
                availableInStock:800,
                onWay: 200,
                response:'8月2号可交货1000'

            },{
                index:2,
                materialID:'DE221325',
                name:'电阻',
                APU:1,
                demand:1000,
                distributed:1000,
                notDistributed:0,
                availableInStock:0,
                onWay: 0,
                response:'8月2号可交货1001'
            },{
                index:3,
                materialID:'DE221326',
                name:'电阻',
                APU:1,
                demand:1000,
                distributed:1000,
                notDistributed:0,
                availableInStock:0,
                onWay: 0,
                response:'8月2号可交货1002'
            },{
                index: 4,
                materialID: 'DE221327',
                name: '电阻',
                APU: 1,
                demand: 1000,
                distributed:0,
                notDistributed: 1000,
                availableInStock: 500,
                onWay: 500,
                response: '8月2号可交货1003'
            }, {
                index: 5,
                materialID: 'DE221328',
                name: '电阻',
                APU: 1,
                demand: 1000,
                distributed:0,
                notDistributed: 1000,
                availableInStock: 500,
                onWay: 500,
                response: '8月2号可交货1004'
            }          
        ],
        assemblingBOM: [],
        DIPBOM: [],
        SMTBOM: [],
        progress: {
            silent: true,
            grid: {
                top: 0,
                left: 0,
                right: 0,
                bottom: 0,
                width: '100%',
                containLabel: false
            },
            xAxis:  {
                type: 'value',
                show: false,
                max:'dataMax'
            },
            yAxis: {
                type: 'category',
                data: ['备料'],
                axisLine:{show: false},
                axisLabel: {show: false},
                axisTick: {show: false},
            },
            series: [
                {
                    name: '已出货',
                    type: 'bar',
                    stack: '总量',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    data: [380],
                    color: '#2bd54d',
                    barWidth:40
                },
                {
                    name: '成品库存',
                    type: 'bar',
                    stack: '总量',
                    color: '#93b7e3',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    data: [200]
                },
                {
                    name: '已投产',
                    type: 'bar',
                    stack: '总量',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    color: '#e6b600',
                    data: [500]
                },
                {
                    name: '未生产',
                    type: 'bar',
                    stack: '总量',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    data: [300]
                },
            ]
        }
    },
    { key: 3, orderID: '0000003', status: '包装中', customerName: '客户1', 
        description: {
            packagingStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false,
                    max:'dataMax'
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false},
                    max: 'dataMax'
                },
                series: [
                    {
                        name: '库存齐套',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [380],
                        barWidth:40,
                        color: '#2bd54d',
                    },
                    {
                        name: '在途中',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        color: '#e6b600',
                        data: [820]
                    },
                    {
                        name: '请购下达',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [300]
                    },
                ]
            },
            assemblingStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false}
                },
                series: [
                    {
                        name: '工单齐套',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [360],
                        barWidth:40,
                        color: '#2bd54d',
                    },
            
                    {
                        name: '工单未齐套',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [840]
                    },
                ]
            },
            DIPStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false}
                },
                series: [
                    {
                        name: '已完成',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [340],
                        color: '#2bd54d',
                        barWidth:40
                    },
            
                    {
                        name: '生产中',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        color: '#e6b600',
                        data: [860]
                    },
                    {
                        name: '物料不足',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [300]
                    },
                ]
            },
            SMTStatus: {
                silent: true,
                grid: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    width: '800px',
                    containLabel: false
                },
                xAxis:  {
                    type: 'value',
                    show: false
                },
                yAxis: {
                    type: 'category',
                    data: ['备料'],
                    axisLine:{show: false},
                    axisLabel: {show: false},
                    axisTick: {show: false}
                },
                series: [
                    {
                        name: '已出货',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [400],
                        color: '#2bd54d',
                        barWidth:40
                    },
            
                    {
                        name: '待出货',
                        type: 'bar',
                        stack: '总量',
                        color: '#93b7e3',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [600]
                    },
                    {
                        name: '未完成',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight',
                                formatter:'{a}：{c}'
                            }
                        },
                        data: [200]
                    },
                ]
            }
        },
        packingBOM: [
            {
                index:1,
                materialID:'DE221324',
                name:'电阻',
                APU:1,
                demand:1000,
                distributed:0,
                notDistributed:1000,
                availableInStock:800,
                onWay: 200,
                response:'8月2号可交货1000'

            },{
                index:2,
                materialID:'DE221325',
                name:'电阻',
                APU:1,
                demand:1000,
                distributed:1000,
                notDistributed:0,
                availableInStock:0,
                onWay: 0,
                response:'8月2号可交货1001'
            },{
                index:3,
                materialID:'DE221326',
                name:'电阻',
                APU:1,
                demand:1000,
                distributed:1000,
                notDistributed:0,
                availableInStock:0,
                onWay: 0,
                response:'8月2号可交货1002'
            },{
                index: 4,
                materialID: 'DE221327',
                name: '电阻',
                APU: 1,
                demand: 1000,
                distributed:0,
                notDistributed: 1000,
                availableInStock: 500,
                onWay: 500,
                response: '8月2号可交货1003'
            }, {
                index: 5,
                materialID: 'DE221328',
                name: '电阻',
                APU: 1,
                demand: 1000,
                distributed:0,
                notDistributed: 1000,
                availableInStock: 500,
                onWay: 500,
                response: '8月2号可交货1004'
            }          
        ],
        assemblingBOM: [],
        DIPBOM: [],
        SMTBOM: [],
        progress: {
            silent: true,
            grid: {
                top: 0,
                left: 0,
                right: 0,
                bottom: 0,
                width: '100%',
                containLabel: false
            },
            xAxis:  {
                type: 'value',
                show: false,
                max:'dataMax'
            },
            yAxis: {
                type: 'category',
                data: ['备料'],
                axisLine:{show: false},
                axisLabel: {show: false},
                axisTick: {show: false},
            },
            series: [
                {
                    name: '已出货',
                    type: 'bar',
                    stack: '总量',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    data: [800],
                    color: '#2bd54d',
                    barWidth:40
                },
                {
                    name: '成品库存',
                    type: 'bar',
                    stack: '总量',
                    color: '#93b7e3',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    data: [600]
                },
                {
                    name: '已投产',
                    type: 'bar',
                    stack: '总量',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    color: '#e6b600',
                    data: [200]
                },
                {
                    name: '未生产',
                    type: 'bar',
                    stack: '总量',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight',
                            formatter:'{a}：{c}'
                        }
                    },
                    data: [400]
                },
            ]
        }
    },
];

class Xiaomi extends React.Component {
    render() {
        return (
            <Table
                columns={columns}
                expandedRowRender={record => 
                    <div>
                        <Row style={{marginBottom:'2px'}}>
                                <Table 
                                    columns={orderColumns} 
                                    dataSource={stageData} 
                                    pagination={false}
                                    expandedRowRender={() =>
                                        <Table size={'small'} pagination={false} columns={BOMColumns} dataSource={record.packingBOM} /> 
                                    }
                                />
                        </Row>
                    </div>
                }
                dataSource={data}
            /> 
        )
    }
}

export default Xiaomi