// 折扣维护

import React from 'react';
import { Select, Input, Row, Col, Button, Spin, Divider, Popconfirm, message, Icon, Form, DatePicker, Table, Tabs, Modal, Card, Pagination, Dropdown } from 'antd';
import { $http } from 'containers/config/https';
import { Keup, ArraySome } from 'tools/index';
import Moment from 'moment';
import PubilcTablePagination from '../../common/PubilcTablePagination.jsx'; // 公共table组件
import DatePickerFormat from '../../../components/datePicker/DatePickerFormat';
import './style/style.less'
import store from '../../../store';
import CommonPagination from 'components/pagination/index';
import ColumnAuthoritysModel from 'pages/columnAuthority/ColumnAuthoritysModel';


// 组件const
const { Option } = Select;
const TabPane = Tabs.TabPane;
const { RangePicker } = DatePicker;
const dateFormat = 'YYYY-MM-DD' || undefined;

export default class OutpatientExpensesInquiry extends React.Component {

    constructor(props) {
        super(props)
        this.state = {
            dataTable1: [], // table数据 主列表table
            dataTable2: [], // table数据 折扣记账系数配置列表
            dataTable3: [], // table数据 不属于折扣内明细
            // 表格数据总条数1
            total1: 0,
            page1: 1,
            pageSize1: 10,
            StartDate1: null,  // //开始日期
            EndDate1: null,  // //结束日期
            // 表格数据总条数2
            total2: 0,
            page2: 1,
            pageSize2: 10,
            StartDate2: null,  // //开始日期
            EndDate2: null,  // //结束日期
            // 表格数据总条数3
            total3: 0,
            page3: 1,
            pageSize3: 10,
            StartDate3: null,  // //开始日期
            EndDate3: null,  // //结束日期
            defaultHos: JSON.parse(window.sessionStorage.userData).hospID,   // 初始医院
            defaultHosModal: JSON.parse(window.sessionStorage.userData).hospID,   // 初始医院弹框
            hospitalData: [], // 医院集合
            modlaTitle: '', // modalTitle
            modalShowPay: false, // modalTitle
            discountCoefficient: '',// 折扣系数
            designatedAmount: '',// 指定金额
            disDis: false,  // //折扣系数
            desDis: false,  // //指定金额
            shaDiss: false,  // //指定金额
            tableName: '',
            typeOfDiscountData: [], //折扣类型
            feesData1: [], //指定金额1
            feesData2: [], //指定金额2
            typeOfDiscount1: '', //折扣类型1
            typeOfDiscount2: '', //指折扣类型2
            fees1: null, //指定金额1
            fees2: null, //指定金额2
            disID1: '',
            disID2: '',
            disID3: '',
            typesOfConsultationData: [],   // 就诊类型
            typesOfConsultation: '',   // 就诊类型
            discountTypeData: [],   // 就诊类型
            discountTypeIDData: [],   // 就诊类型
            coefficientTypeData: [],   // 就诊类型
            discountType: '',
            discountTypeID: '',
            coefficientType: '',
            coefficientType2: '',
            shareFree: '',
            activeKey: '0',
            openSelect: false,    //openSelect
            fees1Val: '',
            fees2Val: '',
            discountTypeChange: '',
            disAdd: false, // 弹框不可修改
            disAddTime: false, // 弹框不可修改时间
            noadd: false,
            active1: '1',
            active2: '1',
            active3: '1',

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

        }

        // // 主列表table
        // this.columns1 = [{ title: '序号', dataIndex: 'number', align: "center", width: 100, key: '1' },
        // { title: '医院', dataIndex: 'disHospDesc', align: "center", width: 200, key: '2' },
        // { title: '就诊类型', dataIndex: 'disAdmTypeDesc', align: "center", width: 100, key: '3' },
        // { title: '折扣类型', dataIndex: 'discountTypeDesc', align: "center", width: 100, key: '4' },
        // { title: '系数类型', dataIndex: 'coefficientType', align: "center", width: 100, key: '5' },
        // { title: '金额', dataIndex: 'free', align: "center", width: 100, key: '6' },
        // { title: '生效日期', dataIndex: 'disStDate', align: "center", width: 100, key: '13' },
        // { title: '失效日期', dataIndex: 'disStopDate', align: "center", width: 100, key: '14' },
        // { title: '创建日期', dataIndex: 'disCreateDate', align: "center", width: 100, key: '10' },
        // { title: '创建时间', dataIndex: 'disCreateTime', align: "center", width: 100, key: '11' },
        // { title: '创建人', dataIndex: 'disCreateUser', align: "center", width: 100, key: '12' }]

        // // 折扣记账系数配置列表

        // this.columns2 = [
        //     {
        //         title: '分类',
        //         dataIndex: 'disSubDisCountConfigTypeDesc',
        //         align: "center",
        //         width: 100,
        //         key: '1'
        //     },
        //     {
        //         title: '项目名称',
        //         dataIndex: 'chargeItemDesc',
        //         align: "center",
        //         width: 100,
        //         key: '2'
        //     },
        //     {
        //         title: '系数类型',
        //         dataIndex: 'coefficientType',
        //         align: "center",
        //         width: 100,
        //         key: '3'
        //     },
        //     {
        //         title: '系数或金额',
        //         dataIndex: 'free',
        //         align: "center",
        //         width: 100,
        //         key: '4'
        //     },
        //     {
        //         title: '生效日期',
        //         dataIndex: 'disSubStDate',
        //         align: "center",
        //         width: 100,
        //         key: '5'
        //     },
        //     {
        //         title: '失效日期',
        //         dataIndex: 'disSubStopDate',
        //         align: "center",
        //         width: 100,
        //         key: '6'

        //     },
        //     {
        //         title: '创建日期',
        //         dataIndex: 'disSubCreateDate',
        //         align: "center",
        //         width: 100,
        //         key: '7'
        //     },
        //     {
        //         title: '创建时间',
        //         dataIndex: 'disSubCreateTime',
        //         align: "center",
        //         defaultSortOrder: 'descend',
        //         width: 100,
        //         key: '8'
        //     },
        //     {
        //         title: '创建人',
        //         dataIndex: 'disSubCreateUser',
        //         align: "center",
        //         width: 100,
        //         key: '9'
        //     }];


        // // 不属于折扣内明细

        // this.columns3 = [
        //     {
        //         title: '分类',
        //         dataIndex: 'disSubDisCountConfigTypeDesc',
        //         align: "center",
        //         width: 100,
        //         key: '1'
        //     },
        //     {
        //         title: '项目名称',
        //         dataIndex: 'chargeItemDesc',
        //         align: "center",
        //         width: 100,
        //         key: '2'
        //     },
        //     {
        //         title: '生效日期',
        //         dataIndex: 'disSubStDate',
        //         align: "center",
        //         width: 100,
        //         key: '3'
        //     },
        //     {
        //         title: '失效日期',
        //         dataIndex: 'disSubStopDate',
        //         align: "center",
        //         width: 100,
        //         key: '4'

        //     },
        //     {
        //         title: '创建日期',
        //         dataIndex: 'disSubCreateDate',
        //         align: "center",
        //         width: 100,
        //         key: '5'
        //     },
        //     {
        //         title: '创建时间',
        //         dataIndex: 'disSubCreateTime',
        //         align: "center",
        //         width: 100,
        //         key: '6'
        //     },
        //     {
        //         title: '创建人',
        //         dataIndex: 'disSubCreateUser',
        //         align: "center",
        //         width: 100,
        //         key: '7'
        //     }
        // ];

        this.menuColumns = [
            {
                title: this.state.languageCode === "CN" ? '代码' : 'Code',
                dataIndex: 'code',
                align: "center",
                width: 100,
                key: '1'
            },
            {
                title: this.state.languageCode === "CN" ? '名称' : 'Name',
                dataIndex: 'descripts',
                align: "center",
                width: 100,
                key: '2'
            }
        ]



    }

