فهرست منبع

Merge remote-tracking branch 'origin/ChronicMag' into ChronicMag

# Conflicts:
#	src/components/AssessResult/index.jsx
#	src/containers/AssessResult.js
#	src/containers/ChronicInfo.js
#	src/store/async-actions/fetchModules.js
#	src/store/async-actions/historyTemplates.js
zhouna 6 سال پیش
والد
کامیت
641ca1ec76
51فایلهای تغییر یافته به همراه1029 افزوده شده و 536 حذف شده
  1. 5 2
      src/common/components/ComplexModal/index.jsx
  2. 11 5
      src/common/components/ComplexModal/index.less
  3. 1 0
      src/common/components/MiniToast/index.less
  4. 1 1
      src/common/components/Textarea/index.jsx
  5. 1 1
      src/common/js/func.js
  6. 1 1
      src/components/AddAssistCheck/index.jsx
  7. 1 1
      src/components/AddInspect/index.jsx
  8. 10 6
      src/components/AssessResult/index.jsx
  9. 8 0
      src/components/AssessResult/index.less
  10. 138 54
      src/components/ChronicInfo/index.jsx
  11. 15 0
      src/components/ChronicInfo/index.less
  12. 4 4
      src/components/CurrentIll/index.jsx
  13. 2 1
      src/components/DiagnosticItem/index.jsx
  14. 4 2
      src/components/DiagnosticList/index.jsx
  15. 41 0
      src/components/Information/index.jsx
  16. 17 0
      src/components/Information/index.less
  17. 2 1
      src/components/MainSuit/index.jsx
  18. 27 109
      src/components/PreviewBody/index.jsx
  19. 9 4
      src/components/PreviewBody/index.less
  20. 8 10
      src/components/PrintPreview/index.jsx
  21. 2 17
      src/components/PushItems/index.jsx
  22. 76 12
      src/components/ScaleTable/index.jsx
  23. 27 0
      src/components/ScaleTable/index.less
  24. 16 9
      src/components/TemplateItems/TemplateItem/index.jsx
  25. 9 36
      src/components/Treat/AdverseReactions/index.jsx
  26. 1 2
      src/components/Treat/LastTreat/index.jsx
  27. 6 4
      src/components/Treat/index.jsx
  28. 1 1
      src/containers/AssistCheck.js
  29. 8 3
      src/containers/ChronicInfo.js
  30. 1 1
      src/containers/CurrentIll.js
  31. 7 1
      src/containers/DiagnosticList.js
  32. 9 1
      src/containers/MainSuit.js
  33. 20 0
      src/containers/ScaleTable.js
  34. 19 12
      src/containers/SpreadDrop.js
  35. 10 2
      src/containers/Treat.js
  36. 1 0
      src/main.js
  37. 2 2
      src/store/actions/currentIll.js
  38. 51 0
      src/store/actions/treat.js
  39. 39 0
      src/store/async-actions/fetchModules.js
  40. 6 1
      src/store/async-actions/historyTemplates.js
  41. 3 1
      src/store/async-actions/homePage.js
  42. 3 3
      src/store/async-actions/patInfo.js
  43. 6 4
      src/store/async-actions/pushMessage.js
  44. 146 119
      src/store/async-actions/treat.js
  45. 2 1
      src/store/reducers/mainSuit.js
  46. 6 2
      src/store/reducers/pushMessage.js
  47. 107 98
      src/store/reducers/treat.js
  48. 1 0
      src/store/types/pushMessage.js
  49. 4 0
      src/store/types/treat.js
  50. 69 0
      src/utils/jqprint.js
  51. 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 - 0
src/common/components/MiniToast/index.less

@@ -36,6 +36,7 @@
       text-align: center;
       border: 1px solid #3B9ED0;
       border-radius: 4px;
+      cursor: pointer;
     }
   }
 }

+ 1 - 1
src/common/components/Textarea/index.jsx

@@ -23,7 +23,7 @@ class Textarea extends Component {
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput,isChronic} = this.props;
     handleFocus&&handleFocus();         //其他史、查体获取数据的方法
-    if(fuzhen&&!isChronic&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
+    if(fuzhen&& !isChronic.name&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
       const text = config.currentText.replace("(**)",fuzhen);
       this.$dom.current.innerText?(this.$dom.current.innerText = text):(this.$dom.current.innerHTML = text);
       handleInput&&handleInput({text});

+ 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 })

+ 10 - 6
src/components/AssessResult/index.jsx

