liucf 6 лет назад
Родитель
Сommit
23701f2100
40 измененных файлов с 788 добавлено и 504 удалено
  1. 5 2
      src/common/components/ComplexModal/index.jsx
  2. 11 5
      src/common/components/ComplexModal/index.less
  3. 1 1
      src/common/js/func.js
  4. 1 1
      src/components/AddAssistCheck/index.jsx
  5. 1 1
      src/components/AddInspect/index.jsx
  6. 40 35
      src/components/AssessResult/index.jsx
  7. 8 0
      src/components/AssessResult/index.less
  8. 23 3
      src/components/ChronicInfo/index.jsx
  9. 2 1
      src/components/DiagnosticList/index.jsx
  10. 41 0
      src/components/Information/index.jsx
  11. 17 0
      src/components/Information/index.less
  12. 2 1
      src/components/MainSuit/index.jsx
  13. 27 109
      src/components/PreviewBody/index.jsx
  14. 9 4
      src/components/PreviewBody/index.less
  15. 8 10
      src/components/PrintPreview/index.jsx
  16. 2 17
      src/components/PushItems/index.jsx
  17. 5 2
      src/components/ScaleTable/index.jsx
  18. 8 0
      src/components/ScaleTable/index.less
  19. 16 9
      src/components/TemplateItems/TemplateItem/index.jsx
  20. 9 36
      src/components/Treat/AdverseReactions/index.jsx
  21. 1 2
      src/components/Treat/LastTreat/index.jsx
  22. 6 4
      src/components/Treat/index.jsx
  23. 1 1
      src/containers/AssessResult.js
  24. 1 1
      src/containers/AssistCheck.js
  25. 7 1
      src/containers/DiagnosticList.js
  26. 26 5
      src/containers/MainSuit.js
  27. 2 24
      src/containers/OtherHistory.js
  28. 10 2
      src/containers/Treat.js
  29. 1 0
      src/main.js
  30. 51 0
      src/store/actions/treat.js
  31. 40 2
      src/store/async-actions/fetchModules.js
  32. 6 1
      src/store/async-actions/historyTemplates.js
  33. 3 1
      src/store/async-actions/homePage.js
  34. 3 3
      src/store/async-actions/patInfo.js
  35. 3 1
      src/store/async-actions/pushMessage.js
  36. 146 119
      src/store/async-actions/treat.js
  37. 107 98
      src/store/reducers/treat.js
  38. 4 0
      src/store/types/treat.js
  39. 69 0
      src/utils/jqprint.js
  40. 65 2
      src/utils/tools.js

+ 5 - 2
src/common/components/ComplexModal/index.jsx

@@ -14,10 +14,12 @@ import close from '@common/images/icon_close.png';
  *height:弹窗的高度
  * **/
 
