فهرست منبع

清除添加化验辅按钮浮动,打印医生名字位置,辅检标题小屏幕换行,模板接口进入页面没有调用问题

Luolei 6 سال پیش
والد
کامیت
7e81b634b0

+ 3 - 3
src/components/AddAssistCheck/index.jsx

@@ -104,12 +104,12 @@ class AddAssistCheck extends React.Component {
     </ul>
     }
     getAssistLabel(){
-        const {assistLabel,handleChangeAssistValue,handleChangeDate,isRead,handlePush} = this.props;
+        const {assistLabel,handleChangeAssistValue,handleChangeDate,isRead,handlePush,winWidth} = this.props;
         return <ul className={styles.labelWrap} id="datePick">
             {
                 assistLabel.map((item,idx) => {
                     return (<li key={item.id} className={styles.assistLists}>
-                        <span className={styles.assistName}>{item.name}:</span>
+                        <span className={styles.assistName} style={{width:winWidth < 1200?'120px':'auto'}}>{item.name}:</span>
                         <div className={styles.textareaWrap}>
                             <Textarea value={item.value} handlePush={handlePush} isRead={isRead} handleChangeAssistValue={handleChangeAssistValue} idx={idx}></Textarea>
                         </div>
@@ -132,7 +132,7 @@ class AddAssistCheck extends React.Component {
         return (
             <div className={styles.wrapper}>
                 {this.getAssistLabel()}
-                <div id="searchWrapAssist" style={{position:"relative"}}>
+                <div id="searchWrapAssist" style={{position:"relative",clear:'both'}}>
                     <Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck"/>
                   {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
                         {this.getSearchList(list)}

+ 2 - 2
src/components/AddAssistCheck/index.less

@@ -69,8 +69,8 @@
             }
         }
         .assistName {
-            height: 20px;
-            line-height: 20px;
+            // height: 20px;
+            // line-height: 20px;
             box-sizing: border-box;
             float: left;
         }

+ 1 - 1
src/components/AddInspect/index.jsx

@@ -361,7 +361,7 @@ class Inspect extends React.Component {
                         }
                     </ul>
                 </div>
-                <div style={{position:"relative"}}>
+                <div style={{position:"relative",clear:"both"}}>
                     <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap"/>
                   {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
                         {this.getSearchList(list)}

+ 2 - 1
src/components/AssistCheck/index.jsx

@@ -10,7 +10,7 @@ class AssistCheck extends React.Component {
     }
 
     render(){
-        const {list,assistLabel,handleChangeValue,handleSign,fetchPushInfos,handleDelAssist,handleChangeAssistValue,handleChangeDate,isRead} = this.props;
+        const {list,assistLabel,handleChangeValue,handleSign,fetchPushInfos,handleDelAssist,handleChangeAssistValue,handleChangeDate,isRead,winWidth} = this.props;
         return (
             <div className={styles.wrapper}>
                 <div className={styles.top}>
@@ -35,6 +35,7 @@ class AssistCheck extends React.Component {
                             handleChangeAssistValue={handleChangeAssistValue}
                             handleChangeDate={handleChangeDate}
                             isRead={isRead}
+                            winWidth={winWidth}
                         >
 
                         </AddAssistCheck>

+ 2 - 2
src/components/MainSuit/index.jsx

@@ -54,7 +54,6 @@ class MainSuit extends Component{
       }else {
         return chooseType({item,boxMark,i,hideTag:false,showArr,selecteds,saveText,mainIds});
       }
-
     })
     return list;
   }
@@ -137,11 +136,12 @@ class MainSuit extends Component{
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
     let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
+    let num = this.props.datas.length == 0?0:60
     if(isIE()){
       leftL = getPageCoordinate(e).boxLeft
     }else{
       const ele = document.activeElement;
-      leftL = ele.offsetLeft+60
+      leftL = ele.offsetLeft+num
     }
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,

+ 259 - 245
src/components/PreviewBody/index.jsx

@@ -1,282 +1,296 @@
 import React, { Component } from "react";
 import style from "./index.less";
-import { normalVal } from '@utils/tools';
+import { normalVal, filterDataArr } from '@utils/tools';
+import Notify from '@commonComp/Notify';
 import $ from "jquery";
 
 (function ($) {
   var opt;
 
   $.fn.jqprint = function (options) {
-      opt = $.extend({}, $.fn.jqprint.defaults, options);
+    opt = $.extend({}, $.fn.jqprint.defaults, options);
 
-      var $element = (this instanceof $) ? this : $(this);
+    var $element = (this instanceof $) ? this : $(this);
 
-      if (opt.operaSupport && $.browser.opera) {
-          var tab = window.open("", "jqPrint-preview");
-          tab.document.open();
+    if (opt.operaSupport && $.browser.opera) {
+      var tab = window.open("", "jqPrint-preview");
+      tab.document.open();
 
-          var doc = tab.document;
-      }
-      else {
-          var $iframe = $("<iframe  />");
+      var doc = tab.document;
+    }
+    else {
+      var $iframe = $("<iframe  />");
 
-          if (!opt.debug) { $iframe.css({ position: "absolute", width: "0px", height: "0px", left: "-300px", top: "-300px" }); }
+      if (!opt.debug) { $iframe.css({ position: "absolute", width: "0px", height: "0px", left: "-300px", top: "-300px" }); }
 
-          $iframe.appendTo("body");
-          var doc = $iframe[0].contentWindow.document;
-      }
+      $iframe.appendTo("body");
+      var doc = $iframe[0].contentWindow.document;
+    }
 
-      if (opt.importCSS) {
-          if ($("link[media=print]").length > 0) {
-              $("link[media=print]").each(function () {
-                  doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' media='print' />");
-              });
-          }
-          else {
-              $("link").each(function () {
-                  doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />");
-              });
-          }
+    if (opt.importCSS) {
+      if ($("link[media=print]").length > 0) {
+        $("link[media=print]").each(function () {
+          doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' media='print' />");
+        });
+      }
+      else {
+        $("link").each(function () {
+          doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />");
+        });
       }
+    }
 
-      if (opt.printContainer) { doc.write($element.outer()); }
-      else { $element.each(function () { doc.write($(this).html()); }); }
+    if (opt.printContainer) { doc.write($element.outer()); }
+    else { $element.each(function () { doc.write($(this).html()); }); }
 
-      doc.close();
+    doc.close();
 
-      (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).focus();
-      setTimeout(function () { (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).print(); if (tab) { tab.close(); } }, 1000);
+    (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).focus();
+    setTimeout(function () { (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).print(); if (tab) { tab.close(); } }, 1000);
   }
 
   $.fn.jqprint.defaults = {
-      debug: false,
-      importCSS: true,
-      printContainer: true,
-      operaSupport: true
+    debug: false,
+    importCSS: true,
+    printContainer: true,
+    operaSupport: true
   };
 
   $.fn.outer = function () {
-      return $($('<div></div>').html(this.clone())).html();
+    return $($('<div></div>').html(this.clone())).html();
   }
 })($);
 
-import {filterDataArr} from '@utils/tools'
 class PreviewBody extends Component {
-    constructor(props) {
-        super(props)
-        this.state={
-            dateTime:"",
-        }
-        this.$content = React.createRef();
-        this.getCurrentDate = this.getCurrentDate.bind(this);
-        this.onPrint = this.onPrint.bind(this);
-    }
-    componentDidMount(){
-        this.getCurrentDate();
-    }
-    componentWillReceiveProps(){
-        $(this.$content.current)[0].scrollIntoView(true);
+  constructor(props) {
+    super(props)
+    this.state = {
+      dateTime: "",
     }
-    onPrint() {
-      $("#content").jqprint({
-          debug: false,
-          importCSS: true,
-          printContainer: true,
-          operaSupport: false,
-      });
-      this.props.onClose()
+    this.$content = React.createRef();
+    this.getCurrentDate = this.getCurrentDate.bind(this);
+    this.onPrint = this.onPrint.bind(this);
   }
-    getCurrentDate(){
-        let myDate = new Date();
-        let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
-        let mon = myDate.getMonth()-0+1;       //获取当前月份(0-11,0代表1月)
-        let day = myDate.getDate();            //获取当前日(1-31)
-        let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
-        this.setState({dateTime:date})
+  componentDidMount() {
+    this.getCurrentDate();
+  }
+  componentWillReceiveProps() {
+    $(this.$content.current)[0].scrollIntoView(true);
+  }
+  onPrint() {
+    $("#content").jqprint({
+      debug: false,
+      importCSS: true,
+      printContainer: true,
+      operaSupport: false,
+    });
+    this.props.onClose()
+  }
+
+  surePrint(jsonStr) {
+    if (filterDataArr(JSON.parse(jsonStr.chief)) == '') {
+      Notify.info('主诉不能为空');
+      return false;
+    } else if (!jsonStr.diag || jsonStr.diag.trim().length < 1) {
+      Notify.info('诊断不能为空');
+      return false;
+    } else {
+      this.onPrint();
+      this.props.save(true)
     }
-    showDetails(val){
-        if(val.questionDetailList.length > 0){
-            return val.questionDetailList.map((item)=>{
-                if(val.value == item.name){
-                    return <td style={{width:'16%',fontSize:'12px'}}><span style={{color:item.abnormal != '0' ?"red":null}}>{val.value}</span> { val.labelSuffix}</td>
-                }
-            })
-        }else{ 
-            return <td style={{width:'16%',fontSize:'12px'}}><span style={{color:(val.value - 0).toString() == 'NaN'?"red":(val.maxValue || val.minValue)?(val.value > val.maxValue || val.value < val.minValue?"red":null):null}}>{val.value}</span> { val.labelSuffix}</td>
+    // if(filterDataArr(JSON.parse(jsonStr.chief)) == ''){
+    //   Notify.info('主诉不能为空');
+    //     return false;
+    // }else if(!jsonStr.diag || jsonStr.diag.trim().length < 1){
+    //     Notify.info('诊断不能为空');
+    //     return false;
+    // }else{
+    //     this.onPrint();
+    //     this.props.save(true)
+    // }
+  }
+  getCurrentDate() {
+    let myDate = new Date();
+    let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
+    let mon = myDate.getMonth() - 0 + 1;       //获取当前月份(0-11,0代表1月)
+    let day = myDate.getDate();            //获取当前日(1-31)
+    let date = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day);
+    this.setState({ dateTime: date })
+  }
+  showDetails(val) {
+    if (val.questionDetailList.length > 0) {
+      return val.questionDetailList.map((item) => {
+        if (val.value == item.name) {
+          return <td style={{ width: '16%', fontSize: '12px' }}><span style={{ color: item.abnormal != '0' ? "red" : null }}>{val.value}</span> {val.labelSuffix}</td>
         }
+      })
+    } else {
+      return <td style={{ width: '16%', fontSize: '12px' }}><span style={{ color: (val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : null) : null }}>{val.value}</span> {val.labelSuffix}</td>
     }
-    render() {
-        const { show, preInfo, dataJson, dataStr,baseObj,flg } = this.props;
+  }
+  render() {
+    const { show, preInfo, dataJson, dataStr, baseObj, flg } = this.props;
 
-        return <div className={style['content']} style={{width:flg?'700':'820'}}>
-            <div className={style['contents']} id="content" style={{margin:"0 auto",maxWidth:"600px"}}>
-                <div ref={this.$content} style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px',textAlign:'center' }}>{preInfo.hospitalName}</div>
-                <table className={style['patInfo']} style={{ margin: '0px 0px 30px 0px', borderCollapse: 'collapse', width: "100%" }}>
-                    <tr>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '31%',fontSize:"14px" }}>卡号:{baseObj?baseObj.patientIdNo:JSON.stringify(preInfo) == '{}'?'':preInfo.patientIdNo}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>姓名:{baseObj?baseObj.patientName:JSON.stringify(preInfo) == '{}'?'':preInfo.patientName}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>年龄:{baseObj?baseObj.patientAge:JSON.stringify(preInfo) == '{}'?'':preInfo.patientAge}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>性别:{baseObj?baseObj.patientSex:JSON.stringify(preInfo) == '{}'?'':preInfo.patientSex}</td>
-                    </tr>
-                    <tr>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '31%',fontSize:"14px" }}>就诊时间:{baseObj?baseObj.inquiryDate:(JSON.stringify(preInfo) == '{}'?'':preInfo.systemTime.split(' ')[0])}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>科室:{baseObj?baseObj.hospitalDeptName:(JSON.stringify(preInfo) == '{}'?'':preInfo.hospitalDeptName)}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>医生:{baseObj?baseObj.doctorName:(JSON.stringify(preInfo) == '{}'?'':preInfo.doctorName)}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>门诊号:{baseObj?baseObj.inquiryCode:(JSON.stringify(preInfo) == '{}'?'':preInfo.recordId)}</td>
-                    </tr>
-                </table>
-                <table style={{width:"100%", borderCollapse: 'collapse'}}>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>主诉:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
-                            {
-                                filterDataArr(JSON.parse(dataStr.chief))
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>现病史:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
-                            {
-                                filterDataArr(JSON.parse(dataStr.present))
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>其他史:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px'  }}>
-                            {
-                                filterDataArr(JSON.parse(dataStr.other))
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>查体:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px'  }}>
-                            {
-                                filterDataArr(JSON.parse(dataStr.vital))
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ width: 70, textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>化验:</td>
-                        <td style={{ fontSize: '14px', padding: '4px 0px 8px 0px',lineHeight:'20px',maxWidth:'650px'}}>
-                                {
-                                    dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items)=>{
-                                        return items.lisExcelRes && items.lisExcelRes.map((item)=>{
-                                            return <table style={{marginBottom:'10px',width:'100%',fontSize:'12px'}}>
-                                                <tr style={{fontSize:'14px',lineHeight:'1.5'}}><td><span style={{borderBottom:'1px solid #666666'}}>{item.menus}</span></td></tr>
-                                                {
-                                                    item.lisExcelItem && item.lisExcelItem.map((value)=>{
-                                                        return <tr style={{lineHeight:'1.5',maxWidth:'650px'}}>
-                                                            <td style={{width:'32%',fontSize:'12px'}}>{value.itemName}</td>
-                                                            <td style={{width:'16%',fontSize:'12px'}}><span style={{fontSize:'12px',color:value.type == 1?"red":null}}>{value.value}</span> {value.unit}</td>
-                                                            <td style={{width:'24%',fontSize:'12px'}}>
-                                                                {normalVal(value.min,value.max)}
-                                                            </td>
-                                                            <td style={{width:'28%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
-                                                        </tr>
-                                                    })
-                                                }
-                                            </table>
-                                        })
-                                    })
-                                }
-                                {
-                                    dataJson.lis.labelList && dataJson.lis.labelList.map((item,idx) => {
-                                        if(item.show){
-                                            return <table style={{margin:'8px 0',width:'100%'}}>
-                                                <tr style={{fontSize:'14px',lineHeight:'1.5'}}><td><span style={{borderBottom:'1px solid #666666'}}>{item.name}</span></td></tr>
-                                                {
-                                                    item.details.map((val)=>{
-                                                        if(val.value && val.value != ''){
-                                                            return <tr style={{lineHeight:'1.5',width:'100%',fontSize:'12px'}}>
-                                                                <td style={{width:'32%',fontSize:'12px'}}>{val.name}</td>
-                                                                {this.showDetails(val)}
-                                                                <td style={{width:'24%',fontSize:'12px'}}>
-                                                                    {normalVal(val.minValue,val.maxValue)}
-                                                                </td>
-                                                                <td style={{width:'28%',fontSize:'12px'}}>{'化验时间:'+item.time}</td>
-                                                            </tr>
-                                                        }
-                                                    })
-                                                }
-                                            </table>
-                                        }
-                                    })
-                                }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>辅检:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
-                            {
-                                dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item)=>{
-                                    return <div style={{ fontSize: '14px' }}>{item}</div>
-                                })
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>诊断:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
-                            {
-                                dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item)=>{
-                                    return <div style={{ fontSize: '14px'}}>{item}</div>
-                                })
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>医嘱:</td>
-                        <td style={{ fontSize: '14px', padding: '1px 0px 8px 0px',lineHeight:'20px' }}>
-                            {
-                                dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{fontSize:'14px',marginBottom:"8px"}}><span>开单项目</span></p> : ''
-                            }
-                            {
-                                dataJson.advice.assay && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.assay}</div>
-                            }
-                            {
-                                dataJson.advice.check && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.check}</div>
-                            }
-                            {dataJson.advice.scheme && dataJson.advice.scheme.length > 0  && <p style={{fontSize:'14px', marginBottom: '8px',marginTop:'8px'}}><span>治疗方案</span></p>}
-                            {
-                                dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
-                                    return <p>{item.treatment.map((it,ii) =>{
-                                      return(it.treatmentStr && it.treatmentStr.length > 0 ? 
-                                        <div style={{ padding: '0px 0px 5px 0px' }}>{ it.treatmentStr }</div>: '')
-                                    })}</p>
-                                  })
-                            }
-                        </td>
-                    </tr>
-                </table>
-                <table style={{ marginTop: '10px',marginBottom:'30px',position:'absolute',minWidth:'200px',right:'0',display: show ? 'block' : 'none' }}>
-                    <tr style={{textAlign:'right',verticalAlign: 'top',position:'absolute',right:'0'}}>
-                        <td>医生签名:</td>
-                        <td style={{
-                          minWidth:'50px',
-                          padding:'0 5px 2px 5px',
-                          borderBottom:'1px solid #333',
-                        }}>{baseObj?baseObj.doctorName:(JSON.stringify(preInfo) == '{}'?'':preInfo.doctorName)}</td>
-                    </tr>
-                </table>
-            </div>
-            
-            <div onClick={()=>{this.onPrint()}} style={{
-                display: show ? 'inline-block' : 'none',
-                padding: '10px 20px',
-                float:'right',
-                marginTop:'15px',
-                background: '#3B9ED0',
-                color: '#fff',
-                borderRadius: '4px',
-                cursor: 'pointer',
-                position:'absolute',
-                right:'40px'
-            }}>打印</div>
-        </div>
-    }
+    return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>
+      <div className={style['contents']} id="content" style={{ margin: "0 auto", maxWidth: "600px" }}>
+        <div ref={this.$content} style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px', textAlign: 'center' }}>{preInfo.hospitalName}</div>
+        <table className={style['patInfo']} style={{ margin: '0px 0px 30px 0px', borderCollapse: 'collapse', width: "100%" }}>
+          <tr>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '31%', fontSize: "14px" }}>卡号:{baseObj ? baseObj.patientIdNo : JSON.stringify(preInfo) == '{}' ? '' : preInfo.patientIdNo}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>姓名:{baseObj ? baseObj.patientName : JSON.stringify(preInfo) == '{}' ? '' : preInfo.patientName}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>年龄:{baseObj ? baseObj.patientAge : JSON.stringify(preInfo) == '{}' ? '' : preInfo.patientAge}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>性别:{baseObj ? baseObj.patientSex : JSON.stringify(preInfo) == '{}' ? '' : preInfo.patientSex}</td>
+          </tr>
+          <tr>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '31%', fontSize: "14px" }}>就诊时间:{baseObj ? baseObj.inquiryDate : (JSON.stringify(preInfo) == '{}' ? '' : preInfo.systemTime.split(' ')[0])}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>科室:{baseObj ? baseObj.hospitalDeptName : (JSON.stringify(preInfo) == '{}' ? '' : preInfo.hospitalDeptName)}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>医生:{baseObj ? baseObj.doctorName : (JSON.stringify(preInfo) == '{}' ? '' : preInfo.doctorName)}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>门诊号:{baseObj ? baseObj.inquiryCode : (JSON.stringify(preInfo) == '{}' ? '' : preInfo.recordId)}</td>
+          </tr>
+        </table>
+        <table style={{ width: "100%", borderCollapse: 'collapse' }}>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>主诉:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                filterDataArr(JSON.parse(dataStr.chief))
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>现病史:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                filterDataArr(JSON.parse(dataStr.present))
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>其他史:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                filterDataArr(JSON.parse(dataStr.other))
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>查体:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                filterDataArr(JSON.parse(dataStr.vital))
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ width: 70, textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>化验:</td>
+            <td style={{ fontSize: '14px', padding: '4px 0px 8px 0px', lineHeight: '20px', maxWidth: '650px' }}>
+              {
+                dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items) => {
+                  return items.lisExcelRes && items.lisExcelRes.map((item) => {
+                    return <table style={{ marginBottom: '10px', width: '100%', fontSize: '12px' }}>
+                      <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}>{item.menus}</span></td></tr>
+                      {
+                        item.lisExcelItem && item.lisExcelItem.map((value) => {
+                          return <tr style={{ lineHeight: '1.5', maxWidth: '650px' }}>
+                            <td style={{ width: '32%', fontSize: '12px' }}>{value.itemName}</td>
+                            <td style={{ width: '16%', fontSize: '12px' }}><span style={{ fontSize: '12px', color: value.type == 1 ? "red" : null }}>{value.value}</span> {value.unit}</td>
+                            <td style={{ width: '24%', fontSize: '12px' }}>
+                              {normalVal(value.min, value.max)}
+                            </td>
+                            <td style={{ width: '28%', fontSize: '12px' }}>{value.time == '' ? ('导入时间: ' + this.state.dateTime) : '化验时间: ' + value.time}</td>
+                          </tr>
+                        })
+                      }
+                    </table>
+                  })
+                })
+              }
+              {
+                dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
+                  if (item.show) {
+                    return <table style={{ margin: '8px 0', width: '100%' }}>
+                      <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}>{item.name}</span></td></tr>
+                      {
+                        item.details.map((val) => {
+                          if (val.value && val.value != '') {
+                            return <tr style={{ lineHeight: '1.5', width: '100%', fontSize: '12px' }}>
+                              <td style={{ width: '32%', fontSize: '12px' }}>{val.name}</td>
+                              {this.showDetails(val)}
+                              <td style={{ width: '24%', fontSize: '12px' }}>
+                                {normalVal(val.minValue, val.maxValue)}
+                              </td>
+                              <td style={{ width: '28%', fontSize: '12px' }}>{'化验时间:' + item.time}</td>
+                            </tr>
+                          }
+                        })
+                      }
+                    </table>
+                  }
+                })
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>辅检:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item) => {
+                  return <div style={{ fontSize: '14px' }}>{item}</div>
+                })
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>诊断:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item) => {
+                  return <div style={{ fontSize: '14px' }}>{item}</div>
+                })
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>医嘱:</td>
+            <td style={{ fontSize: '14px', padding: '1px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{ fontSize: '14px', marginBottom: "8px" }}><span>开单项目</span></p> : ''
+              }
+              {
+                dataJson.advice.assay && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.assay}</div>
+              }
+              {
+                dataJson.advice.check && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.check}</div>
+              }
+              {dataJson.advice.scheme && dataJson.advice.scheme.length > 0 && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>治疗方案</span></p>}
+              {
+                dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
+                  return <p>{item.treatment.map((it, ii) => {
+                    return (it.treatmentStr && it.treatmentStr.length > 0 ?
+                      <div style={{ padding: '0px 0px 5px 0px' }}>{it.treatmentStr}</div> : '')
+                  })}</p>
+                })
+              }
+            </td>
+          </tr>
+        </table>
+        <p style={{textAlign:'right',marginTop:'15px'}}>医生签名:<span style={{minWidth: '60px',padding: '0 5px 2px 5px',borderBottom: '1px solid #333',}}>{baseObj ? baseObj.doctorName : (JSON.stringify(preInfo) == '{}' ? '' : preInfo.doctorName)}</span></p>
+      </div>
+
+      <div onClick={() => { this.surePrint(dataStr) }} style={{
+        display: show ? 'inline-block' : 'none',
+        padding: '10px 20px',
+        float: 'right',
+        marginTop: '15px',
+        background: '#3B9ED0',
+        color: '#fff',
+        borderRadius: '4px',
+        cursor: 'pointer',
+        position: 'absolute',
+        right: '40px'
+      }}>打印</div>
+    </div>
+  }
 }
 
 export default PreviewBody;

