/**
 * 
 * 医嘱列跳转配置
 */
import React from 'react';
import {
    Card, Table, Input, Form, Select, Row, Col, Checkbox, Tabs,
    DatePicker, Button, Pagination, Icon, Divider, message, Modal,
} from 'antd';
import { Util, dayFormat } from 'tools/index';
import { $http } from 'containers/config/https';
import CommonPagination from 'components/pagination/index';
import { PAGE_NUM_MORE_STATUS } from 'tools/statusConstants';
import store from 'store';
import moment from 'moment';
import '../style/index.less';

const { RangePicker } = DatePicker;
const Search = Input.Search;
const Option = Select.Option;
const TabPane = Tabs.TabPane;
const confirm = Modal.confirm;

class AdviceMoveColumnsTabPane extends React.Component {
    constructor(props) {
        super(props)
        var userData = JSON.parse(sessionStorage.getItem('userData'))
        this.state = {
            dataSource: [],
            total: 0,
            page: 1,
            pageSize: 10,
            userData: userData,
            ids: [],
            editFlag: 'N',
            code: [],
            docOrdListSelect: [],
            otherData: [],
            otherListData: [],
            rightSource: [],
            size: 'small',
        }
    }

    componentDidMount() {
        this.loadData(1)
        this.loadSelectData()
        this.initData()
    }

    initData() {
        this.columns = [
            // {
            //     title: '医嘱录入列名称',
            //     dataIndex: 'docOrderListDesc',
            //     width: 180,
            //     align: 'center',
            // },

            {
                title: '描述',
                dataIndex: 'descripts',
                width: 180,
                align: 'center',
            },
            {
                title: '就诊类型',
                dataIndex: 'admTypeDesc',
                width: 180,
                align: 'center',
            },
            {
                title: '医嘱优先级',
                dataIndex: 'priorityDesc',
                width: 180,
                align: 'center',
            },
            // {
            //     title: '医嘱优先级',
            //     dataIndex: 'editFlag',
            //     width: 180,
            //     align: 'center',
            //     render: (text, data) => {
            //         return <span>{data.editFlag == 'Y' ? '可编辑' : '不可编辑'}</span>
            //     }
            // },
        ],
            this.rightColumns = [
                {
                    title: '医嘱录入列名称',
                    dataIndex: 'descripts',
                    width: 180,
                    align: 'center',
                },
            ]
        this.sunColumns = [
            {
                title: '子类名称',
                dataIndex: 'descripts',
                width: 180,
                align: 'center',
            }
        ]
    }