@@ -1,9 +1,10 @@
 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";
 
 class AssessResult extends Component {
@@ -23,7 +24,7 @@ class AssessResult extends Component {
     //获取评估
     this.props.getAssess();
   }
-  handleScaleText(text){console.log(text)
+  handleScaleText(text){
       this.setState({
         wholeAssessText:text
       })
@@ -71,10 +72,13 @@ class AssessResult extends Component {
     }
   }
   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;
+  }
 }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 138 - 54
src/components/ChronicInfo/index.jsx


+ 15 - 0
src/components/ChronicInfo/index.less

@@ -128,6 +128,7 @@
       }
       .blue{
         color:#3B9ED0;
+        cursor: pointer;
       }
       .mainList{
         .listBtn{
@@ -245,3 +246,17 @@
         margin-right: 20px;
       }
     }
+  .chooseItem{
+    display: inline-block;
+    margin-right: 10px;
+  }
+  .forMulBtn{
+    height: 32px;
+    line-height: 32px;
+    text-align: center;
+    color: #fff;
+    background: #DBDBDB;
+    border-radius: 4px;
+    cursor: auto;
+    margin-top: 15px;
+  }

+ 4 - 4
src/components/CurrentIll/index.jsx

@@ -56,12 +56,11 @@ class CurrentIll extends Component{
       })
     }else {
       let num = moduleNum.num;//主诉使用了几个模板
-      // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
-      if(data.length==0 && !isChronic){
-        // setData && setData({useEmpty,num,mainData,mainIds});
+        // isChronic为一个对象
+      if(data.length==0 && !isChronic.name ){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回
-          setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic});
+            setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic});   
         },200)  
         this.setState({
           setDataTimer
@@ -71,6 +70,7 @@ class CurrentIll extends Component{
           showMoudle:true,
           forbidInput:false,
           boxEditable:false,
+          setDataTimer
       })
       changeEditIll(false)
       /*const showTimer = setTimeout(function(){

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

@@ -36,7 +36,8 @@ class DiagnosticItem extends Component{
     }
     chooseDiagodal(item) {
         const { diagnosticList,getTips } = this.props;
-        getTips && getTips(item);
+        // getTips && getTips(item);
+        getTips && getTips({id:item.id,type:7});
         for (let i = 0; i < diagnosticList.length; i++) {
             if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
                 Notify.info('该诊断已存在');

+ 4 - 2
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,
         })
@@ -85,7 +86,8 @@ class DiagnosticList extends Component {
     } 
     handleClickDiag(item) {
         const { getTips } = this.props;
-        getTips && getTips(item);
+        // getTips && getTips(item);
+        getTips && getTips({id:item.id,type:7});
     }
     referRecord() {
         const { hideReferRecord, showHistoryCaseModal ,chronicMagItem} = this.props

+ 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 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>

+ 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){

+ 76 - 12
src/components/ScaleTable/index.jsx

@@ -1,7 +1,8 @@
 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:量表标题
@@ -10,21 +11,60 @@ import mocks from '../../mock/chronicTable.js'
 class ScaleTable extends React.Component{
   constructor(props){
     super(props);
+    this.state={
+      data:props.data && data[1].content|| [],
+      selecteds:{}
+    }
     this.handleChange = this.handleChange.bind(this);
   }
 
   handleChange(event){
     console.log(event.target.value);
   }
+  handleRadio(name,value){
+    const {selecteds} = this.state;
+    this.setState({
+      selecteds:Object.assign({},selecteds,{[name]:value})
+    })
+  }
+  handleCheckbox(name,value){
+    let {selecteds} = this.state;
+    selecteds[name]?selecteds[name]:selecteds[name]=[];
+    const index = selecteds[name].findIndex((i)=>i==value);
+    if(index!=-1){
+      selecteds[name].splice(index,1);
+    }else{
+      selecteds[name].push(value);
+    }
+    this.setState({
+      selecteds:selecteds
+    });
+  }
+
+  handleFormula(data){
+    const {tableId,getResult,parentId} = this.props; 
+    const params = {
+      type:1,
+      content:data, //选择后的数据--字符串形式
+      id:parentId,
+      scaleId:tableId,
+    }
+    // console.log("调计算接口");
+    // getResult&&getResult(params);
+  }
 
   render(){
     const {data,title} = this.props;
+    let {selecteds} = this.state;
     const content = data && data[1].content;//表格内容
     const preContent = data && data[0].content;//表前文字
     const footContent = data && data[2].content; //表后文字
     const datas = content && JSON.parse(content);
-
-    return <div className={style['tableBox']}>
+    // console.log(555,datas,content);
+    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']}>
@@ -40,14 +80,35 @@ class ScaleTable extends React.Component{
                     return <tr>
                     <td>{v.name}</td>
                     <td>
-                      {v.details.map((it,index)=>{
-                        return <td className={style['block']}>
-                          <label>
-                            <input type="radio" name={v.name} value={it.score} onChange={this.handleChange}/>{it.detailName}
-                            <span style={{display:it.state==1?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>
-                          </label>
-                        </td>
-                      })}
+                      {/*{v.details.map((it,index)=>{
+                            return <td className={style['block']}>
+                              <label>
+                                <input type="radio" name={v.name} value={it.score} onChange={this.handleChange}/>{it.detailName}
+                                <span style={{display:it.state==1?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>
+                              </label>
+                            </td>
+                            
+                          })}*/}
+                      {v.controltype==0?v.details.map((it,index)=>{
+                          return <td className={style['block']}>
+                            <Radio label={it.detailName}
+                                   id={it.id}
+                                   isSelect={selecteds[v.name]==it.detailName}
+                                   handleClick={this.handleRadio.bind(this,v.name,it.detailName)}>
+                            </Radio>
+                            {it.state==1?<span style={{color:'#3B9ED0'}}>(智能推荐)</span>:''}
+                          </td>
+                        }):v.details.map((it,index)=>{
+                          return <td className={style['block']}>
+                              <CheckBtn id={it.detailName}
+                                        value={it.detailName}
+                                        label={it.detailName}
+                                        isSelect={selecteds[v.name]&&selecteds[v.name].includes(it.detailName)}
+                                        handleClick={this.handleCheckbox.bind(this,v.name,it.detailName)}>
+                              </CheckBtn>
+                            </td>
+                        })
+                    }
                     </td>
                     <td>
                       {v.details.map((it,index)=>{
@@ -60,7 +121,10 @@ class ScaleTable extends React.Component{
               </tbody>
               <tfoot>
                 <tr>
-                  <td colspan="4" className={style['sum']}>总计:</td>
+                  <td colspan="4" className={style['sum']}>
+                  总计:<i>95</i>
+                  <span className={style['formulaBtn']} onClick={this.handleFormula.bind(this,datas)}>计算</span>
+                  </td>
                 </tr>
               </tfoot>
             </table>

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

@@ -32,6 +32,25 @@
   }
   .sum{
     text-align: right;
+    i{
+      display: inline-block;
+      min-width: 30px;
+      border-bottom: 1px solid #979797;
+      text-align: center;
+    }
+    .formulaBtn{
+      display: inline-block;
+      width: 50px;
+      height: 30px;
+      line-height: 30px;
+      text-align: center;
+      color:#fff;
+      background: #3B9ED0;
+      border-radius: 4px;
+      margin-left: 10px;
+      cursor: pointer;
+      font-weight: normal;
+    }
   }
   .block{
     display: block;
@@ -44,4 +63,12 @@ strong{
   p{
     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/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,

+ 8 - 3
src/containers/ChronicInfo.js

@@ -1,7 +1,7 @@
 import {connect} from 'react-redux';
 import ChronicInfo from '../components/ChronicInfo';
 import {SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
-import {getTableList,getScaleInfo} from '../store/async-actions/pushMessage';
+import {getTableList,getScaleInfo,getTips} from '../store/async-actions/pushMessage';
 import {ADD_ASSESS_ITEMS,SET_SAVE_ASSESS_DATA} from "@types/assessResult";
 import {saveMessage} from "../store/async-actions/print";
 import {saveClickNum} from '@store/async-actions/homePage';
@@ -14,7 +14,8 @@ function mapStateToProps(state){
     showList: state.pushMessage.showList,
     scaleInfo: state.pushMessage.scaleInfo,//量表明细
     chronicDesease:state.mainSuit.chronicDesease,//主诉存的慢病
-    update:state.assessResult.update1
+    update:state.assessResult.update1,
+    formulaResult:state.pushMessage.formulaResult //量表信息
   }
 }
 
@@ -41,10 +42,14 @@ function mapDispatchToProps(dispatch){
       })
     },
     //保存管理评估
-    saveAssessInfos(obj){console.log(obj)
+    saveAssessInfos(obj){
       dispatch(Object.assign({},obj,{type:SET_SAVE_ASSESS_DATA}));
       dispatch(saveClickNum);
       dispatch(() => saveMessage())
+    },
+    // 获取量表静态知识
+    getInfomation(item){
+      dispatch(getTips(item));
     }
   }
 }

+ 1 - 1
src/containers/CurrentIll.js

@@ -43,7 +43,7 @@ function mapStateToProps(state) { //console.log(111,state);
         boxLeft:state.homePage.boxLeft,
         allModules:state.homePage.allModules,
         // isChronic:!!state.diagnosticList.chronicMagItem,
-        isChronic:!!state.mainSuit.chronicDesease,
+        isChronic:state.mainSuit.chronicDesease,
 
     }
 }

+ 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,

+ 9 - 1
src/containers/MainSuit.js

@@ -8,7 +8,7 @@ import {SET_MAIN_SUIT} from '@store/types/fillInfo';
 import {CLEAR_DIAGNOSE} from '@store/types/diagnosticList';
 import {getSearch,getFeature,setOtherHisModule} from '@store/async-actions/fetchModules';
 import {billing} from '@store/async-actions/pushMessage';
-import {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';
@@ -207,6 +207,13 @@ function mapDispatchToProps(dispatch) {
         dispatch({type:SHOW_HISTORY_BOX});
 
       },
+      pureSaveChronic(item){//引用病例时储存
+        // 存慢病
+        dispatch({
+          type:SAVE_CHRONIC,
+          data:item
+        })
+      },
       closeHisBox(){
         dispatch({type:HIDE_HISTORY_BOX})
       },
@@ -216,6 +223,7 @@ function mapDispatchToProps(dispatch) {
       autoFillMoudles() {//自动填充模板
         dispatch({type: CURRENT_CHRONIC})//现病史
         //其他史模板填充-先去历史,无历史用模板
+        inspectAndAssist()//化验辅检
         dispatch(setOtherHisModule());
         //查体模板填充
         dispatch((dispatch, getStore) => {

+ 20 - 0
src/containers/ScaleTable.js

@@ -0,0 +1,20 @@
+import {connect} from 'react-redux';
+import ScaleTable from '@components/ScaleTable';
+import {getFormulaResult} from '@store/async-actions/fetchModules.js'
+
+function mapStateToProps (state){
+  return {
+    formulaResult:state.pushMessage.formulaResult //计算结果
+  }
+}
+
+function mapDispatchToProps (dispatch){
+  return {
+    getResult(obj){//计算结果
+      dispatch(getFormulaResult(obj));
+    }
+  }
+}
+
+const ScaleTableContainer = connect(mapStateToProps,mapDispatchToProps)(ScaleTable);
+export default ScaleTableContainer;

+ 19 - 12
src/containers/SpreadDrop.js

@@ -154,18 +154,25 @@ function currentIll(dispatch,store,params){
   fetchModules(ids).then((res)=>{
     if(+res.data.code===0){
       const list = res.data.data;
-      existsId.map((i)=>{
-        // has.push(...list[i].questionMapping);
-        has.push(list[i]);
-      });
-      withsId.map((i)=>{
-        // wes.push(...list[i].questionMapping);
-        wes.push(list[i]);
-      });
-      dispatch({
-        type: CURRENT_CONFIRM,
-        data: {exists:has,withs:wes,nones:nones,ikey,ban,noneIds}
-      });
+      if(list&&list.length>0){
+        existsId.map((i)=>{
+          // has.push(...list[i].questionMapping);
+          has.push(list[i]);
+        });
+        withsId.map((i)=>{
+          // wes.push(...list[i].questionMapping);
+          wes.push(list[i]);
+        });
+        dispatch({
+          type: CURRENT_CONFIRM,
+          data: {exists:has,withs:wes,nones:nones,ikey,ban,noneIds}
+        });
+      }else{
+        dispatch({
+          type: CURRENT_CONFIRM,
+          data: {exists,withs,nones,ikey,ban,noneIds}
+        });
+      }
       dispatch({    //自由文本标签数据更新
         type:ISREAD
       });

+ 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兼容

+ 2 - 2
src/store/actions/currentIll.js

@@ -382,7 +382,7 @@ export const confirm = (state,action) =>{
   let res = Object.assign({},state);
   let length1 = res.data.length;
   let arr = JSON.parse(JSON.stringify(res.data));
-  const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
+  const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;console.log(111,action)
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
@@ -403,7 +403,7 @@ export const confirm = (state,action) =>{
   if(withs && withs.length>0){
     // for(let i in withs){
     for(let i=0;i<withs.length; i++){
-      withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping&&withs[i].questionMapping.length>0?withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;}):[]));
       /*withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));*/
     }
   }

+ 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;
+}

+ 39 - 0
src/store/async-actions/fetchModules.js

@@ -7,6 +7,7 @@ import {getEMRParams,didPushParamChange} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 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";
 
 const api={
@@ -19,6 +20,7 @@ const api={
   getSymptomFeature:'/feature/getSymptomFeature',
   getAssess:'/evaluationModuleMapping/getEvaluationModules',    //获取管理评估-慢病
   getIndexData:'/indexData/getIndexDatas',    //获取指标数据-图表-慢病
+  getFormulaResult:'/push/calculate',  // 计算接口
   getAssessHis:'/inquiryInfo/getEvaluations',   //历史评估记录
 };
 
@@ -259,4 +261,41 @@ export function getIndexData(range){
     };
     return json(api.getIndexData,param);
   }
+}
+
+// 计算接口
+export const getFormulaResult = (item)=>{
+  // type:1-量表 11-计算公式
+  const type = item.type;
+  const id = item.id;//计算量表的id
+  let param;
+  if(type==1){
+    param = {
+      type:type,
+      scale:item.content
+    }
+  }else if(type==11){
+    param = {
+      type:type,
+      formula:item.content
+    }
+  }
+  return (dispatch) => {
+    json(api.getFormulaResult,param).then((res)=>{
+      if(+res.data.code==0){
+        dispatch({
+          type:SAVE_TABLE_RESULT,
+          id:id, //外层疾病id
+          data:{
+            data:item.content, //量表内容
+            // id:item.scaleId,  //量表id
+            type:type,
+            result:res.data.data, //计算结果
+          }
+        })
+      }else{
+        console.log(res.msg)
+      }
+    })
+  }
 }

+ 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,"disType":0,"disName":'糖尿病复诊'};
+    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));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
       // }

+ 6 - 4
src/store/async-actions/pushMessage.js

@@ -7,7 +7,7 @@ import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
 const api={
   push:'/push/pushInner',
   textPush:'/push/pushText',
-  getTableList:'/scale/getList' //获取量表列表
+  getTableList:'/scale/getList', //获取量表列表
 }
 
 //获取右侧推送信息
@@ -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",
     diag: emrData.dis,
     lis: emrData.lis,
     other: emrData.other,
@@ -89,7 +91,7 @@ export const getTips = (diagItem) =>{
         const url = '/introduceInfo/getByQuestionId';
         const params = {
             questionId: diagItem.id,
-            type: 7,
+            type: diagItem.type,
             position: 1
         }
         json(url, params)
@@ -113,7 +115,7 @@ export const getTipsDetails = () => {
 
         //弹窗显示
         const url ='/introduceInfo/getByQuestionId'
-        
+        console.log(123,state.diagnosticList.clickDiag)
         const params = {
             type: 7,
             questionId: state.diagnosticList.clickDiag.id,

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 146 - 119
src/store/async-actions/treat.js


+ 2 - 1
src/store/reducers/mainSuit.js

@@ -26,7 +26,8 @@ const initState = {
   symptomFeature:{//分词
     featureData:[],
     refresh:false //用于数据更新
-  }
+  },
+  chronicDesease:{} //慢病
 }
 
 export default function(state=initState,action){

+ 6 - 2
src/store/reducers/pushMessage.js

@@ -1,4 +1,4 @@
-import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG, SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,HIDE_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS} from '../types/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG, SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,HIDE_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,SAVE_TABLE_RESULT} from '../types/pushMessage';
 import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails, setCommontreatment, isFirstMainDiag, setAdviceInput } from '../actions/pushMessage';
 
 const initState = {
@@ -18,7 +18,8 @@ const initState = {
   },
   AdviceStr: '',
   tmpFlg:'',
-  tableList:[]
+  tableList:[],
+  formulaResult:{}
 };
 export default function(state = initState, action) {
   let res = Object.assign({},state);
@@ -70,6 +71,9 @@ export default function(state = initState, action) {
     case SET_SCALE_INFO://量表明细
       res.scaleInfo = action.data;
       return res;
+    case SAVE_TABLE_RESULT://量表计算结果
+      res.formulaResult = Object.assign({},res.formulaResult,{[action.id]:action.data});
+      return res;
     default:
       return state;
   }

+ 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
     }

+ 1 - 0
src/store/types/pushMessage.js

@@ -20,5 +20,6 @@ export const SHOW_TABLE_LIST = 'SHOW_TABLE_LIST' ; //显示量表列表
 export const HIDE_TABLE_LIST = 'HIDE_TABLE_LIST' ; //隐藏量表列表
 export const SET_CHRONIC_PUSHS ='SET_CHRONIC_PUSHS'; //右侧慢病量表评估推送模块数据
 export const SET_SCALE_INFO = 'SET_SCALE_INFO' ; //量表明细
+export const SAVE_TABLE_RESULT = 'SAVE_TABLE_RESULT' ; //量表计算结果
 
 

+ 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
 };