//收费项维护 编辑收费项 医保对照
import React from 'react';
import { Table, Input, Button, Select, message, DatePicker, Row, Col, Modal } from 'antd';
import '../../assets/css/system.css';
import store from '../../store';
import { $http } from '../../containers/config/https';
import { handleExcel } from 'tools/handleExcel.js';
// import PublicModalTable from '../common/PublicModalTable';
import ColumnAuthoritysModel from 'pages/columnAuthority/ColumnAuthoritysModel';
import PublicListHead from '../common/PublicListHead'
const Option = Select.Option;
export default class InsuLinkCharge extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            modalRowData: {},
            // 主菜单列表数据
            data: [],
            linkID: '',
            showUploadrecord: false,
            //自定义下拉框的值
            insuItemData: [],
            insuItemID: '',
            insuTotal: 0,
            insuItemDesc: '',
            showInsuTable: false,
            num: '1',
            hospSelect: [],
            payReasonSelect: [],
            visStatus: false,
            insuItemDescInput: '',
            insuItemDescInput: true,
            //医院下拉框的值
            hospList: [],
            //传入的收费项ID
            itmID: '',
            downFlag: false,
            code: '',
            desc: '',
            userInfo: {},

            // 抽屉显示
            visible: false,
            // 主菜单分页数据
            total: 0,
            page: 1,
            pageSize: 10,
            flag: '',
            title: '',
            // 是否显示loading
            showLoading: true,
            // 表格loading
            loading: true,
            hospID: '',
            groupID: '',
            payReasonID: '',
            stDate: undefined,
            bitCode: "",
            manufacturer: "",
            inputCharge: "",
            outputCharge: "",
            currentDate: null,

            columns: [],
            languageTable1: {}, // 国际化Table1
            languageTable2: {}, // 国际化Table2
            languageData: {}, // 国际化语言包
            language: {},   // 国际化语言
            languageCode: JSON.parse(window.sessionStorage.userData).language, // 国际化语言标识

            tableColumns: [],
            languageTable3: {}, // 国际化Table1
            languageTable4: {}, // 国际化Table2

            specInput: undefined,
            pprovalNoInput: undefined,
            manfDescInput: undefined,
            publicTableLoading: false
        }
        // this.columns = [
        //     {
        //         title: "对照表ID",
        //         dataIndex: "linkID",
        //         width: '10%',
        //         align: 'center',
        //         key: '1',
        //     },
        //     {
        //         title: '医保目录代码',
        //         dataIndex: 'insuItemCode',
        //         width: '15%',
        //         align: 'center',
        //         key: '2',
        //     },
        //     {
        //         title: "医保目录名称",
        //         dataIndex: "insuItemDesc",
        //         width: '15%',
        //         align: 'center',
        //         key: '3',
        //     },
        //     {
        //         title: "收费项代码",
        //         dataIndex: 'itmCode',
        //         width: '15%',
        //         align: 'center',
        //         key: '4',
        //     },
        //     {
        //         title: '收费项名称',
        //         dataIndex: 'itmDesc',
        //         width: '15%',
        //         align: 'center',
        //         key: '5',

        //     },
        //     {
        //         title: '医院',
        //         dataIndex: 'hospDesc',
        //         width: '10%',
        //         align: 'center',
        //         key: '6',

        //     }
        // ]
        this.insuColumns = [
            {
                title: "医保目录id",
                dataIndex: "id",
                width: '10%',
                align: 'center',
                key: '1',
            },
            {
                title: '医保目录代码',
                dataIndex: 'code',
                width: '20%',
                align: 'center',
                key: '2',
            },
            {
                title: "医保目录名称111",
                dataIndex: "descripts",
                width: '20%',
                align: 'center',
                key: '3',
            }
        ]
    }

    componentDidMount() {
        this.tableList("InsuLinkCharge", "InsuLinkCharge");
        // 初始化列表数据
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};

        this.setState({
            // 初始化列表数据
            hospID: sessionInfo.hospID,
            groupID: sessionInfo.groupID,
            /*
                * @ByYQY: 解决费别默认回显问题
                * Create 2022-01-11
            */
            payReasonID: '',
            itmID: this.props.itmID
        }, () => {
            this.handleQuery();
            this.handleHospSelect();
            // this.handleInsuQuery();
            this.handlpayReasonSelect();
            // this.infoTableList();
            // 初始化设置table的高度以及表体的高度
            document.querySelector('.ant-table-body').style.height = store.getState().tableHeight.y + 'px';
        })

    }

    componentWillUnmount() {
        this.setState = (state, callback) => {
            return
        }
    }

    //查询本位码
    queryBitCode = () => {
        let { insuItemID } = this.state;
        if (insuItemID === "") {
            message.error("请用选择的医保目录的信息");
            return false;
        }
        let data = {}
        data = {
            params: [{
                insuItemID: insuItemID,
            }]
        }
        $http.post('urlADS', this, {
            code: "05100998",
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    this.setState({ bitCode: res.data.bitCode, showUploadrecord: true });
                }
            }
        })
    }

    onColumnRef = (ref) => {
        // console.log(ref)
        this.columnRef = ref;
    }

    //生效日期变化
    onStartChange = value => {
        this.setState({ stDate: value });
    };

    // 获取主列表columns
    tableList = (reactCode, compontName) => {
        var data = {
            params: [{
                "reactCode": [reactCode],
                "compontName": compontName,
                "type": "C"
            }]
        }
        // console.log(1, data)
        $http.post('urlS', this, {
            code: '01040073',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    let resC = res.result.C
                    let { languageCode } = this.state
                    for (var i = 0; i < resC.length; i++) {
                        resC[i].key = i;
                    }
                    if (languageCode === "EN") {
                        resC.map((item, i) => {
                            item.title = item.enDescripts
                        })
                    }

                    if (languageCode === "CN") {
                        resC.map((item, i) => {
                            item.title = item.descripts
                        })
                    }
                    let arr = res.result && resC.length > 0 ? JSON.parse(JSON.stringify(resC)).map(item => {
                        return {
                            align: item.align,
                            widthNum: parseInt(item.width),
                            width: item.width,
                            dataIndex: item.dataIndex,
                            title: <div onDoubleClick={() => this.columnRef.onOpenModel()}>{item.title}</div>,
                            display: item.display,
                            key: item.seqNo
                        }
                    }) : '';
                    let filterArr = arr.filter(function (item) { return item.display === 'Y' });
                    this.setState({
                        columns: filterArr,
                        languageTable1: res.result.B || {},  // 国际化Table1
                        languageTable2: res.result.C || {},  // 国际化Table2
                        languageData: res.result.language || {},  // 国际化语言包
                    }, () => {
                        this.LanCNEN(this.state.languageCode)
                    })
                }
            }
        })
    }

    // 获取医保信息列表columns
    infoTableList = (reactCode, compontName) => {
        var data = {
            params: [{
                "reactCode": ['MedicalInsuranceInformation'],
                "compontName": 'MedicalInsuranceInformation',
                "type": "C"
            }]
        }
        // console.log(1, data)
        $http.post('urlS', this, {
            code: '01040073',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    let resC = res.result.C
                    let { languageCode } = this.state
                    // for (var i = 0; i < resC.length; i++) {
                    //     resC[i].key = i;
                    // }
                    // if (languageCode === "EN") {
                    //     resC.map((item, i) => {
                    //         item.title = item.enDescripts
                    //     })
                    // }

                    // if (languageCode === "CN") {
                    //     resC.map((item, i) => {
                    //         item.title = item.descripts
                    //     })
                    // }
                    let arr = res.result && resC.length > 0 ? JSON.parse(JSON.stringify(resC)).map(item => {
                        return {
                            align: item.align,
                            widthNum: parseInt(item.width),
                            width: item.width,
                            dataIndex: item.dataIndex,
                            title: <div onDoubleClick={() => this.child.handleShowOne()}>{languageCode === "EN" ? item.enDescripts : item.title}</div>,
                            display: item.display,
                            key: item.seqNo
                        }
                    }) : '';
                    let filterArr = arr.filter(function (item) { return item.display === 'Y' });

                    this.setState({
                        tableColumns: filterArr,
                        languageTable3: res.result.B || {},  // 国际化Table1
                        languageTable4: res.result.C || {},  // 国际化Table2

                    }, () => {
                        this.LanCNEN(this.state.languageCode)
                    })
                }
            }
        })
    }

    LanCNEN = (code) => {
        let { languageData } = this.state
        this.setState({
            language: languageData[code]
        })
    }

    onRef = ref => {
        this.child = ref
    }

    // 页码改变的回调，参数是改变后的页码及每页条数
    onChange = (page, pageSize) => {
        this.setState({ page: page, pageSize: pageSize }, () => {
            // 重新调用查询方法
            this.handleQuery();
        });
    }
    // 重置数据
    resetUserInfo() {
        this.setState({ userInfo: {} })
    }

    /***下拉框***/
    //医院下拉框
    handleHospSelect = () => {
        let { hospID, groupID } = this.state
        let data = {}
        data = {
            params: [{
                hospitalId: hospID,
                logonGroupID: groupID,
                logonHospID: hospID,
                dataType: 'combo'

            }]
        }
        $http.post('urlS', this, {
            code: '05100046',
            data: data,
            success: function (res) {
                // console.log("res----",res)
                if (+res.errorCode === 0 && res.Hosp) {
                    let hospSelect = []
                    for (var i = 0; i < res.Hosp.length; i++) {
                        if (res.Hosp[i].id && res.Hosp[i].descripts) hospSelect.push(<Option key={res.Hosp[i].id} alias={res.Hosp[i].descriptsSPCode}>{res.Hosp[i].descripts}</Option>)
                    }
                    this.setState({
                        hospSelect,
                    })

                    // console.log(this.state.hospSelect, '343343')
                }
            }
        })
    }

    //费别下拉框
    handlpayReasonSelect = () => {
        let data = {}
        data = {
            params: [{
                hospID: this.state.hospID
            }]
        }
        $http.post('urlS', this, {
            code: '05100129',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.data) {
                    let payReasonSelect = []
                    for (var i = 0; i < res.data.length; i++) {
                        payReasonSelect.push(<Option key={res.data[i].id} alias={res.data[i].descriptsSPCode}>{res.data[i].descripts}</Option>)
                    }
                    this.setState({
                        payReasonSelect: payReasonSelect
                    })
                    // console.log(this.state.payReasonSelect)
                }
            }
        })
    }

    /***双向绑定***/
    onChangeCode = (e) => {
        this.setState({
            code: e.target.value
        })
    }

    onChangeDesc = (e) => {
        this.setState({
            desc: e.target.value
        });
    }

    onChangeHospID = (value) => {
        this.setState({
            hospID: value
        });
    }

    onChangepayReasonID = (value) => {
        this.setState({
            payReasonID: value
        });
    }

    onChangeText = (e) => {
        this.setState({
            insuItemID: '',
            insuItemDesc: e.target.value
        });
    }

    //改变行的颜色通过className
    setInsuItemRowClassName = (record) => {
        return record.id === this.state.insuItemID ? 'clickRowStyle' : '';
    }

    //点击行进行ID赋值
    onClickInsuItemRow = (record) => {
        this.setState({
            insuItemID: record.id,
            insuItemDesc: record.descripts,
            showInsuTable: false,
        });
    }

    //关联表
    //改变行的颜色通过className
    setInsuLinkItemRowClassName = (record) => {
        return record.linkID === this.state.linkID ? 'clickRowStyle' : '';
    }

    //点击行进行ID赋值
    onClickInsuLinkItemRow = (record) => {
        if (this.state.linkID === "") {
            this.setState({
                linkID: record.linkID,

            });
        } else {
            if (this.state.linkID !== record.linkID) {
                this.setState({
                    linkID: record.linkID,
                });
            } else {
                this.setState({
                    linkID: '',
                });
            }
        }
    }

    /***增删改查***/
    // 查询关联信息
    handleQuery = () => {
        let { itmID, code, desc, page, pageSize, hospID, insuItemDesc, payReasonID, stDate } = this.state;
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let data = {}
        data = {
            params: [{
                itmID: itmID,
                code: code,
                insuItemDesc: insuItemDesc,
                hospID: hospID,
                payReasonID: payReasonID,
                stDate: stDate
            }],
            pagination: [{
                pageSize: pageSize,
                currentPage: page,
                sortColumn: "Code",
                sortOrder: "asc"
            }]
        }

        $http.post('urlS', this, {
            code: '05100122',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.data) {
                    for (var i = 0; i < res.data.length; i++) {
                        res.data[i].key = i;
                    }
                    this.setState({ data: res.data, total: res.data.length, loading: false })
                } else {
                    this.setState({ data: [], total: 0, loading: false })
                }
            }
        })
    }

    //医保项目明细
    handleInsuQuery = (title) => {
        let { itmID, page, pageSize, hospID, payReasonID, specInput, pprovalNoInput, manfDescInput } = this.state;
        // let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let data = {}
        data = {
            params: [{
                itmID: itmID,
                insuCode: title,
                insuDesc: title,
                hospID: hospID,
                payReasonID: payReasonID,
                spec: specInput, // 规格
                menfDesc: manfDescInput, // 生产厂家
                bitCode: pprovalNoInput, // 批准文号
            }],
            pagination: [{
                pageSize: pageSize,
                currentPage: page,
                sortColumn: "Code",
                sortOrder: "asc"
            }]
        }

        $http.post('urlS', this, {
            code: '05100123',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.data) {
                    // for (var i = 0; i < res.data.length; i++) {
                    //     res.data[i].key = i;
                    // }
                    this.setState({ insuItemData: res.data, insuTotal: res.data.length, publicTableLoading: false })
                } else {
                    this.setState({ insuItemData: [], insuTotal: 0, publicTableLoading: false })
                }
            }
        })
    }

    //添加对照
    handleAdd = () => {
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let { itmID, insuItemID, hospID, stDate, payReasonID } = this.state;
        if (insuItemID === "") {
            message("请用选择的医保目录的信息");
            return false;
        }
        let data = {}
        data = {
            params: [{
                itmID: itmID,
                insuItemID: insuItemID,
                hospID: hospID,
                updateUserID: sessionInfo.userID,
                stDate: stDate ? stDate : '',
                payReasonID: payReasonID,
            }]
        }
        $http.post('urlADS', this, {
            code: "05100124",
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    message.success('对照成功');
                    // 刷新列表数据*/
                    this.handleQuery();
                }
            },
            error: function (error) {
                message.error('对照失败：' + error);
            }
        })
    }

    // 取消对照
    handleDetele = () => {
        let { linkID } = this.state;
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let data = {
            params: [{
                linkID: linkID,
                updateUserID: sessionInfo.userID,
            }]
        }
        $http.post('urlADS', this, {
            code: '05100126',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    message.success('取消对照成功');
                    // 刷新列表数据
                    this.handleQuery()
                }
            },
            error: function (error) {
                message.error('删除失败：' + error);
            }
        })
    }

    // 操作弹框
    onClickRowPublic = (record) => {
        return {
            // 单击行选中
            onClick: () => {
                if (this.state.insuItemID === '') {
                    // 保存行数据以及ID
                    this.setState({ insuItemID: record.id })
                } else {
                    if (this.state.insuItemID !== record.id) {
                        this.setState({ insuItemID: record.id })
                    }
                }
            },
            onDoubleClick: () => {
                this.confirmSelection(record);
            }
        }
    }

    setRowClassNamePublic = (record) => {
        return record.id === this.state.insuItemID ? 'clickRowStyle' : '';
    }

    // 双击选中行数据的回调
    confirmSelection = (record) => {
        // console.log(record, "123333recoed")
        //this.resetFields();
        this.setState({ insuItemID: record.id, insuItemDesc: record.code, modalRowData: record }, () => {
            // 关闭弹窗
            this.child.handleCancel();
            // 获取单位下拉框数据
            //this.getUnitData(record.stockID);
            //this.getInputValue(record.stockID, this.props.handleThis.state.inOperLocID);
            //this.props.form.setFieldsValue({stockDesc: record.stockDesc,unitID: undefined});
            //this.handleOnSelect(1)
        })
        // console.log(this.state.insuItemDesc, "insuItemDesc11")
    }

    // 描述回车事件
    insuItemOnPressEnter = (e) => {
        let { insuItemDesc } = this.state;
        if (!insuItemDesc) return;
        this.infoTableList();
        ///let top = 0+ 'px';
        // let top =document.getElementById('insuItemInput').getBoundingClientRect().top + 40 + 'px';
        // let left = document.getElementById('insuItemInput').getBoundingClientRect().left + 60 + 'px';
        this.child.showModal();
        let top = document.getElementById('insuItemInput').getBoundingClientRect().top + 40 + 'px';
        let left = document.getElementById('insuItemInput').getBoundingClientRect().left - 590 + 'px';
        // console.log(top, left)
        this.setState({
            top: this.props.top ? this.props.top : top,
            left: left,
            insuItemData: [],
            insuTotal: 0,
            publicTableLoading: true
        }, () => {
            this.handleInsuQuery(insuItemDesc);
        });
    }

    showUploadRecord = () => {
        this.setState({
            bitCode: "",
            manufacturer: "",
            inputCharge: "",
            outputCharge: "",
            currentDate: null,
        }, () => {
            this.queryBitCode()
        })
    }

    handleCancelUpload = () => {
        this.setState({ showUploadrecord: false })
    }

    onCurrentDateChange = value => {
        this.setState({ currentDate: value });
    };

    //上传备案
    uploadRecord = () => {
        let { insuItemID, itmID } = this.state;
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let data = {
            params: [{
                userID: sessionInfo.userID,
                hospID: sessionInfo.hospID,
                groupID: sessionInfo.groupID,
                locID: sessionInfo.locID,
                transChannel: 10,       //HIS刷卡
                insuItemID: insuItemID,
                itmID: itmID
            }]
        }
        $http.post('urlADS', this, {
            code: '05100999',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    message.success('成功');
                }
            },
            error: function (error) {
                message.error('失败：' + error);
            }
        })
    }

    onChangeBitCode = (e) => {
        this.setState({ bitCode: e.target.value });
    }

    onChangeManu = (e) => {
        this.setState({ manufacturer: e.target.value });
    }

    onChangeInput = (e) => {
        this.setState({ inputCharge: e.target.value });
    }

    onChangeOutput = (e) => {
        this.setState({ outputCharge: e.target.value });
    }

    onChangeSpecInput = (e) => {
        this.setState({ specInput: e.target.value });
    }

    onChangePprovalNoInput = (e) => {
        this.setState({ pprovalNoInput: e.target.value });
    }

    onChangeManfDescInput = (e) => {
        this.setState({ manfDescInput: e.target.value });
    }

    // 导出
    handleExport = () => {
        let { columns, data } = this.state;
        handleExcel.exportExcel(columns, data, '对照关系')
        message.success("导出对照关系成功");
    }

    render() {
        let { height } = this.props;
        let { language, publicTableLoading } = this.state
        let param = {
            width: '1100px',
            top: this.state.top,
            left: this.state.left,
            //columns: this.insuColumns,
            columns: this.state.tableColumns,
            data: this.state.insuItemData,
            isOnRow: true,
            TableClassName: 'tab-placeholder',
            rowClassName: true,
            publicTableLoading
        }
        return (
            <div style={{ marginTop: '12px' }} >
                < div >
                    {/* 医保目录代码： <Input placeholder="请输入代码" style={{ width: '150px' }} value={this.state.code} onChange={this.onChangeCode} />
                    医保目录描述： <Input placeholder='请输入描述' style={{ width: "150px" }} value={this.state.desc} onChange={this.onChangeDesc} />*/}
                    <Row>
                        <Col span={24}>
                            <Row >
                                {language && language.InsuLinkChargepayReasonID ? language.InsuLinkChargepayReasonID.descripts : "费别"}： <Select
                                    showSearch
                                    allowClear
                                    placeholder={language && language.InsuLinkChargepayReasonID ? language.InsuLinkChargepayReasonID.message : "请选择费别"}
                                    optionFilterProp="children"
                                    style={{ width: "200px", marginRight: '10px' }}
                                    value={this.state.payReasonID}
                                    onChange={this.onChangepayReasonID}
                                    reOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                >{this.state.payReasonSelect}</Select>
                                {language.InsuLinkChargeinsuItemDesc && language.InsuLinkChargeinsuItemDesc.descripts}：<Input style={{ width: "200px", marginRight: '10px' }}
                                    placeholder={language.InsuLinkChargeinsuItemDesc && language.InsuLinkChargeinsuItemDesc.message}
                                    onChange={this.onChangeText} value={this.state.insuItemDesc}
                                    onPressEnter={this.insuItemOnPressEnter}
                                    id="insuItemInput"
                                />
                                {language.InsuLinkChargehospID && language.InsuLinkChargehospID.descripts}： <Select
                                    showSearch
                                    allowClear
                                    placeholder={language.InsuLinkChargehospID && language.InsuLinkChargehospID.message}
                                    optionFilterProp="children"
                                    style={{ width: "250px", marginRight: '10px' }}
                                    value={this.state.hospID != '' ? this.state.hospID : JSON.parse(window.sessionStorage.userData).hospID}
                                    onChange={this.onChangeHospID}
                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                >{this.state.hospSelect}</Select>
                            </Row>
                            <Row style={{ marginTop: "10px" }}>
                                生效日期：<DatePicker
                                    style={{ width: "150px", marginRight: '15px' }}
                                    format="YYYY-MM-DD"
                                    placeholder="请选择生效日期"
                                    value={this.state.stDate}
                                    onChange={this.onStartChange}
                                />
                                规格：<Input placeholder="请输入规格"
                                    value={this.state.specInput}
                                    style={{ width: '150px', marginRight: '10px' }}
                                    onChange={this.onChangeSpecInput}
                                    onPressEnter={this.insuItemOnPressEnter}
                                />
                                厂家：<Input placeholder="请输入厂家" value={this.state.manfDescInput}
                                    style={{ width: '150px', marginRight: '10px' }} onChange={this.onChangeManfDescInput}
                                    onPressEnter={this.insuItemOnPressEnter}
                                />
                                批准文号：<Input placeholder="请输入批准文号"
                                    value={this.state.pprovalNoInput} style={{ width: '150px' }} onChange={this.onChangePprovalNoInput}
                                    onPressEnter={this.insuItemOnPressEnter}
                                />
                            </Row>
                        </Col>
                    </Row>
                    <Row style={{ marginTop: '10px' }}>
                        <Col span={24}>
                            <Button type="primary" onClick={this.handleQuery}>{language.InsuLinkChargehandleQuery && language.InsuLinkChargehandleQuery.descripts}</Button>
                            <Button type="primary" onClick={this.handleAdd} style={{ marginLeft: '30px' }}>{language.InsuLinkChargehandleAdd && language.InsuLinkChargehandleAdd.descripts}</Button>
                            {/* <Button type="primary" onClick={this.showUploadRecord} style={{ marginLeft: '30px' }}>上传备案</Button> */}
                            <Button type="danger" onClick={this.handleDetele} style={{ marginLeft: '30px' }}>{language.InsuLinkChargehandleDetele && language.InsuLinkChargehandleDetele.descripts}</Button>
                            <Button
                                style={{ marginLeft: '30px' }}
                                type="primary"
                                ghost
                                disabled={this.state.data && this.state.data.length > 0 ? false : true}
                                icon='export'
                                onClick={this.handleExport}
                            >
                                导出
                            </Button>
                            {/* <Table
                        style={{ height: store.getState().tableHeight.y + 45 + 'px', marginTop: '30px' }}
                        dataSource={this.state.data}
                        columns={this.columns}
                        bordered    //让属table表格清晰显示
                        scroll={{ x: 1500, y: store.getState().tableHeight.y }}
                        rowClassName={this.setInsuLinkItemRowClassName}
                        onRow={(record) => {
                            return {
                                onClick: (event) => {
                                    this.onClickInsuLinkItemRow(record)
                                },
                            };
                        }}
                    /> */}
                        </Col>
                    </Row>
                </div>
                <div className='mT20'>
                    <Table
                        // style={{ height: store.getState().tableHeight.y / 2 + 'px' }}
                        dataSource={this.state.data}
                        columns={this.state.columns}
                        pagination={false}
                        scroll={{ x: 1500, y: height ? height : store.getState().tableHeight.y - 116 }}
                        bordered
                        rowClassName={this.setInsuLinkItemRowClassName}
                        onRow={(record) => {
                            return {
                                onClick: (event) => {
                                    this.onClickInsuLinkItemRow(record)
                                },
                            };
                        }}
                        className='TableA table-body-height'
                    />
                    <ColumnAuthoritysModel
                        clientWidth='900px'
                        compontName='InsuLinkCharge'
                        configType="C"
                        onRef={this.onColumnRef}
                        reloadData={this.tableList}
                    />
                    {/* <PublicModalTable
                        onClickRowPublic={this.onClickRowPublic}
                        setRowClassNamePublic={this.setRowClassNamePublic}
                        param={param}
                        onRef={this.onRef}
                    /> */}
                    <PublicListHead
                        onClickRowPublic={this.onClickRowPublic}
                        setRowClassNamePublic={this.setRowClassNamePublic}
                        param={param}
                        onRef={this.onRef}
                        reloadData={this.infoTableList}
                    />
                </div>
                <Modal
                    visible={this.state.showUploadrecord}
                    title="上传备案"
                    onOk={() => this.uploadRecord}
                    onCancel={this.handleCancelUpload}
                    width='600px'
                    footer={[
                        <Button key="back" onClick={this.handleCancelUpload}>
                            返回
                        </Button>,
                        <Button key="submit" type="primary" loading={this.state.loading} onClick={this.uploadRecord}>
                            提交
                        </Button>,
                    ]}
                >
                    <Row>
                        <Col span={6}>药品本位码：</Col>
                        <Col span={18}>
                            <Input style={{ width: '100%' }} onChange={(e) => this.onChangeBitCode(e)} value={this.state.bitCode} allowClear placeholder="请输入药品本位码" />
                        </Col>
                        <Col span={6}>厂家：</Col>
                        <Col span={18}>
                            <Input style={{ width: '100%' }} onChange={(e) => this.onChangeManu(e)} value={this.state.manufacturer} allowClear placeholder="地补药、中药饮片及颗粒必填" />
                        </Col>
                        <Col span={6}>药品进货价格：</Col>
                        <Col span={18}>
                            <Input style={{ width: '100%' }} onChange={(e) => this.onChangeInput(e)} value={this.state.inputCharge} allowClear placeholder="请输入药品进货价格" />
                        </Col>
                        <Col span={6}>药品收费价格：</Col>
                        <Col span={18}>
                            <Input style={{ width: '100%' }} onChange={(e) => this.onChangeOutput(e)} value={this.state.outputCharge} allowClear placeholder="请输入药品收费价格" />
                        </Col>
                        <Col span={6}>备案日期：</Col>
                        <Col span={18}>
                            <DatePicker
                                style={{ width: "100%" }}
                                format="YYYY-MM-DD"
                                placeholder="请选择备案日期"
                                value={this.state.currentDate}
                                onChange={this.onCurrentDateChange}
                            />
                        </Col>
                    </Row>
                </Modal>
            </div>

        )
    }
}