    loadData(page, pageSize, e) {
        var params = {
            params: [{
                userID: this.state.userData.userID,
                hospID: this.state.userData.hospID,
                groupID: this.state.userData.groupID,
                admTypeID: this.state.admTypeId,
                orderTypeID: this.state.orderTypeId,
                priorityID: this.state.priorityId,
            }],
            pagination: [{
                pageSize: this.state.size == 'small' ? this.state.pageSize : PAGE_NUM_MORE_STATUS[0].code,
                currentPage: page
            }]
        }
        $http.post('urlDeault', this, {
            code: "03010048",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    this.setState({
                        dataSource: res.result.data,
                        total: res.result.totalCount,
                        ids: [],
                        docOrderListID: undefined,
                        admTypeID: undefined,
                        orderTypeID: undefined,
                        priorityID: undefined,
                        editFlag: 'N',
                        search: e,
                        loading: false
                    })
                }
            }
        });
    }

    loadSelectData() {
        var params = {
            params: [{
                admTypeFlag: 'Y',
                orderTypeFlag: 'Y',
                docOrdListFlag: 'Y',
                priorityFlag: 'Y',
                subCatFlag: 'Y'
            }]
        }
        $http.post('urlDeault', this, {
            code: "03010045",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    this.setState({
                        admType: res.result.admType,
                        orderType: res.result.orderType,
                        docOrdList: res.result.docOrdList,
                        priority: res.result.priority,
                        subCatData: res.result.subCat
                    })
                }
            }
        });
    }

    //保存
    saveEditRole(status) {
        var params = {
            params: [{
                userID: this.state.userData.userID,
                hospID: this.state.userData.hospID,
                groupID: this.state.userData.groupID,
                docOrderListID: [],
                admTypeID: this.state.admTypeID,
                descripts: this.state.descripts,
                priorityID: this.state.priorityID,
                copyID: status == 'copy' ? this.state.ids[0] : ''
            }]
        }
        $http.post('urlDeault', this, {
            code: "03010046",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    message.success('保存成功',this.state.userData && this.state.userData.messageTime)
                    this.loadData(1)
                }
            }
        });
    }

    //分页切换
    onChange(e) {
        this.setState({ page: e }, () => {
            this.loadData(e);
        });
    }

    //分页切换
    changePageSize(current, pageSize) {
        this.setState({ pageSize: pageSize, page: current }, () => {
            this.loadData(current, pageSize, 'search');
        });
    }

    handleDel() {
        var params = {
            params: [{
                userID: this.state.userData.userID,
                hospID: this.state.userData.hospID,
                groupID: this.state.userData.groupID,
                id: this.state.ids
            }]
        }
        $http.post('urlDeault', this, {
            code: "03010047",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    message.success('删除成功！',this.state.userData && this.state.userData.messageTime)
                    this.loadData(1)
                }
            }
        });
    }

    handleDelRight() {
        // this.loadDeleteTemplate()
        var flag = true;
        var that = this;
        var { docOrdListSelect, code, rightSource } = this.state;
        // var rightSource = []
        // rightSource = this.state.docOrdListSelect.concat(this.state.otherData)
        var data = this.state.status ? rightSource : docOrdListSelect;
        for (var i = 0; i < code.length; i++) {
            for (var j = 0; j < data.length; j++) {
                if (data[j].tabIndex == code[i]) {
                    if (this.state.status) {
                        this.state.otherData.splice(j, 1);
                    } else {
                        this.state.docOrdListSelect.splice(j, 1);
                        this.state.otherData.splice(j, 1);
                    }
                }
            }
        }
        that.setState({ code: [] })
    }

    onSelectChange(ids) {
        this.setState({
            ids
        })
    }

    onSelectRightChange(code, selectData) {
        this.setState({
            code: code,
            selectData: selectData
        })
    }

    commonCheckbox(name, e) {
        this.setState({
            [name]: e.target.checked ? 'Y' : 'N'
        })
    }

    //点击行，渲染当前行样式
    onClickRow = (record) => {
        var docOrdList = record.docOrdList;
        var docList = []
        if (docOrdList) {
            for (var i = 0; i < docOrdList.length; i++) {
                docList.push({
                    code: docOrdList[i].code,
                    descripts: docOrdList[i].descripts,
                    descriptsSPCode: docOrdList[i].descriptsSPCode,
                    id: docOrdList[i].id,
                    count: docOrdList[i].count,
                    tabIndex: i
                })
            }
        }
        return {
            onClick: () => {
                this.setState({
                    rowId: record.id,
                    record: record,
                    docOrdListSelect: docList,
                    otherListSelect: record.otherList,
                }, () => {
                    this.loadSunData()
                })
            }
        };
    }

    loadSunData() {
        var params = {
            params: [{
                userID: this.state.userData.userID,
                hospID: this.state.userData.hospID,
                groupID: this.state.userData.groupID,
                enterID: this.state.rowId
            }],
        }
        $http.post('urlDeault', this, {
            code: "03010107",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    this.setState({
                        sunData: res.result.data,
                    })
                }
            }
        });
    }

    //点击行，渲染当前行样式 
    setRowClassName = (record) => {
        return record.id === this.state.rowId ? 'clickRowStyle' : '';
    }

    //保存明细
    addDetailList() {
        var rightSource = []
        var id = []
        rightSource = this.state.docOrdListSelect.concat(this.state.otherData)
        for (var i = 0; i < rightSource.length; i++) {
            id.push(rightSource[i].id)
        }
        var params = {
            params: [{
                userID: this.state.userData.userID,
                hospID: this.state.userData.hospID,
                groupID: this.state.userData.groupID,
                docOrderList: id,
                admTypeID: this.state.record.admTypeID,
                orderTypeID: this.state.record.orderTypeID,
                priorityID: this.state.record.priorityID,
                id: this.state.rowId,
            }]
        }
        $http.post('urlDeault', this, {
            code: "03010046",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    message.success('保存成功！',this.state.userData && this.state.userData.messageTime)
                    this.loadData(1)
                    // this.loadRightData(1)
                }
            }
        });
    }

    //重写table数据
    addTableData() {
        var { otherListSelect } = this.state;
        var rightSource = this.state.docOrdListSelect.concat(this.state.otherData)
        if(!Util.isEmpty(rightSource)){
            for(var i=0;i<rightSource.length;i++){
                if(this.state.docOrderListID == rightSource[i].id){
                    message.error('该数据已存在，无法重复添加！',this.state.userData && this.state.userData.messageTime)
                    return
                }
            }
        }
        var otherData = []
        if (!Util.isEmpty(this.state.docOrderListID)) {
            for (var i = 0; i < otherListSelect.length; i++) {
                if (this.state.docOrderListID == otherListSelect[i].id) {
                    this.state.otherData.push(otherListSelect[i])
                } else {
                    this.state.otherListData.push(otherListSelect[i])
                }
                this.setState({})
            }
        }
    }

    //上移
    handleUpSort() {
        // var keys = this.state.code;
        var rightSource = []
        var dataCount = []
        rightSource = this.state.docOrdListSelect.concat(this.state.otherData)
        for (var i = 0; i < rightSource.length; i++) {
            dataCount.push({
                code: rightSource[i].code,
                descripts: rightSource[i].descripts,
                descriptsSPCode: rightSource[i].descriptsSPCode,
                id: rightSource[i].id,
                count: rightSource[i].count,
                tabIndex: i
            })
        }
        var { selectData } = this.state;
        var keys = []
        for (var i = 0; i < selectData.length; i++) {
            for (var j = 0; j < dataCount.length; j++) {
                if (selectData[i].id == dataCount[j].id) {
                    keys.push(j)
                }
            }
        }
        var data = dataCount//this.state.status ? this.state.rightSource : this.state.docOrdListSelect
        var newKeys = []

        keys = keys.sort(function (m, n) {
            if (m < n) return -1
            else if (m > n) return 1
            else return 0
        });
        for (var i = 0; i < keys.length; i++) {
            if (parseInt(keys[i]) === 0) {
                newKeys.push(parseInt(keys[i]))
                // continue
                message.warn('已经到顶了，无法再移动！',this.state.userData && this.state.userData.messageTime)
                return
            }
            var curRowData = data[parseInt(keys[i])]
            var curRowKey = curRowData.tabIndex
            var upRowData = data[parseInt(keys[i]) - 1]
            var upRowKey = upRowData.tabIndex
            upRowData.tabIndex = curRowKey
            curRowData.tabIndex = upRowKey
            data[parseInt(keys[i])] = upRowData
            data[parseInt(keys[i]) - 1] = curRowData
            newKeys.push(parseInt(keys[i]) - 1)
        }
        this.setState(
            {
                rightSource: data,
                docOrdListSelect: data,
                code: newKeys,
                otherData: []
            }
        )

    }

    handleDownSort() {
        // var keys = this.state.code
        var rightSource = []
        rightSource = this.state.docOrdListSelect.concat(this.state.otherData)
        var dataCount = []
        for (var i = 0; i < rightSource.length; i++) {
            dataCount.push({
                code: rightSource[i].code,
                descripts: rightSource[i].descripts,
                descriptsSPCode: rightSource[i].descriptsSPCode,
                id: rightSource[i].id,
                count: rightSource[i].count,
                tabIndex: i
            })
        }
        var { selectData } = this.state;
        var keys = []
        for (var i = 0; i < selectData.length; i++) {
            for (var j = 0; j < dataCount.length; j++) {
                if (selectData[i].id == dataCount[j].id) {
                    keys.push(j)
                }
            }
        }
        // var data = this.state.status ? this.state.dataCount : this.state.docOrdListSelect
        var data = dataCount
        var newKeys = []
        keys = keys.sort(function (m, n) {
            if (m < n) return -1
            else if (m > n) return 1
            else return 0
        });
        for (var i = keys.length - 1; i >= 0; i--) {
            if (parseInt(keys[i]) === data.length - 1) {
                newKeys.push(parseInt(keys[i]))
                // continue
                message.warn('已经到底了，无法再移动！',this.state.userData && this.state.userData.messageTime)
                return
            }
            var curRowData = data[parseInt(keys[i])]
            var upRowData = data[parseInt(keys[i] + 1)]
            var curRowKey = curRowData.tabIndex
            var upRowKey = upRowData.tabIndex
            upRowData.tabIndex = curRowKey
            curRowData.tabIndex = upRowKey
            data[parseInt(keys[i])] = upRowData
            data[parseInt(keys[i] + 1)] = curRowData
            newKeys.push(parseInt(keys[i]) + 1)
        }

        this.setState({
            rightSource: data,
            docOrdListSelect: data,
            code: newKeys,
            otherData: []
        }
        )
    }

    handleSelectChange(name, e) {
        this.setState({
            [name]: e
        })
    }

    saveSunData() {
        var params = {
            params: [{
                userID: this.state.userData.userID,
                hospID: this.state.userData.hospID,
                orderSubCatID: this.state.subID,
                enterID: this.state.rowId
            }]
        }
        $http.post('urlDeault', this, {
            code: "03010105",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    message.success('保存成功！',this.state.userData && this.state.userData.messageTime)
                    this.loadSunData(1)
                    this.clearInput()
                }
            }
        });
    }

    clearInput() {
        this.setState({
            subID: undefined
        })
    }

    handleDelSunData() {
        var params = {
            params: [{
                userID: this.state.userData.userID,
                hospID: this.state.userData.hospID,
                groupID: this.state.userData.groupID,
                id: this.state.newCode
            }]
        }
        $http.post('urlDeault', this, {
            code: "03010106",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    message.success('删除成功！',this.state.userData && this.state.userData.messageTime)
                    this.loadSunData(1)
                }
            }
        });
    }

    onSelectSunData(newCode) {
        this.setState({
            newCode
        })
    }

    render() {
        var { admType, orderType, docOrdList, priority, ids, otherListSelect, code, subCatData, newCode } = this.state;
        const rowSelection = {
            ids,
            onChange: this.onSelectChange.bind(this),
            selectedRowKeys: ids,
        }
        const rowRightSelection = {
            code,
            onChange: this.onSelectRightChange.bind(this),
            selectedRowKeys: code,
        }

        const sunSelection = {
            newCode,
            onChange: this.onSelectSunData.bind(this),
            selectedRowKeys: newCode,
        }

        //就诊类型
        var admTypeOption = []
        admType && admType.map((item, index) => {
            admTypeOption.push(<Option value={item.id} key={index} code={item.descriptsSPCode}>{item.descripts}</Option>)
        })
        //医嘱类型
        var orderTypeOption = []
        orderType && orderType.map((item, index) => {
            orderTypeOption.push(<Option value={item.id} key={index} code={item.descriptsSPCode}>{item.descripts}</Option>)
        })

        //医嘱优先级
        var priorityOption = []
        priority && priority.map((item, index) => {
            priorityOption.push(<Option value={item.id} key={index} code={item.descriptsSPCode}>{item.descripts}</Option>)
        })
        var otherListSelectOption = []
        // if (!Util.isEmpty(otherData)) {
        //     otherListData && otherListData.map((item, index) => {
        //         otherListSelectOption.push(<Option value={item.id} key={index+item.id} code={item.descriptsSPCode}>{item.descripts}</Option>)
        //     })
        // } else {
        otherListSelect && otherListSelect.map((item, index) => {
            otherListSelectOption.push(<Option value={item.id} key={index + item.id} code={item.descriptsSPCode}>{item.descripts}</Option>)
        })
        // }
        //将选择的数据concat
        var rightSource = []
        rightSource = this.state.docOrdListSelect.concat(this.state.otherData)

        //医嘱子类
        var subCatDataOption = []
        subCatData && subCatData.map((item, index) => {
            subCatDataOption.push(<Option value={item.id} key={index} code={item.descriptsSPCode}>{item.descripts}</Option>)
        })

        return <div className='outpatient-station-body' style={{ height: '100%', background: '#f0f2f5' }}>
            <Card>
                <Row>
                    <Col span={5}>
                        就诊类型：<Select placeholder='请选择就诊类型' style={{ width: 180 }} showSearch allowClear
                            onChange={Util.handleSelectChange.bind(this, 'admTypeID')}
                            value={this.state.admTypeID}
                            filterOption={(input, option) =>
                                option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                            }>{admTypeOption}</Select>
                    </Col>
                    <Col span={5}>
                        {/* 医嘱类型：<Select placeholder='请选择医嘱类型' style={{ width: 180 }} showSearch allowClear
                            onChange={Util.handleSelectChange.bind(this, 'orderTypeID')}
                            value={this.state.orderTypeID}
                            filterOption={(input, option) =>
                                option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                            }>{orderTypeOption}</Select> */}
                        医嘱类型：<Input onChange={Util.commonInputChange.bind(this, 'descripts')} style={{ width: 180 }} />
                    </Col>
                    {/* <Col span={5}>
                        医嘱录入列：<Select placeholder='请选择医嘱录入列' style={{ width: 180 }} showSearch allowClear
                            onChange={Util.handleSelectChange.bind(this, 'docOrderListID')}
                            value={this.state.docOrderListID}
                            filterOption={(input, option) =>
                                option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                            }>{docOrdListOption}</Select>
                    </Col> */}
                    <Col span={5}>
                        医嘱优先级：<Select placeholder='请选择医嘱优先级' style={{ width: 180 }} showSearch allowClear
                            onChange={Util.handleSelectChange.bind(this, 'priorityID')}
                            value={this.state.priorityID}
                            filterOption={(input, option) =>
                                option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                            }>{priorityOption}</Select>
                    </Col>
                    <Button type='primary' style={{ marginLeft: 10 }} onClick={this.saveEditRole.bind(this)}>保存</Button>
                    <Button type='primary' style={{ marginLeft: 10 }} disabled={!Util.isEmpty(this.state.ids)?false:true}
                     onClick={this.saveEditRole.bind(this, 'copy')}>复制</Button>
                </Row>
            </Card>

            <div style={{ marginTop: 10, background: 'f0f2f5' }}>
                <div style={{ float: 'left', width: '55%', border: '1px solid #f0f2f5' }}>
                    <Table columns={this.columns} style={{ background: 'white', height: store.getState().tableHeight.y + 'px' }}
                        dataSource={this.state.dataSource}
                        loadData={this.loadData.bind(this)}
                        onRow={this.onClickRow}
                        rowClassName={this.setRowClassName}
                        rowSelection={rowSelection}
                        title={() => {
                            return <div style={{ display: 'flex', lineHeight: '35px' }}>
                                就诊类型：<Select placeholder='请选择就诊类型' style={{ width: 170 }} showSearch allowClear
                                    onChange={Util.handleSelectChange.bind(this, 'admTypeId')}
                                    value={this.state.admTypeId}
                                    filterOption={(input, option) =>
                                        option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                        || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                    }>{admTypeOption}</Select>
                                {/* <span style={{ marginLeft: 5 }}>医嘱类型：</span><Select placeholder='请选择医嘱类型' style={{ width: 170 }} showSearch allowClear
                                    onChange={Util.handleSelectChange.bind(this, 'orderTypeId')}
                                    value={this.state.orderTypeId}
                                    filterOption={(input, option) =>
                                        option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                        || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                    }>{orderTypeOption}</Select> */}
                                <span style={{ marginLeft: 5 }}>医嘱优先级：</span><Select placeholder='请选择医嘱优先级' style={{ width: 170 }} showSearch allowClear
                                    onChange={Util.handleSelectChange.bind(this, 'priorityId')}
                                    value={this.state.priorityId}
                                    filterOption={(input, option) =>
                                        option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                        || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                    }>{priorityOption}</Select>
                                <Button type='primary' style={{ marginLeft: 10 }} onClick={this.loadData.bind(this, '1', 'search')}>查询</Button>
                                <Button style={{ marginLeft: 10 }} type='danger' onClick={this.handleDel.bind(this)}>删除</Button>
                            </div>
                        }}
                        rowKey={(data) => {
                            return data.id
                        }}
                        scroll={{ y: store.getState().tableHeight.y + 'px' }}
                        pagination={false}>
                    </Table>
                    <CommonPagination size={this.state.size} current={this.state.page} total={this.state.total} search={this.state.search}
                        onShowSizeChange={this.changePageSize.bind(this)} complete={false} dataSource={this.state.dataSource}
                        loading={this.state.loading} onChange={this.onChange.bind(this)} />
                </div>
                <div style={{ float: 'right', width: '44.8%', background: 'f0f2f5', border: '1px solid #f0f2f5' }}>

                    <div>
                        <Table columns={this.sunColumns} style={{ background: 'white', height: 300 }}
                            dataSource={this.state.sunData}
                            loadData={this.loadSunData.bind(this, '1')}
                            rowSelection={sunSelection}
                            bordered
                            title={() => {
                                return <div style={{ display: 'flex', lineHeight: '35px' }}>
                                    <span style={{ marginLeft: 10 }}>医嘱子类：</span><Select placeholder='请选择医嘱子类' style={{ width: 350 }} showSearch allowClear
                                        onChange={this.handleSelectChange.bind(this, 'subID')}
                                        mode="multiple"
                                        // value={this.state.docOrderListID ? this.state.docOrderListID :
                                        //     (Util.isEmpty(this.state.editData) ? undefined : this.state.editData.docOrderListID)}
                                        filterOption={(input, option) =>
                                            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                            || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                        }>{subCatDataOption}</Select>

                                    <Button type='primary' style={{ marginLeft: 10 }}
                                        onClick={this.saveSunData.bind(this)}>保存</Button>
                                    <Button style={{ marginLeft: 10 }} type='danger' onClick={this.handleDelSunData.bind(this)}>删除</Button>
                                </div>
                            }}
                            rowKey={(data) => {
                                return data.id
                            }}
                            scroll={{ y: 200 }}
                            pagination={false}>
                        </Table>
                    </div>

                    <div>
                        <Table columns={this.rightColumns} style={{ background: 'white', height: 300 }}
                            dataSource={rightSource}
                            loadData={this.loadData.bind(this)}
                            rowSelection={rowRightSelection}
                            title={() => {
                                return <div style={{ display: 'flex', lineHeight: '35px' }}>
                                    <span style={{ marginLeft: 10 }}>医嘱录入列：</span><Select placeholder='请选择医嘱录入列' style={{ width: 170 }} showSearch allowClear
                                        onChange={this.handleSelectChange.bind(this, 'docOrderListID')}
                                        value={this.state.docOrderListID}
                                        filterOption={(input, option) =>
                                            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                            || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                        }>{otherListSelectOption}</Select>

                                    <Button type='primary' style={{ marginLeft: 10 }} onClick={this.addTableData.bind(this)}>添加</Button>
                                    <Button type='primary' style={{ marginLeft: 10 }} onClick={this.addDetailList.bind(this)}>保存</Button>
                                    <Button style={{ marginLeft: 10 }} onClick={this.handleUpSort.bind(this)}>上移</Button>
                                    <Button style={{ marginLeft: 10 }} onClick={this.handleDownSort.bind(this)}>下移</Button>
                                    <Button style={{ marginLeft: 10 }} type='danger' onClick={this.handleDelRight.bind(this)}>删除</Button>
                                </div>
                            }}
                            rowKey={(data) => {
                                return data.tabIndex
                            }}
                            scroll={{ y: 200 }}
                            pagination={false}>
                        </Table>
                    </div>
                </div>
            </div>
        </div>
    }

}
export default AdviceMoveColumnsTabPane;