|
@@ -2,65 +2,11 @@ import React, { Component } from "react";
|
|
|
import style from "./index.less";
|
|
|
import { normalVal, filterDataArr, filterOtherDataArr,timestampToTime } from '@utils/tools';
|
|
|
import Notify from '@commonComp/Notify';
|
|
|
+import Information from '../Information';
|
|
|
import $ from "jquery";
|
|
|
import AssessResultHis from '@containers/AssessResultHis'
|
|
|
|
|
|
-(function ($) {
|
|
|
- var opt;
|
|
|
-
|
|
|
- $.fn.jqprint = function (options) {
|
|
|
- opt = $.extend({}, $.fn.jqprint.defaults, options);
|
|
|
-
|
|
|
- var $element = (this instanceof $) ? this : $(this);
|
|
|
-
|
|
|
- if (opt.operaSupport && $.browser.opera) {
|
|
|
- var tab = window.open("", "jqPrint-preview");
|
|
|
- tab.document.open();
|
|
|
-
|
|
|
- var doc = tab.document;
|
|
|
- }
|
|
|
- else {
|
|
|
- var $iframe = $("<iframe />");
|
|
|
-
|
|
|
- if (!opt.debug) { $iframe.css({ position: "absolute", width: "0px", height: "0px", left: "-300px", top: "-300px" }); }
|
|
|
-
|
|
|
- $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.printContainer) { doc.write($element.outer()); }
|
|
|
- else { $element.each(function () { doc.write($(this).html()); }); }
|
|
|
-
|
|
|
- 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);
|
|
|
- }
|
|
|
-
|
|
|
- $.fn.jqprint.defaults = {
|
|
|
- debug: false,
|
|
|
- importCSS: true,
|
|
|
- printContainer: true,
|
|
|
- operaSupport: true
|
|
|
- };
|
|
|
-
|
|
|
- $.fn.outer = function () {
|
|
|
- return $($('<div></div>').html(this.clone())).html();
|
|
|
- }
|
|
|
-})($);
|
|
|
+// import "@utils/jqprint";
|
|
|
|
|
|
class PreviewBody extends Component {
|
|
|
constructor(props) {
|
|
@@ -68,16 +14,12 @@ class PreviewBody extends Component {
|
|
|
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);
|
|
|
- }
|
|
|
onPrint() {
|
|
|
$("#content").jqprint({
|
|
|
debug: false,
|
|
@@ -99,16 +41,6 @@ class PreviewBody extends Component {
|
|
|
this.onPrint();
|
|
|
this.props.save(true)
|
|
|
}
|
|
|
- // 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();
|
|
@@ -148,41 +80,27 @@ class PreviewBody extends Component {
|
|
|
const noData = JSON.stringify(preInfo) == '{}';
|
|
|
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']}>
|
|
|
- <tr>
|
|
|
- <td>卡号:{baseObj ? baseObj.patientIdNo : noData ? '' : preInfo.patientIdNo}</td>
|
|
|
- <td>姓名:{baseObj ? baseObj.patientName : noData ? '' : preInfo.patientName}</td>
|
|
|
- <td>年龄:{baseObj ? baseObj.patientAge : noData ? '' : preInfo.patientAge}</td>
|
|
|
- <td>性别:{baseObj ? baseObj.patientSex : noData ? '' : preInfo.patientSex}</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>就诊时间:{baseObj ? baseObj.inquiryDate : (noData ? '' : preInfo.systemTime.split(' ')[0])}</td>
|
|
|
- <td>科室:{baseObj ? baseObj.hospitalDeptName : (noData ? '' : preInfo.hospitalDeptName)}</td>
|
|
|
- <td>医生:{baseObj ? baseObj.doctorName : (noData ? '' : preInfo.doctorName)}</td>
|
|
|
- <td>门诊号:{baseObj ? baseObj.inquiryCode : (noData ? '' : preInfo.recordId)}</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
+ <Information baseObj={baseObj} preInfo={preInfo}></Information>
|
|
|
<table className={style['infos']}>
|
|
|
- <tr>
|
|
|
- <td>主诉:</td>
|
|
|
- <td>
|
|
|
+ <tr className={style['patInfoFst']}>
|
|
|
+ <td className={style['patInfoSec']}>主诉:</td>
|
|
|
+ <td className={style['patInfoSec']}>
|
|
|
{
|
|
|
filterDataArr(JSON.parse(dataStr.chief))
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr>
|
|
|
- <td>现病史:</td>
|
|
|
- <td>
|
|
|
+ <tr className={style['patInfoFst']}>
|
|
|
+ <td className={style['patInfoSec']}>现病史:</td>
|
|
|
+ <td className={style['patInfoSec']}>
|
|
|
{
|
|
|
filterDataArr(JSON.parse(dataStr.present))
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr>
|
|
|
- <td>其他史:</td>
|
|
|
- <td>
|
|
|
+ <tr className={style['patInfoFst']}>
|
|
|
+ <td className={style['patInfoSec']}>其他史:</td>
|
|
|
+ <td className={style['patInfoSec']}>
|
|
|
{
|
|
|
other_yjs.str1
|
|
|
}
|
|
@@ -202,17 +120,17 @@ class PreviewBody extends Component {
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr>
|
|
|
- <td>查体:</td>
|
|
|
- <td>
|
|
|
+ <tr className={style['patInfoFst']}>
|
|
|
+ <td className={style['patInfoSec']}>查体:</td>
|
|
|
+ <td className={style['patInfoSec']}>
|
|
|
{
|
|
|
filterDataArr(JSON.parse(dataStr.vital))
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr>
|
|
|
- <td>化验:</td>
|
|
|
- <td>
|
|
|
+ <tr className={style['patInfoFst']}>
|
|
|
+ <td className={style['patInfoSec']}>化验:</td>
|
|
|
+ <td className={style['patInfoSec']}>
|
|
|
{
|
|
|
dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items) => {
|
|
|
return items.lisExcelRes && items.lisExcelRes.map((item) => {
|
|
@@ -263,9 +181,9 @@ class PreviewBody extends Component {
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr>
|
|
|
- <td>辅检:</td>
|
|
|
- <td>
|
|
|
+ <tr className={style['patInfoFst']}>
|
|
|
+ <td className={style['patInfoSec']}>辅检:</td>
|
|
|
+ <td className={style['patInfoSec']}>
|
|
|
{
|
|
|
dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item) => {
|
|
|
return <div style={{ fontSize: '14px',wordBreak:"break-all" }}>{item}</div>
|
|
@@ -273,9 +191,9 @@ class PreviewBody extends Component {
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr>
|
|
|
- <td>诊断:</td>
|
|
|
- <td>
|
|
|
+ <tr className={style['patInfoFst']}>
|
|
|
+ <td className={style['patInfoSec']}>诊断:</td>
|
|
|
+ <td className={style['patInfoSec']}>
|
|
|
{
|
|
|
dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item) => {
|
|
|
return <div style={{ fontSize: '14px' }}>{item}</div>
|
|
@@ -283,9 +201,9 @@ class PreviewBody extends Component {
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr>
|
|
|
- <td>医嘱:</td>
|
|
|
- <td style={{ fontSize: '14px', padding: '1px 0px 8px 0px', lineHeight: '20px' }}>
|
|
|
+ <tr className={style['patInfoFst']}>
|
|
|
+ <td className={style['patInfoSec']}>医嘱:</td>
|
|
|
+ <td className={style['patInfoSec']} style={{ fontSize: '14px', padding: '1px 0px 8px 0px', lineHeight: '20px' }}>
|
|
|
{dataJson.advice.commontreatment && dataJson.advice.commontreatment.length > 0 && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>一般治疗</span></p>}
|
|
|
{
|
|
|
dataJson.advice.commontreatment && <div style={{ padding: '0px 0px 5px 0px',wordBreak:"break-all" }}>{dataJson.advice.commontreatment}</div>
|