+
 class ComplexModal extends Component {
   constructor(props) {
-    super(props)
+    super(props);
   }
+
   render() {
     const { onclose,title,children,footer,shadeClose,icon,width,top,bottom} = this.props;
     const marginLeft = width? -parseInt(width)/2 : '';
@@ -25,12 +27,13 @@ class ComplexModal extends Component {
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(<div className={style['container']}>
       <div className={style['shade']} onClick={shadeClose===false?'':onclose}></div>
-      <div className={style['modal']} style = {{width: width?width:'auto', marginLeft:marginLeft, top:top?top+'px':'',bottom:bottom?bottom+'px':''}}>
+      <div className={style['modal']} style={{width: width?width:'auto', marginLeft:marginLeft, top:top?top+'px':'',bottom:bottom?bottom+'px':''}}>
         <div className={style['close']}>
           {icon?<img src={icon} />:''}
           {title}
           <img src={close} onClick={onclose} className={style['closeIcon']} />
         </div>
+        <i className={style['flg']}>患者基本信息</i>
         <div className={style["content"]} style = {{width: width?width:'auto'}}>{children}</div>
         <div className={style['footer']} style = {{width: width?width:'auto'}}>{footer}</div>
       </div>

+ 11 - 5
src/common/components/ComplexModal/index.less

@@ -14,11 +14,17 @@
     bottom:30px;
     text-align: right;
   }
-  /*@media print {
-    .shade{
-      display: none;
-    }
-  }*/
+  // @media print {
+  //   .close{
+  //     display: none;
+  //   }
+  //   .flg {
+  //     display: block !important;
+  //   }
+  // }
+  .flg {
+    display: none;
+  }
   .shade {
     position: fixed;
     left: 0;

+ 1 - 1
src/common/js/func.js

@@ -96,7 +96,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       value = '',
       item={},
       checkHiddenDefault=false;
-  arr.map((it,i)=>{
+  arr&&arr.map((it,i)=>{
     notText = notTextLabel(it);
     value = it.value||'';
     textLabel = !ifEmpty&&i==0?Object.assign({},JSON.parse(config.textLabel),{showInCheck:true}):JSON.parse(config.textLabel);

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

@@ -55,7 +55,7 @@ class AddAssistCheck extends React.Component {
     $(document).click((event) => {
       let _con = $('#searchWrapAssist');   // 设置目标区域
       let _cons = $('#datePick');   // 设置目标区域
-      if (searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
+      if (_con && searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
         this.setState({ show: false });
       }
       if (!_cons.is(event.target) && _cons.has(event.target).length === 0) { // Mark 1

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

@@ -241,7 +241,7 @@ class Inspect extends React.Component {
         list && list.map((item, idx) => {
           return <li key={idx}
             className={styles.searchLi}
-            title={item.name}
+            title={item.name == item.retrievalName ? item.name : item.name + '(' + item.retrievalName + ')'}
             onClick={() => {
               handleSign(item.questionId, idx,'search');
               this.setState({ show: false })

+ 40 - 35
src/components/AssessResult/index.jsx

@@ -1,80 +1,85 @@
 import React, { Component } from "react";
 import style from "./index.less";
-import { Radio} from '@commonComp';
+import { Radio } from '@commonComp';
 import Notify from '@commonComp/Notify';
 import ChooseItem from "./ChooseItem";
 import ScaleItem from "./ScaleItem";
+import Information from '../Information'
 import ChartItem from "./ChartItem";
+import $ from "jquery";
 
 class AssessResult extends Component {
   constructor(props) {
     super(props);
-    this.state={
-      chooseSelecteds:{},     //大数据选择模块
-      chartTimeTypes:{},      //图表模块
-      wholeAssessItems:props.wholeIndexs,     //整体评估模块
-      wholeAssessText:props.wholeText||''     //整体评估补充说明
+    this.state = {
+      chooseSelecteds: {},     //大数据选择模块
+      chartTimeTypes: {},      //图表模块
+      wholeAssessItems: props.wholeIndexs,     //整体评估模块
+      wholeAssessText: props.wholeText || ''     //整体评估补充说明
     }
     this.handleChooseChange = this.handleChooseChange.bind(this);
     this.handleScaleDel = this.handleScaleDel.bind(this);
     this.handleScaleText = this.handleScaleText.bind(this);
   }
-  componentWillMount(){
+  componentWillMount() {
     //获取评估
     this.props.getAssess();
   }
-  handleScaleText(text){
-      this.setState({
-        wholeAssessText:text
-      })
+  handleScaleText(text) {
+    this.setState({
+      wholeAssessText: text
+    })
   }
-  handleScaleDel(i,j){
-    const items = Object.assign({},this.state.wholeAssessItems);
-    const inx = items[i].findIndex(x=>x==j);
-    items[i].splice(inx,1);
+  handleScaleDel(i, j) {
+    const items = Object.assign({}, this.state.wholeAssessItems);
+    const inx = items[i].findIndex(x => x == j);
+    items[i].splice(inx, 1);
     this.setState({
       wholeAssessItems: items
     });
   }
-  handleChooseChange(i,selects){
-    const {chooseSelecteds} = this.state;
+  handleChooseChange(i, selects) {
+    const { chooseSelecteds } = this.state;
     this.setState({
-      chooseSelecteds: Object.assign(chooseSelecteds,{[i]:selects})
+      chooseSelecteds: Object.assign(chooseSelecteds, { [i]: selects })
     });
   }
-  handleChartChange(i,selects){
-    const {chartTimeTypes} = this.state;
+  handleChartChange(i, selects) {
+    const { chartTimeTypes } = this.state;
     this.setState({
-      chartTimeTypes:Object.assign(chartTimeTypes,{[i]:selects})
+      chartTimeTypes: Object.assign(chartTimeTypes, { [i]: selects })
     });
   }
-  componentWillUnmount(){
+  componentWillUnmount() {
     //点确定关闭弹窗时把参数传到父组件去
-    const {handleSave,isAssessConfirm} = this.props;
-    isAssessConfirm&&handleSave(this.state);
+    const { handleSave, isAssessConfirm } = this.props;
+    isAssessConfirm && handleSave(this.state);
   }
-  handoutTypes(item,i){
-    const {getIndexData,indexData,timeTypes,wholeAssessData,wholeIndexs} =this.props;
+  handoutTypes(item, i) {
+    const { getIndexData, indexData, timeTypes, wholeAssessData, wholeIndexs } = this.props;
     //console.log(indexData)
     const chartData = indexData;
-    const name = item.regionName+":";
-    const list = item.data&&item.data.rows;
-    switch (+item.regionType){
+    const name = item.regionName + ":";
+    const list = item.data && item.data.rows;
+    switch (+item.regionType) {
       case 0:     //数据来源与右侧手动添加
         return <ScaleItem title={name} data={wholeAssessData} handleRemove={this.handleScaleDel} handleInp={this.handleScaleText} indexs={this.state.wholeAssessItems}></ScaleItem>;
       case 1:     //数据来源于大数据
-        return <ChooseItem title={name} data={list} handleChange={this.handleChooseChange.bind(this,i)}></ChooseItem>;
+        return <ChooseItem title={name} data={list} handleChange={this.handleChooseChange.bind(this, i)}></ChooseItem>;
       case 10:    //数据来源于后台
-        return <ChartItem title={name} data={chartData||{}} timeTypes={timeTypes} initFn={getIndexData} handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
+        return <ChartItem title={name} data={chartData || {}} timeTypes={timeTypes} initFn={getIndexData} handleChange={this.handleChartChange.bind(this, i)}></ChartItem>;
       default:
         return '';
     }
   }
   render() {
-    const { onClose,data } = this.props;
-    return <div className={style['assess-cont']}>
-      {data&&data.map((it,i)=>{
-        return this.handoutTypes(it,i);
+    const { onClose, data } = this.props;
+    return <div className={style['assess-cont']} id="AssistResult">
+      <div className={style['printShow']}>
+        <Information></Information>
+      </div> 
+      {data && data.map((it, i) => {
+        return this.handoutTypes(it, i);
       })}
     </div>;
   }

+ 8 - 0
src/components/AssessResult/index.less

@@ -89,4 +89,12 @@
       }
     }
   }
+}
+.printShow {
+  display: none;
+}
+@media print {
+  .printShow {
+    display: block;
+  }
 }

+ 23 - 3
src/components/ChronicInfo/index.jsx

@@ -17,6 +17,7 @@ import AssessResult from '@containers/AssessResult';
 import ScaleTable from '@containers/ScaleTable';
 // import ScaleTable from '../ScaleTable';
 import { Radio,CheckBtn } from '@commonComp';
+import $ from 'jquery';
 
 /***
 慢病右侧推送模块规则:
@@ -25,6 +26,7 @@ import { Radio,CheckBtn } from '@commonComp';
 明细--量表-计算公式-核心指标
 controlType:0-radio  1-checkbox  2-text  3-dropdownlist
 **/
+
 class ChronicInfo extends React.Component{
   constructor(props){
     super(props);
@@ -44,6 +46,8 @@ class ChronicInfo extends React.Component{
       radioVal:{},  //可能结果选择内容
       possible:{},  //可能结果
     };
+    this.$content = React.createRef();
+
     this.showInfo = this.showInfo.bind(this);
     this.closeInfo = this.closeInfo.bind(this);
     this.showOption = this.showOption.bind(this);
@@ -56,7 +60,22 @@ class ChronicInfo extends React.Component{
     this.closeFormula = this.closeFormula.bind(this); //关闭计算公式
     this.handleAddAssessItem = this.handleAddAssessItem.bind(this);   //加入病例记录
     this.handleSaveAssess = this.handleSaveAssess.bind(this);       //评估弹窗确定
+    this.onPrint = this.onPrint.bind(this); 
+  }
+
+  onPrint() {
+    let dom = this.state.showTable?$("#printcontent"):$("#AssistResult");
+    dom.jqprint({
+      debug: false,
+      importCSS: true,
+      printContainer: true,
+      operaSupport: false,
+    });
+  }
+  componentWillReceiveProps() {
+    $(this.$content.current)[0].scrollIntoView(true);
   }
+  
   showTableList(id){//量表
     const {getTableList,questionId} = this.props;
     // getTableList(questionId&&questionId.id);
@@ -181,7 +200,7 @@ class ChronicInfo extends React.Component{
     const {showInfo,showOption,infoId,formulaId,optionId,possible,radioVal} = this.state;
     let list = data&&data.map((v,i)=>{
                     return <div className={style["list"]}>
-                      <p>
+                      <p ref={this.$content}>
                         <span>{'患者可能有'+v.name}</span>
                         <img src={infoPic} className={style["infoPic"]} onClick={this.showInfo.bind(this,v.id)}/>
@@ -318,11 +337,12 @@ class ChronicInfo extends React.Component{
 
   render(){
     const footer = <div className={style['footer']}>
-      <span className={style['print']}><img src={printIcon} alt=""/>打印</span>
+      <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
       <span className={style['okBtn']} onClick={()=>this.handleSaveAssess()}>确定</span>
     </div>;
     const {chronicMagItem,showList,tableList,scaleInfo,data,saveAssessInfos,chronicDesease} = this.props;
     const {showInfo,showOption,showTable,showAssess,isAssessConfirm,tableName,tableId,parentId} = this.state;
+    console.log(8989,chronicMagItem,chronicDesease);
     return <div className={style["tips"]} style={{marginBottom:'15px'}}>
               <div className={`${style["tips-title"]} ${style["chronic"]}`}>
                 <div className={style["tips-name"]}>
@@ -363,7 +383,7 @@ class ChronicInfo extends React.Component{
                 <ScaleTable data={scaleInfo} title={tableName} tableId={tableId} parentId={parentId}></ScaleTable>
               </ComplexModal>:''}
               {showAssess?<ComplexModal onclose={this.showAssessFn} footer={footer}
-                      title='管理和评估' 
+                      title='管理和评估'
                       icon={manageIcon}
                       top={20}
                       bottom={20}

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

@@ -51,8 +51,9 @@ class DiagnosticList extends Component {
     }
     deleteItem() {
         const { delItem } = this.state;
-        const { delDiagnostic } = this.props;
+        const { delDiagnostic, delReact } = this.props;
         delDiagnostic && delDiagnostic(delItem);
+        delReact && delReact(delItem)
         this.setState({
             visible: false,
         })

+ 41 - 0
src/components/Information/index.jsx

@@ -0,0 +1,41 @@
+import React, { Component } from "react";
+import style from "./index.less";
+import store from "@store";
+import $ from "jquery";
+
+
+class Information extends Component {
+  constructor(props) {
+    super(props)
+    this.$content = React.createRef();
+  }
+
+  componentWillReceiveProps() {
+    $(this.$content.current)[0].scrollIntoView(true);
+  }
+  render() {
+    const { baseObj } = this.props;
+    let baseData = store.getState()
+    let preInfo = baseData.patInfo.message;
+    const noData = JSON.stringify(preInfo) == '{}';
+    return <div className={style['information']}>
+        <div ref={this.$content} className={style['title']}>{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>
+      </div>
+  }
+}
+
+export default Information;

+ 17 - 0
src/components/Information/index.less

@@ -0,0 +1,17 @@
+.title {
+  clear: both;
+  font-size: 24px;
+  margin-bottom: 30px;
+  text-align:center;
+}
+.patInfo {
+  margin: 0px 0px 30px 0px;
+  td {
+    border: 1px solid #aaa;
+    padding: 8px 10px;
+    font-size: 14px;
+  }
+  tr td:first-child{
+    width: 31%;
+  }
+}

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

@@ -297,7 +297,7 @@ class MainSuit extends Component{
     autoFillMoudles && autoFillMoudles()
   }
   referCase() {
-        const { items } = this.props
+        const { items ,pureSaveChronic} = this.props
         this.setState({
           showHistoryCase:false
         })
@@ -307,6 +307,7 @@ class MainSuit extends Component{
         // let baseList = store.getState(); 
         let baseObj = items[this.state.activeHistory];
         pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
+        pureSaveChronic && pureSaveChronic({name:'糖尿病',id:21773}); //储存慢病疾病
         this.props.getBilling();
         this.setState({
             activeHistory: -1

+ 27 - 109
src/components/PreviewBody/index.jsx

@@ -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 arrow from '@common/images/icon_tri_blue.png';
 
-(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>

+ 9 - 4
src/components/PreviewBody/index.less

@@ -16,19 +16,24 @@ table{
   width: 100%;
 }
 .infos{
-  &>tr{
+  .patInfoFst{
     vertical-align: top;
     border-bottom: 1px solid #e2e4e6;
   }
-  &>tr>td{
+  .patInfoFst .patInfoSec{
     padding: 9px 5px 8px 0px;
     line-height: 20px;
   }
-  &>tr>td:first-child {
-    text-align: right;
+  .patInfoFst .patInfoSec:first-child{
+    text-align: right;    
     width: 70px;
     font-size: 14px;
   }
+  &>tr>td:first-child {//打印样式需要改
+    // text-align: right;
+    // width: 70px;
+    // font-size: 14px;
+  }
 }
 .patInfo {
   margin: 0px 0px 30px 0px;

+ 8 - 10
src/components/PrintPreview/index.jsx

@@ -33,16 +33,14 @@ class PrintPreview extends Component {
             <div className={style['shade']} onClick={onClose}></div>
             <div className={style['modal']}>
                 <div className={style['close']}>打印<img src={close} onClick={onClose} /></div>
-                {/* <div id="content"> */}
-                    <PreviewBody
-                        preInfo={preInfo}
-                        dataJson={dataJson}
-                        dataStr={dataStr}
-                        show={true}
-                        onClose={onClose}
-                        save={save}
-                    ></PreviewBody>
-                {/* </div> */}
+                  <PreviewBody
+                      preInfo={preInfo}
+                      dataJson={dataJson}
+                      dataStr={dataStr}
+                      show={true}
+                      onClose={onClose}
+                      save={save}
+                  ></PreviewBody>
             </div>
         </div>
     }

+ 2 - 17
src/components/PushItems/index.jsx

@@ -14,7 +14,7 @@ import store from "@store";
 import { getWindowInnerHeight } from "@common/js/func";
 import {addLabel} from '@store/actions/inspect';
 import {addAssistLabel} from '@store/actions/assistCheck';
-import {windowEventHandler} from '@utils/tools'
+import {windowEventHandler,getCurrentDate} from '@utils/tools'
 import {ConfirmModal} from '@commonComp';
 import ChronicInfo from '@containers/ChronicInfo';//慢病推送模块
 
@@ -51,27 +51,12 @@ class PushItems extends Component {
       showAssess:!this.state.showAssess
     });
   }
-  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);
-    return date;
-  }
 
   billing() {
     const { assay, check } = this.props.pushMessage;
     const checkedAssay = assay.filter(item => item.checked);
     const checkedCheck = check.filter(item => item.checked);
     this.props.billing(checkedAssay, checkedCheck);
-    // if(checkedAssay.length > 0 || checkedCheck.length > 0) {
-    //   const Height = $(".src-components-BodyContainer-2SgEx").height();
-    //   const adviceHeight = $(".src-common-components-ItemBox-1Bpz3").height();
-    //   const winHeight = window.innerHeight;
-    //   const scrollTop = Height;
-    //   $('#addScrollEvent').scrollTop(100000)
-    // }
     let obj = {   //添加化验
       details: [],
       name: '',
@@ -82,7 +67,7 @@ class PushItems extends Component {
       name: '',
       questionId: '',
       showType: 1,
-      time:this.getCurrentDate(),
+      time:getCurrentDate(),
       value:''
     }
     if(checkedAssay.length > 0){

+ 5 - 2
src/components/ScaleTable/index.jsx

@@ -2,7 +2,7 @@ import React from 'react';
 import style from './index.less';
 import mocks from '../../mock/chronicTable.js'
 import { Radio,CheckBtn } from '@commonComp';
- 
+ import Information from '../Information'
 /**
 *量表 具体信息页面
 *title:量表标题
@@ -61,7 +61,10 @@ class ScaleTable extends React.Component{
     const footContent = data && data[2].content; //表后文字
     const datas = content && JSON.parse(content);
     // console.log(555,datas,content);
-    return <div className={style['tableBox']}>
+    return <div className={style['tableBox']} id="printcontent">
+            <div className={style['printShow']}>
+              <Information></Information>
+            </div> 
             <h1>{title}</h1>
             <div dangerouslySetInnerHTML={{__html:preContent}} className={style['textlh']}></div>
             <table className={style['table']}>

+ 8 - 0
src/components/ScaleTable/index.less

@@ -64,3 +64,11 @@ strong{
     line-height: 22px;
   }
 }
+.printShow {
+  display: none;
+}
+@media print {
+  .printShow {
+    display: block;
+  }
+}

+ 16 - 9
src/components/TemplateItems/TemplateItem/index.jsx

@@ -24,7 +24,6 @@ class TemplateItem extends React.Component {
             checkBox:false,
             bgColor:false,
         };
-        this.titleDOM = null;
         this.isConfirmClick = false;
         this.timer = null;
         this.handleTitleClick = this.handleTitleClick.bind(this)
@@ -107,12 +106,21 @@ class TemplateItem extends React.Component {
         this.props.handleTitleChange(currId,name);
     }
 
-    recoverTitle() {
-        this.titleDOM.innerHTML = this.props.title;
-    }
-
     handleTitleClick(e) {
-      if($(e.target).attr('src')){
+      if(e.target.tagName == 'I'){
+        let tmpDomLis = $(e.target).parent().parent().siblings()
+        $(e.target).parent().next().slideToggle()
+        if($(e.target).parent().next().height() == 0){
+          $(e.target).next().attr('src',arrow_down_icon)
+        }else{
+          $(e.target).next().attr('src',arrow_icon)
+        }
+        for(let i = 0;i < tmpDomLis.length;i++){
+          let tmpDiv = tmpDomLis[i]
+          $(tmpDiv).children().eq(1).slideUp()
+          $(tmpDiv).children().eq(0).children('img').eq(0).attr('src',arrow_icon)
+        }
+      }else if($(e.target).attr('src')){
         let tmpDomLis = $(e.target).parent().parent().siblings()
         $(e.target).parent().next().slideToggle()
         if($(e.target).parent().next().height() == 0){
@@ -159,13 +167,12 @@ class TemplateItem extends React.Component {
                             src={this.getCheckIcon()[0]}
                         /></div>:null
                     }
-                    <span
-                        ref={(title) => this.titleDOM = title}
+                    <i
                         className={style['title']}
                         title={name+sexStr}
                     >
                         {name+sexStr}
-                    </span>
+                    </i>
                     <img className={style.arrow} src={arrow_icon} />
                     <img title={'删除模板'} 
                         className={style.del}

+ 9 - 36
src/components/Treat/AdverseReactions/index.jsx

@@ -7,44 +7,16 @@ import $ from "jquery";
 class AdverseReactions extends Component {
     constructor(props){
         super(props);
-        this.state = {
-            currentIndex: -1
-        }
-        this.handleMouseLeaveDrug = this.handleMouseLeaveDrug.bind(this);
-        this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this);
-        this.setDrugInfo = this.setDrugInfo.bind(this);
+      
     }
-    handleMouseEnterDrug(index, item) {
-        const drugNameWidth = parseInt($('#'+item.medicitionName)[0].offsetWidth)
-        const imgLeft = drugNameWidth/2-8
-        $('#'+item.medicitionName).find('img').css('left', imgLeft)
-        this.setState({
-            currentIndex: index,
-        })
-    }
-    handleMouseLeaveDrug() {
-        this.setState({
-            currentIndex: -1, 
-        })
-    }
-    handleMouseEnterImg() {
-        this.setState({
-            hasEnterImg: true
-        })
-    }
-    handleMouseLeaveImg() {
-        this.setState({
-            hasEnterImg: false
-        })
-    }
-    setDrugInfo(item) {
-        const { setDrugInfo } = this.props;
-        setDrugInfo && setDrugInfo(item);
+    changeReact(it, index) {
+        console.log('itttttttt', it, index)
+        this.props.changeReact(it, index);
     }
 
 
     render() {
-        const { icon, titleStyle,titleBg, filter, title, showDrugInfo, setDrugInfo, adversReactionList } = this.props
+        const { icon, titleStyle,titleBg, filter, title,  adversReactionList } = this.props
         return(
             <div className={style['last-treat-wrapper']}>
                 { console.log('adversReactionList', adversReactionList) }
@@ -52,9 +24,10 @@ class AdverseReactions extends Component {
                 <div className={style['last-treat-title']} ><img className={style['last-treat-icon']} src={icon}/>{title}</div>
                 {adversReactionList.map((item, index) => {
                     return (<div key={item.id}><span>{item.tagName}:</span>
-                        {item.details.map((it, index) => {
+                        {console.log('item.details', item.details)}
+                        {item.details.map((it, idx) => {
                             return <span key={item.id + it.name}>
-                                <input type="checkbox" checked={item.checked} id={item.id + it.name} onChange={()=>{console.log('change')}}/>
+                                <input type="checkbox" checked={it.checked} id={item.id + it.name} onChange={this.changeReact.bind(this, it, index)}/>
                                 <label for={item.id + it.name}> {it.name} </label>
                             </span>
                         })}
@@ -66,4 +39,4 @@ class AdverseReactions extends Component {
 
 }
 
-export default AdverseReactions;
+export default AdverseReactions;

+ 1 - 2
src/components/Treat/LastTreat/index.jsx

@@ -20,7 +20,6 @@ class LastTreat extends Component {
         return(
             chronicDisMedica && chronicDisMedica.length > 0 && commonDisMedica && commonDisMedica.length > 0 &&
             <div className={style['last-treat-wrapper']}>
-                {console.log('lasttreatTreat', lastTreat)}
                 <div className={style['last-treat-title-box']} style={titleStyle}></div>
                 <div className={style['last-treat-title']} ><img className={style['last-treat-icon']} src={icon}/>{title}</div>
                 {commonDisMedica.length > 0 && <LastDrug title='普通病用药内容' lastDrugList = {commonDisMedica}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
@@ -31,4 +30,4 @@ class LastTreat extends Component {
 
 }
 
-export default LastTreat;
+export default LastTreat;

+ 6 - 4
src/components/Treat/index.jsx

@@ -39,9 +39,10 @@ class Treat extends Component {
         Notify.info('该功能即将上线,敬请期待。', 2000)
     }
     handleDetermine() {
-        const { title, treatment, advice } = this.props
+        const { title, treatment, advice, treatItem, adversReactionList, saveAllAdverseReaction } = this.props
         const { addScheme } = this.props
         addScheme && addScheme(title, treatment);
+        saveAllAdverseReaction && saveAllAdverseReaction(treatItem)
         this.hideTreat()
     }
     showDrugInfo() {
@@ -53,8 +54,9 @@ class Treat extends Component {
       $('#drugWrapper').css({'z-index': 301});
     }
     render(){
-        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, lastTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore, adversReactionList} = this.props;
+        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, lastTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore, adversReactionList, changeReact} = this.props;
         const { zIndex,show } = this.state
+        {console.log('adversReactionListadversReactionList11', adversReactionList)}
         return(
             <div   className={style['treat-wrapper']}>
                 <div className={style['treat-mask']} onClick={this.hideTreat}>
@@ -65,8 +67,8 @@ class Treat extends Component {
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
-                        <LastTreat icon={generalIcon} title='上次用药情况' lastTreat={lastTreat}  showDrugInfo = {showDrugInfo} setDrugInfo={ setDrugInfo }></LastTreat>
-                        <AdverseReactions icon={generalIcon} title='不良反应' adversReactionList = {adversReactionList}></AdverseReactions>
+                        { lastTreat && lastTreat.chronicDisMedica &&lastTreat. chronicDisMedica.length > 0 && lastTreat.commonDisMedica && lastTreat.commonDisMedica.length > 0 &&<LastTreat icon={generalIcon} title='上次用药情况' lastTreat={lastTreat}  showDrugInfo = {showDrugInfo} setDrugInfo={ setDrugInfo }></LastTreat>}
+                        {adversReactionList&&adversReactionList.length>0&&<AdverseReactions icon={generalIcon} title='不良反应' adversReactionList = {adversReactionList} changeReact = {changeReact}></AdverseReactions>}
                         <DrugTreat treatment={ treatment } 
                                 selectDrug={selectDrug} 
                                 setOtherRecommend={ setOtherRecommend } 

+ 1 - 1
src/containers/AssessResult.js

@@ -17,7 +17,7 @@ import store from '@store';
  *
  * ***/
 
-function mapStateToProps(state) {console.log(state)
+function mapStateToProps(state) {//console.log(state)
   const {assessResult} = state;
   return {
     data:assessResult.data,

+ 1 - 1
src/containers/AssistCheck.js

@@ -8,7 +8,7 @@ import { getSearchList,getInstroduce } from '@store/async-actions/assistCheck';
 import {ISREAD} from '@store/types/homePage.js';
 import {billing} from '@store/async-actions/pushMessage';
 
-function mapStateToProps(state) {//console.log(state.assistCheck)
+function mapStateToProps(state) {//console.log(state)
     return {
         list:state.assistCheck.list,
         assistLabel:state.assistCheck.assistLabel,

+ 7 - 1
src/containers/DiagnosticList.js

@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
 import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE } from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
-import { SHOW_TREAT } from '../store/types/treat';
+import { SHOW_TREAT, DEL_REACT } from '@store/types/treat.js';
 import {billing, getTips} from '../store/async-actions/pushMessage';
 import {keepPushData} from '@store/actions/tabTemplate';
 import { showHistory,sortHistory,activeHistory,visibleHistory } from '@store/actions/historyTemplates'
@@ -35,6 +35,12 @@ function mapDispatchToProps(dispatch) {
                 type: GET_DIAGNOSTIC_STR
             });
         },
+        delReact: (item) => {
+            dispatch({
+                type: DEL_REACT,
+                item: item
+            })
+        },
         upDiagnostic: (index, id) => {
             dispatch({
                 type: UP_DIAGNOSTIC,

+ 26 - 5
src/containers/MainSuit.js

@@ -6,13 +6,14 @@ import {RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION,MODI_LOADING} from '@store/
 import {getCommSymptoms,getCommSymptomPush} from '@store/async-actions/mainSuit.js'
 import {SET_MAIN_SUIT} from '@store/types/fillInfo';
 import {CLEAR_DIAGNOSE} from '@store/types/diagnosticList';
-import {getSearch,getFeature} from '@store/async-actions/fetchModules';
+import {getSearch,getFeature,setOtherHisModule} from '@store/async-actions/fetchModules';
 import {billing} from '@store/async-actions/pushMessage';
-import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
+import {didPushParamChange,filterDataArr,inspectAndAssist} from '@utils/tools.js';
 import config from '@config/index.js';
 import {Notify} from '@commonComp';
 import {getInitModules} from '@store/async-actions/homePage.js';
-import {CURRENT_CHRONIC} from '@store/types/currentIll'
+import {CURRENT_CHRONIC} from '@store/types/currentIll';
+import {SET} from '@types/checkBody';
 
 function mapStateToProps(state) {//console.log(11,state);
   return {
@@ -206,14 +207,34 @@ function mapDispatchToProps(dispatch) {
         dispatch({type:SHOW_HISTORY_BOX});
 
       },
+      pureSaveChronic(item){//引用病例时储存
+        // 存慢病
+        dispatch({
+          type:SAVE_CHRONIC,
+          data:item
+        })
+      },
       closeHisBox(){
         dispatch({type:HIDE_HISTORY_BOX})
       },
       getBilling: () => {
         dispatch(billing())
       },
-      autoFillMoudles(){//自动填充模板
-        dispatch({type:CURRENT_CHRONIC})//现病史
+      autoFillMoudles() {//自动填充模板
+        dispatch({type: CURRENT_CHRONIC})//现病史
+        //其他史模板填充-先去历史,无历史用模板
+        inspectAndAssist()//化验辅检
+        dispatch(setOtherHisModule());
+        //查体模板填充
+        dispatch((dispatch, getStore) => {
+          const state = getStore();
+          const initData = state.homePage.initData;
+          dispatch({
+            type: SET,
+            data: [...initData.checkbody],
+            isEmpty:false
+          });
+        });
       }
     }
 }

+ 2 - 24
src/containers/OtherHistory.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import OtherHistory from "../components/OtherHistory";
 import {SETSELECTED,CLEARSELECTED,CONFIRMSELECTED,SELECTOTHERSEARCHDATA,SETDATA,SETTEXTMODEVALUE,OTHEREDICLEAR} from '@types/otherHistory';
 import {HIDE,RESET,ISREAD,SEARCH_DROP_LOCATION} from '@store/types/homePage.js';
-import {getModule} from '@store/async-actions/fetchModules.js';
+import {getModule,setOtherHisModule} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {fullfillText} from '@common/js/func';
 import {didPushParamChange,filterDataArr} from '@utils/tools.js';
@@ -37,29 +37,7 @@ function mapDispatchToProps(dispatch,store){
   return {
     setInitData(){
       //先获取最近记录,没有的话显示模板
-      dispatch((dispatch,getStore)=>{
-        const state = getStore();
-        const initData = state.homePage.initData;
-        const mode = state.typeConfig.typeConfig;
-        const model = JSON.parse(JSON.stringify(initData.otherHisModel));     //查体模板
-        const arr = JSON.parse(JSON.stringify(initData.otherHis||null));        //最近其他史数据
-        const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave||null));    //最近其他史saveText
-        const selects = JSON.parse(JSON.stringify(initData.otherSelecteds||null));  //其他史杂音类选中项
-        const isHis = initData.otherIsHis;     //是否是历史数据
-        const onlyOneText = arr&&arr.length==1&&arr[0].tagType==8&&!(arr[0].name||arr[0].value);    //是否只有一个自由文本标签
-        const listObj = isHis&&(mode==1||(!onlyOneText&&mode==0))?{newArr:arr,saveText:arrSave||[]}:fullfillText(model);
-        dispatch({
-          type:SETDATA,
-          data:listObj.newArr,
-          selecteds:selects,
-          period:initData.period,
-          save:listObj.saveText,
-          isEmpty:false
-        });
-        dispatch({
-          type:ISREAD
-        })
-      });
+      dispatch(setOtherHisModule());
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送

+ 10 - 2
src/containers/Treat.js

@@ -1,8 +1,8 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import Treat from '@components/Treat';
-import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO } from '@store/types/treat.js';
-import { getInstroduce, getRecommendBasic, getInstroduceMore, commonTreatAddToAdvice } from '@store/async-actions/treat';
+import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, CHANGE_REACT,  DEL_REACT } from '@store/types/treat.js';
+import { getInstroduce, getRecommendBasic, getInstroduceMore, commonTreatAddToAdvice, saveAllAdverseReactions } from '@store/async-actions/treat';
 import { ADD_SCHEME } from '@store/types/pushMessage.js'
 import { showDrugInfo } from '../store/actions/treat';
 
@@ -26,6 +26,10 @@ function mapStateToProps(state){
  
 function mapDispatchToProps(dispatch) {
     return {
+        changeReact: (it, index) => {
+            dispatch({type: CHANGE_REACT, it, index})
+        },
+      
         selectDrug: (index, ii)=>{
             dispatch ({
                 type: SELECT_DRUG,
@@ -76,6 +80,10 @@ function mapDispatchToProps(dispatch) {
             })
             dispatch(commonTreatAddToAdvice())
         },
+        saveAllAdverseReaction: (item) => {
+            dispatch(saveAllAdverseReactions(item))
+        },
+        
         //查询多条药品说明数据(添加数据用)
         setDrugInfoMore:(drugIdList) => {
             dispatch(getInstroduceMore(drugIdList));

+ 1 - 0
src/main.js

@@ -7,6 +7,7 @@ import store from './store';
 import {AppContainer} from 'react-hot-loader';
 import HomePage from './modules/HomePage';
 import $ from 'jquery';
+import "@utils/jqPrint";
 
 const render = (Component) => {
   //ie8 console兼容

+ 51 - 0
src/store/actions/treat.js

@@ -16,6 +16,7 @@ export const clearTreat = (state, action) => {
     res.generalTreat = '';
     res.surgeryTreat = '';
     res.treatment = [];
+    res.adversReactionList=[];
     return res
 }
 
@@ -112,3 +113,53 @@ export const clearFirstMainDiag = (state, action) => {
     res.isFirstMainDiag = action.flag;
     return res;
 }
+
+//设置不良反应
+export const setAdverseReactions = (state, action) => {
+    const res = Object.assign({}, state);
+    res.adversReactionList = action.adversReactionList;
+    return res;
+}
+//保存所有不良反应(第二次打开质量方案不良反应有所变化时进行比较)
+export const setALLAdverseReactions =(state, action) => {
+    const res = JSON.parse(JSON.stringify(state));
+    let allAdversReactionList = res.allAdversReactionList
+    let hasAdversReactionList = false
+    for( let i = 0; i < allAdversReactionList.length; i++) {
+        if (action.adversReactionList.id == allAdversReactionList[i].id) {
+            allAdversReactionList[i] = action.adversReactionList
+            hasAdversReactionList = true
+        } 
+    }
+    if(!hasAdversReactionList) {
+        allAdversReactionList.push(action.adversReactionList)
+    }
+    res.allAdversReactionList = allAdversReactionList;
+    return res;
+}
+
+//改变不良反应选中状态
+export const changeReact=(state,action)=>{
+    const res = JSON.parse(JSON.stringify(state));
+    const index = action.index
+    res.adversReactionList[index].details = res.adversReactionList[index].details.map(item => {
+      if(item.name == action.it.name){
+        item.checked = !item.checked
+      }
+      return item
+    })
+    return res;
+  };
+
+// 删除该疾病不良反应
+export const delReact = (state, action) => {
+    const res = JSON.parse(JSON.stringify(state));
+    let allAdversReactionList = res.allAdversReactionList
+    for( let i = 0; i < allAdversReactionList.length; i++) {
+        if (action.item.id == allAdversReactionList[i].id) {
+            allAdversReactionList.splice(i, 1)
+        } 
+    }
+    res.allAdversReactionList = allAdversReactionList;
+    return res;
+}

+ 40 - 2
src/store/async-actions/fetchModules.js

@@ -3,9 +3,10 @@ import {SET} from '@types/checkBody.js';
 import {fullfillText,_fullfillText} from '@common/js/func';
 import {SETDATA} from '@store/types/otherHistory';
 import store from '@store';
-import {getEMRParams} from '@utils/tools.js';
+import {getEMRParams,didPushParamChange} from '@utils/tools.js';
 import {Notify} from '@commonComp';
-import {SETOTHERHISTORY} from "../types/homePage";
+import {billing} from '@store/async-actions/pushMessage';
+import {SETOTHERHISTORY,ISREAD} from "../types/homePage";
 import {SAVE_TABLE_RESULT} from "../types/pushMessage";
 import config from "@config/index";
 
@@ -171,6 +172,43 @@ export function getInitData(){
   }
 }
 
+//其他史模板填充-先取最近记录,无则用模板
+export function setOtherHisModule(){
+  return (dispatch, getStore) => {
+    const state = getStore();
+    const initData = state.homePage.initData;
+    const mode = state.typeConfig.typeConfig;
+    const model = JSON.parse(JSON.stringify(initData.otherHisModel));     //查体模板
+    const arr = JSON.parse(JSON.stringify(initData.otherHis || null));        //最近其他史数据
+    const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave || null));    //最近其他史saveText
+    const selects = JSON.parse(JSON.stringify(initData.otherSelecteds || null));  //其他史杂音类选中项
+    const isHis = initData.otherIsHis;     //是否是历史数据
+    const onlyOneText = arr && arr.length == 1 && arr[0].tagType == 8 && !(arr[0].name || arr[0].value);    //是否只有一个自由文本标签
+    const listObj = isHis && (mode == 1 || (!onlyOneText && mode == 0)) ? {
+      newArr: arr,
+      saveText: arrSave || []
+    } : fullfillText(model);
+    dispatch({
+      type: SETDATA,
+      data: listObj.newArr,
+      selecteds: selects,
+      period: initData.period,
+      save: listObj.saveText,
+      isEmpty: false
+    });
+    dispatch({
+      type: ISREAD
+    });
+
+    //右侧推送
+    setTimeout(function () {      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
+      if (didPushParamChange()) {     //操作后内容有变化才推送
+        dispatch(billing());
+      }
+    }, 500);
+  }
+}
+
 //保存切换模式
 export function saveMode(mode){
   return (dispatch,getStore)=>{

+ 6 - 1
src/store/async-actions/historyTemplates.js

@@ -7,7 +7,12 @@ export const initItemList = (item) => {
     let baseList = store.getState();
     // let whichSign = baseList.typeConfig.typeConfig;
     let state = baseList.patInfo.message;
-    const param = item?{"hospitalId": state.hospitalId,"patientId": state.patientId,"disName":item.name,"disType":1}:{"hospitalId": state.hospitalId,"patientId": state.patientId};
+    const param = {
+      "hospitalId": state.hospitalId,
+      "patientId": state.patientId,
+      "disName":item?item.name : 'bbb',
+      "disType":item?1:0
+    }
     return (dispatch) => {
         axios.json('/inquiryInfo/hisInquirys',param).then((res)=>{
             const data =res.data;

+ 3 - 1
src/store/async-actions/homePage.js

@@ -31,6 +31,7 @@ function modulesParseJson(data){
 export const getInitModules= (dispatch,getStore)=>{
   const state = getStore();
   const {message} = state.patInfo;
+  const {allModules} = state.homePage;
   // const chronicMagItem = state.diagnosticList.chronicMagItem;
   // const chronicId = chronicMagItem?chronicMagItem.id:'';//诊断为慢病复诊时储存慢病信息到store
   const chronicMagItem = state.mainSuit.chronicDesease;
@@ -40,10 +41,11 @@ export const getInitModules= (dispatch,getStore)=>{
     sexType:message.sex,
     mouduleType:chronicId?2:(message.hospitalDeptId?1:0),//慢病2  科室1 其他0
     relationId:chronicId?chronicId:(message.hospitalDeptId?message.hospitalDeptId:0), //慢病id  科室id  其他0
+    // mouduleType:2,
+    // relationId:21773, //慢病id  科室id  其他0
   }
   // return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
   return json(api.getModules,param).then((res) => {
-      dispatch(initHistoryDetails(message));      //历史病历回读
       if (res.data.code == '0') {
         const newObj = modulesParseJson(res.data.data);
         const initData = newObj.json;

+ 3 - 3
src/store/async-actions/patInfo.js

@@ -21,7 +21,6 @@ export const initPersonInfo = (dispatch, getState) => {
         const data = res.data;
         if (data.code == 0) {
             dispatch(getInfos(data.data));
-            //console.log(data.data)
             getPatientMessage(dispatch, getState);
         } else {
             console.log(res)
@@ -98,9 +97,10 @@ export const getPatientMessage = (dispatch, getState) => {
         type: CONFIRM_TYPE,
         confirmType:data1.modeValue
       });
-      dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
+      dispatch(getInitModules);       //确保病人信息获取以后再获取模板等数据,否则参数为空
       dispatch(getCommonList(5));     //获取常用化验标签列表
-      dispatch(getCommonList(6));     //获取常用辅检标签列表
+      dispatch(getCommonList(6));     //获取常用辅检标签列表if(allModules.length == 0){//模板为空才回读
+      dispatch(initHistoryDetails());      //历史病历回读
       // if(state.tabTemplate.items.length == 0){
       //   dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
       // }

+ 3 - 1
src/store/async-actions/pushMessage.js

@@ -21,7 +21,9 @@ export const billing = (mdata) => {
   const emrData = getEMRParams();
   const params = {
     age: emrData.age,
-    featureType: "4,5,6,7,22",
+    // featureType: "4,5,6,7,22",
+    featureType: "22",
+    // featureType: "4,5,6,22",
     // featureType: "4,5,6,22",
     diag: emrData.dis,
     lis: emrData.lis,

Разница между файлами не показана из-за своего большого размера
+ 146 - 119
src/store/async-actions/treat.js


+ 107 - 98
src/store/reducers/treat.js

@@ -1,5 +1,5 @@
-import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG,CLEAR_FIRST_MAIN_DIAG } from '../types/treat'
-import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList, isFirstMainDiag,clearFirstMainDiag } from '../actions/treat'
+import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG,CLEAR_FIRST_MAIN_DIAG ,SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS,CHANGE_REACT, DEL_REACT } from '../types/treat'
+import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList, isFirstMainDiag, clearFirstMainDiag, setAdverseReactions, setALLAdverseReactions, changeReact ,delReact } from '../actions/treat'
 const initState = {
     show: false, //治疗方案显示隐藏
     showDrugInfo: false, //药品信息显示隐藏
@@ -69,105 +69,106 @@ const initState = {
     //     }
     // ],
     lastTreat: {
-        commonDisMedica: [
-            {
-                medicitionName: '泮托拉唑',
-                id: 145
-            },
-            {
-                medicitionName: '奥美拉唑',
-                id: 341
-            }
-        ],
-        chronicDisMedica: [
-            {
-                medicitionName: '兰索拉唑',
-                id: 342
-            },
-            {
-                medicitionName: '山莨菪碱',
-                id: 344
-            }
-        ],
+        // commonDisMedica: [
+        //     {
+        //         medicitionName: '泮托拉唑',
+        //         id: 145
+        //     },
+        //     {
+        //         medicitionName: '奥美拉唑',
+        //         id: 341
+        //     }
+        // ],
+        // chronicDisMedica: [
+        //     {
+        //         medicitionName: '兰索拉唑',
+        //         id: 342
+        //     },
+        //     {
+        //         medicitionName: '山莨菪碱',
+        //         id: 344
+        //     }
+        // ],
     },
     adversReactionList:[
-        {
-            id: 40772,
-            name: '低血糖反应',
-            tagName: '低血糖反应',
-            showInfo: '0',
-            controlType: 2,
-            details: [
-                {
-                    name: "否",
-                    value: 0
-                },
-                {
-                    name: "是",
-                    value: 0
-                },
-                {
-                    name: "轻度",
-                    value: 0
-                },
-                {
-                    name: "中度",
-                    value: 0
-                },
-                {
-                    name: "重度",
-                    value: 0
-                },
-                {
-                    name: "偶尔",
-                    value: 0
-                },
-                {
-                    name: "频繁",
-                    value: 0
-                }
-            ]
+        // {
+        //     id: 40772,
+        //     name: '低血糖反应',
+        //     tagName: '低血糖反应',
+        //     showInfo: '0',
+        //     controlType: 2,
+        //     details: [
+        //         {
+        //             name: "否",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "是",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "轻度",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "中度",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "重度",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "偶尔",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "频繁",
+        //             value: 0
+        //         }
+        //     ]
 
-        },
-        {
-            id: 40773,
-            name: '胃肠道不良反应',
-            tagName: '胃肠道不良反应',
-            showInfo: '0',
-            controlType: 2,
-            details: [
-                {
-                    name: "否",
-                    value: 0
-                },
-                {
-                    name: "是",
-                    value: 0
-                },
-                {
-                    name: "轻度",
-                    value: 0
-                },
-                {
-                    name: "中度",
-                    value: 0
-                },
-                {
-                    name: "重度",
-                    value: 0
-                },
-                {
-                    name: "偶尔",
-                    value: 0
-                },
-                {
-                    name: "频繁",
-                    value: 0
-                }
-            ]
+        // },
+        // {
+        //     id: 40773,
+        //     name: '胃肠道不良反应',
+        //     tagName: '胃肠道不良反应',
+        //     showInfo: '0',
+        //     controlType: 2,
+        //     details: [
+        //         {
+        //             name: "否",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "是",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "轻度",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "中度",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "重度",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "偶尔",
+        //             value: 0
+        //         },
+        //         {
+        //             name: "频繁",
+        //             value: 0
+        //         }
+        //     ]
 
-        }
+        // }
     ],
+    allAdversReactionList:[],
     treatDesc:{
         title: '药品推荐',
     }
@@ -299,9 +300,17 @@ export default function(state=initState, action){
         case SET_DRUG_INFO_LIST:
             return setDrugInfoList(state, action);
         case IS_FIRST_MAIN_DIAG: 
-            return isFirstMainDiag(state, action)
+            return isFirstMainDiag(state, action);
         case CLEAR_FIRST_MAIN_DIAG: 
-            return clearFirstMainDiag(state, action)
+            return clearFirstMainDiag(state, action);
+        case SET_ADVERSE_REACTIONS:
+            return setAdverseReactions(state, action);
+        case SET_ALL_ADVERSE_REACTIONS: 
+            return setALLAdverseReactions(state, action);
+        case CHANGE_REACT: 
+            return changeReact(state, action);
+        case DEL_REACT:
+            return delReact(state, action);
         default:
             return state
     }

+ 4 - 0
src/store/types/treat.js

@@ -15,3 +15,7 @@ export const SET_TREAT_INFO = 'SET_TREAT_INFO' //设置治疗方案信息(name
 export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' //查询多个药品说明书(添加数据时查看药品说明用)
 export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' //是否为主诊断第一次开单
 export const CLEAR_FIRST_MAIN_DIAG = 'CLEAR_FIRST_MAIN_DIAG' //回读清空是否为主诊断第一次开单
+export const SET_ADVERSE_REACTIONS = 'SET_ADVERSE_REACTIONS'    //设置不良反应
+export const SET_ALL_ADVERSE_REACTIONS = 'SET_ALL_ADVERSE_REACTIONS'    //设置所有不良反应
+export const CHANGE_REACT = 'CHANGE_REACT'  //改变不良反应状态
+export const DEL_REACT = 'DEL_REACT'  //改变不良反应状态

+ 69 - 0
src/utils/jqprint.js

@@ -0,0 +1,69 @@
+import $ from 'jquery';
+
+(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) {
+      doc.write('<!DOCTYPE html>');
+
+      $("style").each(function () {//获取内联样式放到iframe中
+        doc.write('<style type="text/css" rel="stylesheet" media="print" >' + $(this)[0].textContent + '</style>');
+      });
+
+      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") + "' />");
+        });
+      }
+    }
+
+    var canvasLis = $(this).find('canvas');//页面有canvas需要转换为图片
+    if (!canvasLis) {
+      return
+    } else {
+      $("img").remove('.canvasImg')//删除已添加的图片避免多张图片重叠
+      for (var k = 0; k < canvasLis.length; k++) {
+        var canvasSrc = canvasLis[k].toDataURL();
+        let canvasImg = "<img class='canvasImg' src='" + canvasSrc + "'>"
+        $(canvasLis[k]).parent().append(canvasImg)
+      }
+    }
+
+    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(); } }, 500);
+  }
+
+  $.fn.jqprint.defaults = {
+    debug: false,
+    importCSS: true,
+    printContainer: true,
+    operaSupport: true
+  };
+
+  $.fn.outer = function () {
+    return $($('<div></div>').html(this.clone())).html();
+  }
+})($);

+ 65 - 2
src/utils/tools.js

@@ -3,8 +3,8 @@ import {CLEAR_MAIN_SUIT} from '@store/types/mainSuit';
 import {CLEAR_CURRENT_ILL} from '@store/types/currentIll';
 import {CLEAROTHERHISTORY} from '@store/types/otherHistory';
 import {CLEARCHECKBODY} from '@store/types/checkBody';
-import {clearAssistData} from '@store/actions/assistCheck';
-import {clearAllLabel} from '@store/actions/inspect';
+import {clearAssistData,addAssistLabel} from '@store/actions/assistCheck';
+import {clearAllLabel,addLabel} from '@store/actions/inspect';
 import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
 import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS} from '@store/types/pushMessage';
 import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
@@ -835,6 +835,67 @@ function dragBox(domWrap,domDrag){
 // function handleMove(event,mouseX){
 //     console.log(event)
 // }
+function 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);
+  return date;
+}
+function inspectAndAssist(){
+  let obj = {   //添加化验
+    details: [],
+    name: '',
+    questionId: '',
+    showType: 1,
+  }
+  let obj1 = {  //添加辅检
+    name: '',
+    questionId: '',
+    showType: 1,
+    time:getCurrentDate(),
+    value:''
+  }
+  const state = store.getState();
+  let tmpAll = state.homePage.allModules;
+  let tmpInspected = state.inspect.labelList;
+  let tmpAssisted = state.assistCheck.assistLabel;
+  let tmpInspect = [],tmpAssist = [],assayArr = [],tmpDetail=[],checkArr = [];
+
+  for(let i = 0;i < tmpAll.length;i++){
+    let tmpItem = tmpAll[i];
+    if(tmpItem.type == 5){
+      tmpInspect = tmpItem.moduleDetailDTOList || []
+    }else if(tmpItem.type == 6){
+      tmpAssist = tmpItem.moduleDetailDTOList || []
+    }
+  }
+  for(let i = 0;i < tmpInspect.length;i++){//化验数据处理
+    let tmpObj = JSON.parse(JSON.stringify(obj));
+    if (tmpInspect[i].controlType == 0) {
+      tmpDetail = tmpInspect[i].questionMapping
+    }else if(tmpInspect[i].controlType == 1 || tmpInspect[i].controlType == 6){
+      tmpDetail.push(tmpInspect[i])
+    }
+    tmpObj.questionId = tmpInspect[i].id
+    tmpObj.name = tmpInspect[i].name
+    tmpObj.details = tmpDetail
+    assayArr.push(tmpObj)
+  }
+  for(let i = 0;i < tmpAssist.length;i++){//辅检数据处理
+    let tmpObj = JSON.parse(JSON.stringify(obj1));
+    tmpObj.questionId = tmpAssist[i].id
+    tmpObj.name = tmpAssist[i].name
+    checkArr.push(tmpObj)
+  }
+  if(assayArr.length>0 && tmpInspected.length == 0){//化验
+    store.dispatch(addLabel(assayArr))
+  }
+  if(checkArr.length > 0 && tmpAssisted.length == 0){//辅检
+    store.dispatch(addAssistLabel(checkArr))
+  }
+}
 module.exports = {
     checkType: Type.checkType,
     regexp,
@@ -866,5 +927,7 @@ module.exports = {
     getPageLength,
     dragBox,
     formatContinueDots,
+    inspectAndAssist,
+    getCurrentDate,
     ifOtherClear
 };