//住院医嘱点评
import React from 'react';
import { Card, Row, Col, Form, DatePicker, Select, Button, Icon, Table, Checkbox , message, Input  } from 'antd';
import { $http } from 'containers/config/https';
import Moment from 'moment';
import store from 'store';
import './style/index.less';
import PublicModalTable from './../../common/PublicModalTable';
const { Option } = Select;
const FormItem = Form.Item;
const formItemLayout = {    // label 和input宽度
    labelCol: { span:7 },
    wrapperCol: { span: 17 },
};
const formItemCheckbox = {    // label 和input宽度
    labelCol: { span:7 },
    wrapperCol: { span: 2 },
};
const HospitalOrder = Form.create()(
    class extends React.Component {
        constructor() {
            super();
            this.state = {
                userInfo: JSON.parse(window.sessionStorage.userData),
                data: [],
                queryCondition: {},
                SelectData: {},
                inOpLocDr:'',
                vendor: '',
                WaListData: [], //库存单数据
                pageSize: 20,
                page: 1,
                total:0,
                modalData: [],
                stockID: '',
                ModalRowData: {}, // 弹框双击选中行数据
                columns: [],
                 ChineseEnglishSize: [],
                detailWidthTotal: '',
                auditDate: '', // 审核日期
                batchSP: '', //批次售价
                doctor: [], //医生下拉
                locID:'',
                checkboxShowR: false, //随机数的状态
                checkboxShowP: false, //百分比的状态
                valueR: '',
                valueP: '',
            }
            this.modalColumns = [
                {
                    key: 1,
                    title: this.state.userInfo.language == 'EN' ? 'Inventory item code' : '药品代码',
                    dataIndex: 'stockCode',
                    align: "center",
                    width: '22%'
                },
                {
                    key: 2,
                    title: this.state.userInfo.language == 'EN' ? 'Inventory item description' : '药品描述',
                    dataIndex: 'stockDesc',
                    align: "center",
                    width: '24%',
                },
                {
                    key: 5,
                    title: this.state.userInfo.language == 'EN' ? 'Inventory classification' : '库存分类',
                    dataIndex: 'stkSubCatDesc',
                    align: "center",
                    width: '16%',
                },
                {
                    key: 3,
                    title: this.state.userInfo.language == 'EN' ? 'Packing specification' : '包装规格',
                    dataIndex: 'stockSpec',
                    align: "center",
                    width: '12%',
                },
                {
                    key: 6,
                    title: this.state.userInfo.language == 'EN' ? 'Basic unit' : '基本单位',
                    dataIndex: 'baseUnitDesc',
                    align: "center",
                    width: '12%',
                },
                {
                    key: 7,
                    title: this.state.userInfo.language == 'EN' ? 'Storage unit' : '入库单位',
                    dataIndex: 'purUnitDesc',
                    align: "center",
                }
            ]
        }

        componentDidMount() {
            // 初始化数据
            this.getTacitlyApproveData();
            // this.getDetailTableColumns();
            this.doctorFilter();
            let listData = document.querySelectorAll('.AccordingHeight  .ant-table-body');
            if(listData.length>0){
                listData[0].style.height = (store.getState().tableHeight.y)/2 +160 + 'px';
            }
        }

        componentWillUnmount() {
            // 组件销毁前将静止让setState修改state的状态，防止内存泄漏
            this.setState = (state,callback)=>{ return; }
        }

        // 获取明系列表头数据
        getDetailTableColumns = () => {
            let {userInfo} = this.state;
            let data = {
                params: [{
                    reactCode: ['StorageDetailsQuery'],
                    compontName: 'StorageDetailsQuery',
                    type: 'C',
                }]
            }
            $http.post('urlS', this, {
                code: '01040073',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        let arr = res.result.C&&res.result.C.length > 0 ? JSON.parse(JSON.stringify(res.result.C)).map((item, index) => {
                            return  {
                                ...item,
                                key: index + 1,
                                title: <div onDoubleClick={() => { this.columnRef.onOpenModel();}}>{userInfo.language== 'EN' ? item.enDescripts : item.title}</div>
                            }
                        }) : '';
                        let filterArr = arr.filter(function(item){ return item.display === 'Y'});
                        // this.setState({columns: filterArr, detailWidthTotal: res.totalWidth,ChineseEnglishSize:userInfo.language=='EN' ? res.result.language.EN : res.result.language.CN})
                    }
                }
            });
        };

        //清空表格内容
        handleReset = () => {
            this.setState({WaListData: [],total: 0, auditDate: '', batchSP: '', valueP: '', valueR: ''});
            this.props.form.resetFields();
        };

        // 获取界面默认值
        getTacitlyApproveData() {
            let data = {
                params: []
            };
            // 获取下拉数据
            $http.post('urlS', this, {
                code: "02020312",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({SelectData: res, doctor: res.doctor})
                    }
                }
            })
        }
        doctorFilter=()=>{
            let data = {
                params: [{
                    locID: this.state.locID ? this.state.locID : '',
                }]
            };
            // 获取下拉数据
            $http.post('urlS', this, {
                code: "02020297",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({ doctor: res.doctor})
                    }
                }
            })
        };
        doctorLoc=(v)=>{
            this.props.form.setFieldsValue({doctor: undefined});
            this.setState({locID: v},()=>{
                this.doctorFilter();
            })
        }
        searchInformation=()=>{
            this.setState({page: 1},()=>{
                this.getConsumptionList()
            })
        };

        // 查询
        getConsumptionList=()=>{
            let {ChineseEnglishSize} = this.state;
            this.props.form.validateFields((error, value)=>{
                let obj = JSON.parse(JSON.stringify(value));
                if(error == null){
                    let data = {
                        params: [{
                            // locID: obj.locDesc ? obj.locDesc : undefined,
                            startDate: obj.startDate ? Moment(obj.startDate).format( 'YYYY-MM-DD') : undefined,
                            endDate: obj.endDate ? Moment(obj.endDate).format('YYYY-MM-DD') : undefined,
                            patNum: obj.patNum ? obj.patNum : "",
                            Outpatient: obj.Outpatient ? obj.Outpatient : "",
                            doctor: obj.doctor?obj.doctor:"",
                            stockID: this.state.stockID?this.state.stockID:"",
                            admReason: obj.admReason ? obj.admReason : '',
                            pharmacy: obj.pharmacy ? obj.pharmacy : '',
                            poison: obj.poison?obj.poison:"",
                            minAge: obj.minAge?obj.minAge:"",
                            baseDrugFlag:this.state.batchSP ? '0' : '1',
                            phcatDr: obj.phcatDr?obj.phcatDr:"",
                            form: obj.form?obj.form:"",
                        }]
                    };
                    $http.post('urlS', this, {
                        code: "02020313",
                        data: data,
                        success: function (res) {
                            if(res.errorCode == 0){
                                message.success('查询到'+res.total+'条数据');
                                this.setState({ total: res.total});
                            }else {
                                this.setState({total: 0});
                                 message.error(res.errorMessage);
                            }
                        }
                    });
                }
            })

        };

        // 抽取
        save=()=>{
            this.props.form.validateFields((error, value)=>{
                let obj = JSON.parse(JSON.stringify(value));
                if(error == null){
                    let data = {
                        params: [{
                            // locID: obj.locDesc ? obj.locDesc : undefined,
                            startDate: obj.startDate ? Moment(obj.startDate).format( 'YYYY-MM-DD') : undefined,
                            endDate: obj.endDate ? Moment(obj.endDate).format('YYYY-MM-DD') : undefined,
                            patNum: obj.patNum ? obj.patNum : "",
                            Outpatient: obj.Outpatient ? obj.Outpatient : "",
                            doctor: obj.doctor?obj.doctor:"",
                            stockID: this.state.stockID?this.state.stockID:"",
                            admReason: obj.admReason ? obj.admReason : '',
                            pharmacy: obj.pharmacy ? obj.pharmacy : '',
                            poison: obj.poison?obj.poison:"",
                            minAge: obj.minAge?obj.minAge:"",
                            baseDrugFlag:this.state.batchSP ? '0' : '1',
                            phcatDr: obj.phcatDr?obj.phcatDr:"",
                            form: obj.form?obj.form:"",
                            // random: obj.random ? obj.random : '',
                            TimeInterval: obj.TimeInterval ? obj.TimeInterval : '',
                            // percentage: obj.percentage ? obj.percentage : '',
                            random:this.state.valueR ? this.state.valueR : '',
                            percentage: this.state.valueP ? this.state.valueP : '',
                        }]
                    };
                    $http.post('urlS', this, {
                        code: "02020314",
                        data: data,
                        success: function (res) {
                            if(res.errorCode == 0){
                                message.success(res.errorMessage);
                                // this.setState({ total: res.total});
                            }else {
                                // this.setState({total: 0});
                                message.error(res.errorMessage);
                            }
                        }
                    });
                }
            })
        }
        // 获取描述列表数据
        getModalListData(alias) {
            let data = {
                params: [
                    {
                        stockAlias: alias, // 库存项描述别名
                        frLocID: this.state.frLocDr ? this.state.frLocDr : undefined
                    }
                ]
            };
            $http.post('urlS', this, {
                code: "02020042",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        for (var i = 0; i < res.result.length; i++) {
                            res.result[i].key = i
                        }
                        this.setState({ modalData: res.result })
                    } else {
                        this.setState({ modalData: [] })
                    }
                }
            })
        }
        // 描述回车事件
        stockDescOnPressEnter = (e) => {
            let top = document.getElementById('stock-desc').getBoundingClientRect().top + 40 + 'px';
            let left = document.getElementById('stock-desc').getBoundingClientRect().left + 100 + 'px';
            this.setState({
                top: top,
                left: left
            });
            this.getModalListData(e.target.value);
            this.child.showModal();
        };

        // 当描述失去焦点的时候
        stastockDescOnBlure = (e) => {
            if (this.state.ModalRowData && (e.target.value !== this.state.ModalRowData.stockDesc)) {
                this.props.form.setFieldsValue({ stockDesc: undefined });
            }
        };

        // 操作弹框
        onClickRowPublic = (record) => {
            return {
                onDoubleClick: () => {
                    this.confirmSelection(record);
                }
            }
        };
        // 双击选中行数据的回调
        confirmSelection = (record) => {
            // this.resetFields();
            this.setState({ ModalRowData: record }, () => {
                this.setState({ stockID: record.stockID });
                this.props.form.setFieldsValue({ stockDesc: record.stockDesc });
                // 关闭弹窗
                this.child.handleCancel();
            })
        };

        onchangeStock = (val) => {
            if (!val.target.value) {
                this.setState({ stockID: '' });
            }
        };


        onChangeSP=(e)=>{
            this.setState({batchSP: e.target.checked})
        }
        onRef = (ref) => {
            this.child = ref;
        };
        percentageChange=(e) =>{
            this.props.form.setFieldsValue({random: false});
            this.setState({checkboxShowP:e.target.checked, checkboxShowR: false ,valueR: ''});
        };
        randomChange =(e)=>{
            this.props.form.setFieldsValue({percentage: false});
            this.setState({checkboxShowR:e.target.checked, checkboxShowP: false, valueP: ''})
        }
        percentageInput=(v)=>{
            this.setState({valueP: v.target.value})
        }
        randomInput=(v)=>{
            this.setState({valueR: v.target.value})
        }
        render() {
            const { getFieldDecorator } = this.props.form;
            let {ChineseEnglishSize,userInfo} = this.state;
            //科室列表
            let inOpLocDrSelect = [];
            this.state.SelectData.Outpatient && this.state.SelectData.Outpatient.map((item, i) => {
                inOpLocDrSelect.push(<Option value={item.id} key={i} seatchprop={item.descripts + item.descriptsSPCode}>{item.descripts}</Option>)
            });
            //医生下拉
            let doctor = [];
            this.state.doctor && this.state.doctor.map((item, i) => {
                doctor.push(<Option value={item.id} key={i} seatchprop={item.descripts + item.descriptsSPCode}>{item.descripts}</Option>)
            });
            //药房名称下拉
            let pharmacy = [];
            this.state.SelectData.pharmacy && this.state.SelectData.pharmacy.map((item, i) => {
                pharmacy.push(<Option value={item.id} key={i} seatchprop={item.descripts + item.descriptsSPCode}>{item.descripts}</Option>)
            });
            //管制分类列表
            let poisonSelect = [];
            this.state.SelectData.poison && this.state.SelectData.poison.map((item, i) => {
                poisonSelect.push(<Option value={item.id} key={i} seatchprop={item.descripts + item.descriptsSPCode}>{item.descripts}</Option>)
            });
            //患者费用类别下拉
            let admReason = [];
            this.state.SelectData.admReason && this.state.SelectData.admReason.map((item, i) => {
                admReason.push(<Option value={item.id} key={i} seatchprop={item.descripts + item.descriptsSPCode}>{item.descripts}</Option>)
            });
            let param = {
                width: '600px',
                top: this.state.top,
                left: this.state.left,
                columns: this.modalColumns,
                data: this.state.modalData,
                isOnRow: true,
                TableClassName: 'tab-placeholder',
            };
            return (
                <div className="HospitalOrder">
                    <Row>
                        <Card
                            size="small"
                            title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.InventoryAlarmAccordingToConsuaccToConsumption ? ChineseEnglishSize.InventoryAlarmAccordingToConsuaccToConsumption.descripts:'住院医嘱点评'}</div>}
                        >
                            <Col span={20}>
                                <Form>
                                    <Row >
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuStartDate ? ChineseEnglishSize.InventoryAlarmAccordingToConsuStartDate.descripts:'起初日期'}>
                                                {getFieldDecorator('startDate',{
                                                    initialValue: this.state.SelectData.params&&this.state.SelectData.params.startDate ? Moment(this.state.SelectData.params.startDate, 'YYYY-MM-DD') : Moment(),
                                                    rules: [{required: true, message: '起初日期不能为空',}],
                                                })(
                                                    <DatePicker format="YYYY-MM-DD" style={{width:'100%'}}/>
                                                ) }
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsudeadline ? ChineseEnglishSize.InventoryAlarmAccordingToConsudeadline.descripts:'截止日期'}>
                                                {getFieldDecorator('endDate',{
                                                    initialValue: this.state.SelectData.params&&this.state.SelectData.params.endDate ? Moment(this.state.SelectData.params.endDate, 'YYYY-MM-DD') : Moment(),
                                                    rules: [{required: true, message: '截止日期不能为空',}],
                                                })(
                                                    <DatePicker  format="YYYY-MM-DD" style={{width:'100%'}}/>
                                                ) }
                                            </FormItem>
                                        </Col>
                                        <Col span={6} id='stock-desc'>
                                            <FormItem label="药品名称" {...formItemLayout}>
                                                {getFieldDecorator('stockDesc', {
                                                    rules: [{required: false, message: 'Please input your groupClass',}],
                                                })(
                                                    <Input placeholder='回车检索药品相关信息' allowClear onPressEnter={this.stockDescOnPressEnter} onBlur={this.stastockDescOnBlure} onChange={this.onchangeStock} />
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'出院人数'}>
                                                {getFieldDecorator('patNum',{
                                                    initialValue: "",
                                                    rules:[{ required : ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.required =='Y'? true:false: false, message: ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.message:'出院人数不能为空'}]
                                                })(
                                                 <Input />
                                                ) }
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row >
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'医生科室'}>
                                                {getFieldDecorator('Outpatient',{
                                                    initialValue: undefined,
                                                    rules:[{ required: true, message: ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.message:'医生科室不能为空'}]
                                                })(
                                                    <Select allowClear onChange={this.doctorLoc} showSearch optionFilterProp="seatchprop">
                                                        {inOpLocDrSelect}
                                                    </Select>
                                                ) }
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'医生'}>
                                                {getFieldDecorator('doctor',{
                                                    initialValue: undefined,
                                                    rules:[{ required: true, message: ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.message:'医生不能为空'}]
                                                })(
                                                    <Select allowClear showSearch optionFilterProp="seatchprop">
                                                        {doctor}
                                                    </Select>
                                                ) }
                                            </FormItem>
                                        </Col>
                                        {/*<Col span={6}>*/}
                                            {/*<FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'抗菌药物级别'}>*/}
                                                {/*{getFieldDecorator('inOpType0',{*/}
                                                    {/*initialValue: "",*/}
                                                    {/*rules:[{ required : ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.required =='Y'? true:false: false, message: ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.message:'抗菌药物级别不能为空'}]*/}
                                                {/*})(*/}
                                                    {/*<Select allowClear>*/}
                                                        {/*{inOpTypeSelect}*/}
                                                    {/*</Select>*/}
                                                {/*) }*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'病人年龄下限'}>
                                                {getFieldDecorator('minAge',{
                                                    initialValue: "",
                                                    rules:[{ required : ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.required =='Y'? true:false: false, message: ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.message:'病人年龄下限不能为空'}]
                                                })(
                                                    <Input style={{ width: '100%' }} />
                                                ) }
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'药房名称'}>
                                                {getFieldDecorator('pharmacy',{
                                                    initialValue: "",
                                                    rules:[{ required : ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.required =='Y'? true:false: false, message: ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.message:'药房名称不能为空'}]
                                                })(
                                                    <Select allowClear showSearch optionFilterProp="seatchprop">
                                                        {pharmacy}
                                                    </Select>
                                                ) }
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row >
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'管制分类'}>
                                                {getFieldDecorator('poison',{
                                                    initialValue: "",
                                                    rules:[{ required : ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.required =='Y'? true:false: false, message: ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.message:'管制分类不能为空'}]
                                                })(
                                                    <Select allowClear showSearch optionFilterProp="seatchprop">
                                                        {poisonSelect}
                                                    </Select>
                                                ) }
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'药学分类'}>
                                                {getFieldDecorator('phcatDr',{
                                                    initialValue: "",
                                                    rules:[{ required : ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.required =='Y'? true:false: false, message: ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.message:'药学分类不能为空'}]
                                                })(
                                                    <Input style={{ width: '100%' }} />
                                                ) }
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'患者费用类型'}>
                                                {getFieldDecorator('admReason',{
                                                    initialValue: "",
                                                    rules:[{ required : ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.required =='Y'? true:false: false, message: ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.message:'患者费用类型不能为空'}]
                                                })(
                                                    <Select allowClear showSearch optionFilterProp="seatchprop">
                                                        {admReason}
                                                    </Select>
                                                ) }
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>

                                            {/*<FormItem {...formItemLayoutL}>*/}
                                                {/*{getFieldDecorator('baseDrugFlag',{*/}
                                                    {/*initialValue: "",*/}
                                                {/*})(*/}
                                                    {/*<Checkbox onChange={this.onChangeSP}>基本药物</Checkbox>*/}
                                                {/*) }*/}
                                            {/*</FormItem>*/}
                                            {/*<Col span={7}>*/}
                                                <Col style={{paddingLeft: '45px',marginTop: '10px'}}>
                                                    <Checkbox onChange={this.onChangeSP}>基本药物</Checkbox>
                                                </Col>
                                            {/*</Col>*/}
                                        </Col>
                                    </Row>
                                </Form>
                            </Col>
                            <Col span={4} style={{textAlign:'center'}}>
                                <Row style={{marginBottom: '18px'}} className="button">
                                    <Button  onClick={this.searchInformation}>{ChineseEnglishSize.InventoryAlarmAccordingToConsusearch ? ChineseEnglishSize.InventoryAlarmAccordingToConsusearch.descripts:'查询'}</Button>
                                </Row>
                                {/*<Row style={{marginBottom: '18px'}} className="button">*/}
                                    {/*<Button type="primary" onClick={this.handleReset}>{ChineseEnglishSize.InventoryAlarmAccordingToConsuclean ? ChineseEnglishSize.InventoryAlarmAccordingToConsuclean.descripts:'清屏'}</Button>*/}
                                {/*</Row>*/}
                            </Col>
                        </Card>
                    </Row>
                    <Row>
                        <Card
                            size="small"
                            title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.InventoryAlarmAccordingToConsuaccToConsumption ? ChineseEnglishSize.InventoryAlarmAccordingToConsuaccToConsumption.descripts:'生成点评单'}</div>}
                        >
                            <Col span={20}>
                                    <Row >
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'点评单号'}>
                                                {getFieldDecorator('NO',{
                                                    initialValue: "",
                                                    rules:[{ required : ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.required =='Y'? true:false: false, message: ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.message:'点评单号不能为空'}]
                                                })(
                                                    <Input style={{ width: '100%' }} />
                                                ) }
                                            </FormItem>
                                        </Col>
                                        {/*<Col span={6}>*/}
                                            {/*<FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'随机数'}>*/}
                                                {/*{getFieldDecorator('random',{*/}
                                                    {/*initialValue: "",*/}
                                                {/*})(*/}
                                                    {/*<Input style={{ width: '100%' }} />*/}
                                                {/*) }*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={6}>*/}
                                            {/*<FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'百分比'}>*/}
                                                {/*{getFieldDecorator('percentage',{*/}
                                                    {/*initialValue: "",*/}
                                                {/*})(*/}
                                                    {/*<Input style={{ width: '100%' }} />*/}
                                                {/*) }*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        <Col span={6} className='random'>
                                            <FormItem {...formItemCheckbox} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'随机数'}>
                                                {getFieldDecorator('random',{
                                                    valuePropName: 'checked',
                                                    initialValue: '',
                                                })(
                                                    <Checkbox onChange={this.randomChange}></Checkbox>
                                                ) }
                                            </FormItem>
                                            <span className='ran'><Input style={{ width: '60%' }} disabled={!this.state.checkboxShowR} value={this.state.valueR}  onChange={this.randomInput}  /></span>
                                        </Col>
                                        <Col span={6} className='percentage'>
                                            <FormItem {...formItemCheckbox} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'百分比'}>
                                                {getFieldDecorator('percentage',{
                                                    valuePropName: 'checked',
                                                    initialValue: '',
                                                })(
                                                    <Checkbox onChange={this.percentageChange}></Checkbox>
                                                ) }
                                            </FormItem>
                                            <span className='per'><Input style={{ width: '60%' }} disabled={!this.state.checkboxShowP} value={this.state.valueP} onChange={this.percentageInput} /></span>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'抽查数'}>
                                                {getFieldDecorator('maxSp210',{
                                                    initialValue: "",
                                                })(
                                                    <Input style={{ width: '100%' }} />
                                                ) }
                                            </FormItem>
                                        </Col>
                                    </Row>
                                <Row >
                                    <Col span={6}>
                                        <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'时隔数'}>
                                            {getFieldDecorator('TimeInterval',{
                                                initialValue: "",
                                            })(
                                                <Input style={{ width: '100%' }} />
                                            ) }
                                        </FormItem>
                                    </Col>
                                    <Col span={6}>
                                        <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'理论所需总数'}>
                                            {getFieldDecorator('maxSp452',{
                                                initialValue: "",
                                            })(
                                                <Input style={{ width: '100%' }} />
                                            ) }
                                        </FormItem>
                                    </Col>
                                    <Col span={6}>
                                        <FormItem {...formItemLayout} label={ChineseEnglishSize.InventoryAlarmAccordingToConsuloc ? ChineseEnglishSize.InventoryAlarmAccordingToConsuloc.descripts:'建议时隔数'}>
                                            {getFieldDecorator('minSp79',{
                                                initialValue: "",
                                            })(
                                                <Input style={{ width: '100%' }} />
                                            ) }
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row style={{margin: '20px 0 0 112px'}} className="button">
                                    <Button disabled={this.state.total >0 ? false : true} onClick={this.save} >{ChineseEnglishSize.InventoryAlarmAccordingToConsusearch ? ChineseEnglishSize.InventoryAlarmAccordingToConsusearch.descripts:'抽取出院简历'}</Button>
                    </Row>
                </Col>
                        </Card>
                    </Row>
                    <PublicModalTable onClickRowPublic={this.onClickRowPublic}  param={param} onRef={this.onRef} />
                </div>
            )
        }
    }
);
export default HospitalOrder;