// 手术风险评估
import React, { Component } from 'react';
import { Row, Col, Select, Button, Divider, message, Input, Icon, Form, Card } from 'antd';
import { $http } from '../../../containers/config/https';
import { Util } from 'tools/index';
import PatientInfo from '../Patient/PatientInfo';
const FormItem = Form.Item;
// 用户数据
let userData ;
const formItemLayout = {
	labelCol: { span: 10 },
	wrapperCol: { span: 14 },
}
const OperationRiskEva = Form.create()(
	class extends Component {
		constructor(props) {
			super(props);
			this.state = {
				operationCutCleanData: [],		// 手术切口清洁度数据源
				anesthesiaLevelData: [],		// 麻醉等级数据源
				operationCatData: [],			// 手术类别数据源
				cutConditionData: [],			// 手术切口状况数据源
				operationDurationData: [],		// 手术持续时间数据源
				operationDocData: [],			// 手术医师数据源
				anesthesiaDocData: [],			// 麻醉医师数据源
				tourNurData: [],				// 巡回护士数据源
			}
			userData = sessionStorage.userData ? JSON.parse(sessionStorage.userData) : {};
		}
		componentDidMount() {
            // this.getHospData();
            // this.getSelectData();
            // this.getLocUserData();
            // this.getLocData();
            if ((!this.props.admID)||(this.props.admID == '')){
                message.warning('请选择手术台次');
            }            
            // this.getConsultationInfo();
        }
		// 提交
		handleSubmit = () => {

		}
		render() {
			const { getFieldDecorator } = this.props.form;
			const inputStyle = {
				width: '50px'
			}
			const spanStyle = {
				marginTop: '5px'
			}
			return (
				<Card title='手术风险评估' className='PainScore-Card'>
					<Row style={{ width: '100%', height: '45px', textAlign: 'center', lineHeight: '45px', borderBottom: '1px solid #cccccc' }}>
						<PatientInfo admID={(this.props.admID) && (!Util.isEmpty(this.props.admID)) ? this.props.admID : ''} />
					</Row>
					<Form onSubmit={this.handleSubmit} layout="vertical">
						<Row>
							<Col span={6} >
								<FormItem {...formItemLayout} label='手术切口清洁度'>
									{getFieldDecorator('operationCutCleanID', {
										initialValue: '',
										// rules: [{ required: true, message: '请选择...', }]
									})(
										<Select showSearch allowClear optionFilterProp="role" >
											{this.state.operationCutCleanData.map(data => (<Select.Option key={data.id} value={data.id} role={data.code + '^' + data.descripts + '^' + data.descriptsSPCode}>{data.descripts}</Select.Option>))}
										</Select>
									)}
								</FormItem>
							</Col>
							<Col span={6} >
								<FormItem {...formItemLayout} label='麻醉分级 (ASA分级)'>
									{getFieldDecorator('anesthesiaLevelID', {
										initialValue: '',
										// rules: [{ required: true, message: '请选择...', }]
									})(
										<Select showSearch allowClear optionFilterProp="role" >
											{this.state.anesthesiaLevelData.map(data => (<Select.Option key={data.id} value={data.id} role={data.code + '^' + data.descripts + '^' + data.descriptsSPCode}>{data.descripts}</Select.Option>))}
										</Select>
									)}
								</FormItem>
							</Col>
							<Col span={6} >
								<FormItem {...formItemLayout} label='手术类别'>
									{getFieldDecorator('operationCatID', {
										initialValue: '',
										// rules: [{ required: true, message: '请选择...', }]
									})(
										<Select showSearch allowClear optionFilterProp="role" >
											{this.state.operationCatData.map(data => (<Select.Option key={data.id} value={data.id} role={data.code + '^' + data.descripts + '^' + data.descriptsSPCode}>{data.descripts}</Select.Option>))}
										</Select>
									)}
								</FormItem>
							</Col>
						</Row>
						<Row>
							<Col span={6} >
								<FormItem {...formItemLayout} label='切口愈合与感染情况'>
									{getFieldDecorator('cutConditionID', {
										initialValue: '',
										// rules: [{ required: true, message: '请选择...', }]
									})(
										<Select showSearch allowClear optionFilterProp="role" >
											{this.state.cutConditionData.map(data => (<Select.Option key={data.id} value={data.id} role={data.code + '^' + data.descripts + '^' + data.descriptsSPCode}>{data.descripts}</Select.Option>))}
										</Select>
									)}
								</FormItem>
							</Col>
							<Col span={6} >
								<FormItem {...formItemLayout} label='手术持续时间'>
									{getFieldDecorator('operationDurationID', {
										initialValue: '',
										// rules: [{ required: true, message: '请选择...', }]
									})(
										<Select showSearch allowClear optionFilterProp="role" >
											{this.state.operationDurationData.map(data => (<Select.Option key={data.id} value={data.id} role={data.code + '^' + data.descripts + '^' + data.descriptsSPCode}>{data.descripts}</Select.Option>))}
										</Select>
									)}
								</FormItem>
							</Col>
						</Row>
						<Row>
							<Col span={6} >
								<FormItem {...formItemLayout} label='手术医生签名'>
									{getFieldDecorator('operationDocID', {
										initialValue: '',
										// rules: [{ required: true, message: '请选择...', }]
									})(
										<Select showSearch allowClear optionFilterProp="role" >
											{this.state.operationDocData.map(data => (<Select.Option key={data.id} value={data.id} role={data.code + '^' + data.descripts + '^' + data.descriptsSPCode}>{data.descripts}</Select.Option>))}
										</Select>
									)}
								</FormItem>
							</Col>
							<Col span={6} >
								<FormItem {...formItemLayout} label='麻醉医生签名'>
									{getFieldDecorator('anesthesiaDocID', {
										initialValue: '',
										// rules: [{ required: true, message: '请选择...', }]
									})(
										<Select showSearch allowClear optionFilterProp="role" >
											{this.state.anesthesiaDocData.map(data => (<Select.Option key={data.id} value={data.id} role={data.code + '^' + data.descripts + '^' + data.descriptsSPCode}>{data.descripts}</Select.Option>))}
										</Select>
									)}
								</FormItem>
							</Col>
							<Col span={6} >
								<FormItem {...formItemLayout} label='巡回护士签名'>
									{getFieldDecorator('tourNurID', {
										initialValue: '',
										// rules: [{ required: true, message: '请选择...', }]
									})(
										<Select showSearch allowClear optionFilterProp="role" >
											{this.state.tourNurData.map(data => (<Select.Option key={data.id} value={data.id} role={data.code + '^' + data.descripts + '^' + data.descriptsSPCode}>{data.descripts}</Select.Option>))}
										</Select>
									)}
								</FormItem>
							</Col>
						</Row>
					</Form>
					<div style={{diaplay: 'flex'}}>
						<span style={spanStyle}>手术切口清洁度</span>
						<Input style={inputStyle}></Input>
						<span style={spanStyle}>分 ＋ 麻醉分级 (ASA分级)</span>
						<Input style={inputStyle}></Input>
						<span style={spanStyle}>分 ＋ 手术持续时间</span>
						<Input style={inputStyle}></Input>
						<span style={spanStyle}>分 ＝</span>						
						<Input style={inputStyle}></Input>
						<span style={spanStyle}>总分</span>
						<span >NNIS级数：</span>
						<Input style={inputStyle}></Input>
					</div>					
				</Card>
			)
		}
	}
)
export default OperationRiskEva;
