// 主收费项维护界面
import React from 'react';
import { Row, Col, Card, Button, Form, Select, Input, Icon, Tabs, Modal, Checkbox, message, Spin, Table, Upload } from 'antd';
import store from 'store';
import { handleExcel } from 'tools/handleExcel.js';
import PubilcTablePagination from '../common/PubilcTablePagination.jsx';
import { $http } from 'containers/config/https';
import { ArraySome } from 'tools/index';
import * as XLSX from 'xlsx';
import 'assets/css/common.css';
import { Util } from 'tools/index';

// 子组件
import MTMBasicInformation from './component/MTMBasicInformation';
import MTMPriceInformation from './component/MTMPriceInformation';
import MTMAffiliatedHospital from './component/MTMAffiliatedHospital';
import InsuLinkCharge from '../InvManagement/InsuLinkCharge';
import ExternalDrugLinkCharge from '../ExternalDrugBasic/ExternalDrugLinkCharge';
import MTMBasicPriceInformation from './component/MTMBasicPriceInformation';
import StandardClassification from './component/StandardClassification';

const { TabPane } = Tabs;
const { Option } = Select;

class MenuTaritemMaintain extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            mainData: [], // 收费项表格数据
            detailData: [], // 价格表格数据
            detailColumns: [], // 价格表表头
            total: 0,
            mainPage: 1,
            mainPageSize: 10,
            rowData: {}, // 选中行数据
            rowId: '', // 选中行id
            exportVisible: false, // 导出visible
            importVisible: false, // 导入visible
            importVisible2: false, // 批量调价
            exportCheckMainValue: false, // 导出收费项check
            exportCheckDetailValue: false, // 导出价格check
            importCheckMainValue: false, // 导入收费项check
            importCheckDetailValue: false, // 导入价格check
            regionSelectData: [], // 地区下拉框数据
            hospSelectData: [], // 医院下拉框数据
            subclassSelectData: {}, // 子类下拉框数据
            otherSelectData: {}, // 1.1.5.费别，等级,单位,地区下拉框数据
            activeKey: '0', // 当前激活的key值
            itemID: '', // 基本信息新增成功之后返回itemID
            exportLoading: false, // 导出loading
            modalTypeVisible: false, // modalTypeVisible
            modalTypeSelectData1: [],
            modalTypeSelectData2: [],
            modalTypeSelectDataArr: [],
            dataTableLeft: [],
            dataTableRight: [],
            standPublicPrice: false, // standPublicPrice
            adjustOfHospitalPrice: false, // adjustOfHospitalPrice
            associatedHospital: false, // associatedHospital
            hospitalData: [], // 医院data
            addreR: '', // addreR
            addreL: '', // addreL
            addreLData: [], // addreLData
            addreRData: [], // addreLData
            hospL: '', // hospL
            hospR: '', // hospR
            regionTypeAddreID: '', // regionTypeAddreID
            excelData: [], // excelData
            loadingFile: false,
            newSelectDataArr: [],
            loading: false,
            recordData: [],
            insuItemDesc: '',
            isContrast: 'Y',
            /**
             * updateBy:WanRuixiang
             * updateDate:2022/11/14
             * before: isContrast: '',
             */
        };
        this.columns = [
            { title: '序号', dataIndex: 'key', key: '1', width: '50px', align: "center" },
            { title: '代码', dataIndex: 'itemCode', key: '2', width: '100px', align: "center" },
            { title: '描述', dataIndex: 'itemDesc', key: '3', width: '150px', align: "center" },
            { title: '规格', dataIndex: 'itemSpec', key: '34', width: '150px', align: "center" },
            { title: '批准文号', dataIndex: 'itemApprovalNo', key: '6', width: '100px', align: "center" },
            { title: '生产厂家', dataIndex: 'itemManfDesc', key: '7', width: '150px', align: "center" },
            { title: '医院', dataIndex: 'itemHospDesc', key: '4', width: '150px', align: "center" },
            { title: '单位', dataIndex: 'itemUnitDesc', key: '5', width: '100px', align: "center" },
            { title: '收费分类', dataIndex: 'itemTCsubDesc', key: '8', width: '150px', align: "center" },
            { title: '收费大类', dataIndex: 'itemTCDesc', key: '9', width: '150px', align: "center" },
            { title: '物价分类', dataIndex: 'itemPCsubDesc', key: '10', width: '150px', align: "center" },
            { title: '物价大类', dataIndex: 'itemPCDesc', key: '11', width: '150px', align: "center" },
            { title: '住院子类', dataIndex: 'itemICsubDesc', key: '12', width: '150px', align: "center" },
            { title: '住院大类', dataIndex: 'itemICDesc', key: '13', width: '150px', align: "center" },
            { title: '门诊子类', dataIndex: 'itemOCsubDesc', key: '14', width: '150px', align: "center" },
            { title: '门诊大类', dataIndex: 'itemOCDesc', key: '15', width: '150px', align: "center" },
            { title: '核算子类', dataIndex: 'itemECsubDesc', key: '16', width: '150px', align: "center" },
            { title: '核算大类', dataIndex: 'itemECDesc', key: '17', width: '150px', align: "center" },
            { title: '会计子类', dataIndex: 'itemACsubDesc', key: '18', width: '150px', align: "center" },
            { title: '会计大类', dataIndex: 'itemACDesc', key: '19', width: '150px', align: "center" },
            { title: '病案子类', dataIndex: 'itemMCsubDesc', key: '20', width: '150px', align: "center" },
            { title: '病案大类', dataIndex: 'itemMCDesc', key: '21', width: '150px', align: "center" },
            { title: '备注', dataIndex: 'itemRemarks', key: '22', width: '150px', align: "center" },
            { title: '开始日期', dataIndex: 'itemStDate', key: '23', width: '100px', align: "center" },
            { title: '结束日期', dataIndex: 'itemEndDate', key: '24', width: '100px', align: "center" },
            { title: '创建日期', dataIndex: 'itemCreateDate', key: '25', width: '100px', align: "center" },
            { title: '创建时间', dataIndex: 'itemCreateTime', key: '26', width: '100px', align: "center" },
            { title: '创建人员', dataIndex: 'itemCreateUser', key: '27', width: '100px', align: "center" },
            { title: '项目内含', dataIndex: 'itemInClusion', key: '28', width: '100px', align: "center" },
            { title: '除外内容', dataIndex: 'itemExCluded', key: '29', width: '100px', align: "center" },
            { title: '收费说明', dataIndex: 'itemExplain', key: '30', width: '100px', align: "center" },
            { title: '所属物价地区类型', dataIndex: 'itemRegionType', key: '31', width: '150px', align: "center" },
            { title: 'Rowid', dataIndex: 'ID', key: '32', width: '100px', align: "center" },
            { title: 'hospItemID', dataIndex: 'hospItemID', key: '33', width: '100px', align: "center" },
        ]
        this.contrastSelectData = [{
            id: '',
            descripts: '全部',
            descriptsSPCode: 'qb'
        }, {
            id: 'Y',
            descripts: '有效',
            descriptsSPCode: 'yx'
        }, {
            id: 'N',
            descripts: '失效',
            descriptsSPCode: 'sx'
        }]
    }

    componentDidMount() {
        this.handleQuery(); // 初始化收费项列表数据
        this.getRegionSelectData(); // 获取地区下拉框数据
        // this.getHospSelectData(); // 获取医院下拉框数据
        this.getSubclassSelectData(); // 获取子类下拉框数据
        this.getOtherSelectData(); // 1.1.5.费别，等级,单位,地区下拉框数据
        // window.addEventListener("keydown", this.handleOnKeydown)
        this.modalTypeSelectData1() // 获取子类下拉框数据
        this.searachHospDr() //医院列表
    }

    componentWillUnmount() {
        this.setState = (state, callback) => { return; };
        // window.removeEventListener("keydown", this.handleOnKeydown);
    }

    handleOnKeydown = (e) => {
        var e = window.event || e;
        let id = '';
        let obj = {};
        let oneArr = this.state.mainData && this.state.mainData.length > 0 ? this.state.mainData : [];
        switch (e.keyCode) {
            case 38: //上
                if (this.state.rowId) {
                    for (var i = 0; i < oneArr.length; i++) {
                        if (oneArr[i].ID === this.state.rowId) {
                            id = i > 0 ? oneArr[i - 1].ID : oneArr[0].ID;
                            obj = i > 0 ? oneArr[i - 1] : oneArr[0];
                            break;
                        }
                    }
                    this.setState({ rowId: id, rowData: obj })
                } else {
                    this.setState({ rowId: oneArr[0].ID, rowData: oneArr[0] })
                }
                break;
            case 40: //下
                if (this.state.rowId) {
                    for (let i = 0; i < oneArr.length; i++) {
                        if (oneArr[i].ID === this.state.rowId) {
                            id = i + 1 >= oneArr.length ? oneArr[oneArr.length - 1].ID : oneArr[i + 1].ID;
                            obj = i + 1 >= oneArr.length ? oneArr[oneArr.length - 1] : oneArr[i + 1];
                            break;
                        }
                    }
                    this.setState({ rowId: id, rowData: obj })
                } else {
                    this.setState({ rowId: oneArr[0].ID, rowData: oneArr[0] })
                }
                break;
        }
    }

    // 请求列表数据
    getTableData() {
        this.setState({ loading: true });
        let { mainPageSize, mainPage, isContrast } = this.state;
        const { form: { validateFields } } = this.props;
        validateFields((errors, values) => {
            // 验证成功
            if (errors === null) {
                let data = {
                    params: [{
                        itemCode: values.itemCode, // 收费项代码
                        itemdescripts: values.itemdescripts, // 收费项描述
                        alias: values.alias, // 别名
                        hospID: values.hospID, // 医院ID
                        RegionTypeID: values.RegionTypeID, // 地区
                        FindType: this.state.newSelectDataArr || [], // 分类
                        isContrast: isContrast
                    }],
                    pagination: [{
                        pageSize: mainPageSize,
                        currentPage: mainPage,
                        sort: "",
                        dir: "Asc"
                    }]
                }
                $http.post('urlS', this, {
                    code: "05100010",
                    data: data,
                    success: function (res) {
                        if (+res.errorCode === 0 && res.result) {
                            for (var i = 0; i < res.result.Data.length; i++) {
                                res.result.Data[i].key = i + 1
                            }
                            this.setState({ mainData: res.result.Data, total: res.result.TotalCount, loading: false }, () => {
                                // 数据加载成功关闭loading
                                this.child.handleLoading()
                            })
                        } else {
                            this.setState({ mainData: [], total: 0, loading: false }, () => {
                                // 数据加载成功关闭loading
                                this.child.handleLoading();
                            })
                        }
                    },
                    error: function () {
                        this.setState({ mainData: [], total: 0, loading: false }, () => {
                            // 数据加载成功关闭loading
                            this.child.handleLoading();
                        })
                    }
                })
            }
        })
    }

    // 查询收费项信息
    handleQuery = () => {
        this.setState({ mainPage: 1, mainPageSize: 10, rowId: '', rowData: {}, activeKey: '0' }, () => {
            this.getTableData();
        })
    }

    // 提供修改page和pageSize的回调函数
    compilePage(page, pageSize) {
        // 修改page，或者pageSize
        this.setState({ mainPage: page, mainPageSize: pageSize }, () => {
            // 重新调用查询方法
            this.getTableData();
        })
    }

    // 获取地区下拉框数据
    getRegionSelectData = () => {
        let data = {
            params: [{}]
        }
        $http.post('urlS', this, {
            code: "05100089",
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    this.setState({ regionSelectData: res.result })
                }
            }
        })
    }

    // 获取医院下拉框数据
    getHospSelectData = () => {
        let user = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let data = {
            params: [{
                logonGroupID: user && user.groupID ? user.groupID : '', // 登录的角色ID
                logonHospID: user && user.hospID ? user.hospID : '', // 登录的医院
                dataType: 'combo', //
            }]
        }
        $http.post('urlS', this, {
            code: "05100046",
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    this.setState({ hospSelectData: res.Hosp });
                }
            }
        })
    }

    // 获取子类下拉框数据
    getSubclassSelectData = () => {
        let data = {
            params: [{
                hospID: "",
                tartype: 'SUB'
            }]
        }
        $http.post('urlS', this, {
            code: "05100011",
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    this.setState({ subclassSelectData: res })
                }
            }
        })
    }

    // 1.1.5.费别，等级,单位,地区
    getOtherSelectData = () => {
        let data = {
            params: [{}]
        }
        $http.post('urlS', this, {
            code: "05100082",
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    this.setState({ otherSelectData: res })
                }
            }
        })
    }

    // 调用子组件的连接事件
    onRef = (ref) => {
        this.child = ref
    }

    onBasicInRef = (ref) => {
        this.childBasic = ref
    }

    onPriceInRef = (ref) => {
        this.childPrice = ref
    }

    // 切换tabs的回调
    callback = (key) => {
        if (this.state.rowId) {
            this.setState({ activeKey: key }, () => {
                this.onClickRow(this.state.recordData)
            });
        } else {
            message.info("请选择或新增一条收费项信息");
        }
    }

    // 操作行
    onClickRowPublic = (record) => {
        return {
            // 单击行选中
            onClick: () => {
                this.onClickRow(record)
            }
        }
    }

    onClickRow = (record) => {
        this.setState({
            recordData: record
        })
        if (this.state.rowId === '') {
            // 保存行数据以及ID
            this.setState({ rowId: record.ID, rowData: record }, () => {
                this.childBasic && this.childBasic.resetFields(); // 重置基本信息表单
                this.childPrice && this.childPrice.resetFields(); // 重置价格表单及选中数据
            });
        } else {
            if (this.state.rowId !== record.ID) {
                this.setState({ rowId: record.ID, rowData: record }, () => {
                    this.childBasic && this.childBasic.resetFields();  // 重置基本信息表单
                    this.childPrice && this.childPrice.resetFields(); // 重置价格表单及选中数据
                });
            } else {
                // this.setState({rowId: '', rowData: {}}, () => {
                //     this.childBasic&&this.childBasic.resetFields();  // 重置基本信息表单
                //     this.childPrice&&this.childPrice.resetFields(); // 重置价格表单及选中数据
                // })
            }
        }
    }

    // 选中行操作
    setRowClassNamePublic = (record) => {
        return record.ID === this.state.rowId ? 'clickRowStyle' : '';
    }

    // 重置选中数据
    resetFieldsUserInfo = () => {
        this.setState({ rowId: '', rowData: {} })
    }

    // 导出收费项表
    exportChargingItemTable = () => {
        const { form: { validateFields } } = this.props;
        validateFields((errors, values) => {
            // 验证成功
            if (errors === null) {
                let data = {
                    params: [{
                        itemCode: values.itemCode, // 收费项代码
                        itemdescripts: values.itemdescripts, // 收费项描述
                        alias: values.alias, // 别名
                        hospID: values.hospID, // 医院ID
                        RegionTypeID: values.RegionTypeID, // 地区
                        FindType: this.state.newSelectDataArr || [], // 分类
                        isContrast: this.state.isContrast
                    }],
                    pagination: [{
                        pageSize: 10000,
                        currentPage: 1,
                        sort: "",
                        dir: "Asc"
                    }]
                }
                $http.post('urlS', this, {
                    code: "05100010",
                    data: data,
                    success: function (res) {
                        if (+res.errorCode === 0 && res.result) {
                            let arr = res.result.Data ? res.result.Data : [];
                            for (var i = 0; i < arr.length; i++) {
                                arr[i].key = i + 1;
                            }
                            handleExcel.exportExcel(this.columns, arr, '收费项表');
                            this.setState({ exportVisible: false, exportLoading: false, exportCheckMainValue: false, exportCheckDetailValue: false }, () => {
                                message.success("导出收费项表成功");
                            });
                        }
                    }
                })
            }
        })
    }

    // 导出价格表
    exportPriceList = () => {
        let arr = this.state.detailData;
        handleExcel.exportExcel(this.state.detailColumns, arr, '价格表')
        message.success("导出价格表成功");
    }

    // 导出弹框确定
    exportOnOk = () => {
        let { exportCheckMainValue, exportCheckDetailValue } = this.state;
        if (exportCheckMainValue && exportCheckDetailValue) {// 同时导出两张表
            this.setState({ exportLoading: true }, () => {
                this.exportChargingItemTable()
                this.exportPriceList()
            })
        } else if (exportCheckMainValue) {// 导出收费项表
            this.setState({ exportLoading: true }, () => {
                this.exportChargingItemTable()
            })
        } else if (exportCheckDetailValue) {// 导出价格表
            this.exportPriceList();
            this.setState({ exportVisible: false, exportCheckMainValue: false, exportCheckDetailValue: false });
        } else {
            message.info("请选择需要导出的表格")
        }
    }

    // 关闭弹窗
    onCancel = (flag) => {
        if (flag === 'export') {
            this.setState({ exportVisible: false })
        } else if (flag === 'import') {
            this.setState({ importVisible: false })
        }
    }

    // 操作导出收费项Checkbox
    exportCheckedMain = (e) => {
        this.setState({ exportCheckMainValue: e.target.checked })
    }

    // 操作导出价格Checkbox
    exportCheckedDetails = (e) => {
        this.setState({ exportCheckDetailValue: e.target.checked })
    }

    // 操作导入收费项Checkbox
    importCheckedMain = (e) => {
        if (e.target.checked) {
            this.setState({ importCheckMainValue: e.target.checked, importCheckDetailValue: false })
        } else {
            this.setState({ importCheckMainValue: e.target.checked })
        }
    }

    //  操作导入收费项CheckboxstandPublicPrice
    standPublicPrice = (e) => {
        this.setState({ standPublicPrice: e.target.checked })
    }

    //  操作导入收费项CheckboxadjustOfHospitalPrice
    adjustOfHospitalPrice = (e) => {
        this.setState({ adjustOfHospitalPrice: e.target.checked })
    }

    //  操作导入收费项CheckboxassociatedHospital
    associatedHospital = (e) => {
        this.setState({ associatedHospital: e.target.checked })
    }

    regionTypeAddreID = (e) => {
        this.setState({ regionTypeAddreID: e })
    }

    //  操作导入收费项addreR
    addreR = (e) => {
        this.setState({ addreR: e })
        var data = {
            params: [{
                regionTypeID: e,
            }]
        }
        let dataTabRight = []
        $http.post('urlS', this, {
            code: "05100154",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    let resfdata = res.result
                    resfdata.map((item, i) => {
                        let obj = {}
                        obj.ID = item.ID
                        obj.key = item.ID
                        obj.descripts = item.descripts
                        dataTabRight.push(obj)
                    })
                    this.setState({
                        addreRData: dataTabRight || [],
                    })
                }
            }
        });
    }

    //  操作导入收费项addreL
    addreL = (e) => {
        this.setState({ addreL: e })
        var data = {
            params: [{
                regionTypeID: e,
            }]
        }
        let dataTableLeft = []
        $http.post('urlS', this, {
            code: "05100154",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    let resfdata = res.result
                    resfdata.map((item, i) => {
                        let obj = {}
                        obj.ID = item.ID
                        obj.key = item.ID
                        obj.descripts = item.descripts
                        dataTableLeft.push(obj)
                    })
                    this.setState({
                        addreLData: dataTableLeft || [],
                    })
                }
            }
        });
    }

    //  操作导入收费项hospL
    hospL = (e) => {
        this.setState({ hospL: e })
    }

    //  操作导入收费项hospR
    hospR = (e) => {
        this.setState({ hospR: e })
    }

    //  添加addAddrL
    addAddrL = () => {
        let { dataTableLeft, addreLData, addreL } = this.state
        if (!addreL && addreL === '') {
            return false
        }
        let NewdataTableLeft = dataTableLeft.concat(addreLData)
        NewdataTableLeft = ArraySome.ArrayWeigh(NewdataTableLeft, 'remove') // 数组去重
        this.setState({ dataTableLeft: NewdataTableLeft })
    }

    //  添加addHospL
    addHospL = () => {
        let { dataTableLeft, hospL, hospitalData } = this.state
        let obj = {}
        let desData = hospitalData.filter((item) => {
            return item.id === hospL;
        })
        obj.ID = hospL
        obj.key = hospL
        obj.descripts = desData[0].descripts
        dataTableLeft.push(obj)
        // console.log(dataTableLeft)
        // console.log(ArraySome.ArrayWeigh(dataTableLeft, 'remove'))
        dataTableLeft = ArraySome.ArrayWeigh(dataTableLeft, 'remove') // 数组去重
        // console.log(dataTableLeft)
        this.setState({ dataTableLeft: dataTableLeft })
    }

    //  添加addAddrR
    addAddrR = () => {
        let { dataTableRight, addreRData, addreR } = this.state
        if (!addreR && addreR === '') {
            return false
        }
        let NewdataTableLeft = dataTableRight.concat(addreRData)
        NewdataTableLeft = ArraySome.ArrayWeigh(NewdataTableLeft, 'remove') // 数组去重
        this.setState({ dataTableRight: NewdataTableLeft })
    }

    //  添加addHospR
    addHospR = () => {
        let { dataTableRight, hospR, hospitalData } = this.state
        let obj = {}
        let desData = hospitalData.filter((item) => {
            return item.id === hospR;
        })
        obj.ID = hospR
        obj.key = hospR
        obj.descripts = desData[0].descripts
        dataTableRight.push(obj)
        dataTableRight = ArraySome.ArrayWeigh(dataTableRight, 'remove') // 数组去重
        this.setState({ dataTableRight: dataTableRight })
    }

    clearnHosL = (record) => {
        let { dataTableLeft } = this.state
        for (var i = 0; i < dataTableLeft.length; i++) {
            if (dataTableLeft[i].ID == record.ID) {
                dataTableLeft.splice(i, 1);
            }
        }
        let NewdataTableLeft = ArraySome.ArrayWeigh(dataTableLeft, 'remove') // 数组去重
        this.setState({ dataTableLeft: NewdataTableLeft })
    }

    clearnHosR = (record) => {
        let { dataTableRight } = this.state
        for (var i = 0; i < dataTableRight.length; i++) {
            if (dataTableRight[i].ID == record.ID) {
                dataTableRight.splice(i, 1);
            }
        }
        let NewdataTableRight = ArraySome.ArrayWeigh(dataTableRight, 'remove') // 数组去重

        this.setState({ dataTableRight: NewdataTableRight })

    }

    // 操作导入价格Checkbox
    importCheckedDetails = (e) => {
        if (e.target.checked) {
            this.setState({ importCheckDetailValue: e.target.checked, importCheckMainValue: false })
        } else {
            this.setState({ importCheckDetailValue: e.target.checked })
        }
    }

    // 基本信息新增成功之后调用修改tabs方法自动跳转到价格信息
    compileActiveKey = (itemID) => {
        this.setState({ activeKey: '2', rowId: itemID }, () => {
            let page = Math.ceil(Number((this.state.total + 1)) / Number(this.state.mainPageSize));
            this.compilePage(page, this.state.mainPageSize)
        })
    }

    handleExport = () => {
        this.setState({
            exportVisible: true,
            detailData: this.childPrice && this.childPrice.state ? this.childPrice.state.tableData : [],
            detailColumns: this.childPrice && this.childPrice.columns ? this.childPrice.columns : [],
        })
    }

    // 地区切换
    addChange = (e) => {
        this.setState({
            hospSelectData: [],
        })
        var data = {
            params: [{
                regionTypeID: e,
            }]
        }
        $http.post('urlS', this, {
            code: "05100154",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    this.setState({
                        hospSelectData: res.result || [],
                    })
                }
            }
        });
    }

    // 弹框打开
    modalType = () => {
        this.setState({
            modalTypeVisible: true
        })
    }

    modalTypeHandleCancel = () => {
        this.setState({
            modalTypeVisible: false
        }, () => {
            this.getTableData() // 查询
        })
    }

    msg = (data) => {
        this.setState({
            newSelectDataArr: data,
        });
    }

    // 获取子类下拉框数据
    modalTypeSelectData1 = () => {
        let data = {
            params: [{
                hospID: "",
                tartype: 'SUB'
            }]
        }
        $http.post('urlS', this, {
            code: "05100011",
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    var arr = []
                    for (let i in res) {
                        let o = {};
                        o[i] = res[i];
                        arr.push(o)
                    }
                    this.setState({ modalTypeSelectData1: arr }, () => {
                        this.modalTypeSelectData2()
                    })
                }
            }
        })
    }

    // 获取子类下拉框数据
    modalTypeSelectData2 = () => {
        let data = {
            params: [{
                hospID: "",
                tartype: ''
            }]
        }
        $http.post('urlS', this, {
            code: "05100011",
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    var arr = []
                    for (let i in res) {
                        let o = {};
                        o[i] = res[i];
                        arr.push(o)
                    }
                    this.setState({ modalTypeSelectData2: arr }, () => {
                        let modalTypeSelectDataArr = this.state.modalTypeSelectData1.concat(this.state.modalTypeSelectData2)
                        let arrNew = []
                        modalTypeSelectDataArr.forEach((v, i) => {
                            Object.keys(v).forEach(v => {
                                let o = {}
                                o.name = v //取到了key
                                o.val = modalTypeSelectDataArr[i][v] //取到了值
                                arrNew.push(o)
                            })
                        })

                        let arrNew1 = arrNew.filter((item, i) => {
                            return Object.prototype.toString.call(item.val).indexOf('Array') !== -1    //过滤非数组
                        })
                        arrNew1.map((item, i) => {
                            switch (item.name) {
                                case "ACSUBData":
                                    item.label = '会计子类'
                                    break;
                                case "ECSUBData":
                                    item.label = '核算子类'
                                    break;
                                case "ICSUBData":
                                    item.label = '住院子类'
                                    break;
                                case "MCSUBData":
                                    item.label = '病案子类'
                                    break;
                                case "OCSUBData":
                                    item.label = '门诊子类'
                                    break;
                                case "PCSUBData":
                                    item.label = '物价子类'
                                    break;
                                case "TCSUBData":
                                    item.label = '收费子类'
                                    break;
                                case "ACData":
                                    item.label = '会计科目'
                                    break;
                                case "ECData":
                                    item.label = '核算项目分类'
                                    break;
                                case "ICData":
                                    item.label = '住院收据费用'
                                    break;
                                case "MCData":
                                    item.label = '病案分类'
                                    break;
                                case "OCData":
                                    item.label = '门诊收据费用'
                                    break;
                                case "PCData":
                                    item.label = '物价分类'
                                    break;
                                case "TCData":
                                    item.label = '收费分类'
                                    break;
                                default:
                                    break;
                            }
                        })
                        this.setState({
                            modalTypeSelectDataArr: arrNew1
                        })

                    })
                }
            }
        })
    }

    changeType = (e, index) => {
        let { modalTypeSelectDataArr } = this.state
        modalTypeSelectDataArr[index].id = e
        this.setState({
            modalTypeSelectDataArr: modalTypeSelectDataArr
        })
    }

    // 医院列表加载
    searachHospDr = () => {
        var data = {
            params: [{
            }]
        }
        $http.post('urlS', this, {
            code: "01040078",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    this.setState({
                        hospitalData: res.data, //  医院列表
                    })
                }
            }
        });
    }

    // 导入
    beforeUpload = (file, fileList) => {
        var rABS = true;
        const f = fileList[0];
        var reader = new FileReader();
        this.setState({
            loadingFile: true
        })
        reader.onload = event => {
            try {
                const { result } = event.target;
                // 以二进制流方式读取得到整份excel表格对象
                const workbook = XLSX.read(result, { type: 'binary' });
                // 存储获取到的数据
                let data = [];
                // 遍历每张工作表进行读取（这里默认只读取第一张表）
                for (const sheet in workbook.Sheets) {
                    // esline-disable-next-line
                    if (workbook.Sheets.hasOwnProperty(sheet)) {
                        // 利用 sheet_to_json 方法将 excel 转成 json 数据
                        data = data.concat(XLSX.utils.sheet_to_json(workbook.Sheets[sheet]));
                        // break; // 如果只取第一张表，就取消注释这行
                    }
                }
                // 最终获取到并且格式化后的 json 数据

                // this.disposeImportData(data)
                this.setState({ excelData: data, loadingFile: false });
            } catch (e) {
                // 这里可以抛出文件类型错误不正确的相关提示
                message.error('文件类型不正确！');
            }
        };
        if (rABS) reader.readAsBinaryString(f); else reader.readAsArrayBuffer(f);
        return false;
    }

    // 将数组array分成长度为subGroupLength的小数组并返回新数组
    group(array, subGroupLength) {
        let index = 0;
        let newArray = [];
        while (index < array.length) {
            newArray.push(array.slice(index, index += subGroupLength));
        }
        return newArray;
    }

    //导入接口
    disposeImportData() {
        let data = this.state.excelData
        let groupedArray = this.group(data, 500);
        let { dataTableLeft, dataTableRight } = this.state
        let leftID = []
        let rightID = []
        if (this.state.adjustOfHospitalPrice) {
            dataTableLeft.map((item) => {
                leftID.push(item.ID)
            })
        }
        if (this.state.associatedHospital) {
            dataTableRight.map((item) => {
                rightID.push(item.ID)
            })
        }
        groupedArray.map((item, i) => {

            var data = {
                params: [{
                    "userID": JSON.parse(window.sessionStorage.userData).userID, //人员id
                    "ifBasicPrice": this.state.standPublicPrice, //是否作为标准公共价格
                    "regionTypeID": this.state.regionTypeAddreID, //所属地区
                    "changeHospData": leftID, //调整医院价格的医院集
                    "relationHospData": rightID, //关联医院的医院集
                    "pagedata": item, //导入的数据
                }]
            }

            $http.post('urlADS', this, {
                code: "05100164",
                data: data,
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        this.importOnCancel()
                        Modal.success({
                            title: '导入结果',
                            content: '导入成功！总共导入：' + res.num + '条！成功：' + res.successNum + '条！失败：' + res.errNum + '条！',
                            onOk() {
                                Modal.destroy();
                            },
                        });

                    }
                }
            });
        })

    }
    importOnCancel() {
        this.setState({
            importVisible: false,
            importVisible2: false,
            dataTableLeft: [],
            dataTableRight: [],
            standPublicPrice: false, // standPublicPrice
            adjustOfHospitalPrice: false, // adjustOfHospitalPrice
            associatedHospital: false, // associatedHospital
            // hospitalData: [], // 医院data
            addreR: '', // addreR
            addreL: '', // addreL
            addreLData: [], // addreLData
            addreRData: [], // addreLData
            hospL: '', // hospL
            hospR: '', // hospR
            regionTypeAddreID: '', // regionTypeAddreID
            excelData: [], // excelData
            loadingFile: false,
        })
    }

    importOnOk() {
        this.disposeImportData() //导入接口
    }

    importOnOk2() {
        let data = this.state.excelData
        let groupedArray = this.group(data, 500);
        let { dataTableLeft } = this.state
        let leftID = []
        dataTableLeft.map((item) => {
            leftID.push(item.ID)
        })
        groupedArray.map((item, i) => {
            var data = {
                params: [{
                    "regionTypeID": this.state.regionTypeAddreID, //所属地区
                    "userID": JSON.parse(window.sessionStorage.userData).userID, //人员id
                    "changeHospData": leftID, //调整医院价格的医院集
                    "pagedata": item, //导入的数据
                }]
            }
            $http.post('urlADS', this, {
                code: "05100273",
                data: data,
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        this.importOnCancel()
                        /**
                         * @ByShizi: 导入成功之后提示框关闭不了问题处理
                         * Create 2021-03-25
                         * */
                        Modal.success({
                            title: '导入结果',
                            content: '导入成功！总共导入：' + res.num + '条！成功：' + res.successNum + '条！失败：' + res.errNum + '条！',
                            // onOk() {
                            //     Modal.destroy();
                            // },
                        });
                    }
                }
            });
        })
    }

    render() {
        const uploadprops = {
            // 这里我们只接受excel2007以后版本的文件，accept就是指定文件选择框的文件类型
            accept: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
            name: 'file',
            headers: {
                authorization: 'authorization-text',
            },
            showUploadList: false,
            // 把excel的处理放在beforeUpload事件，否则要把文件上传到通过action指定的地址去后台处理
            // 这里我们没有指定action地址，因为没有传到后台
            beforeUpload: this.beforeUpload
        };

        let { mainData, detailData, total, mainPage, exportVisible, exportCheckMainValue, exportCheckDetailValue, importVisible, importVisible2,
            subclassSelectData, otherSelectData, rowData, rowId, activeKey, hospSelectData, regionSelectData, loading, isContrast
        } = this.state;
        const { getFieldDecorator } = this.props.form;
        const formItemInput = {
            labelCol: { span: 9 },
            wrapperCol: { span: 15 }
        };
        // 组件所需参数
        const param = {
            // 表头配置
            columns: this.columns,
            // 表格数据
            data: mainData,
            // 数据总条数
            total: total,
            // 当前页数
            page: mainPage,
            // 表格的宽度
            x: 4200,
            y: store.getState().tableHeight.y - 25,
            height: store.getState().tableHeight.y + 25 + 'px',
            isOnRow: true,
            rowClassName: true,
            loading
        }
        // 地区
        let regionOption = regionSelectData && regionSelectData.map((item, index) => {
            return (<Option key={index} title={item.descripts} value={item.id}>{item.descripts}</Option>)
        })
        // 医院
        let hospOption = hospSelectData && hospSelectData.map((item, index) => {
            return (<Option key={item.ID} value={item.ID} title={item.descripts} seatchprop={item.descripts + '^' + item.descriptsSPCode}>{item.descripts}</Option>)
        })

        const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
        return (
            <div>
                <Row>
                    <Col span={10}>
                        <Card
                            size="small"
                            title={<div className="card-title-left-icon"><div></div>收费项列表</div>}
                        >
                            <div style={{ textAlign: 'center', position: 'absolute', top: '3px', right: '0' }}>
                                <Button onClick={this.handleExport} style={{ border: 'none', color: '#FF7A45' }}>
                                    <Icon type="upload" />导出
                                </Button>
                                <Button onClick={() => this.setState({ importVisible: true })} style={{ border: 'none', color: '#722ED1' }}>
                                    <Icon type="download" />导入
                                </Button>
                                <Button onClick={() => this.setState({ importVisible2: true })} style={{ border: 'none', color: '#1890FF' }}>
                                    <Icon type="unordered-list" />批量调价
                                </Button>
                            </div>
                            <Form>
                                <Row>
                                    <Col span={10}>
                                        <Col span={24}>
                                            <Form.Item label="地区" {...formItemInput}>
                                                {getFieldDecorator('RegionTypeID', {
                                                    initialValue: undefined,
                                                })(
                                                    <Select showSearch allowClear placeholder="请选择" onChange={(event) => { this.addChange(event) }}>
                                                        {regionOption}
                                                    </Select>
                                                )}
                                            </Form.Item>
                                        </Col>
                                        <Col span={24}>
                                            <Form.Item label="代码/名称/别名" {...formItemInput}>
                                                {getFieldDecorator('alias', {
                                                    initialValue: undefined,
                                                })(
                                                    <Input placeholder="请输入" onPressEnter={this.handleQuery} />
                                                )}
                                            </Form.Item>
                                        </Col>
                                    </Col>
                                    <Col span={10}>
                                        <Col span={24}>
                                            <Form.Item label="医院" {...formItemInput}>
                                                {getFieldDecorator('hospID', {
                                                    initialValue: undefined,
                                                })(
                                                    <Select showSearch optionFilterProp="seatchprop" allowClear placeholder="请选择" >
                                                        {hospOption}
                                                    </Select>
                                                )}
                                            </Form.Item>
                                        </Col>

                                        <Col span={24}>
                                            <Form.Item label="标准分类" {...formItemInput}>
                                                {getFieldDecorator('FindType', {
                                                    initialValue: undefined,
                                                })(
                                                    <Button onClick={() => this.modalType()} style={{ width: '100%' }}><Icon type="file-add" />请选择</Button>
                                                )}
                                            </Form.Item>
                                        </Col>
                                    </Col>
                                    <Col span={4}>
                                        <Col span={24}>
                                            <Select
                                                allowClear
                                                showSearch
                                                optionFilterProp="seachprop"
                                                placeholder="请选择"
                                                value={isContrast}
                                                onChange={Util.handleSelectChange.bind(this, 'isContrast')}
                                                style={{ width: '90px', top: '4px', left: '20px' }}
                                            >
                                                {React.$SelectOptions(this.contrastSelectData)}
                                            </Select>
                                        </Col>
                                        <Col span={24}>
                                            <Button onClick={this.handleQuery} style={{ position: 'absolute', right: '0', top: '24px' }}>查询</Button>
                                        </Col>
                                    </Col>
                                </Row>
                                {/* <Form.Item label="收费项代码" {...formItemInput}>
                                    {getFieldDecorator('itemCode', {
                                        initialValue: undefined,
                                    })(
                                        <Input placeholder="请输入" />
                                    )}
                                </Form.Item>
                                <Form.Item label="收费项名称" {...formItemInput}>
                                    {getFieldDecorator('itemdescripts', {
                                        initialValue: undefined,
                                    })(
                                        <Input placeholder="请输入" />
                                    )}
                                </Form.Item> */}
                            </Form>
                        </Card>
                        <div style={{ height: '6px', background: 'rgba(240, 242, 245, 1)', width: '100%' }}></div>
                        {/* 
                            @ByShizi: 编辑主收费项时下拉框上下选择是左侧列表也上下移动问题处理
                            Create 2021-03-25
                        */}
                        <div
                            tabIndex={1}
                            onKeyDown={this.handleOnKeydown}
                            style={{ outline: 'none' }}
                        >
                            <PubilcTablePagination
                                param={param}
                                handelThis={this}
                                onRef={this.onRef}
                                onClickRowPublic={this.onClickRowPublic}
                                setRowClassNamePublic={this.setRowClassNamePublic}
                            />
                        </div>
                    </Col>
                    <Col span={14}>
                        <div style={{ paddingLeft: '6px', position: 'relative' }}>
                            <Card
                                size="small"
                                title={<div className="card-title-left-icon"><div></div>编辑收费项</div>}
                            >
                                <div style={{ height: store.getState().tableHeight.y + 180 + 'px', overflow: 'auto' }} className='greeTab' >
                                    <Tabs onChange={this.callback} activeKey={activeKey} type="card"  >
                                        <TabPane tab="全部信息" key="0">
                                            <Card
                                                className='grayCard'
                                                title='基本信息'
                                                size="small"
                                                style={{ outline: 'none' }}
                                            >
                                                <MTMBasicInformation
                                                    rowId={rowId}
                                                    subclassSelectData={subclassSelectData}
                                                    otherSelectData={otherSelectData}
                                                    rowData={rowData}
                                                    resetFieldsUserInfo={this.resetFieldsUserInfo}
                                                    onRef={this.onBasicInRef}
                                                    compileActiveKey={this.compileActiveKey}
                                                    getTableData={this.getTableData.bind(this)}
                                                />
                                            </Card>
                                            <Card
                                                size="small"
                                                className='grayCard'
                                                title='医院价格信息'
                                                style={{ outline: 'none' }}
                                            >
                                                <MTMPriceInformation
                                                    height={300}
                                                    rowId={rowId}
                                                    rowData={rowData}
                                                    onRef={this.onPriceInRef}
                                                    otherSelectData={otherSelectData}
                                                    hospSelectData={hospSelectData}
                                                />
                                            </Card>
                                            <Card
                                                size="small"
                                                className='grayCard'
                                                title='所属医院'
                                                style={{ outline: 'none' }}
                                            >
                                                <MTMAffiliatedHospital height={300} rowId={rowId} onRef={this.onPriceInRef} />
                                            </Card>
                                            <Card
                                                size="small"
                                                className='grayCard'
                                                title='医保对照'
                                                style={{ outline: 'none' }}
                                            >
                                                <InsuLinkCharge height={300} itmID={rowId} key={rowId} />
                                            </Card>
                                            <Card
                                                size="small"
                                                className='grayCard'
                                                title='公共价格信息'
                                                style={{ outline: 'none' }}
                                            >
                                                <MTMBasicPriceInformation
                                                    height={300}
                                                    rowId={rowId}
                                                    rowData={rowData}
                                                    onRef={this.onPriceInRef}
                                                    otherSelectData={otherSelectData}
                                                />
                                            </Card>
                                            <Card
                                                size="small"
                                                className='grayCard'
                                                title='外部药品目录对照'
                                                style={{ outline: 'none' }}
                                            >
                                                <ExternalDrugLinkCharge
                                                    height={300}
                                                    key={rowId}
                                                    itmID={rowId}
                                                    onRef={this.onBasicInRef}
                                                />
                                            </Card>
                                        </TabPane>
                                        <TabPane tab="基本信息" key="1">
                                            <MTMBasicInformation
                                                rowId={rowId}
                                                subclassSelectData={subclassSelectData}
                                                otherSelectData={otherSelectData}
                                                rowData={rowData}
                                                resetFieldsUserInfo={this.resetFieldsUserInfo}
                                                onRef={this.onBasicInRef}
                                                compileActiveKey={this.compileActiveKey}
                                                getTableData={this.getTableData.bind(this)}
                                            />
                                        </TabPane>
                                        <TabPane tab="医院价格信息" key="2">
                                            <MTMPriceInformation
                                                rowId={rowId}
                                                rowData={rowData}
                                                onRef={this.onPriceInRef}
                                                otherSelectData={otherSelectData}
                                                hospSelectData={hospSelectData}
                                            />
                                        </TabPane>
                                        <TabPane tab="所属医院" key="3">
                                            <MTMAffiliatedHospital rowId={rowId} onRef={this.onPriceInRef} />
                                        </TabPane>
                                        <TabPane tab="医保对照" key="4">
                                            <InsuLinkCharge itmID={rowId} key={rowId} top={'250px'} />
                                        </TabPane>
                                        <TabPane tab="公共价格信息" key="5">
                                            <MTMBasicPriceInformation
                                                rowId={rowId}
                                                rowData={rowData}
                                                onRef={this.onPriceInRef}
                                                otherSelectData={otherSelectData}
                                                insuItemDesc={this.state.insuItemDesc}
                                            />
                                        </TabPane>
                                        <TabPane tab="外部药品目录对照" key="6">
                                            <ExternalDrugLinkCharge itmID={rowId} key={rowId} />
                                        </TabPane>
                                    </Tabs>
                                </div>
                            </Card>
                            <div style={{ width: '6px', background: 'rgba(240, 242, 245, 1)', position: 'absolute', top: 0, left: 0, height: '100%' }}></div>
                        </div>
                    </Col>
                </Row>
                <Modal
                    visible={exportVisible}
                    title="导出Excel表格"
                    okText={<Spin indicator={antIcon} spinning={this.state.exportLoading}>确定</Spin>}
                    onCancel={() => this.onCancel('export')}
                    onOk={this.exportOnOk}
                >
                    <Row style={{ textAlign: 'center', margin: '12px 0' }}>
                        <Col>
                            <Col span={12}>
                                导出收费项表：<Checkbox checked={exportCheckMainValue} onChange={this.exportCheckedMain} disabled={mainData && mainData.length < 1} />
                            </Col>
                            <Col span={12}>
                                导出价格表：<Checkbox checked={exportCheckDetailValue} onChange={this.exportCheckedDetails} disabled={detailData && detailData.length < 1} />
                            </Col>
                        </Col>
                    </Row>
                    <div style={{ position: 'absolute', bottom: '10px', left: '16px', height: '32px', lineHeight: '32px', opacity: '0.5' }}>提示：当表格存在数据时才支持导出功能。</div>
                </Modal>
                <Modal
                    visible={importVisible}
                    title="导入Excel表格"
                    okText="确定"
                    onCancel={() => this.importOnCancel()}
                    onOk={() => this.importOnOk()}
                    width='900px'
                >
                    <Row style={{ textAlign: 'left', margin: '12px 0' }}>
                        <Col span={24}>
                            <Col span={12} className='mB10'>
                                是否作为标准公共价格：<Checkbox checked={this.state.standPublicPrice} onChange={this.standPublicPrice} />
                            </Col>
                            <Col span={12} className='mB10'>
                                所属地区：  <Select showSearch optionFilterProp="seatchprop" placeholder="请选择" style={{ width: '200px' }} value={this.state.regionTypeAddreID} onChange={(event) => { this.regionTypeAddreID(event) }}>
                                    {regionOption}
                                </Select>
                            </Col>
                            <Col span={12} className='mB10'>
                                是否调整医院价格（包括关联医院）：<Checkbox checked={this.state.adjustOfHospitalPrice} onChange={this.adjustOfHospitalPrice} />
                            </Col>
                            <Col span={12} className='mB10'>
                                是否关联医院：<Checkbox checked={this.state.associatedHospital} onChange={this.associatedHospital} />
                            </Col>
                            <Col span={12} style={{ padding: 12 }} >
                                <Card style={{ width: '100%', textAlign: 'center', display: this.state.adjustOfHospitalPrice ? 'block' : 'none' }} title='是否调整医院价格（包括关联医院）' >
                                    <Col span={24} className='mB10'>
                                        地区：<Select showSearch allowClear optionFilterProp="seatchprop" placeholder="请选择" style={{ width: '200px' }} value={this.state.addreL} onChange={(event) => { this.addreL(event) }} >
                                            {regionOption}
                                        </Select><Button className=' mL20' onClick={this.addAddrL}  >添加</Button>

                                    </Col>
                                    <Col span={24} className='mB10'>
                                        医院：<Select showSearch allowClear optionFilterProp="seatchprop" placeholder="请选择" style={{ width: '200px' }} value={this.state.hospL} onChange={(event) => { this.hospL(event) }} >
                                            {this.state.hospitalData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                        </Select><Button className=' mL20' onClick={this.addHospL}  >添加</Button>

                                    </Col>
                                    <Col span={24} className='mB10'>
                                        <Table
                                            pagination={false}
                                            bordered
                                            scroll={{ y: 180 }}
                                            style={{ minHeight: '220px' }}
                                            columns={[
                                                {
                                                    title: '医院',
                                                    dataIndex: 'descripts',
                                                    key: '1',
                                                    align: "center",
                                                    width: '100%',
                                                },]}
                                            dataSource={this.state.dataTableLeft}
                                            className="smallTable"
                                            onRow={(record) => {
                                                return {
                                                    onDoubleClick: (event) => {
                                                        this.clearnHosL(record)
                                                    },
                                                };
                                            }}

                                        />
                                        <div style={{ height: '32px', lineHeight: '32px', opacity: '0.5', textAlign: 'center', color: '#f5222d' }}>双击取消</div>
                                    </Col>


                                </Card>

                            </Col>
                            <Col span={12} style={{ padding: 12 }} >
                                <Card style={{ width: '100%', textAlign: 'center', display: this.state.associatedHospital ? 'block' : 'none' }} title='是否关联医院' >
                                    <Col span={24} className='mB10'>
                                        地区：<Select showSearch allowClear optionFilterProp="seatchprop" placeholder="请选择" style={{ width: '200px' }} value={this.state.addreR} onChange={(event) => { this.addreR(event) }} >
                                            {regionOption}
                                        </Select><Button className=' mL20' onClick={this.addAddrR} >添加</Button>

                                    </Col>
                                    <Col span={24} className='mB10'>
                                        医院：<Select showSearch allowClear optionFilterProp="seatchprop" placeholder="请选择" style={{ width: '200px' }} value={this.state.hospR} onChange={(event) => { this.hospR(event) }} >
                                            {this.state.hospitalData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                        </Select><Button className=' mL20' onClick={this.addHospR} >添加</Button>

                                    </Col>
                                    <Col span={24} className='mB10'>
                                        <Table
                                            pagination={false}
                                            bordered
                                            scroll={{ y: 180 }}
                                            style={{ minHeight: '220px' }}
                                            columns={[
                                                {
                                                    title: '医院',
                                                    dataIndex: 'descripts',
                                                    key: '1',
                                                    align: "center",
                                                    width: '100%',
                                                },]}
                                            dataSource={this.state.dataTableRight}
                                            className="smallTable"
                                            onRow={(record) => {
                                                return {
                                                    onDoubleClick: (event) => {
                                                        this.clearnHosR(record)
                                                    },
                                                };
                                            }}

                                        />
                                        <div style={{ height: '32px', lineHeight: '32px', opacity: '0.5', textAlign: 'center', color: '#f5222d' }}>双击取消</div>
                                    </Col>

                                </Card>

                            </Col>
                            <Col span={24} style={{ textAlign: 'center' }} >
                                <Upload  {...uploadprops}>
                                    <Button disabled={this.state.loadingFile ? true : false}>
                                        <Icon type="upload" /> 导入Excel表格
                                    </Button>
                                </Upload>
                                <Spin tip="正在上传文件,请稍等..." style={{ display: this.state.loadingFile ? 'block' : 'none', marginTop: '30px' }}>

                                </Spin>
                            </Col>
                        </Col>
                    </Row>
                    <div style={{ position: 'absolute', bottom: '10px', left: '16px', height: '32px', lineHeight: '32px', opacity: '0.5' }}>提示：每次只能导入单张表格数据。</div>
                </Modal>
                <Modal
                    visible={importVisible2}
                    title="批量调价"
                    okText="确定"
                    onCancel={() => this.importOnCancel()}
                    onOk={() => this.importOnOk2()}
                    width='600px'
                >
                    <Row style={{ textAlign: 'left', margin: '12px 0' }}>
                        <Col span={24}>
                            <Col span={18} offset={3} style={{ padding: 12 }} >
                                <Card style={{ width: '100%', textAlign: 'center' }} title='是否调整医院价格（包括关联医院）' >
                                    <div style={{ textAlign: 'left', }}>
                                        <Col span={24} className='mB10'>
                                            所属地区：  <Select showSearch optionFilterProp="seatchprop" placeholder="请选择" style={{ width: '200px' }} value={this.state.regionTypeAddreID} onChange={(event) => { this.regionTypeAddreID(event) }}>
                                                {regionOption}
                                            </Select>
                                        </Col>
                                        <Col span={24} className='mB10'>
                                            地区：<Select showSearch allowClear optionFilterProp="seatchprop" placeholder="请选择" style={{ width: '200px' }} value={this.state.addreL} onChange={(event) => { this.addreL(event) }} >
                                                {regionOption}
                                            </Select><Button className=' mL20' onClick={this.addAddrL}  >添加</Button>
                                        </Col>
                                        <Col span={24} className='mB10'>
                                            医院：<Select showSearch allowClear optionFilterProp="seatchprop" placeholder="请选择" style={{ width: '200px' }} value={this.state.hospL} onChange={(event) => { this.hospL(event) }} >
                                                {this.state.hospitalData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                            </Select><Button className=' mL20' onClick={this.addHospL}  >添加</Button>

                                        </Col>
                                    </div>
                                    <Col span={24} className='mB10'>
                                        <Table
                                            pagination={false}
                                            bordered
                                            scroll={{ y: 180 }}
                                            style={{ minHeight: '220px' }}
                                            columns={[
                                                {
                                                    title: '医院',
                                                    dataIndex: 'descripts',
                                                    key: '1',
                                                    align: "center",
                                                    width: '100%',
                                                },]}
                                            dataSource={this.state.dataTableLeft}
                                            className="smallTable"
                                            onRow={(record) => {
                                                return {
                                                    onDoubleClick: (event) => {
                                                        this.clearnHosL(record)
                                                    },
                                                };
                                            }}

                                        />
                                        <div style={{ height: '32px', lineHeight: '32px', opacity: '0.5', textAlign: 'center', color: '#f5222d' }}>双击取消</div>
                                    </Col>
                                </Card>
                            </Col>
                        </Col>
                        <Col span={24} style={{ textAlign: 'center' }} >
                            <Upload  {...uploadprops}>
                                <Button disabled={this.state.loadingFile ? true : false}>
                                    <Icon type="upload" /> 导入Excel表格
                                </Button>
                            </Upload>
                            <Spin tip="正在上传文件,请稍等..." style={{ display: this.state.loadingFile ? 'block' : 'none', marginTop: '30px' }}>

                            </Spin>
                        </Col>
                    </Row>
                </Modal>
                <Modal
                    visible={this.state.modalTypeVisible}
                    title='标准分类'
                    onCancel={this.modalTypeHandleCancel}
                    onOk={this.modalTypeHandleCancel}
                    width='900px'
                >
                    <StandardClassification msg={this.msg} />
                </Modal>
            </div>
        )
    }
};
const MenuTaritemMaintainForm = Form.create()(MenuTaritemMaintain);
export default MenuTaritemMaintainForm;