+ 3 - 15
src/components/PrintPreview/index.jsx

@@ -1,9 +1,8 @@
 import React, { Component } from "react";
-import { getAllDataList, getAllDataStringList,filterDataArr } from '@utils/tools';
+import { getAllDataList, getAllDataStringList } from '@utils/tools';
 import style from "./index.less";
 import PreviewBody from "../PreviewBody";
 import store from '@store';
-import Notify from '@commonComp/Notify';
 import close from '../../common/images/icon_close.png';
 
 
@@ -11,20 +10,8 @@ class PrintPreview extends Component {
     constructor(props) {
         super(props)
     }
-    surePrint(jsonStr){
-        if(filterDataArr(JSON.parse(jsonStr.chief)) == ''){
-          Notify.info('主诉不能为空');
-            return false;
-        }else if(!jsonStr.diag || jsonStr.diag.trim().length < 1){
-            Notify.info('诊断不能为空');
-            return false;
-        }else{
-            this.onPrint();
-            this.props.save(true)
-        }
-    }
     render() {
-        const { onClose, visible, preInfo } = this.props;
+        const { onClose, visible, preInfo,save } = this.props;
         let baseList = store.getState();
         const dataJson = getAllDataList(baseList);
         const dataStr = getAllDataStringList(baseList);
@@ -40,6 +27,7 @@ class PrintPreview extends Component {
                         dataStr={dataStr}
                         show={true}
                         onClose={onClose}
+                        save={save}
                     ></PreviewBody>
                 {/* </div> */}
             </div>

+ 2 - 1
src/containers/AssistCheck.js

@@ -7,11 +7,12 @@ import { assistLable,delAssistLabel,changeAssistVal,changeDate } from '@store/ac
 import { getSearchList } from '@store/async-actions/assistCheck';
 import {billing} from '@store/async-actions/pushMessage';
 
-function mapStateToProps(state) {  
+function mapStateToProps(state) {
     return {
         list:state.assistCheck.list,
         assistLabel:state.assistCheck.assistLabel,
         isRead:state.homePage.isRead,
+        winWidth:state.homePage.windowWidth,
     }
 }
 

+ 2 - 0
src/store/async-actions/patInfo.js

@@ -57,6 +57,8 @@ export const initHistoryDetails = (dispatch) => {
                     if(baseList.tabTemplate.items.length == 0){
                       dispatch(initItemList());        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
                     }
+                }else{
+                  dispatch(initItemList(baseList.typeConfig.typeConfig))
                 }
             } else {
                 console.log(res)