/*
 * Creator:     ML
 * CreatDate:   2019-09-12
 * descripts：  门诊医生医嘱录入 治疗单打印
*/

import React from 'react';
import { Tabs, Row, Col, Icon, Divider,Modal,Button,Table,Card,} from 'antd';
import { $http } from 'containers/config/https';

class PrintingTreatmentSheet extends React.Component {
    constructor( porps ) {
        super(porps);
        this.state = {
            
        }

    }


    render() {
        //项目明细
        const leftDetailColumns = [
           { 
             // align: "center",
             title: '项目名称', 
             dataIndex: 'templetCatDesc',
             key: '1',
             width: '100px',
             render(text, row, index) {
               if (row.ordTempletDesc) {
                   return text;
               }
               return {
                   children: text,
                   props: {
                       colSpan: 6,
                   },
               };
           },
           },
           {
             align: "center",
             width: '100px',
             title: '次数',
             dataIndex: 'ordTempletDesc', 
             key: '2' ,
           },
           { 
             align: "center",
             width: '100px',
             title: '日期',
             dataIndex: 'ordTempletAlias', 
             key: '3',
           },
           { 
             align: "center",
             width: '100px',
             title: '执行人',
             dataIndex: 'ordTempletUserDesc',
             key: '4',
           },
         ];
         const childColumns = [
           {
             align: "center",
             title: '申请时间',
             dataIndex: 'descripts',
             key: 'descripts',
             editable: true,
           }, {
               align: "center",
               title: '申请项目',
               dataIndex: 'descripts',
               key: 'descripts',
               editable: true,
             }, {
               align: "center",
               title: '执行科室',
               dataIndex: 'descripts',
               key: 'descripts',
               editable: true,
             }, {
               align: "center",
               title: '状态',
               dataIndex: 'descripts',
               key: 'descripts',
               editable: true,
             },]
       //申请单列表
       const rowSelection_right = {
       selectedRowKeys: this.state.selectedRowKeys_right,
       onChange: (selectedRowKeys, selectedRows) => {
         let selectrow = "";
         if (selectedRowKeys.length === 0) {
         } else {
           selectrow = selectedRowKeys[selectedRowKeys.length - 1];
         }
         let arr = []
         selectedRows.map((item, i) => {
           arr.push(item.id)
         })
         this.setState({ selectedRowIds_O: arr, selectrow: selectrow, selectedRow_right: selectedRows, selectedRowKeys_right: selectedRowKeys }, () => {
         });
       },
       onSelectAll: (selected, selectedRows, changeRows) => {
         let arr = []
         selectedRows.map((item, i) => {
           arr.push(item.id)
         })
         this.setState({ selectedRowIds_O: arr, selectedRow_right: selectedRows });
       }
     };
       return (
        <div className="userInfoDom" style={{width:"100% !important"}}>
            <div>
               <Card style={{  width: '74%',float:"left" }}>
                   <Col className="bigTitle">
                   深圳市人民医院门诊申请单
                   </Col>
                   <Col className="marginTbs"> 
                   <span className="marginR">
                    <span className="middTitle">申请科室：</span>消化内科
                   </span> 
                   <span className="marginR">
                   <span className="middTitle">申请日期：</span>2019-04-12
                   </span>
                   <span className="marginR">
                   <span className="middTitle">申请医师：</span>王希孟
                   </span> 
                   </Col>
                   <Col className="marginTbs">
                   <span className="marginR">
                   <span className="middTitle">门诊/住院号：</span>10005678899
                   </span> 
                   <span className="marginR">
                   <span className="middTitle">姓名：</span>王希孟
                   </span>
                   <span className="marginR">
                   <span className="middTitle">性别：</span>男
                   </span> 
                   <span className="marginR">
                   <span className="middTitle">年龄：</span>21岁
                   </span> 
                   <span className="marginR">
                   <span className="middTitle">联系电话：</span>15523235656
                   </span> 
                   </Col>
                   <Col className="marginR marginTbs"> 
                   <span className="middTitle">临床诊断：</span>XXXXXXXXXXXXXXXXXXXXXXXXXXXX
                   </Col>
                   <Col className="marginR marginTbs">
                   <span className="middTitle">治疗项目：</span>中耳炎修复
                   </Col>
                   <Col className="marginR marginTbs">
                   <span className="middTitle">项目价格：</span>￥50.00
                   </Col>
                   <Col className="marginR marginTbs">
                   <span className="middTitle">执行科室：</span>耳鼻喉科
                   </Col>
                   <Col>
                   <Table
                       className="components-table-demo-nested"
                       columns={leftDetailColumns}
                       pagination={false}
                       rowClassName={this.setRowClassName}
                       // onRow={this.onClickRow}
                       rowKey={record => record.key}
                       // expandedRowRender={expandedRowRender}
                       // defaultExpandedRowKeys={this.state.newOpen&&this.state.newOpen.length > 0 ? this.state.newOpen : [0]} 
                       // defaultExpandAllRows={true}
                       // defaultExpandAllRows={true}
                       dataSource={this.state.leftData?this.state.leftData:[]}
                       style={{
                           width:"500px",
                           height: '500px',
                           overflow: 'auto'
                         }}
                       /> 
                   </Col>
                   <Col className="marginR">
                   <span className="middTitle">执行科室：</span>门诊检验科
                   </Col>
                   </Card>
                   <Card style={{ float:"rigth", width: '26%', height: '323px'}} title='申请单列表'>
                       <p style={{textAlign:"right"}}> <Button  type="primary">打印</Button> </p>
                       <Row>
                    <Col>
                    <Table
                       columns={childColumns}
                       pagination={false}
                       rowClassName={this.childRowClassNames}
                       dataSource={this.state.baseSubclassifications?this.state.baseSubclassifications:[]}
                       rowSelection={rowSelection_right}
                       className="childTableDom"
                     />
                    </Col>
                   </Row>
                   </Card>
            </div>
           <div>

           </div>             
        </div>
       )
   }
}
export default PrintingTreatmentSheet