    componentDidMount() {
        this.tableList("DiscountMaintenance", "DiscountMaintenance");
        this.tableList("DiscountMaintenance", "DiscountConfig");
        this.tableList("DiscountMaintenance", "NotDiscount");
        // 医院列表加载
        this.searachHospDr()

        // 科室加载
        this.hospDrChange(this.state.defaultHos)

        //折扣类型
        this.typeOfDiscount()

        //就诊类型
        this.typesOfConsultationData()
    }


    onColumnRef = (ref) => {
        this.columnRef = ref;
    }
    // 获取主列表columns
    tableList = (reactCode, compontName) => {
        var data = {
            params: [{
                "reactCode": [reactCode],
                "compontName": compontName,
                "type": "C"
            }]
        }
        $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.setState({ ColumnAuthority: compontName }, () => this.columnRef.onOpenModel())}>{item.title}</div>,
                            display: item.display,
                            key: item.seqNo
                        }
                    }) : '';
                    let filterArr = arr.filter(function (item) { return item.display === 'Y' });
                    if (compontName === 'DiscountMaintenance') {
                        this.setState({
                            columns1: filterArr,
                            languageTable1: res.result.B || {},  // 国际化Table1
                            languageTable2: res.result.C || {},  // 国际化Table2
                            languageData: res.result.language || {},  // 国际化语言包
                        }, () => {
                            this.LanCNEN(this.state.languageCode)
                        })
                    } else if (compontName === 'DiscountConfig') {
                        this.setState({
                            columns2: filterArr,
                        })
                    } else if (compontName === 'NotDiscount') {
                        this.setState({
                            columns3: filterArr,
                        })
                    }

                }
            }
        })
    }

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

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

    // 条数改变的回调
    apponShowSizeChange = (current, size) => {
        this.setState({
            page: current,
            pageSize: size,
        }, () => {
            // 重新调用查询方法
            this.handleQuery();
        });
    }

    activeKeyChange = (activeKey) => {
        this.setState({
            activeKey: activeKey
        })
    }

    // 就诊类型
    typesOfConsultationData = () => {
        var data = {
            params: [{
            }]
        }

        $http.post('urlS', this, {
            code: "05100222",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    this.setState({
                        typesOfConsultationData: res.admTypeData || [], //  就诊类型
                        discountTypeData: res.discData || [],   // 折扣类型下拉框
                        coefficientTypeData: res.coefficientData || [],    // 系数类型下拉款
                    })
                }
            }
        });
    }



    // 医院列表加载
    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, //  医院列表
                    })
                }
            }
        });
    }


    // 医院切换
    hospDrChange = (value) => {
        if (!value) {
            return false
        }

        this.setState({
            defaultHos: value,
            page1: 1,
            pageSize1: 10
        }, () => {
            this.searchTable1() //第一个table
        });
    }

    // 医院弹框
    hospDrChangeModal = (value) => {
        if (!value) {
            return false
        }
        this.setState({
            defaultHosModal: value,
        });
    }

    //第一个table
    searchTable1 = () => {
        let { defaultHos, pageSize1, page1, active1 } = this.state

        let data = {
            params: [{
                "hospID": defaultHos,
                active: active1,
            }],
            // pagination: [{
            //     pageSize: pageSize1,
            //     currentPage: page1,
            // }]
        };
        $http.post('urlS', this, {
            code: "05100025",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;

                if (errorCode === '0') {
                    for (var i = 0; i < res.disArrInfo.length; i++) {
                        res.disArrInfo[i].key = i;
                    }
                    this.setState({
                        dataTable1: res.disArrInfo || [],
                        total1: res.total,
                    })
                } else {
                    this.setState({
                        dataTable1: [],
                        total1: 0,
                    })
                }
            }
        });
    }

    //第二个table
    searchTable2 = () => {
        let { defaultHos, pageSize2, page2, active2 } = this.state
        // if (!this.state.fees1 || this.state.fees1 === '') {
        //     message.warning('请选择下拉框')
        //     return false;
        // }
        let DiscountData = this.state.typeOfDiscountData.filter((item) => {
            return item.conLinkUserName === this.state.typeOfDiscount1;
        })

        if (!this.state.disID1 || this.state.disID1 === '') {
            return false
        }
        let data = {
            params: [{
                "disID": this.state.disID1 || '',
                disCountConfigTypeID: DiscountData && DiscountData[0] ? DiscountData[0].id : '',
                linkTableID: this.state.fees1 || '',
                active: active2,
            }],
            pagination: [{
                pageSize: pageSize2,
                currentPage: page2,
            }]
        };
        $http.post('urlS', this, {
            code: "05100035",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;

                if (errorCode === '0') {
                    for (var i = 0; i < res.disInfoArr.length; i++) {
                        res.disInfoArr[i].key = i;
                    }
                    this.setState({
                        dataTable2: res.disInfoArr || [],
                        total2: res.total,
                    })
                } else {
                    this.setState({
                        dataTable2: [],
                        total2: 0,
                    })
                }
            }
        });
    }

    //第三个table
    searchTable3 = () => {
        let { defaultHos, pageSize3, page3, active3 } = this.state
        // if (!this.state.fees2 || this.state.fees2 === '') {
        //     message.warning('请选择下拉框')
        //     return false;
        // }
        let DiscountData = this.state.typeOfDiscountData.filter((item) => {
            return item.conLinkUserName === this.state.typeOfDiscount2;
        })

        if (!this.state.disID1 || this.state.disID1 === '') {
            return false
        }
        let data = {
            params: [{
                "disID": this.state.disID1 || '',
                disCountConfigTypeID: DiscountData && DiscountData[0] ? DiscountData[0].id : '',
                linkTableID: this.state.fees2 || '',
                active: active3,
            }],
            pagination: [{
                pageSize: pageSize3,
                currentPage: page3,
            }]
        };
        $http.post('urlS', this, {
            code: "05100041",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;

                if (errorCode === '0') {
                    for (var i = 0; i < res.disExceptInfoArr.length; i++) {
                        res.disExceptInfoArr[i].key = i;
                    }
                    this.setState({
                        dataTable3: res.disExceptInfoArr || [],
                        total3: res.total,
                    })
                } else {
                    this.setState({
                        dataTable3: [],
                        total3: 0,
                    })
                }
            }
        });
    }

    // 回显table1
    callTable1 = (record) => {
        this.setState({
            defaultHosModal: record.disHospID || '',   // 医院
            typesOfConsultation: record.disAdmTypeID || '',   // 就诊类型
            discountType: record.discountType || '',   // 折扣类型
            discountTypeID: record.discountTypeID || '',   // 对应
            coefficientType: record.coefficientType || '',   // 系数类型,
            free: record.free || '',   // 金额
            StartDate1: record.disStDate || undefined,  // //开始日期
            EndDate1: record.disStopDate || undefined,  // //结束日期
            modlaTitle: this.state.languageCode === "CN" ? '编辑' : 'Edit',
            disID: record.disID || '',   // disID
            disAdd: true,
            disAddTime: !record.disStopDate || record.disStopDate === '' ? false : true,
        }, () => {
            // 弹框打开
            this.modalTrue()
            this.discountType(record.discountType)
        })
    }

    // 回显table2
    callTable2 = (record) => {
        this.setState({
            StartDate2: record.disSubStDate || undefined,  // //开始日期
            EndDate2: record.disSubStopDate || undefined,  // //结束日期
            coefficientType2: record.coefficientType || undefined,  // //折扣系数
            designatedAmount: record.free || undefined,  // //指定金额
            typeOfDiscount1: record.conLinkUserName || undefined,  // //指定金额
            fees1Val: record.chargeItemDesc || undefined,  // //指定金额
            active2: record.stopFlag === 'Y' ? '2' : '1',  // //指定金额
        })


    }


    // 回显table3
    callTable3 = (record) => {
        this.setState({
            StartDate3: record.disSubStDate || undefined,  // //开始日期
            EndDate3: record.disSubStopDate || undefined,  // //结束日期
            typeOfDiscount2: record.conLinkUserName || undefined,  // //指定金额
            fees2Val: record.chargeItemDesc || undefined,  // //指定金额
            active3: record.stopFlag === 'Y' ? '2' : '1',  // //指定金额
        })
    }

    // 保存/编辑table1
    addTableBody = () => {
        //  不可修改不调接口
        if (this.state.disAddTime) {
            return false
        }
        var data = {
            params: [{
                "disID": this.state.disID,
                "updateUserID": JSON.parse(window.sessionStorage.userData).userID,
                "hospID": this.state.defaultHosModal,
                "admTypeID": this.state.typesOfConsultation,
                "stDate": this.state.StartDate1 ? Moment(this.state.StartDate1).utcOffset(480).format('YYYY-MM-DD') : '',
                "endDate": this.state.EndDate1 ? Moment(this.state.EndDate1).utcOffset(480).format('YYYY-MM-DD') : '',
                discountType: this.state.discountType,
                discountTypeID: this.state.discountTypeID,
                coefficientType: this.state.coefficientType,
                free: this.state.free,
            }]
        }

        $http.post('urlS', this, {
            code: "05100026",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    this.handleCancel()
                    this.searchTable1()
                    message.success(res.errorMessage)
                }
            }
        });
    }

    // 保存/编辑table2
    addTableRight = () => {
        if (this.state.noadd) {
            message.warning('该记录已失效')
            return false
        }
        if (this.state.disID2 && this.state.disID2 !== '') {
            //编辑
            var data = {
                params: [{
                    "disID": this.state.disID2,
                    "updateUserID": JSON.parse(window.sessionStorage.userData).userID,
                    "stDate": this.state.StartDate2 ? Moment(this.state.StartDate2).utcOffset(480).format('YYYY-MM-DD') : '',
                    "stopDate": this.state.EndDate2 ? Moment(this.state.EndDate2).utcOffset(480).format('YYYY-MM-DD') : '',
                }]
            }

            $http.post('urlADS', this, {
                code: "05100036",
                data: data,
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        this.clearn()
                        message.success(res.errorMessage)
                    }
                }
            });
        } else {
            // 新增
            let DiscountData = this.state.typeOfDiscountData.filter((item) => {
                return item.conLinkUserName === this.state.typeOfDiscount1;
            })

            if (DiscountData.length < 1) {
                message.warning('请选择收费项')
                return false
            }

            var data = {
                "params": [{
                    "disID": this.state.disID1,
                    "updateUserID": JSON.parse(window.sessionStorage.userData).userID,
                    "upData": [{
                        "disCountConfigTypeID": DiscountData[0].id || '',
                        "chargeItemID": this.state.fees1 || '',
                        coefficientType: this.state.coefficientType2 || '',
                        free: this.state.designatedAmount || '',
                        "stDate": this.state.StartDate2 ? Moment(this.state.StartDate2).utcOffset(480).format('YYYY-MM-DD') : '',
                        "stopDate": this.state.EndDate2 ? Moment(this.state.EndDate2).utcOffset(480).format('YYYY-MM-DD') : '',
                    }]
                }]
            }

            $http.post('urlADS', this, {
                code: "05100134",
                data: data,
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        this.clearn()

                        message.success(res.errorMessage)

                    }
                }
            });
        }

    }

    // 保存/编辑table3
    addTableRightBottom = () => {
        if (this.state.noadd) {
            message.warning('该记录已失效')
            return false
        }
        if (this.state.disID3 && this.state.disID3 !== '') {
            //编辑
            var data = {
                params: [{
                    "disID": this.state.disID3,
                    "updateUserID": JSON.parse(window.sessionStorage.userData).userID,
                    "stDate": this.state.StartDate3 ? Moment(this.state.StartDate3).utcOffset(480).format('YYYY-MM-DD') : '',
                    "stopDate": this.state.EndDate3 ? Moment(this.state.EndDate3).utcOffset(480).format('YYYY-MM-DD') : '',
                }]
            }

            $http.post('urlADS', this, {
                code: "05100042",
                data: data,
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {

                        this.clearn()
                        message.success(res.errorMessage)
                    }
                }
            });
        } else {
            // 新增
            let DiscountData = this.state.typeOfDiscountData.filter((item) => {
                return item.conLinkUserName === this.state.typeOfDiscount2;
            })

            // if (!this.state.fees2 || this.state.fees2 === '') {
            //     message.warning('请选择下拉框')
            //     return false;
            // }

            if (DiscountData.length < 1) {
                message.warning('请选择收费项')
                return false
            }


            var data = {
                params: [{
                    "disID": this.state.disID1,
                    "updateUserID": JSON.parse(window.sessionStorage.userData).userID,
                    "upExceptData": [{
                        "disCountConfigTypeID": DiscountData[0].id || '',
                        "chargeItemID": this.state.fees2 || '',
                        "stDate": this.state.StartDate3 ? Moment(this.state.StartDate3).utcOffset(480).format('YYYY-MM-DD') : '',
                        "stopDate": this.state.EndDate3 ? Moment(this.state.EndDate3).utcOffset(480).format('YYYY-MM-DD') : '',
                    }]
                }]
            }

            $http.post('urlADS', this, {
                code: "05100133",
                data: data,
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        this.clearn()
                        message.success(res.errorMessage)
                    }
                }
            });

        }
    }

    // table1组件改变
    StartDate1 = (e) => {
        this.setState({
            StartDate1: e, //  开始时间
        })
    }

    EndDate1 = (e) => {
        this.setState({
            EndDate1: e, //  结束时间
        })
    }


    // table2组件改变

    StartDate2 = (e) => {
        this.setState({
            StartDate2: e, //  开始时间
        })
    }

    EndDate2 = (e) => {
        this.setState({
            EndDate2: e, //  结束时间
        })
    }

    // table3组件改变

    StartDate3 = (e) => {
        this.setState({
            StartDate3: e, //  开始时间
        })
    }

    EndDate3 = (e) => {
        this.setState({
            EndDate3: e, //  结束时间
        })
    }


    //  就诊类型
    typesOfConsultation = (e) => {
        this.setState({
            typesOfConsultation: e,
        })
    }

    // 折扣类型
    discountType = (e) => {
        this.setState({
            discountType: e,
        }, () => {
            var data = {
                params: [{
                    "type": e,
                    "hospID": this.state.defaultHos || '',
                }]
            }

            $http.post('urlADS', this, {
                code: "05100221",
                data: data,
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        let fill = this.state.discountTypeData.filter((item, i) => {
                            return item.id === e
                        })
                        this.setState({
                            discountTypeIDData: res.data || [],
                            discountTypeChange: fill[0].descripts || ''
                        })
                    }
                }
            });
        })
    }
    discountTypeID = (e) => {
        this.setState({
            discountTypeID: e,
        })
    }
    coefficientType = (e) => {
        this.setState({
            coefficientType: e,
        })
    }
    coefficientType2 = (e) => {
        this.setState({
            coefficientType2: e,
        })
    }
    free = (e) => {
        this.setState({
            free: e.target.value,//  收费
        })
    }

    active1 = (e) => {
        this.setState({
            active1: e,//  收费
        }, () => {
            this.searchTable1()
        })
    }

    active2 = (e) => {
        this.setState({
            active2: e,//  收费
        })
    }

    active3 = (e) => {
        this.setState({
            active3: e,//  收费
        })
    }




    // 折扣类型
    typeOfDiscount = () => {
        var data = {
            params: [{
            }]
        }

        $http.post('urlS', this, {
            code: "05100131",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    this.setState({
                        typeOfDiscountData: res.data || [], //  折扣类型列表
                    })
                }
            }
        });
    }

    //  折扣类型变化1
    typeOfDiscount1 = (e, is) => {
        console.log(e, is, "zxz1111")
        console.log(this.state.fees1Val, "fees1Val")
        if (!is) {
            this.setState({
                fees1Val: '',
            })
        }
        this.setState({
            typeOfDiscount1: e, //  折扣类型变化1
            feesData1: [],
        }, () => {
            if (!e) {
                return false
            }
            if (!this.state.fees1Val) return;
            var data = {
                params: [{
                    "tableNameStr": this.state.typeOfDiscount1 || '',
                    "hospID": this.state.defaultHos || '',
                    desc: this.state.fees1Val || ''
                }]
            }

            $http.post('urlS', this, {
                code: "05100132",
                data: data,
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        let data = res.data
                        for (var i = 0; i < data.length; i++) {
                            data[i].key = i;
                        }

                        this.setState({
                            feesData1: data || [], //  收费项列表
                        })

                    }
                }
            });
        })
    }


    //  折扣类型变化2
    typeOfDiscount2 = (e, is) => {
        console.log(e, is, "zxz2222")
        if (!is) {
            this.setState({
                fees2Val: '',
            })
        }
        this.setState({
            typeOfDiscount2: e, //  折扣类型变化2
        }, () => {
            if (!e) {
                return false
            }

            var data = {
                params: [{
                    "tableNameStr": this.state.typeOfDiscount2 || '',
                    "hospID": this.state.defaultHos || '',
                    desc: this.state.fees2Val || ''
                }]
            }

            $http.post('urlS', this, {
                code: "05100132",
                data: data,
                success: function (res) {
                    let errorCode = res.errorCode;
                    let data = res.data
                    for (var i = 0; i < data.length; i++) {
                        data[i].key = i;
                    }
                    if (errorCode === '0') {

                        this.setState({
                            // fees2Val:'',
                            feesData2: data || [],//  收费项列表
                        })

                    }
                }
            });
        })
    }

    //  收费项变化1
    fees1 = (e) => {
        let val = this.state.feesData1.filter((item) => {
            return item.id === e;
        })


        this.setState({
            fees1: e, //  折扣类型变化1
            fees1Val: val[0].descripts, //  折扣类型变化1
        })
    }


    //  收费项变化2
    fees2 = (e) => {
        let val = this.state.feesData2.filter((item) => {
            return item.id === e;
        })

        this.setState({
            fees2: e, //  折扣类型变化2
            fees2Val: val[0].descripts, //  折扣类型变化2
        })
    }

    onChangeInput1 = (e) => {
        this.setState({
            fees1Val: e.target.value,//  收费项
        }  , () => {
            this.typeOfDiscount1(this.state.typeOfDiscount1, 'N')
        })
    }
    onChangeInput2 = (e) => {
        this.setState({
            fees2Val: e.target.value,//  收费项
        }, () => {
            this.typeOfDiscount2(this.state.typeOfDiscount2, 'N')
        })

    }


    // 指定金额
    designatedAmount = (e) => {



        let val = e.target.value
        this.setState({
            designatedAmount: Keup.MoneyReplace(val) // 金额过滤
        })
        if (!val || val === '') {
            this.setState({
                disDis: false,
                shaDis: false,
            })
        } else {
            this.setState({
                disDis: true,
                shaDis: true,
            })
        }
    }

    // 折扣系数
    discountCoefficient = (e) => {
        let val = e.target.value
        this.setState({
            discountCoefficient: Keup.MoneyReplace(val) // 金额过滤
        })
        if (!val || val === '') {
            this.setState({
                shaDis: false,
                desDis: false,
            })
        } else {
            this.setState({
                desDis: true,
                shaDis: true,
            })
        }

    }

    // 记账系数
    shareFree = (e) => {
        let val = e.target.value
        this.setState({
            shareFree: Keup.MoneyReplace(val) // 金额过滤
        })

        if (!val || val === '') {
            this.setState({
                disDis: false,
                desDis: false,
            })
        } else {
            this.setState({
                desDis: true,
                disDis: true,
            })
        }

    }




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

    // 显示分页总条数
    showTotal(total) {
        return `共 ${total} 条`;
    }

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

    // 页码改变的回调，参数是改变后的页码及每页条
    onChange2 = (page, pageSize) => {
        this.setState({ page2: page, pageSize2: pageSize }, () => {
            // 重新调用查询方法
            this.searchTable2();
        })
    }

    // 条数改变的回调
    onShowSizeChange2 = (current, size) => {
        this.setState({ page2: 1, pageSize2: size }, () => {
            // 重新调用查询方法
            this.searchTable2();
        })

    }

    // 页码改变的回调，参数是改变后的页码及每页条
    onChange3 = (page, pageSize) => {
        this.setState({ page3: page, pageSize3: pageSize }, () => {
            // 重新调用查询方法
            this.searchTable3();
        })
    }

    // 条数改变的回调
    onShowSizeChange3 = (current, size) => {
        this.setState({ page2: 1, pageSize3: size }, () => {
            // 重新调用查询方法
            this.searchTable3();
        })

    }




    // 操作行
    onClickRowPublic1 = (record) => {
        return {
            // 单击行选中
            onClick: () => {
                if (record.stopFlag === 'Y') {
                    this.setState({
                        noadd: true
                    })
                } else {
                    this.setState({
                        noadd: false
                    })
                }

                this.setState({
                    disID1: record.disID,
                    disID2: '',
                    disID2: '',
                }, () => {
                    this.clearn()
                })
            },
            // 单击行选中
            onDoubleClick: () => {
                if (record.stopFlag === 'Y') {
                    this.setState({
                        noadd: true
                    })
                } else {
                    this.setState({
                        noadd: false
                    })
                }
                this.setState({ disID1: record.disID, disID2: '', disID3: '' }, () => {
                    this.callTable1(record)
                })
            }
        }
    }

    // 选中行操作
    setRowClassNamePublic1 = (record) => {
        return record.disID === this.state.disID1 ? 'clickRowStyle' : '';
    }




    // 操作行
    onClickRowPublic2 = (record) => {
        this.setState({ disID2: record.disSubsID }, () => {
            this.callTable2(record)
        })
    }

    // 选中行操作
    setRowClassNamePublic2 = (record) => {
        return record.disSubsID === this.state.disID2 ? 'clickRowStyle' : '';
    }

    // 操作行
    onClickRowPublic3 = (record) => {
        this.setState({ disID3: record.disExceptID }, () => {
            this.callTable3(record)
        })
    }

    // 选中行操作
    setRowClassNamePublic3 = (record) => {
        return record.disExceptID === this.state.disID3 ? 'clickRowStyle' : '';
    }

    // 弹框打开
    modalTrue = () => {
        this.setState({
            modalShowPay: true,
        });
    }


    // 清除添加属性
    clearn = () => {
        this.setState({
            disCountConfigTypeID: undefined,
            linkTableID: undefined,
            StartDate2: undefined,  // //开始日期
            EndDate2: undefined,  // //结束日期
            StartDate3: undefined,  // //开始日期
            EndDate3: undefined,  // //结束日期
            discountType: undefined,
            discountTypeID: undefined,
            coefficientType: undefined,
            coefficientType2: undefined,
            typeOfDiscount1: undefined, //折扣类型1
            typeOfDiscount2: undefined, //指折扣类型2
            fees1Val: undefined,
            fees2Val: undefined,
            fees1: undefined,
            fees2: undefined,
            designatedAmount: undefined,
            disID2: undefined,
            disID2: undefined,
        }, () => {
            this.searchTable2()
            this.searchTable3()

        })
    }

    // 弹框关闭
    handleCancel = () => {
        this.setState({
            modalShowPay: false,
            disAdd: false,
            disAddTime: false,
            discountType: '',   // 折扣类型
            discountTypeID: '',   // 对应
            coefficientType: '',   // 系数类型,
            free: '',   // 金额
            StartDate1: undefined,  // //开始日期
            EndDate1: undefined,  // //结束日期
        });
    }
    // 弹框确定
    handleOk = () => {
        this.addTableBody() // 弹框关闭

    }

    // 开始日期选择限制
    disabledStDate(current) {
        // 开始日期不能选择今天和之前的日期
        return current && current < Moment().endOf('day');
    }

    // 开始日期选择限制
    disabledStDate2(current) {
        // 开始日期不能选择今天和之前的日期
        return current && current < Moment().add(-1, 'd');
    }

    render() {
        let { language, languageCode } = this.state

        // 组件所需参数
        const param1 = {
            // 表头配置
            columns: this.columns1,
            // 表格数据
            data: this.state.dataTable1,
            // 数据总条数
            total: this.state.total1,
            // 数据页数
            // page: this.state.page1,
            x: 1200,
            height: 220,
            y: 180,
            isOnRow: true,
            rowClassName: true
        }

        // 组件所需参数
        const param2 = {
            // 表头配置
            columns: this.columns2,
            // 表格数据
            data: this.state.dataTable2,
            // 数据总条数
            total: this.state.total2,
            // 数据页数
            page: this.state.page2,
        }

        // 组件所需参数
        const param3 = {
            // 表头配置
            columns: this.columns3,
            // 表格数据
            data: this.state.dataTable3,
            // 数据总条数
            total: this.state.total3,
            // 数据页数
            page: this.state.page3,
        }

        const menu1 = (
            <div style={{ width: '220px' }}>
                <Table
                    columns={this.menuColumns}
                    dataSource={this.state.feesData1}
                    pagination={false}
                    scroll={{ y: 240 }}
                    onRow={(record) => {
                        return {
                            onClick: (event) => {
                                this.fees1(record.id)

                            },
                        };
                    }} />
            </div>

        );

        const menu2 = (
            <div style={{ width: '220px' }}>
                <Table
                    columns={this.menuColumns}
                    dataSource={this.state.feesData2}
                    pagination={false}
                    scroll={{ y: 240 }}
                    onRow={(record) => {
                        return {
                            onClick: (event) => {
                                this.fees2(record.id)
                            },
                        };
                    }} />
            </div>

        );

        return (
            <div>
                <div>
                    <Row>
                        <Col span={24}>
                            <Card style={{ width: '100%', padding: '0' }} className='pd0'>
                                <Row style={{ minHeight: '50px', padding: '0 24px 10px 24px' }}>
                                    <Col span={24}>
                                        <Select showSearch allowClear optionFilterProp="title" value={this.state.defaultHos} onChange={(event) => { this.hospDrChange(event) }} placeholder={languageCode === 'CN' ? "允许登陆医院" : 'Hospital'} style={{ width: '180px', margin: '12px 15px 0 0' }} >
                                            {this.state.hospitalData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                        </Select>
                                        <Select allowClear optionFilterProp="title" value={this.state.active1} onChange={(event) => { this.active1(event) }} placeholder={languageCode === 'CN' ? "状态" : 'Status'} style={{ width: '100px', margin: '12px 15px 0 0' }} >
                                            <Option title={languageCode === 'CN' ? "生效" : 'Effective'} key='1' value='1'  >{languageCode === 'CN' ? "生效" : 'Effective'}</Option>
                                            <Option title={languageCode === 'CN' ? "失效" : 'Invalid'} key='2' value='2'  >{languageCode === 'CN' ? "失效" : 'Invalid'}</Option>
                                            <Option title={languageCode === 'CN' ? "全部" : 'All'} key='3' value='3'  >{languageCode === 'CN' ? "全部" : 'All'}</Option>
                                        </Select>
                                        <Button style={{ margin: '12px 15px 0 0', background: 'rgba(66, 185, 131)', color: '#fff' }} onClick={() => {
                                            this.setState({
                                                modlaTitle: this.state.languageCode === "CN" ? '新增' : 'Add',
                                            }, () => { this.modalTrue() })
                                        }} >{language.DiscountMaintenanceadd && language.DiscountMaintenanceadd.descripts}</Button>
                                    </Col>

                                </Row>
                                <div style={{ height: ' 10px', background: 'rgb(240, 242, 245)' }}></div>
                                <div style={{ padding: 24, }} >
                                    {/* handelThis将夫组件的属性与方法给子组件访问 */}
                                    {/* <PubilcTablePagination
                                        param={param1}
                                        onRef={this.onRef}
                                        onClickRowPublic={this.onClickRowPublic1}
                                        setRowClassNamePublic={this.setRowClassNamePublic1}
                                    /> */}
                                    <Table
                                        dataSource={this.state.dataTable1}
                                        columns={this.state.columns1}
                                        className='TableA'
                                        //rowClassName="editable-row"
                                        pagination={false}
                                        style={{ minHeight: '200px' }}
                                        scroll={{ y: 150, }}
                                        bordered
                                        loading={this.state.loading}
                                        rowClassName={(record) => this.setRowClassNamePublic1(record)}
                                        onRow={(record) => {
                                            return {
                                                // 单击行选中
                                                onClick: () => {
                                                    if (record.stopFlag === 'Y') {
                                                        this.setState({
                                                            noadd: true
                                                        })
                                                    } else {
                                                        this.setState({
                                                            noadd: false
                                                        })
                                                    }

                                                    this.setState({
                                                        disID1: record.disID,
                                                        disID2: '',
                                                        disID2: '',
                                                    }, () => {
                                                        this.clearn()
                                                    })
                                                },
                                                // 单击行选中
                                                onDoubleClick: () => {
                                                    if (record.stopFlag === 'Y') {
                                                        this.setState({
                                                            noadd: true
                                                        })
                                                    } else {
                                                        this.setState({
                                                            noadd: false
                                                        })
                                                    }
                                                    this.setState({ disID1: record.disID, disID2: '', disID3: '' }, () => {
                                                        this.callTable1(record)
                                                    })
                                                }
                                            };
                                        }}
                                    />
                                    <ColumnAuthoritysModel
                                        clientWidth='900px'
                                        compontName={this.state.ColumnAuthority}
                                        configType="C"
                                        onRef={this.onColumnRef}
                                        reloadData={() => {
                                            this.tableList("DiscountMaintenance", this.state.ColumnAuthority)
                                        }}
                                    />
                                </div>
                            </Card>
                        </Col>
                        <Col span={24}>
                            <Row span={24} style={{ padding: '0 24px' }}>
                                <Tabs defaultActiveKey="0" activeKey={this.state.activeKey} onChange={this.activeKeyChange}>
                                    <TabPane tab={language.DiscountMaintenancediscountConfig && language.DiscountMaintenancediscountConfig.descripts} key='0'  >
                                        <Col >
                                            <div >
                                                <Row style={{ minHeight: '80px', padding: '0 24px 0 24px' }}>
                                                    <Col span={24}>
                                                        <Select disabled={this.state.disID1 === '' ? true : false} allowClear value={this.state.typeOfDiscount1} optionFilterProp="title" onChange={(event) => this.typeOfDiscount1(event)} style={{ width: '120px', margin: '23px 15px 0 0' }} placeholder={languageCode === 'CN' ? "请选择折扣类型" : 'Select Discount Type'}>
                                                            <Option key='' value=''  >{languageCode === 'CN' ? "请选择" : 'Please Select'}</Option>
                                                            {this.state.typeOfDiscountData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.conLinkUserName}  >{item.descripts}</Option>)}
                                                        </Select>
                                                        <Dropdown overlay={menu1} placement="bottomCenter" disabled={this.state.disID1 === '' ? true : false} visible={this.state.openSelect} trigger={['click']} >
                                                            <Input disabled={this.state.disID1 === '' ? true : false}
                                                                onChange={(event) => { this.onChangeInput1(event) }}
                                                                onClick={() => { this.setState({ openSelect: !this.state.openSelect }) }}
                                                                onBlur={() => { setTimeout(() => { this.setState({ openSelect: false }) }, 100) }}
                                                                placeholder="请选择收费项" value={this.state.fees1Val}
                                                                style={{ width: '200px', margin: '23px 15px 0 0' }}
                                                                 />
                                                        </Dropdown>
                                                        <Select allowClear optionFilterProp="title" value={this.state.active2} onChange={(event) => { this.active2(event) }} placeholder={languageCode === 'CN' ? "状态" : 'Status'} style={{ width: '100px', margin: '12px 15px 0 0' }} >
                                                            <Option title={languageCode === 'CN' ? "生效" : 'Effective'} key='1' value='1'  >{languageCode === 'CN' ? "生效" : 'Effective'}</Option>
                                                            <Option title={languageCode === 'CN' ? "失效" : 'Invalid'} key='2' value='2'  >{languageCode === 'CN' ? "失效" : 'Invalid'}</Option>
                                                            <Option title={languageCode === 'CN' ? "全部" : 'All'} key='3' value='3'  >{languageCode === 'CN' ? "全部" : 'All'}</Option>
                                                        </Select>

                                                        {/* <Select disabled={this.state.disID1 === '' ? true : false} allowClear value={this.state.fees1} optionFilterProp="title" onChange={(event) => this.fees1(event)} style={{ width: '120px', margin: '23px 15px 0 0' }} placeholder="请选择收费项">
                                                            {this.state.feesData1.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                                        </Select> */}
                                                        <Button style={{ margin: '23px 15px 0 0', background: '#fff', }} onClick={() => this.searchTable2()} disabled={this.state.disID1 === '' ? true : false} >{language.DiscountMaintenancequeryDiscount && language.DiscountMaintenancequeryDiscount.descripts}</Button>
                                                        {language.DiscountMaintenancestartDateDiscount && language.DiscountMaintenancestartDateDiscount.descripts}：<div style={{ width: '120px', margin: '23px 15px 0 0', display: 'inline-block' }}><DatePickerFormat

                                                            value={this.state.StartDate2 && this.state.StartDate2 != '' ? Moment(this.state.StartDate2, 'YYYY-MM-DD') : undefined}
                                                            format={dateFormat}
                                                            onChange={this.StartDate2}
                                                            disabledDate={this.disabledStDate} />
                                                        </div>
                                                        {language.DiscountMaintenanceendDateDiscount && language.DiscountMaintenanceendDateDiscount.descripts}：<div style={{ width: '120px', margin: '23px 15px 0 0', display: 'inline-block' }}><DatePickerFormat

                                                            value={this.state.EndDate2 && this.state.EndDate2 != '' ? Moment(this.state.EndDate2, 'YYYY-MM-DD') : undefined}
                                                            format={dateFormat}
                                                            onChange={this.EndDate2}
                                                            disabledDate={this.disabledStDate2} />
                                                        </div>
                                                        {language.DiscountMaintenancecoefficientType && language.DiscountMaintenancecoefficientType.descripts}：<Select showSearch allowClear optionFilterProp="title" value={this.state.coefficientType2} onChange={(event) => { this.coefficientType2(event) }} placeholder={language.DiscountMaintenancecoefficientType && language.DiscountMaintenancecoefficientType.message} style={{ width: '100px', margin: '23px 15px 0 0' }} >
                                                            {this.state.coefficientTypeData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                                        </Select>
                                                        {language.DiscountMaintenancefree && language.DiscountMaintenancefree.descripts}：<Input disabled={this.state.desDis} style={{ width: '100px', margin: '23px 15px 0 0' }} allowClear placeholder={language.DiscountMaintenancefree && language.DiscountMaintenancefree.message} className='input' value={this.state.designatedAmount} onChange={(event) => { this.designatedAmount(event) }} />

                                                        {/* 记账系数：<Input disabled={this.state.shaDis} style={{ width: '100px', margin: '23px 15px 0 0' }} allowClear placeholder="请输入记账系数" className='input' value={this.state.shareFree} onChange={(event) => { this.shareFree(event) }} />
                                                        折扣系数：<Input disabled={this.state.disDis} style={{ width: '100px', margin: '23px 15px 0 0' }} allowClear placeholder="请输入折扣系数" className='input' value={this.state.discountCoefficient} onChange={(event) => { this.discountCoefficient(event) }} />
                                                        指定金额： */}

                                                        <Button style={{ margin: '23px 15px 0 0', background: 'rgba(66, 185, 131)', color: '#fff' }} disabled={this.state.disID1 === '' ? true : false} onClick={() => { this.addTableRight() }}  >{language.DiscountMaintenancesaveDiscount && language.DiscountMaintenancesaveDiscount.descripts}</Button>
                                                    </Col>
                                                </Row>
                                                <div style={{ padding: 24 }}>
                                                    {/* <Table
                                                        pagination={false}
                                                        bordered
                                                        scroll={{ x: 900, y: 220 }}
                                                        columns={this.columns2}
                                                        dataSource={this.state.dataTable2}
                                                        style={{ minHeight: '220px', overflow: 'auto' }}

                                                        onRow={(record) => {
                                                            return {
                                                                onClick: (event) => {
                                                                    this.onClickRowPublic2(record)
                                                                },
                                                            };
                                                        }}
                                                        rowClassName={(record) => this.setRowClassNamePublic2(record)}

                                                    />
                                                    <CommonPagination size="small" current={param2.page} total={param2.total} search='search'
                                                        onShowSizeChange={this.onShowSizeChange2.bind(this)} complete={true} dataSource={this.state.dataTable2}
                                                        onChange={this.onChange2.bind(this)} /> */}

                                                    <Table
                                                        dataSource={this.state.dataTable2}
                                                        columns={this.state.columns2}
                                                        //rowClassName="editable-row"
                                                        pagination={false}
                                                        style={{ minHeight: (store.getState().tableHeight.y) - 300 + 'px' }}
                                                        scroll={{ y: (store.getState().tableHeight.y) - 350, x: 2000 }}
                                                        bordered
                                                        loading={this.state.loading}
                                                        onRow={(record) => {
                                                            return {
                                                                onClick: (event) => {
                                                                    this.onClickRowPublic2(record)
                                                                },
                                                            };
                                                        }}
                                                        rowClassName={(record) => this.setRowClassNamePublic2(record)}
                                                    />
                                                    <CommonPagination size="small" current={param2.page} total={param2.total} search='search'
                                                        onShowSizeChange={this.onShowSizeChange2.bind(this)} complete={true} dataSource={this.state.dataTable2}
                                                        onChange={this.onChange2.bind(this)} />
                                                    {/* <Pagination
                                                        showTotal={() => this.showTotal(param2.total)}
                                                        size="small"
                                                        showQuickJumper
                                                        showSizeChanger
                                                        defaultCurrent={1}
                                                        defaultPageSize={10}
                                                        current={param2.page}
                                                        total={param2.total}
                                                        onChange={this.onChange2}
                                                        onShowSizeChange={this.onShowSizeChange2}
                                                        style={{ textAlign: "right", marginTop: '13px' }} /> */}
                                                </div>


                                            </div>
                                        </Col>

                                    </TabPane>

                                    <TabPane tab={language.DiscountMaintenancenotDiscount && language.DiscountMaintenancenotDiscount.descripts} key='1'  >
                                        <div >

                                            <Row style={{ minHeight: '80px', padding: '0 24px 0 24px' }}>
                                                <Col span={24}>
                                                    <Select disabled={this.state.disID1 === '' ? true : false} allowClear value={this.state.typeOfDiscount2} optionFilterProp="title" onChange={(event) => this.typeOfDiscount2(event)} style={{ width: '120px', margin: '23px 15px 0 0' }} placeholder={languageCode === 'CN' ? "请选择折扣类型" : 'Select Discount Type'}>
                                                        <Option key='' value=''  >{languageCode === 'CN' ? "请选择" : 'Please Select'}</Option>
                                                        {this.state.typeOfDiscountData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.conLinkUserName}  >{item.descripts}</Option>)}
                                                    </Select>
                                                    <Dropdown overlay={menu2} placement="bottomCenter" disabled={this.state.disID1 === '' ? true : false} visible={this.state.openSelect} trigger={['click']} >
                                                        <Input disabled={this.state.disID1 === '' ? true : false} onChange={(event) => { this.onChangeInput2(event) }} onClick={() => { this.setState({ openSelect: !this.state.openSelect }) }} onBlur={() => { setTimeout(() => { this.setState({ openSelect: false }) }, 100) }} placeholder={languageCode === 'CN' ? "请选择收费项" : 'Select Charge Item'} value={this.state.fees2Val} style={{ width: '400px', margin: '23px 15px 0 0' }} />
                                                    </Dropdown>
                                                    <Select allowClear optionFilterProp="title" value={this.state.active3} onChange={(event) => { this.active3(event) }} placeholder={languageCode === 'CN' ? "状态" : 'Status'} style={{ width: '100px', margin: '12px 15px 0 0' }} >
                                                        <Option title={languageCode === 'CN' ? "生效" : 'Effective'} key='1' value='1'  >{languageCode === 'CN' ? "生效" : 'Effective'}</Option>
                                                        <Option title={languageCode === 'CN' ? "失效" : 'Invalid'} key='2' value='2'  >{languageCode === 'CN' ? "失效" : 'Invalid'}</Option>
                                                        <Option title={languageCode === 'CN' ? "全部" : 'All'} key='3' value='3'  >{languageCode === 'CN' ? "全部" : 'All'}</Option>
                                                    </Select>
                                                    {/* <Select disabled={this.state.disID1 === '' ? true : false} allowClear value={this.state.fees2} optionFilterProp="title" onChange={(event) => this.fees2(event)} style={{ width: '120px', margin: '23px 15px 0 0' }} placeholder="请选择收费项">
                                                        {this.state.feesData2.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                                    </Select> */}
                                                    <Button style={{ margin: '23px 15px 0 0', background: '#fff', }} onClick={() => this.searchTable3()} disabled={this.state.disID1 === '' ? true : false} >{languageCode === 'CN' ? "查询" : 'Query'}</Button>
                                                    {language.DiscountMaintenancestartDateNotDiscount && language.DiscountMaintenancestartDateNotDiscount.descripts}：<div style={{ width: '120px', margin: '23px 15px 0 0', display: 'inline-block' }}><DatePickerFormat
                                                        value={this.state.StartDate3 && this.state.StartDate3 != '' ? Moment(this.state.StartDate3, 'YYYY-MM-DD') : undefined}
                                                        format={dateFormat}
                                                        onChange={this.StartDate3}
                                                        disabledDate={this.disabledStDate} />
                                                    </div>
                                                    {language.DiscountMaintenanceendDateNotDiscount && language.DiscountMaintenanceendDateNotDiscount.descripts}：<div style={{ width: '120px', margin: '23px 15px 0 0', display: 'inline-block' }}><DatePickerFormat
                                                        value={this.state.EndDate3 && this.state.EndDate3 != '' ? Moment(this.state.EndDate3, 'YYYY-MM-DD') : undefined}
                                                        format={dateFormat}
                                                        onChange={this.EndDate3}
                                                        disabledDate={this.disabledStDate2} />
                                                    </div>
                                                    <Button style={{ margin: '23px 15px 0 0', background: 'rgba(66, 185, 131)', color: '#fff' }} disabled={this.state.disID1 === '' ? true : false} onClick={() => { this.addTableRightBottom() }}>{language.DiscountMaintenancesaveNotDiscount && language.DiscountMaintenancesaveNotDiscount.descripts}</Button>
                                                </Col>
                                            </Row>
                                            <div style={{ padding: 24 }}>
                                                {/* <Table
                                                    pagination={false}
                                                    bordered
                                                    scroll={{ x: 700, y: 220 }}
                                                    columns={this.columns3}
                                                    dataSource={this.state.dataTable3}
                                                    style={{ minHeight: '220px', overflow: 'auto' }}
                                                    onRow={(record) => {
                                                        return {
                                                            onClick: (event) => {
                                                                this.onClickRowPublic3(record)
                                                            },
                                                        };
                                                    }}
                                                    rowClassName={(record) => this.setRowClassNamePublic3(record)}
                                                /> */}
                                                <Table
                                                    dataSource={this.state.dataTable3}
                                                    columns={this.state.columns3}
                                                    //rowClassName="editable-row"
                                                    pagination={false}
                                                    style={{ minHeight: (store.getState().tableHeight.y) - 300 + 'px' }}
                                                    scroll={{ y: (store.getState().tableHeight.y) - 350, x: 2000 }}
                                                    bordered
                                                    onRow={(record) => {
                                                        return {
                                                            onClick: (event) => {
                                                                this.onClickRowPublic3(record)
                                                            },
                                                        };
                                                    }}
                                                    rowClassName={(record) => this.setRowClassNamePublic3(record)}
                                                />

                                                <CommonPagination size="small" current={param3.page} total={param3.total} search='search'
                                                    onShowSizeChange={this.onShowSizeChange3.bind(this)} complete={true} dataSource={this.state.dataTable3}
                                                    onChange={this.onChange3.bind(this)} />
                                                {/* <Pagination
                                                    showTotal={() => this.showTotal(param3.total)}
                                                    size="small"
                                                    showQuickJumper
                                                    showSizeChanger
                                                    defaultCurrent={1}
                                                    defaultPageSize={10}
                                                    current={param3.page}
                                                    total={param3.total}
                                                    onChange={this.onChange3}
                                                    onShowSizeChange={this.onShowSizeChange3}
                                                    style={{ textAlign: "right", marginTop: '13px' }} /> */}
                                            </div>

                                        </div>

                                    </TabPane>

                                </Tabs>
                            </Row>
                        </Col>
                    </Row>
                    <Modal
                        visible={this.state.modalShowPay}
                        title={this.state.modlaTitle}
                        width='800px'
                        className='modalPay'
                        onCancel={this.handleCancel}
                        onOk={this.handleOk}
                        okText={this.state.languageCode === "CN" ? "确定" : 'OK'}
                        cancelText={this.state.languageCode === "CN" ? "取消" : 'Cancel'}
                    >
                        <Row>
                            <Col span={24} className='mB20'>
                                <Col span={3}>
                                    {languageCode === 'CN' ? "医院" : 'Hospital'}
                                </Col>
                                <Col span={20} offset={1}>
                                    <Select disabled={this.state.disAdd} showSearch allowClear optionFilterProp="title" value={this.state.defaultHosModal} onChange={(event) => { this.hospDrChangeModal(event) }} placeholder="允许登陆医院" style={{ width: '100%', }} >
                                        {this.state.hospitalData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                    </Select>
                                </Col>
                            </Col>
                            <Col span={24} className='mB20'>
                                <Col span={3}>
                                    {languageCode === 'CN' ? "就诊类型" : 'Treatment Type'}
                                </Col>
                                <Col span={7} offset={1}>
                                    <Select disabled={this.state.disAdd} showSearch allowClear optionFilterProp="title" value={this.state.typesOfConsultation} onChange={(event) => { this.typesOfConsultation(event) }} placeholder="就诊类型" style={{ width: '100%', }} >
                                        {this.state.typesOfConsultationData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                    </Select>
                                </Col>

                            </Col>

                            <Col span={24} className='mB20'>
                                <Col span={3}>
                                    {languageCode === 'CN' ? "折扣类型" : 'Discount Type'}
                                </Col>
                                <Col span={7} offset={1}>
                                    <Select disabled={this.state.disAdd} showSearch allowClear optionFilterProp="title" value={this.state.discountType} onChange={(event) => { this.discountType(event) }} placeholder={languageCode === 'CN' ? "折扣类型" : 'Discount Type'} style={{ width: '100%', }} >
                                        {this.state.discountTypeData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                    </Select>
                                </Col>
                                <Col span={3} offset={2}>
                                    {this.state.discountTypeChange}
                                </Col>
                                <Col span={7} offset={1}>
                                    <Select disabled={this.state.disAdd} showSearch allowClear optionFilterProp="title" value={this.state.discountTypeID} onChange={(event) => { this.discountTypeID(event) }} placeholder={this.state.discountTypeChange} style={{ width: '100%', }} >
                                        {this.state.discountTypeIDData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                    </Select>
                                </Col>
                            </Col>
                            <Col span={24} className='mB20'>
                                <Col span={3}>
                                    {languageCode === 'CN' ? "系数类型" : 'Coefficient Type'}
                                </Col>
                                <Col span={7} offset={1}>
                                    <Select disabled={this.state.disAdd} showSearch allowClear optionFilterProp="title" value={this.state.coefficientType} onChange={(event) => { this.coefficientType(event) }} placeholder={languageCode === 'CN' ? "系数类型" : 'Coefficient Type'} style={{ width: '100%', }} >
                                        {this.state.coefficientTypeData.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                    </Select>
                                </Col>
                                <Col span={3} offset={2}>
                                    {languageCode === 'CN' ? "系数或金额" : 'Coefficient Or Amount'}
                                </Col>
                                <Col span={7} offset={1}>
                                    <Input disabled={this.state.disAdd} onChange={(event) => { this.free(event) }} placeholder={languageCode === 'CN' ? "系数或金额" : 'Coefficient Or Amount'} value={this.state.free} style={{ width: '100%', }} />
                                </Col>
                            </Col>
                            <Col span={24} className='mB20'>
                                <Col span={3}>
                                    {languageCode === 'CN' ? "开始日期" : 'Start Date'}
                                </Col>
                                <Col span={7} offset={1}>
                                    <DatePickerFormat disabled={this.state.disAdd} style={{ width: '100%' }}
                                        value={this.state.StartDate1 && this.state.StartDate1 != '' ? Moment(this.state.StartDate1, 'YYYY-MM-DD') : undefined}
                                        format={dateFormat}
                                        onChange={this.StartDate1}
                                        disabledDate={this.disabledStDate} />
                                </Col>
                                <Col span={3} offset={2}>
                                    {languageCode === 'CN' ? "结束日期" : 'End Date'}
                                </Col>
                                <Col span={7} offset={1}>
                                    <DatePickerFormat disabled={this.state.disAddTime} style={{ width: '100%' }}
                                        value={this.state.EndDate1 && this.state.EndDate1 != '' ? Moment(this.state.EndDate1, 'YYYY-MM-DD') : undefined}
                                        format={dateFormat}
                                        onChange={this.EndDate1}
                                        disabledDate={this.disabledStDate2} />
                                </Col>
                            </Col>

                        </Row>
                    </Modal>
                </div>
            </div>
        )
    }
}