//InsuBaseConfigures医保基础配置

import React from 'react';
import {
    Card, Input, Row, Col, Button, Pagination, Table, Select, message, Form
} from 'antd';
import { $http } from '../../containers/config/https';
//import '../../assets/css/App.css'
import store from '../../store';
//import './style/index.less'
const Option = Select.Option;

const FormHandel = Form.create()(
class InsuBaseConfigures extends React.Component {
    constructor(props) {
        super(props);
        this.state={
            moduleSelect:[],
            areaSelect:[],
            handleHospSelect:[],
             // 主菜单列表数据
             data: [],
             //主表数据
             proconfigureID:'',
             proconfigureCode:'',
             proconfigureDescripts: '',
             proconfigurePMID:'',
              
             //子表数据
             data1: [],
             //子表数据
             proconfigureDetailID:'',
             proconfigureDetailCode:'',
             proconfigureDetailDescripts:'',
             proconfigureDetailValue:'',
             proconfigureDetailRemark:'',
             proconfigureDetailType:'',
             proconfigureDetailYBArea:'',
 
 
             //孙子表数据
             data2: [],
             //孙子表数据
             proconfigureLinkID:'',
             proconfigureLinkHospID:'',
             proconfigureLinkCode:'',
             proconfigureLinkDescripts:'',
             proconfigureLinkLinkValue:'',
             proconfigureLinkLinkCode:'',
             proconfigureLinkRemark:'', 
             //父表
             total: 0,
             page: 1,
             pageSize: 10,
             showLoading: true, 
             //子表
             total1: 0,
             page1: 1,
             pageSize1: 10,
             showLoading1: true, 
             //暂时不使用
             total2: 0,
             page2: 1,
             pageSize2: 10,
             showLoading2: true,
             showFlagInput:'none', 
             showFlagSelect:''
        }

        // 表格的表头数据
        this.columnsA= [
            {
                key: '1',
                title: '代码',
                dataIndex: 'proconfigureCode',
                width: "30%",
                align: 'center'
            },{
                key: '2',
                title: '描述',
                dataIndex: 'proconfigureDescripts',
                width: "35%",
                align: 'center'
            },{
                key: '3',
                title: '模块描述',
                dataIndex: 'proconfigurePMDesc',
                width: "35%",
                align: 'center'
            }
        ]
       
        // 表格的表头数据
        this.columnsB= [
            {
                key: '1',
                title: '代码',
                dataIndex: 'proconfigureDetailCode',
                width: "20%",
                align: 'center'
            },{
                key: '2',
                title: '描述',
                dataIndex: 'proconfigureDetailDescripts',
                width: "20%",
                align: 'center'
            },{
                key: '5',
                title: '类型',
                dataIndex: 'proconfigureDetailType',
                width: "15%",
                align: 'center'
            },
            /*{
                key: '3',
                title: '值',
                dataIndex: 'proconfigureDetailValue',
                width: "15%",
                align: 'center'
            },暂时不显示此字段留用*/
            {
                key: '4',
                title: '备注',
                dataIndex: 'proconfigureDetailRemark',
                width: "15%",
                align: 'center'
            },
            {
                key: '6',
                title: '医保地域',
                dataIndex: 'proconfigureDetailYBAreaDesc',
                width: "15%",
                align: 'center'
            }
    
        ]
      
        // 表格的表头数据
        this.columnsC= [
		    {
                key: '1',
                title: '代码',
                dataIndex: 'proconfigureLinkCode',
                width: "10%",
                align: 'center'
            },{
                key: '2',
                title: '描述',
                dataIndex: 'proconfigureLinkDescripts',
                width: "20%",
                align: 'center'
            },
            {
                key: '3',
                title: '关联值',
                dataIndex: 'proconfigureLinkLinkValueDesc',
                width: "10%",
                align: 'center'
            },
            /*{
                key: '5',
                title: '关联代码',
                dataIndex: 'proconfigureLinkLinkCode',
                width: "10%",
                align: 'center'
            },
            {
                key: '6',
                title: '备注',
                dataIndex: 'proconfigureLinkRemark',
                width: "10%",
                align: 'center'
            },留用字段暂不维护*/{
                key: '7',
                title: '医院',
                dataIndex: 'proconfigureLinkHospDesc',
                width: "10%",
                align: 'center'
            }
        ]
       
    }

    componentDidMount() {
        document.querySelector('.ant-table-body').style.height = '590px';
		// 初始化列表数据
        this.handleProconfigureQuery();
        this.handleModuleSelect();
        this.handleYBAreaSelect();
        this.handleHospSelect();
    }

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

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

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

    // 条数改变的回调
    proponShowSizeChange = (current, size) => {
        this.setState({
            page1: current, 
            pageSize1: size,
        }, () => {
            // 重新调用查询方法
            this.handleProconfigureDetailQuery();
        });
    }




    //父表3个字段
    //代码
    onChangeProconfigureCode = (e) => {
        this.setState({ 
            proconfigureCode:e.target.value,
            });
        }  
    //描述
    onChangeProconfigureDescripts= (e) => {
        this.setState({ 
            proconfigureDescripts: e.target.value,     
        });
    }
    //模块
    onChangeProconfigurePMID= (value) => {
        this.setState({ 
            proconfigurePMID:value,  
        });
    }





    //子表6个字段
    // 代码
	onChangeProconfigureDetailCode = (e) => {
		this.setState({ 
            proconfigureDetailCode:e.target.value,
        });
	}
	// 描述
	onChangeProconfigureDetailDescripts = (e) => {
		this.setState({ 
            proconfigureDetailDescripts:e.target.value,
        });
    }
    //值
	onChangeProconfigureDetailValue = (e) => {
		this.setState({ 
            proconfigureDetailValue:e.target.value,
        });
    }
    // 类型
    onChangeProconfigureDetailType = (value) => {
        this.setState({ 
            proconfigureDetailType:value,
        });
    }

    // 备注
    onChangeProconfigureDetailRemark = (e) => {
        this.setState({ 
            proconfigureDetailRemark:e.target.value,
        });
    }

    //医保地域
    onChangeProconfigureDetailYBArea = (value) => {
        this.setState({ 
            proconfigureDetailYBArea:value
        });
    }





    //孙子表输入6个字段
    // 医院
	onChangeProconfigureLinkHospID = (value) => {
		this.setState({ 
            proconfigureLinkHospID:value,
        });
	}
	// 代码
	onChangeProconfigureLinkCode = (e) => {
		this.setState({ 
            proconfigureLinkCode:e.target.value,
        });
    }
    //描述
	onChangeProconfigureLinkDescripts = (e) => {
		this.setState({ 
            proconfigureLinkDescripts:e.target.value,
        });
    }
    // 关联值
    onChangeProconfigureLinkLinkValue = (e) => {
        this.setState({ 
            proconfigureLinkLinkValue:e.target.value,
        });
    }
      // 关联值
    onChangeProconfigureLinkLinkValues = (value) => {
        this.setState({ 
            proconfigureLinkLinkValue:value,
        });
    }
    // 关联代码
    onChangeProconfigureLinkLinkCode = (e) => {
        this.setState({ 
            proconfigureLinkLinkCode:e.target.value,
        });
    }
    //备注
    onChangeProconfigureLinkRemark = (value) => {
        this.setState({ 
            proconfigureLinkRemark:value
        });
    }
    
    
    
    
    //对父表操作
    //医保基础配置查询
    handleProconfigureQuery = () => {
        let {proconfigureCode, proconfigureDescripts,proconfigurePMID, page, pageSize} = this.state;
        let data = {}
        data = {
            params: [{
                code: proconfigureCode,
                descripts: proconfigureDescripts,
                pmID:proconfigurePMID,
            }],
            pagination:[{ 
                pageSize: pageSize,
                currentPage: page,
                sort: "ID",
                dir: "desc"
            }]
        }
        $http.post('urlS', this, {
			code: '05100103',
			data: data,
			success: function (res) {
				if (+res.errorCode === 0 && res.proconfigureArr) {
					for(var i = 0; i < res.proconfigureArr.length; i++) {
						res.proconfigureArr[i].key = i
                    }
					this.setState({
                        data: res.proconfigureArr,
                        total: res.total,
                        proconfigureID: '',
                        data1: [],
                        proconfigureDetailID:'',
                        proconfigureDetailCode:'',
                        proconfigureDetailDescripts:'',
                        proconfigureDetailValue:'',
                        proconfigureDetailRemark:'',
                        proconfigureDetailType:'',
                        proconfigureDetailYBArea:'', 
                        data2: [],
                        //孙子表数据
                        proconfigureLinkID:'',
                        proconfigureLinkHospID:'',
                        proconfigureLinkCode:'',
                        proconfigureLinkDescripts:'',
                        proconfigureLinkLinkValue:'',
                        proconfigureLinkLinkCode:'',
                        proconfigureLinkRemark:'', 
                        //子表
                        total1: 0,
                        page1: 1,
                        pageSize1: 10,
                        showLoading1: true, 
                        //暂时不使用
                        total2: 0,
                        page2: 1,
                        pageSize2: 10,
                        showLoading2: true, 
                    })
				} else {
                    return;
				}
			}
		})
    }
   
    setProconfigureRowClassName = (record) => {
        return record.proconfigureID === this.state.proconfigureID ? 'clickRowStyle' : '';
    }

    onClickProconfigureRow = (record) => {
        //给右边的编辑form传值
        return {
            onClick: () => {
                this.setState({
                    data1: [],
                    total1: 0,
                    page1: 1,
                    pageSize1: 10,
                    proconfigureDetailID:'',
                    proconfigureDetailCode:'',
                    proconfigureDetailDescripts:'',
                    proconfigureDetailValue:'',
                    proconfigureDetailRemark:'',
                    proconfigureDetailType:'',
                    proconfigureDetailYBArea:'',
                })
                if(this.state.proconfigureID===""){
                   this.setState({
                    proconfigureID: record.proconfigureID,
                    proconfigureCode:record.proconfigureCode,
                    proconfigureDescripts:record.proconfigureDescripts,
                    proconfigurePMID:record.proconfigurePMID,
                    },()=>{this.handleProconfigureDetailQuery()});   
                }else{
                    if(this.state.proconfigureID!==record.proconfigureID){
                        this.setState({
                            proconfigureID: record.proconfigureID,
                            proconfigureCode:record.proconfigureCode,
                            proconfigureDescripts:record.proconfigureDescripts,
                            proconfigurePMID:record.proconfigurePMID,
                        },()=>{this.handleProconfigureDetailQuery()});
                    }else{
                        this.setState({
                            proconfigureID:'',
                            proconfigureCode:'',
                            proconfigureDescripts: '',
                            proconfigurePMID:'',
                            //子表数据
                            data1: [],
                            //子表数据
                            proconfigureDetailID:'',
                            proconfigureDetailCode:'',
                            proconfigureDetailDescripts:'',
                            proconfigureDetailValue:'',
                            proconfigureDetailRemark:'',
                            proconfigureDetailType:'',
                            proconfigureDetailYBArea:'',
                            //孙子表数据
                            data2: [],
                            //孙子表数据
                            proconfigureLinkID:'',
                            proconfigureLinkHospID:'',
                            proconfigureLinkCode:'',
                            proconfigureLinkDescripts:'',
                            proconfigureLinkLinkValue:'',
                            proconfigureLinkLinkCode:'',
                            proconfigureLinkRemark:'', 
                             //信息
                            total1: 0,
                            page1: 1,
                            pageSize1: 10,
                            showLoading1: true, 
                            //信息
                            total2: 0,
                            page2: 1,
                            pageSize2: 10,
                            showLoading2: true, 
                          
                        });
                    }
                } 
            },
        };
    }

    handleProconfigureSave= () => {
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let { 
            proconfigureID,
            proconfigureCode,
            proconfigureDescripts,
            proconfigurePMID,
            } = this.state;
        let data = {}
        data={
            params: [{
                proconfigureID:proconfigureID,
                proconfigureCode:proconfigureCode,
                proconfigureDescripts:proconfigureDescripts,
                proconfigurePMID:proconfigurePMID,
                updateUserID:sessionInfo.userID
            }],
        }
        $http.post('urlADS', this, {
			code: '05100116',
			data: data,
			success: function (res) {   
				if (+res.errorCode === 0 ) {
                    message.success('保存成功');
                    this.handleProconfigureQuery();
				} else {
                    return;
				}
			}
		})
    }

    handleProconfigureClear = () =>{
        this.setState({ 
            proconfigureID:'',
            proconfigureCode:'',
            proconfigureDescripts: '',
            proconfigurePMID:'',
            //子表数据
            data1: [],
            //子表数据
            proconfigureDetailID:'',
            proconfigureDetailCode:'',
            proconfigureDetailDescripts:'',
            proconfigureDetailValue:'',
            proconfigureDetailRemark:'',
            proconfigureDetailType:'',
            proconfigureDetailYBArea:'',
            //孙子表数据
            data2: [],
            //孙子表数据
            proconfigureLinkID:'',
            proconfigureLinkHospID:'',
            proconfigureLinkCode:'',
            proconfigureLinkDescripts:'',
            proconfigureLinkLinkValue:'',
            proconfigureLinkLinkCode:'',
            proconfigureLinkRemark:'', 
            //信息
            total1: 0,
            page1: 1,
            pageSize1: 10,
            showLoading1: true, 
            //信息
            total2: 0,
            page2: 1,
            pageSize2: 10,
            showLoading2: true, 
        });
       
    }






     //对子表的操作
    
    handleProconfigureDetailQuery = () => {
        if(this.state.proconfigureID===""){
            return;
        }
        let {page1, pageSize1} = this.state;
        let data = {}
        data = {
            params: [{
                proconfigureID: this.state.proconfigureID,
            }],
            pagination:[{ 
                pageSize1: pageSize1,
                currentPage1: page1,
                sort: "ID",
                dir: "desc"
            }]
        }
        $http.post('urlS', this, {
			code: '05100107',
			data: data,
			success: function (res) {
				if (+res.errorCode === 0 ) {
					for(var i = 0; i < res.proconfigureDetailArr.length; i++) {
						res.proconfigureDetailArr[i].key = i
                    }
					this.setState( {
                        data1: res.proconfigureDetailArr,
                        total1: res.total,
                        data2: [],
                        //孙子表数据
                        proconfigureLinkID:'',
                        proconfigureLinkHospID:'',
                        proconfigureLinkCode:'',
                        proconfigureLinkDescripts:'',
                        proconfigureLinkLinkValue:'',
                        proconfigureLinkLinkCode:'',
                        proconfigureLinkRemark:'', 
                        //信息
                        total2: 0,
                        page2: 1,
                        pageSize2: 10,
                        showLoading2: true
                    })
				} else {
                    return;
				}
			}
		})
    }


    setProconfigureDetailRowClassName = (record) => {
        return record.proconfigureDetailID === this.state.proconfigureDetailID ? 'clickRowStyle' : '';
    }

    onClickProconfigureDetailRow = (record) => {
        //给右边的编辑form传值
        return {
            onClick: () => {
                if(this.state.proconfigureDetailID===""){
                    this.setState({
                        proconfigureDetailID:record.proconfigureDetailID,
                        proconfigureDetailCode:record.proconfigureDetailCode,
                        proconfigureDetailDescripts:record.proconfigureDetailDescripts,
                        proconfigureDetailValue:record.proconfigureDetailValue,
                        proconfigureDetailRemark:record.proconfigureDetailRemark,
                        proconfigureDetailType:record.proconfigureDetailType,
                        proconfigureDetailYBArea:record.proconfigureDetailYBArea,
                    },()=>{this.handleProconfigureLinkQuery ();
                           this.handleLinkSelect();
                    });
                    
                }else{
                    if(this.state.proconfigureDetailID!==record.proconfigureDetailID){
                        this.setState({
                            proconfigureDetailID:record.proconfigureDetailID,
                            proconfigureDetailCode:record.proconfigureDetailCode,
                            proconfigureDetailDescripts:record.proconfigureDetailDescripts,
                            proconfigureDetailValue:record.proconfigureDetailValue,
                            proconfigureDetailRemark:record.proconfigureDetailRemark,
                            proconfigureDetailType:record.proconfigureDetailType,
                            proconfigureDetailYBArea:record.proconfigureDetailYBArea,
                          },()=>{this.handleProconfigureLinkQuery ();
                                 this.handleLinkSelect();
                        });
                    }else{
                        this.setState({
                            proconfigureDetailID:'',
                            proconfigureDetailCode:'',
                            proconfigureDetailDescripts:'',
                            proconfigureDetailValue:'',
                            proconfigureDetailRemark:'',
                            proconfigureDetailType:'',
                            proconfigureDetailYBArea:'',
                            data2: [],
                            //孙子表数据
                            proconfigureLinkID:'',
                            proconfigureLinkHospID:'',
                            proconfigureLinkCode:'',
                            proconfigureLinkDescripts:'',
                            proconfigureLinkLinkValue:'',
                            proconfigureLinkLinkCode:'',
                            proconfigureLinkRemark:'',
                            //信息
                            total2: 0,
                            page2: 1,
                            pageSize2: 10,
                            showLoading2: true,
                            linkSelect:[],
                        });
                    }
                } 
            },
        };
    }

    handleProconfigureDetailSave= () => {
        if(this.state.proconfigureID===""){
            message.error("请选择左边的功能模块再做保存操作!!!");
            return;
        }
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let { 
            proconfigureDetailID,
            proconfigureDetailCode,
            proconfigureDetailDescripts,
            proconfigureDetailValue,
            proconfigureDetailRemark,
            proconfigureDetailType,
            proconfigureDetailYBArea,
            } = this.state;
        let data = {}
        data={
            params: [{
                proconfigureID:this.state.proconfigureID,
                proconfigureDetailID:proconfigureDetailID,
                proconfigureDetailCode:proconfigureDetailCode,
                proconfigureDetailDescripts:proconfigureDetailDescripts,
                proconfigureDetailValue:proconfigureDetailValue,
                proconfigureDetailRemark:proconfigureDetailRemark,
                proconfigureDetailType:proconfigureDetailType,
                proconfigureDetailYBArea:proconfigureDetailYBArea,
                updateUserID:sessionInfo.userID
            }],
        }
        $http.post('urlADS', this, {
			code: '05100117',
			data: data,
			success: function (res) {   
				if (+res.errorCode === 0 ) {
                    message.success('保存成功');
                    this.handleProconfigureDetailQuery();
				} else {
                    return;
				}
			}
		})
    }

    handleProconfigureDetailClear = () =>{
        this.setState({
            proconfigureDetailID:'',
            proconfigureDetailCode:'',
            proconfigureDetailDescripts:'',
            proconfigureDetailValue:'',
            proconfigureDetailRemark:'',
            proconfigureDetailType:'',
            proconfigureDetailYBArea:'',
            //孙子表数据
            data2: [],
            //孙子表数据
            proconfigureLinkID:'',
            proconfigureLinkHospID:'',
            proconfigureLinkCode:'',
            proconfigureLinkDescripts:'',
            proconfigureLinkLinkValue:'',
            proconfigureLinkLinkCode:'',
            proconfigureLinkRemark:'', 
            //信息
            total2: 0,
            page2: 1,
            pageSize2: 10,
            showLoading2: true, 
        });
       
    }

  


    ///对孙子表的操作
    handleProconfigureLinkSave  = () => {
        if(this.state.proconfigureDetailID===""){
            message.error("请选择上面的参数再做保存操作!!!");
            return;
        }
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let { 
            proconfigureDetailID,
            proconfigureLinkID,
            proconfigureLinkHospID,
            proconfigureLinkCode,
            proconfigureLinkDescripts,
            proconfigureLinkLinkValue,
            proconfigureLinkLinkCode,
            proconfigureLinkRemark
            } = this.state;
        let data = {}
        data={
            params: [{
                proconfigureDetailID:proconfigureDetailID,
                proconfigureLinkID: proconfigureLinkID,
                proconfigureLinkHospID: proconfigureLinkHospID,
                proconfigureLinkCode:proconfigureLinkCode,
                proconfigureLinkDescripts:proconfigureLinkDescripts,
                proconfigureLinkLinkValue:proconfigureLinkLinkValue,
                proconfigureLinkLinkCode:proconfigureLinkLinkCode,
                proconfigureLinkRemark:proconfigureLinkRemark, 
                updateUserID:sessionInfo.userID
            }],
        }
        $http.post('urlADS', this, {
			code: '05100118',
			data: data,
			success: function (res) {   
				if (+res.errorCode === 0 ) {
                    message.success('保存成功');
                    this.handleProconfigureLinkQuery ();
				} else {
                    return;
				}
			}
		})
    }

  



    // 查询
    handleProconfigureLinkQuery  = () => {
        if(this.state.proconfigureDetailID===""){
            return;
        }
        let { 
            proconfigureDetailID,
            } = this.state;
        let data = {}
        data={
            params: [{
             proconfigureDetailID:proconfigureDetailID, 
            }],
        }
        $http.post('urlS', this, {
			code: '05100111',
			data: data,
			success: function (res) {
				if (+res.errorCode === 0 ) {
					for(var i = 0; i < res.proconfigureLinkArr.length; i++) {
						res.proconfigureLinkArr[i].key = i
                    }
					this.setState( {
                        data2: res.proconfigureLinkArr
                    })
				} else {
                    return;
				}
			}
		})
    }

    onClickProconfigureLinkRow = (record) => {
        //给右边的编辑form传值
        return {
            onClick: () => {
                if(this.state.proconfigureLinkID===""){
                    this.setState({
                        proconfigureLinkID: record.proconfigureLinkID,
                        proconfigureLinkHospID: record.proconfigureLinkHospID,
                        proconfigureLinkCode: record.proconfigureLinkCode,
                        proconfigureLinkDescripts: record.proconfigureLinkDescripts,
                        proconfigureLinkLinkValue: record.proconfigureLinkLinkValue,
                        proconfigureLinkLinkCode: record.proconfigureLinkLinkCode,
                        proconfigureLinkRemark: record.proconfigureLinkRemark, 
                    });
                }else{
                    if(this.state.proconfigureLinkID!==record.proconfigureLinkID){
                        this.setState({
                            proconfigureLinkID: record.proconfigureLinkID,
                            proconfigureLinkHospID: record.proconfigureLinkHospID,
                            proconfigureLinkCode: record.proconfigureLinkCode,
                            proconfigureLinkDescripts: record.proconfigureLinkDescripts,
                            proconfigureLinkLinkValue: record.proconfigureLinkLinkValue,
                            proconfigureLinkLinkCode: record.proconfigureLinkLinkCode,
                            proconfigureLinkRemark: record.proconfigureLinkRemark, 
                        });
                    }else{
                        this.setState({
                            proconfigureLinkID:'',
                            proconfigureLinkHospID:'',
                            proconfigureLinkCode:'',
                            proconfigureLinkDescripts:'',
                            proconfigureLinkLinkValue:'',
                            proconfigureLinkLinkCode:'',
                            proconfigureLinkRemark:'', 
                        });
                    }
                } 
            },
        };
    }


    handleProconfigureLinkClear = () =>{
        this.setState({
            proconfigureLinkID:'',
            proconfigureLinkHospID:'',
            proconfigureLinkCode:'',
            proconfigureLinkDescripts:'',
            proconfigureLinkLinkValue:'',
            proconfigureLinkLinkCode:'',
            proconfigureLinkRemark:'', 
        });
    }

    setProconfigureLinkRowClassName  = (record) => {
        return record.proconfigureLinkID === this.state.proconfigureLinkID ? 'clickRowStyle' : '';
    }

    //删除
    handleProconfigureLinkDel = () => {
        if(this.state.proconfigureLinkID===""){
            return;
        }
        let sessionInfo = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {};
        let data = {}
        data = {
            params: [{
                proconfigureLinkID: this.state.proconfigureLinkID,
                updateUserID:sessionInfo.userID
            }],
        }
        $http.post('urlADS', this, {
			code: '05100114',
			data: data,
			success: function (res) {
				if (+res.errorCode === 0 ) {
                    message.success('删除成功');
                    this.handleProconfigureLinkQuery ();
				} else {
                    return;
				}
			}
		})
    }



    // 医保地域
    handleYBAreaSelect = () => {
        let data = {}
        data = {
            params: [{
                proconfigureCode: "CONTRAST",
            }]
        }
        $http.post('urlS', this, {
            code: '05100119',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.data) {
                    let  areaSelect=[]
                    for (var i = 0; i < res.data.length; i++) {
                        areaSelect.push(<Option key={res.data[i].id} alias={res.data[i].descriptsSPCode}>{res.data[i].descripts}</Option>)
                    }
                    this.setState({
                        areaSelect: areaSelect
                    })
                } 
            }
        })
    }

    
     // 模块
     handleModuleSelect= () => {
        let data = {}
        data = {
            params: [{
            }]
        }
        $http.post('urlS', this, {
            code: '05100120',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.data) {
                    let  moduleSelect=[]
                    for (var i = 0; i < res.data.length; i++) {
                        moduleSelect.push(<Option key={res.data[i].id} alias={res.data[i].descriptsSPCode}>{res.data[i].descripts}</Option>)
                    }
                    this.setState({
                        moduleSelect: moduleSelect
                    })
                } 
            }
        })
    }


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


     //关联值
     handleLinkSelect= () => {
        let data = {}
        data = {
            params: [{
                proconfigureDetailID:this.state.proconfigureDetailID, 
            }]
        }
        $http.post('urlS', this, {
            code: '05100121',
            data: data,

            success: function (res) {
                if(res.flag===1){ 
                    this.setState({
                    showFlagInput:'none', 
                    showFlagSelect:''
                })}else{
                    this.setState({
                        showFlagInput:'', 
                        showFlagSelect:'none'  })
                }
                if (+res.errorCode === 0 && res.data) {
                    let  linkSelect=[]
                    for (var i = 0; i < res.data.length; i++) {
                        linkSelect.push(<Option key={res.data[i].id} alias={res.data[i].descriptsSPCode}>{res.data[i].descripts}</Option>)
                    }
                    this.setState({
                        linkSelect: linkSelect
                    })
                } 
            }
        })
    }
    render() {
        var color = {
            color:"#FFFFFF",
            marginLeft:"10px"
        }
        return (
            <div style={{height:'100%'}}>
                <Card style={{height:'97%'}} bodyStyle={{height:'97%'}} title="医保基础配置设置界面">
                    <Col span={10} style={{height:'100%'}}>
                        <Card bodyStyle={{padding:'12px'}}>
                            <Row>
                                <Input placeholder="代码" value={this.state.proconfigureCode} style={{width: '100px', marginRight: '10px'}} onChange={this.onChangeProconfigureCode} />
                                <Input placeholder="描述" value={this.state.proconfigureDescripts} style={{width: '100px', marginRight: '10px'}} onChange={this.onChangeProconfigureDescripts} />
                                <Select      
                                    showSearch
                                    allowClear={true} 
                                    placeholder="模块"
                                    optionFilterProp="children"
                                    onChange={this.onChangeProconfigurePMID}
                                    value={this.state.proconfigurePMID}
                                    style={{ width: '150px',marginRight: '10px' }}
                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                    >{this.state.moduleSelect}</Select>
                                {/*<Input placeholder="模块" value={this.state.proconfigurePMID} style={{width: '100px', marginRight: '10px'}} onChange={this.onChangeProconfigurePMID} />*/}
                                <Button style={{ marginLeft: '15px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handleProconfigureQuery}>查询</Button>
                                <Button style={{ marginLeft: '15px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handleProconfigureSave}>保存</Button>
                                <Button style={{ marginLeft: '15px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handleProconfigureClear}>清空</Button>
                            </Row>
                        </Card>
                        <Row style={{height:'92%'}}>
                            <Col span={24} style={{height:'100%'}}>
                                <Card bodyStyle={{padding:'10px',height:'95%'}} style={{height:'100%'}}>
                                    <div style={{height:'100%'}}> 
                                        <Table
                                            dataSource={this.state.data}
                                            columns={this.columnsA}
                                            rowClassName={this.setProconfigureRowClassName}
                                            pagination={false}
                                            bordered
                                            onRow={this.onClickProconfigureRow}
                                            rowKey="ID"
                                            style={{height:'100%'}}
                                            scroll={{ y: '530px'}}
                                        />
                                            {/* 分页: total--总条数  defaultCurrent--默认的当前页 hideOnSinglePage--只有一页时隐藏分页器 */}
                                            <Pagination
                                                size="small"
                                                showQuickJumper
                                                showSizeChanger
                                                defaultCurrent={1}
                                                current={this.state.page}
                                                total={this.state.total}
                                                onChange={this.appPageChange}
                                                onShowSizeChange={this.apponShowSizeChange}
                                                style={{textAlign: "right", marginTop: '5px'}}
                                            />
                                    </div>
                                </Card>
                            </Col>
                        </Row>
                    </Col>
                    <Col span={14} style={{height:'100%'}}>
                            <Card bodyStyle={{padding:'12px'}}>
                                <Row>
                                    <Input placeholder="代码" value={this.state.proconfigureDetailCode} style={{width: '15%', marginLeft: '2px'}} onChange={this.onChangeProconfigureDetailCode} />
                                    <Input placeholder="描述" value={this.state.proconfigureDetailDescripts} style={{width: '15%', marginLeft: '2px'}} onChange={this.onChangeProconfigureDetailDescripts} />
                                    {/*<Input placeholder="值" value={this.state.proconfigureDetailValue} style={{width: '10%', marginLeft: '2px'}} onChange={this.onChangeProconfigureDetailValue} />*/}
                                    <Select
                                    showSearch
                                    allowClear={true} 
                                    placeholder="请输入"
                                    optionFilterProp="children"
                                    style={{ width: '10%' }}
                                    value={this.state.proconfigureDetailType}
                                    onChange={this.onChangeProconfigureDetailType}
                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}  >
                                    <Option value="String" title='inputType'>String</Option>
                                    <Option value="User" title='inputType'>User</Option>
                                    </Select>
                                    <Input placeholder="备注" value={this.state.proconfigureDetailRemark} style={{width: '15%', marginLeft: '2px'}} onChange={this.onChangeProconfigureDetailRemark} />
                                    <Select      
                                    showSearch
                                    allowClear={true} 
                                    placeholder="医保地域"
                                    optionFilterProp="children"
                                    onChange={this.onChangeProconfigureDetailYBArea}
                                    value={this.state.proconfigureDetailYBArea}
                                    style={{width: '20%', marginLeft: '2px'}}
                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                    >{this.state.areaSelect}</Select>
                                   {/*<Input placeholder="医保地域" value={this.state.proconfigureDetailYBArea} style={{width: '15%', marginLeft: '2px'}} onChange={this.onChangeProconfigureDetailYBArea} />*/}
                                    <Button style={{ marginLeft: '20px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handleProconfigureDetailSave}>保存</Button>
                                    <Button style={{ marginLeft: '20px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handleProconfigureDetailClear}>清空</Button>
                                </Row>
                            </Card>
                            <Card bodyStyle={{padding:'12px',height:'50%'}} style={{height:'40%',marginBottom:'30px'}}>
                                <Row style={{height:'100%'}} >
                                    <Col span={24} style={{height:'100%'}}>
                                        <div style={{height:'100%'}}>
                                            <Table
                                                dataSource={this.state.data1}
                                                columns={this.columnsB}
                                                rowClassName={this.setProconfigureDetailRowClassName}
                                                pagination={false}
                                                bordered
                                                onRow={this.onClickProconfigureDetailRow}
                                                rowKey="ID"
                                                scroll={{ y: store.getState().tableHeight.y - 365 }}
                                                style={{height: (store.getState().tableHeight.y - 325)}}
                                            />
                                            {/* 分页: total1--总条数  defaultCurrent1--默认的当前页 hideOnSinglePage1--只有一页时隐藏分页器 */}
                                            <Pagination
                                                size="small"
                                                showQuickJumper
                                                showSizeChanger
                                                defaultCurrent={1}
                                                current={this.state.page1}
                                                total={this.state.total1}
                                                onChange={this.propPageChange}
                                                onShowSizeChange={this.proponShowSizeChange}
                                                style={{textAlign: "right", marginTop: '15px'}}
                                            />
                                        </div>
                                    </Col>
                                </Row>
                            </Card>
                            <Card bodyStyle={{padding:'12px'}}>
                                <Row>
                                    <Col span={17}>
                                        <Input placeholder="代码" value={this.state.proconfigureLinkCode} style={{width: '20%', marginLeft: '2px'}} onChange={this.onChangeProconfigureLinkCode} />
                                        <Input placeholder="描述" value={this.state.proconfigureLinkDescripts} style={{width: '20%', marginLeft: '2px'}} onChange={this.onChangeProconfigureLinkDescripts} />
                                        <Select      
                                            showSearch
                                            allowClear={true} 
                                            placeholder="关联值"
                                            optionFilterProp="children"
                                            onChange={this.onChangeProconfigureLinkLinkValues}
                                            value={this.state.proconfigureLinkLinkValue}
                                            style={{width: '20%', marginLeft: '2px',display:this.state.showFlagSelect}}
                                            filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                            >{this.state.linkSelect}
                                        </Select>
                                        <Input placeholder="关联值" type="text"  value={this.state.proconfigureLinkLinkValue} style={{width: '20%', marginLeft: '2px',display:this.state.showFlagInput}} onChange={this.onChangeProconfigureLinkLinkValue} />
                                        {/*<Input placeholder="关联代码" value={this.state.proconfigureLinkLinkCode} style={{width: '10%', marginLeft: '2px'}} onChange={this.onChangeProconfigureLinkLinkCode} />
                                        <Input placeholder="备注" value={this.state.proconfigureLinkRemark} style={{width: '15%', marginLeft: '2px'}} onChange={this.onChangeProconfigureLinkRemark} />*/}
                                        <Select      
                                            showSearch
                                            allowClear={true} 
                                            placeholder="医院"
                                            optionFilterProp="children"
                                            onChange={this.onChangeProconfigureLinkHospID}
                                            value={this.state.proconfigureLinkHospID}
                                            style={{width: '25%', marginLeft: '2px'}}
                                            filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                            >{this.state.hospSelect}
                                        </Select>
                                       {/*<Input placeholder="医院" value={this.state.proconfigureLinkHospID} style={{width: '20%', marginLeft: '2px'}} onChange={this.onChangeProconfigureLinkHospID} />*/}
                                    </Col>
                                       <Col span={7}>
                                        <Button style={{ marginLeft: '0px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handleProconfigureLinkSave }>保存</Button>
                                        <Button style={{ marginLeft: '18px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handleProconfigureLinkClear}>清空</Button>
                                        <Button style={{ marginLeft: '25px', background: 'rgba(255,0,0,1)',color:'#ffffff'}}  onClick={this.handleProconfigureLinkDel}>删除</Button>
                                     </Col>
                                </Row>
                            </Card>
                            <Card bodyStyle={{padding:'12px',height:'35%'}} style={{height:'40%'}}>
                                <Row type="flex" justify="space-between">
                                    <Col span={24}>
                                        <div>
                                            <Table
                                                dataSource={this.state.data2}
                                                columns={this.columnsC}
                                                rowClassName={this.setProconfigureLinkRowClassName }
                                                pagination={false}
                                                bordered
                                                onRow={this.onClickProconfigureLinkRow}
                                                rowKey="ID"
                                                style={{height:'204px'}}
                                                scroll={{ x: this.state.TableWidth, y: '169px' }}
                                            />
                                        </div>
                                    </Col>
                                </Row>
                            </Card>
                        </Col>
                    </Card>
            </div>
        )
    }
});
export default FormHandel;