Jelajahi Sumber

Merge branch 'ChronicMag' into optimize

Luolei 6 tahun lalu
induk
melakukan
3533b4541a
56 mengubah file dengan 585 tambahan dan 197 penghapusan
  1. 2 1
      src/common/components/CheckBtn/index.jsx
  2. 4 3
      src/common/components/NumberUnitPan/index.jsx
  3. 2 1
      src/common/components/Radio/index.jsx
  4. 3 3
      src/components/AddAssistCheck/index.jsx
  5. 1 1
      src/components/AddAssistCheck/index.less
  6. 4 3
      src/components/AddInspect/index.jsx
  7. 3 3
      src/components/AddInspect/index.less
  8. 54 7
      src/components/AssessResult/AssessHis/index.jsx
  9. 35 0
      src/components/AssessResult/AssessHis/index.less
  10. 17 7
      src/components/AssessResult/ChartItem/index.jsx
  11. 19 12
      src/components/AssessResult/ScaleItem/index.jsx
  12. 8 4
      src/components/AssessResult/index.jsx
  13. 2 1
      src/components/AssistCheck/index.jsx
  14. 1 1
      src/components/CheckBody/index.jsx
  15. 1 0
      src/components/CheckBody/index.less
  16. 14 11
      src/components/ChronicInfo/index.jsx
  17. 4 0
      src/components/ChronicInfo/index.less
  18. 12 21
      src/components/CurrentIll/index.jsx
  19. 2 2
      src/components/DiagnosticItem/index.jsx
  20. 19 12
      src/components/DiagnosticList/index.jsx
  21. 1 0
      src/components/Information/index.less
  22. 2 1
      src/components/Inspect/index.jsx
  23. 2 1
      src/components/NumberDrop/index.jsx
  24. 8 2
      src/components/Preview/index.less
  25. 27 23
      src/components/PreviewBody/index.jsx
  26. 4 1
      src/components/PreviewBody/index.less
  27. 8 2
      src/components/PrintPreview/index.less
  28. 2 1
      src/components/PushItems/index.jsx
  29. 1 0
      src/components/RadioDrop/index.jsx
  30. 26 11
      src/components/ScaleTable/index.jsx
  31. 10 0
      src/components/ScaleTable/index.less
  32. 111 0
      src/components/ScaleTableHis/index.jsx
  33. 83 0
      src/components/ScaleTableHis/index.less
  34. 0 1
      src/components/Treat/DrugHistory/LastDrug/index.jsx
  35. 2 2
      src/components/Treat/DrugHistory/index.jsx
  36. 0 1
      src/components/Treat/index.jsx
  37. 1 1
      src/containers/AssessResult.js
  38. 0 7
      src/containers/AssessResultHis.js
  39. 2 1
      src/containers/AssistCheck.js
  40. 6 0
      src/containers/ChronicInfo.js
  41. 2 1
      src/containers/DiagnosticItem.js
  42. 1 0
      src/containers/DiagnosticList.js
  43. 1 0
      src/containers/Inspect.js
  44. 3 2
      src/store/actions/assistCheck.js
  45. 36 25
      src/store/actions/currentIll.js
  46. 3 2
      src/store/actions/inspect.js
  47. 2 2
      src/store/async-actions/assistCheck.js
  48. 7 6
      src/store/async-actions/fetchModules.js
  49. 1 1
      src/store/async-actions/homePage.js
  50. 2 2
      src/store/async-actions/inspect.js
  51. 13 5
      src/store/async-actions/print.js
  52. 1 1
      src/store/async-actions/pushMessage.js
  53. 3 0
      src/store/reducers/assessResult.js
  54. 2 0
      src/store/reducers/assistCheck.js
  55. 4 1
      src/store/reducers/inspect.js
  56. 1 1
      src/utils/tools.js

+ 2 - 1
src/common/components/CheckBtn/index.jsx

@@ -16,7 +16,8 @@ class CheckBtn extends React.Component {
   }
 
   handleClick(id){
-    this.props.handleClick(id);
+    const {handleClick} = this.props;
+    handleClick&&handleClick(id);
   }
 
   getStyle(){

+ 4 - 3
src/common/components/NumberUnitPan/index.jsx

@@ -92,7 +92,7 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>5</span></td>
           <td><span onClick={this.handleSelect}>6</span></td>
           <td><span onClick={this.handleSelect}>小时</span></td>
-          <td><span onClick={this.handleSelect}></span></td>
+          <td><span onClick={this.handleSelect}></span></td>
           <td><span onClick={this.handleSelect}>次</span></td> 
         </tr>
         <tr>
@@ -100,7 +100,7 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>8</span></td>
           <td><span onClick={this.handleSelect}>9</span></td>
           <td><span onClick={this.handleSelect}>天</span></td>
-          <td><span onClick={this.handleSelect}></span></td>
+          <td><span onClick={this.handleSelect}></span></td>
           <td><span onClick={this.handleSelect}>岁</span></td> 
         </tr>
         <tr>
@@ -108,7 +108,8 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>0</span></td>
           <td><span onClick={this.handleSelect}>~</span></td>
           <td><span onClick={this.handleSelect}>/</span></td>
-          <td colspan="2" className={style['imgN']}><img src={backspace} onClick={this.handleBack.bind(this)} /></td>
+          <td><span onClick={this.handleSelect}>日</span></td>
+          <td className={style['imgN']}><img src={backspace} onClick={this.handleBack.bind(this)} /></td>
         </tr>
         <tr>
           <td colspan="3"><span onClick={this.handleClear.bind(this)} className={style['clearN']}>清空</span></td>

+ 2 - 1
src/common/components/Radio/index.jsx

@@ -18,7 +18,8 @@ class Radio extends React.Component {
   }
 
   handleClick(id){
-    this.props.handleClick(id);
+    const {handleClick} = this.props;
+    handleClick&&handleClick(id);
   }
 
   getStyle(){

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

@@ -151,7 +151,7 @@ class AddAssistCheck extends React.Component {
     </ul>
   }
   render() {
-    const { handleChangeValue, list } = this.props;
+    const { handleChangeValue, list,assistVal } = this.props;
     const { visible } = this.state;
     return (
       <div className={styles.wrapper}>
@@ -159,9 +159,9 @@ class AddAssistCheck extends React.Component {
         <div id="searchWrapAssist" style={{ position: "relative", clear: 'both' }}>
           <Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck" />
           {this.state.show ? <SearchOption handleChangeValue={handleChangeValue} visible={true}>
-            {list && list.length>0?this.getSearchList(list):''}
+            {list && list.length>0?this.getSearchList(list):(assistVal == ''?'':<p style={{padding:'5px 30px',color:'#bfbfbf'}}>暂无筛选项</p>)}
             {
-              list && list.length>0?'':<div>
+              list && list.length>0 || (assistVal != '')?'':<div>
                 <p style={{padding:'5px 30px',color:'#bfbfbf'}}>常用辅检项</p>
                 {
                   this.getCommonList()

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

@@ -26,7 +26,7 @@
 .searchLiUl {
   overflow-y: auto;
   max-height: 225px;
-  min-height: 80px;
+  // min-height: 80px;
 }
 .searchLi:hover {
     border: 1px solid @blue;

+ 4 - 3
src/components/AddInspect/index.jsx

@@ -284,8 +284,9 @@ class Inspect extends React.Component {
     }
   }
   render() {
-    const { getInfomation,handleChangeValue, list, labelList, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
+    const { getInfomation,handleChangeValue,inspectVal, list, labelList, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
     const { toastText, visible, tmpId, tmpIdx } = this.state;
+
     return (
       <div className={styles.wrapper}>
         <div className={styles.check}>
@@ -343,9 +344,9 @@ class Inspect extends React.Component {
         <div style={{ position: "relative", clear: "both" }}>
           <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap" />
           {this.state.show ? <SearchOption handleChangeValue={handleChangeValue} visible={true}>
-            {list && list.length>0?this.getSearchList(list):''}
+            {list && list.length>0?this.getSearchList(list):(inspectVal == ''?'':<p style={{padding:'5px 30px',color:'#bfbfbf'}}>暂无筛选项</p>)}
             {
-              list && list.length>0?'':<div>
+              list && list.length>0 || (inspectVal != '')?'':<div>
                   <p style={{padding:'5px 30px',color:'#bfbfbf'}}>常用化验项</p>
                   {
                     this.getCommonList()

+ 3 - 3
src/components/AddInspect/index.less

@@ -91,7 +91,7 @@
 .searchLiUl {
   overflow-y: auto;
   max-height: 225px;
-  min-height: 80px;
+  // min-height: 80px;
 }
 .searchLi {
     height: 36px;
@@ -127,7 +127,7 @@
 }
 .itemPart {
     height: 28px;
-    // line-height: 28px;
+    line-height: 28px;
     overflow: hidden;
     padding-top: 0 !important;
     width: 330px;
@@ -151,7 +151,7 @@
     }
     .itemPartT {
         float: right;
-        width: 110px;
+        max-width: 110px;
         input {
             width: 40px;
             text-align: center;

+ 54 - 7
src/components/AssessResult/AssessHis/index.jsx

@@ -1,20 +1,28 @@
 import React, { Component } from "react";
 import style from "./index.less";
-import { Radio} from '@commonComp';
+import { Radio,ComplexModal} from '@commonComp';
 import arrow from '@common/images/icon_tri_blue.png';
 import loadingIcon from '@common/images/loading.gif';
 import ChooseItem from "../ChooseItem";
 import ScaleItem from "../ScaleItem";
 import ChartItem from "../ChartItem";
+import printIcon from '@common/images/team.png';
+import tableIcon from '@common/images/table.png';
+import ScaleTableHis from '@components/ScaleTableHis';
+import $ from "jquery";
 
 class AssessResultHis extends Component {
   constructor(props) {
     super(props);
     this.state={
       chartTimeTypes:{},      //图表模块
+      tableName:'',
+      tableId:'',
+      parentIndex:0
     };
     this.showAssessFn = this.showAssessFn.bind(this);
     this.getAssessContent = this.getAssessContent.bind(this);
+    this.showScaleFn = this.showScaleFn.bind(this);
   }
   handleChartChange(i,selects){
     const {chartTimeTypes} = this.state;
@@ -27,8 +35,8 @@ class AssessResultHis extends Component {
     this.props.getAssessHis(this.props.inquiryId);
   }
   handoutTypes(obj,item,i){
-    const {wholeAssess,wholeIndexs,chooseSelecteds} =obj;
-    const {getIndexData,inquiryDate,indexData,inquiryId,timeTypes} = this.props;
+    const {wholeAssess,wholeIndexs,chooseSelecteds,scaleResult,wholeResults} =obj;
+    const {getIndexData,inquiryDate,indexData,timeTypes} = this.props;
     const {chartTimeTypes} = this.state;
     const name = item.regionName+":";
     const list = item.data&&item.data.rows;
@@ -36,7 +44,10 @@ class AssessResultHis extends Component {
       case 0:     //数据来源与右侧手动添加
         return <ScaleItem title={name}
                           data={wholeAssess}
+                          showScaleFn={this.showScaleFn}
                           indexs={wholeIndexs}
+                          formulaResult={scaleResult}
+                          result={wholeResults}
                           disabled={true}
                           isRecommend={item.isRecommend}></ScaleItem>;
       case 1:     //数据来源于大数据
@@ -72,19 +83,55 @@ class AssessResultHis extends Component {
       chartTimeTypes:indexTimeTypes
     });
   }*/
+  showScaleFn(item,pid){
+    const { list,inquiryId } = this.props;
+    const obj = list&&list[inquiryId];
+    if(item){
+      this.setState({
+        tableName:item.name,
+        tableId:item.id,
+        showScale:!this.state.showScale
+      });
+    }else{
+      this.setState({
+        showScale:!this.state.showScale
+      });
+    }
+
+  }
+  onPrint(){
+    let dom = $("#printcontent");
+    dom.jqprint({
+      debug: false,
+      importCSS: true,
+      printContainer: true,
+      operaSupport: false,
+    });
+  }
   render() {
-    const { loading,isChronic } = this.props;
+    const { loading,isChronic, list,inquiryId } = this.props;
+    const {tableName,tableId,showScale} = this.state;
+    const obj = list&&list[inquiryId];
+    const scaleFooter = <div className={style['footer']}>
+      <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
+      <span className={style['okBtn']} onClick={()=>this.showScaleFn()}>关闭</span>
+    </div>;
     return <div className={style['assess-cont']}>
       <div className={style['assess-result']}>
         <p className={style['enter']}>{isChronic?'管理和评估':'推荐'}结果:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a></p>
       </div>
       <div className={style['assess-box']}>
         {loading?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
-        {/*{data?data.map((it,i)=>{
-          return this.handoutTypes(it,i);
-        }):data===null?<p className={style['no-data']}>没有历史评估记录!</p>:''}*/}
         {this.getAssessContent()}
       </div>
+      {showScale?<ComplexModal onclose={this.showScaleFn} footer={scaleFooter}
+                                          title={tableName}
+                                          icon={tableIcon}
+                                          top={20}
+                                          bottom={20}
+                                          width={820}>
+        <ScaleTableHis title={tableName} tableId={tableId} result={obj.scaleResult&&obj.scaleResult[tableId]} data={obj.scaleInfo&&obj.scaleInfo[tableId]}></ScaleTableHis>
+      </ComplexModal>:''}
     </div>;
   }
 }

+ 35 - 0
src/components/AssessResult/AssessHis/index.less

@@ -29,4 +29,39 @@
   img{
     width: 30px;
   }
+}
+.footer{
+  .print{
+    width: 111px;
+    height: 34px;
+    line-height: 34px;
+    outline: none;
+    border-radius: 4px;
+    /*color: #3B9ED0;*/
+    border: 0 none;
+    cursor: pointer;
+    background: #fff;
+    margin-right: 20px;
+    img{
+      width: 20px;
+      vertical-align: middle;
+      margin-right: 4px;
+    }
+  }
+  .okBtn{
+    width: 80px;
+    height: 34px;
+    line-height: 32px;
+    text-align: center;
+    outline: none;
+    border-radius: 4px;
+    cursor: pointer;
+    border: 1px solid #3B9ED0;
+    box-sizing: border-box;
+    margin-left: 20px;
+    background: #3B9ED0;
+    color: #fff;
+    float: right;
+    margin-right: 20px;
+  }
 }

+ 17 - 7
src/components/AssessResult/ChartItem/index.jsx

@@ -62,7 +62,7 @@ class ChartItem extends Component {
     if(isHour){
       for(let i=0;i<24;i++){
         temp = hour-i>-1?hour-i:hour-i+24;
-        arr.unshift(str+" "+(temp<10?'0'+temp:temp));
+        arr.unshift(str+" "+(temp<10?'0'+temp:temp)+":00:00");
       }
       return arr;
     }else{
@@ -132,9 +132,10 @@ class Chart extends Component{
     const id = endDate?'chart'+endDate+index:'chart'+index;
     let series = [],names=[],inx=-1;
     let myChart = echarts.init(document.getElementById(id) ,null, {renderer: 'svg'});
+    let xAxisArr = [...xAxis];
 
     const interval = {
-      week:24,
+      week:23,
       month:4,
       sixMonth:9,
       year:60
@@ -145,9 +146,12 @@ class Chart extends Component{
       it&&it.creatTime.map((x,i)=>{
         inx=xAxis.findIndex((a)=>{
           name=type=='week'?x.substr(0,13):x.substr(0,10);
-          return a==name;
+          return a.substr(0,13)==name;
         });     //日期对应横坐标的位置
         if(inx!=-1){
+          if(type=='week'){
+            xAxisArr[inx] = x;
+          }
           values[inx] = it.indexValue[i];       //值对应横坐标的位置
         }
       });
@@ -162,7 +166,10 @@ class Chart extends Component{
     // 指定图表的配置项和数据
     var option = {
       tooltip: {
-        trigger: 'axis'
+        trigger: 'axis',
+        textStyle:{
+          fontSize:12
+        }
       },
       legend: {
         data:names,
@@ -174,9 +181,9 @@ class Chart extends Component{
       xAxis: {
         type: 'category',
         boundaryGap: false,
-        data: xAxis,
+        data: xAxisArr,
         splitLine:{
-          show:false
+          show:true
         },
         axisPointer:{
           //show:false
@@ -190,7 +197,10 @@ class Chart extends Component{
           showMaxLabel:true,
           interval:interval[type],
           rotate:65,
-          fontSize:10
+          fontSize:10,
+          formatter: function(value,index){
+            return value.substr(0,10);
+          }
         }
       },
       yAxis: {

+ 19 - 12
src/components/AssessResult/ScaleItem/index.jsx

@@ -48,17 +48,17 @@ class ScaleItem extends Component {
   }
   confirmOption(){
     const {handleRes} = this.props;
-    const {radioVal,possible} = this.state;
+    const {radioVal} = this.state;
     handleRes&&handleRes({
-      possible:Object.assign({},possible,radioVal),
-      radioVal:Object.assign({},possible,radioVal),//不设置radioVal只有最近一次选中的值
+      possible:Object.assign({},radioVal),
+      radioVal:Object.assign({},radioVal),//不设置radioVal只有最近一次选中的值
     });
     this.closeOption();
   }
-  handleShowScale(item,parentId){
+  handleShowScale(item,parentId,pIndex){
     const {showScaleFn,closeAssess} = this.props;
     closeAssess&&closeAssess();    //关闭评估弹窗
-    showScaleFn&&showScaleFn(item,parentId);        //显示量表
+    showScaleFn&&showScaleFn(item,parentId,pIndex);        //显示量表
 
   }
   handleRadio(item,parent){
@@ -156,7 +156,7 @@ class ScaleItem extends Component {
   }
   getDetailItems(item,i){
     let arr = [],temp='';
-    const {indexs,result,formulaResult,calcuResult} = this.props;
+    const {indexs,result,formulaResult,calcuResult,disabled} = this.props;
     const {optionId,formulaId,radioVal,formulaData,isFormulaConfirm} = this.state;
     const possible=result&&result.possible;
 
@@ -166,9 +166,8 @@ class ScaleItem extends Component {
         if(its.type==1){     //量表
           it=deepClone(its);
           let scaleRes=formulaResult&&formulaResult[it.content.id]&&formulaResult[it.content.id].calcalculate;
-
           temp =<span className={style['scale']}
-                      onClick={()=>this.handleShowScale(it.content,item.id)}>
+                      onClick={()=>this.handleShowScale(it.content,item.id,i)}>
                         {scaleRes&&scaleRes.result?(' 【'+it.content.name+'】 结果:'+scaleRes.result.value+" "+scaleRes.result.text):'【'+it.content.name+'】'}
                         </span>;
         }else if(its.type==2){      //计算公式
@@ -197,6 +196,7 @@ class ScaleItem extends Component {
                                   return <div className={style["chooseItem"]}>
                                     <Radio label={ii.detailName}
                                            isSelect={ii.state == 1}
+                                           disabled={disabled}
                                            handleClick={this.handleForRadio.bind(this,item.id,idd, ind)}>
                                       >
                                     </Radio>
@@ -210,7 +210,7 @@ class ScaleItem extends Component {
                                 <span>{'请输入'+item1.name+':'}</span>
                               </td>
                               <td>
-                                <input type="text" placeholder="请输入"  value={item1.value} onInput={(e)=>this.handleInputformula(item.id,idd,e.target.value)}/>
+                                {disabled?item1.value:<input type="text" placeholder="请输入"  value={item1.value} onInput={(e)=>this.handleInputformula(item.id,idd,e.target.value)}/>}
                               </td>
                               <td>
                                 <span>{item1.uint}</span>
@@ -220,7 +220,7 @@ class ScaleItem extends Component {
                           }
                         })}
                       </table>
-                      <div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,j, item, i)}>计算</div>
+                      {disabled?"":<div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,j, item, i)}>计算</div>}
                       <table>
                         {showRes && Array.isArray(showRes) &&showRes.map((itemResult, resultIndex) => {
                           return <tr>
@@ -261,10 +261,17 @@ class ScaleItem extends Component {
                     </MiniToast>
                   </div>;
         }
-        arr.push(<li>
+        const li = disabled?<li>
+            <span>{item.name}:</span>
+            <div className={style['row']}>{temp}</div>
+          </li>:<li>
           <span>{item.name}:</span>
           <div className={style['row']}>{temp}</div>
-        </li>);
+          <div className={style["recommend"]} onClick={()=>this.props.handleRemove(i,j)}>
+            <img className={style["deleteIcon"]} src={deleteIcon} />
+          </div>
+        </li>;
+        arr.push(li);
       }
     });
     return arr;

+ 8 - 4
src/components/AssessResult/index.jsx

@@ -21,8 +21,8 @@ class AssessResult extends Component {
       wholeAssessItems:wholeIndexs,     //整体评估模块
       wholeAssessText:props.wholeAssessText||'',     //整体评估补充说明
       wholeResults:{
-        possible:Object.assign({},props.possible),
-        radioVal:Object.assign({},props.radioVal)
+        possible:props.possible,
+        radioVal:props.radioVal
       },
     };
     this.handleChooseChange = this.handleChooseChange.bind(this);
@@ -79,8 +79,12 @@ class AssessResult extends Component {
     isAssessConfirm&&handleSave(this.state,readyKeepHistory(),isRecommend);
   }
   handoutTypes(item,i){
-    const {getIndexData,indexData,timeTypes,wholeAssessData,closeAssess,showScaleFn,calcuFormula,isRecommend,chronicPushItems,
+    const {getIndexData,indexData,timeTypes,wholeIndexs,closeAssess,showScaleFn,calcuFormula,isRecommend,chronicPushItems,
       formulaResult,calcuResult} =this.props;
+    let obj = [];
+    Object.keys(wholeIndexs).map((i)=>{
+      obj[i]=chronicPushItems[i];
+    });
     const {chooseSelecteds,wholeAssessItems,wholeAssessText,chartTimeTypes,wholeResults} = this.state;
     const chartData = indexData;
     const name = item.regionName+":";
@@ -88,7 +92,7 @@ class AssessResult extends Component {
     switch (+item.regionType){
       case 0:     //数据来源与右侧手动添加
         return <ScaleItem title={name}
-                          data={wholeAssessData}
+                          data={obj}
                           handleRemove={this.handleScaleDel}
                           handleInp={this.handleScaleText}
                           handleRes={this.handleResult}

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

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

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

@@ -31,7 +31,7 @@ class CheckBody extends Component{
   }
   getLabels(){
     const {data,showArr,saveText,selecteds,importLabel} = this.props;
-    let arr = [],list=[];//console.log(data,saveText)
+    let arr = [],list=[];
     const {boxMark,showAll} = this.state;
     const moreNum =data.length-[...data].reverse().findIndex((it)=>it.showInCheck)-1;//被隐藏的位置
     const moreText = filterDataArr([...saveText].splice(moreNum+1));     //被收起的标签中是否有有值得,有则不能再收起showMoreBtn?more:''

+ 1 - 0
src/components/CheckBody/index.less

@@ -7,6 +7,7 @@
   /*float: right;*/
   position: absolute;
   right: 0;
+  background: #fff;
   img{
     vertical-align: text-top;
     width: 15px;

+ 14 - 11
src/components/ChronicInfo/index.jsx

@@ -208,18 +208,18 @@ class ChronicInfo extends React.Component{
     });
   }
   handleInputformula(v,i, j,idd,  e) {
-    const { data, setChronicPush } = this.props
-    const text = e.target.value
+    const { data, setChronicPush } = this.props;
+    const text = e.target.value;
     if (data[i].details) {
       data[i].details[j].content.details[idd].value = text
     } 
     
-    const data1 = JSON.parse(JSON.stringify(data))
+    const data1 = JSON.parse(JSON.stringify(data));
     
     setChronicPush(data1)
   }
   handleForRadio(ii,v,i, j,idd, ind){//计算公式
-    const { data, setChronicPush } = this.props
+    const { data, setChronicPush } = this.props;
     if (data[i].details) {
       for(let z = 0; z <  data[i].details[j].content.details[idd].details.length; z++) {
         data[i].details[j].content.details[idd].details[z].state = 0
@@ -227,7 +227,7 @@ class ChronicInfo extends React.Component{
       data[i].details[j].content.details[idd].details[ind].state = 1
     } 
     
-    const data1 = JSON.parse(JSON.stringify(data))
+    const data1 = JSON.parse(JSON.stringify(data));
     setChronicPush(data1)
   }
   confirmFormula(){//计算公式确定
@@ -244,11 +244,13 @@ class ChronicInfo extends React.Component{
   }
   confirmOption(parent,pIndex){//可能结果确定
     const {radioVal,possible} = this.state;
+    const {savePossibleResult} = this.props;
     this.setState({
       possible:Object.assign({},possible,radioVal),
       radioVal:Object.assign({},possible,radioVal),//不设置radioVal只有最近一次选中的值
-      optionId:null
-    })
+      optionId:null,
+    });
+    savePossibleResult&&savePossibleResult({possible:Object.assign({},possible,radioVal),radioVal:Object.assign({},possible,radioVal)})
   }
   handleSaveCalcu(obj){
     this.setState({
@@ -257,8 +259,8 @@ class ChronicInfo extends React.Component{
     })
   }
   calcuFormula(it,j, v, i) { //计算公式计算
-    const { calcuFormula, data ,chronicPushItems} = this.props
-    let allHasInfo = true
+    const { calcuFormula, data ,chronicPushItems} = this.props;
+    let allHasInfo = true;
     for (let i = 0; i < it.content.details.length; i++) {
       if(it.content.details[i].controlType == 2) {  //输入框类型的有没有填值
         if(!it.content.details[i].value) {
@@ -440,10 +442,11 @@ class ChronicInfo extends React.Component{
                                   <span>{it.content.name?it.content.name+':':''}</span>
                                   {it.content.details&&it.content.details.map((lis,ind)=>{
                                     return <div className={style["chooseItem"]}>
-                                      <Radio label={lis.detailName}
+                                        <Radio label={lis.detailName}
                                                isSelect={radioVal[v.id]==lis.detailName}
                                                handleClick={this.handleRadio.bind(this,lis,v)}>
                                         </Radio>
+                                        {lis.state==1?<span className={style['recomand']}>(智能推荐)</span>:''}
                                     </div>
                                   })}
                                 </div>
@@ -508,7 +511,7 @@ class ChronicInfo extends React.Component{
                           <span>
                             <i onClick={this.handleListClick.bind(this,v)}>{'【'+v.name+'】'}</i>
                             {/*{formulaResult&&formulaResult[v.id]?<i>{'结果:'+formulaResult[v.id].text}</i>:''}*/}
-                            {formulaResult&&formulaResult[v.id]?<i className={style['res']}>{'结果:'}{formulaResult[v.id].calcalculate&&formulaResult[v.id].calcalculate.result.value+' '+ formulaResult[v.id].calcalculate.result.text}</i>:''}
+                            {formulaResult&&formulaResult[v.id]?<i className={style['res']}>{'结果:'}{formulaResult[v.id].calcalculate&&formulaResult[v.id].calcalculate.result.value+' '+ (formulaResult[v.id].calcalculate.result.text?formulaResult[v.id].calcalculate.result.text:'')}</i>:''}
                           </span>
                           </li>
                         })}

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

@@ -259,4 +259,8 @@
     color: #fff;
     background: #3B9ED0;
     margin-top: 15px;
+    cursor: pointer;
+  }
+  .recomand{
+    color:#3B9ED0;
   }

+ 12 - 21
src/components/CurrentIll/index.jsx

@@ -46,18 +46,18 @@ class CurrentIll extends Component{
     // 判断主诉是否为空
     const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear,symptomFeature,isChronic} = this.props;
     const that = this;
+    const ev = e || window.event;
+    const text = ev.target.innerText||ev.target.innerHTML;
     let {setDataTimer} = this.state; 
     let mainFinallyText = filterDataArr(mainText);
-    // if(mainData.length == 0 && !mainText[0]){
     if(!mainFinallyText){
       //弹窗提醒
       Notify.error("无法操作,请先输入主诉");
       this.setState({
         forbidInput:true
       })
-    }else {
+    }else if(!text) {//现病史框里没有内容时才设置模板
       let num = moduleNum.num;//主诉使用了几个模板
-        // isChronic为一个对象
       if(data.length==0 && !isChronic || !isChronic.name ){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回
@@ -74,15 +74,6 @@ class CurrentIll extends Component{
           setDataTimer
       })
       changeEditIll(false)
-      /*const showTimer = setTimeout(function(){
-        that.setState({
-          showMoudle:true,
-          forbidInput:false,
-          boxEditable:false,
-        })
-        changeEditIll(false)
-      },150)
-      clearTimeout(showTimer);*/
     }
 
   }
@@ -142,15 +133,15 @@ class CurrentIll extends Component{
     return list;
   }
   handleBlur(e){
-    const {freeText} = this.props;
-    const ev = e || window.event;
-    const data = ev.target.innerText || e.target.innerHTML;
-    if(!isIE()){
-      e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
-      freeText && freeText(data.trim());
-    }else{
-      if(datas.length==0){
-        freeText && freeText(data);
+    const {freeText,data} = this.props;
+    if(data&&data.length==0){//无模板纯手动输入时存值
+      const ev = e || window.event;
+      const innerData = ev.target.innerText || e.target.innerHTML;
+      if(!isIE()){
+        e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
+        freeText && freeText(innerData.trim());
+      }else{
+          freeText && freeText(innerData);
       }
     }
   }

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

@@ -50,7 +50,7 @@ class DiagnosticItem extends Component{
        
     }
     addDiagodal(diagType){
-        const {item, isChronicMag} = this.props;
+        const {item, isChronicMag,mode} = this.props;
         item.type = diagType;
         // setTimeout(()=>{
         //     this.setState({
@@ -63,7 +63,7 @@ class DiagnosticItem extends Component{
                 //         return
                 //     }
                 // }
-                if(item.type == 2) {
+                if(item.type == 2&&mode==0) {
                     isChronicMag(item);
                 }
                 // 从缓存取慢病列表

+ 19 - 12
src/components/DiagnosticList/index.jsx

@@ -92,7 +92,7 @@ class DiagnosticList extends Component {
         getTips && getTips({id:item.id,type:7});
     }
     referRecord() {
-        const { hideReferRecord, showHistoryCaseModal ,chronicMagItem,hisTemplates,autoFillModules} = this.props
+        const { hideReferRecord, showHistoryCaseModal ,chronicMagItem,hisTemplates,autoFillModules,typeConfig} = this.props
         hideReferRecord && hideReferRecord()
         // showHistoryCaseModal && showHistoryCaseModal()
         // store.dispatch(initItemList(chronicMagItem))
@@ -102,23 +102,28 @@ class DiagnosticList extends Component {
               store.dispatch(setInitHistory(result.data));
               showHistoryCaseModal && showHistoryCaseModal();
             }else{
-              Notify.info("暂无历史病例,已默认展示慢病相关内容");
-              const timer = setTimeout(function(){
-                autoFillModules && autoFillModules();
-                clearTimeout(timer);
-              },1000) //需求要求延时
+              if(typeConfig==0){
+                Notify.info("暂无历史病例,已默认展示慢病相关内容");
+                const timer = setTimeout(function(){
+                  autoFillModules && autoFillModules();
+                  clearTimeout(timer);
+                },1000) //需求要求延时
+              }
             }
         })
     }
     noReferRecord() {
-        const { hideReferRecord ,autoFillModules} = this.props
+        const { hideReferRecord ,autoFillModules,typeConfig} = this.props
         hideReferRecord && hideReferRecord();
-        autoFillModules&&autoFillModules();
+        if(typeConfig==0){//智能推送模式才自动填充
+            autoFillModules&&autoFillModules();
+        }
+        
     }
     referCase() {
-        const { hideHistoryCaseModal, items ,autoFillModules} = this.props
+        const { hideHistoryCaseModal, items ,autoFillModules,typeConfig} = this.props
         hideHistoryCaseModal && hideHistoryCaseModal()
-        if (this.state.activeHistory === -1) {//没有选择历史病例直接点确定
+        if (this.state.activeHistory === -1 && typeConfig==0) {//没有选择历史病例直接点确定
             Notify.info("未选择历史病历,已默认展示慢病相关内容");
               const timer = setTimeout(function(){
                 autoFillModules && autoFillModules();
@@ -138,12 +143,14 @@ class DiagnosticList extends Component {
         })
     }
     closeHistoryCaseModal() {
-        const { hideHistoryCaseModal ,autoFillModules} = this.props
+        const { hideHistoryCaseModal ,autoFillModules,typeConfig} = this.props
         this.setState({
             activeHistory: -1
         })
         hideHistoryCaseModal && hideHistoryCaseModal()
-        autoFillModules && autoFillModules();
+        if(typeConfig==0){//智能推送模式才自动填充
+            autoFillModules&&autoFillModules();
+        }
     }
     handleQuoteClick(item, index) {
         const { handleQuoteClick } = this.props

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

@@ -3,6 +3,7 @@
   font-size: 24px;
   margin-bottom: 30px;
   text-align:center;
+  padding-top: 15px;
 }
 .patInfo {
   margin: 0px 0px 30px 0px;

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

@@ -147,7 +147,7 @@ class Inspect extends React.Component {
         </ul>
     }
     render() {
-        const {fetchPushInfos,getInfomation, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList,delPartItem,inspectList } = this.props;
+        const {fetchPushInfos,getInfomation,inspectVal, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList,delPartItem,inspectList } = this.props;
         const {ieVersion,isIE} = this.state;
         return (
             <div className={styles.wrapper} >
@@ -185,6 +185,7 @@ class Inspect extends React.Component {
                             delPartItem={delPartItem}
                             inspectList={inspectList}
                             getInfomation={getInfomation}
+                            inspectVal={inspectVal}
                         >
                         </AddInspect>
                     </div>

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

@@ -262,7 +262,8 @@ class NumberDrop extends Component{
                 onClick={allClick?this.handleNumClick:null}
                 contentEditable={editable}
                 onBlur={this.handleBlur}
-                onkeydown={handleEnter}>
+                onkeydown={handleEnter}
+                onFocus={(e)=>{e.stopPropagation()}}>
       <span ref = {this.$pre}>&nbsp;{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={allClick?null:this.handleNumClick}

+ 8 - 2
src/components/Preview/index.less

@@ -22,14 +22,20 @@
     bottom: 7%;
     height: 86%;
     overflow: hidden;
+    padding-top: 45px;
   }
   .close { 
-    padding:  15px 15px 15px 20px;
+    padding:  0 15px;
+    height: 45px;
+    line-height: 45px;
     border-bottom: 1px solid #EAEDF1;
+    position: absolute;
+    width: 100%;
+    top: 0;
     img{
       float:right;
       cursor: pointer;
-      margin-top: -5px;
+      margin-top: 10px;
     }
   }
 }

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

@@ -76,6 +76,7 @@ class PreviewBody extends Component {
     const { show, preInfo, dataJson, dataStr, baseObj, flg ,showAssessBtn} = this.props;
     const other_yjs = filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other);
     const noData = JSON.stringify(preInfo) == '{}';
+    const isChronic = (dataJson.diagChronicMagItem&&dataJson.diagChronicMagItem.name)||(dataJson.mainChronicDesease&&dataJson.mainChronicDesease.name);
     return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>
       <div className={style['contents']} id="content" style={{ margin: "0 auto", maxWidth: "620px" }}>
         <Information baseObj={baseObj} preInfo={preInfo}></Information>
@@ -153,28 +154,26 @@ class PreviewBody extends Component {
               }
               {
                 dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
-                  // if (item.show) {
-                    return <table style={{ margin: '8px 0', width: '100%' }}>
-                      {
-                        item.show?<tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}> {item.name} </span></td></tr>:
-                        <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ position:'relative',left:'-10px' }}>「{item.name}」</span></td></tr>
-                      }
-                      {
-                        item.details.map((val) => {
-                          if (val.value && val.value != '') {
-                            return <tr style={{ lineHeight: '1.5', width: '100%', fontSize: '12px' }}>
-                              <td style={{ width: '32%', fontSize: '12px' }}>{val.name}</td>
-                              {this.showDetails(val)}
-                              <td style={{ width: '24%', fontSize: '12px' }}>
-                                {normalVal(val.minValue, val.maxValue)}
-                              </td>
-                              <td style={{ width: '28%', fontSize: '12px' }}>{'化验时间:' + item.time}</td>
-                            </tr>
-                          }
-                        })
-                      }
-                    </table>
-                  // }
+                  return <table style={{ margin: '8px 0', width: '100%' }}>
+                    {
+                      item.show?<tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}> {item.name} </span></td></tr>:
+                      <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ position:'relative',left:'-10px' }}>「{item.name}」</span></td></tr>
+                    }
+                    {
+                      item.details.map((val) => {
+                        if (val.value && val.value != '') {
+                          return <tr style={{ lineHeight: '1.5', width: '100%', fontSize: '12px' }}>
+                            <td style={{ width: '32%', fontSize: '12px' }}>{val.name}</td>
+                            {this.showDetails(val)}
+                            <td style={{ width: '24%', fontSize: '12px' }}>
+                              {normalVal(val.minValue, val.maxValue)}
+                            </td>
+                            <td style={{ width: '28%', fontSize: '12px' }}>{'化验时间:' + item.time}</td>
+                          </tr>
+                        }
+                      })
+                    }
+                  </table>
                 })
               }
             </td>
@@ -202,10 +201,15 @@ class PreviewBody extends Component {
           <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.assay && dataJson.advice.assay.length > 0) || (dataJson.advice.check && dataJson.advice.assay.check > 0)) && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>开单项目</span></p>}
+              {
+                ((dataJson.advice.assay && dataJson.advice.assay.length > 0) || (dataJson.advice.check && dataJson.advice.assay.check > 0)) && <div style={{ padding: '0px 0px 5px 0px',wordBreak:"break-all" }}>{dataJson.advice.check?dataJson.advice.check+',':''} {dataJson.advice.assay}</div>
+              }
               {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>
               }
+              {dataJson.advice.followUp && dataJson.advice.followUp.length > 0 && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>回访时间:<span className={style['bbtm']}>{dataJson.advice.followUp}</span> 后回访,不适随诊</span></p>}
               {dataJson.advice.scheme && dataJson.advice.scheme.length > 0 && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>治疗方案</span></p>}
               {
                 dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
@@ -222,7 +226,7 @@ class PreviewBody extends Component {
           </tr>
         </table>
         <p style={{textAlign:'right',marginTop:'15px'}}>医生签名:<span style={{minWidth: '60px',padding: '0 5px 2px 5px',borderBottom: '1px solid #333',}}>{baseObj ? baseObj.doctorName : (noData ? '' : preInfo.doctorName)}</span></p>
-        {showAssessBtn?<AssessResultHis isChronic={dataJson.diagChronicMagItem&&dataJson.diagChronicMagItem.name?true:false} inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
+        {showAssessBtn?<AssessResultHis isChronic={isChronic?true:false} inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
         
         <div onClick={() => { this.surePrint(dataStr) }} style={{
           display: show ? 'inline-block' : 'none',

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

@@ -5,7 +5,7 @@
   height: 100%;
   top:0px;
   width: 820px;
-  padding: 15px 0px 100px 0px;
+  padding-bottom: 100px;
   box-sizing: border-box;
   .contents {
     position: relative;
@@ -46,4 +46,7 @@ table{
   tr td:first-child{
     width: 31%;
   }
+}
+.bbtm {
+  border-bottom: 1px solid #333;
 }

+ 8 - 2
src/components/PrintPreview/index.less

@@ -22,14 +22,20 @@
       bottom: 7%;
       height: 86%;
       overflow: hidden;
+      padding-top: 45px;
     }
     .close { 
-      padding:  15px 15px 15px 20px;
+      padding:  0 15px;
+      height: 45px;
+      line-height: 45px;
       border-bottom: 1px solid #EAEDF1;
+      position: absolute;
+      width: 100%;
+      top: 0;
       img{
         float:right;
         cursor: pointer;
-        margin-top: -5px;
+        margin-top: 10px;
       }
     }
     .button {

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

@@ -409,7 +409,8 @@ class PushItems extends Component {
                 )}
               </div>
             </div>
-            {chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}
+            {/*{chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}*/}
+            {<ChronicInfo data={chronicPushItems}></ChronicInfo>}
             <div className={style["tips"]}>
               <h1>
                 <img src={tipsImg} />

+ 1 - 0
src/components/RadioDrop/index.jsx

@@ -152,6 +152,7 @@ class RadioDrop extends Component{
            onBlur={this.handleEditLabel}
            contentEditable={this.state.editable}
            onDoubleClick={this.handledbClick}
+           onFocus={(e)=>{e.stopPropagation()}}
            onClick={(e)=>this.handleShow(e,true)}
            onkeydown={handleEnter}>
         {value||placeholder}

+ 26 - 11
src/components/ScaleTable/index.jsx

@@ -24,7 +24,7 @@ class ScaleTable extends React.Component{
     this.handleFormula = this.handleFormula.bind(this);
   }
   
-  handleRadio(groupName,name,item){
+  handleRadio(groupName,name,item,indexId){
     const {selecteds,valueData} = this.state;
     const value = item.detailName;
     this.setState({
@@ -43,13 +43,27 @@ class ScaleTable extends React.Component{
     if(rows){
       for(let j=0; j<rows.length; j++){
         let row = rows[j].row;
-        for(let k=0;k < row.length; k++){
-          if(row[k].name==name){
-            details = row[k].details;
+        let required = rows[j].required;
+        let rowsId = rows[j].indexId;
+        // 必填项处理
+        if(required==1&&rowsId==indexId){
+          for(let k=0;k < row.length; k++){
             row[k].isSelect = true;
-            break;
+            if(row[k].name==name){
+              details = row[k].details;
+              // break;
+            }
+          }
+        }else{
+          for(let k=0;k < row.length; k++){
+            if(row[k].name==name){
+              details = row[k].details;
+              row[k].isSelect = true;
+              break;
+            }
           }
         }
+        
       }
     }
     if(details){
@@ -221,16 +235,17 @@ class ScaleTable extends React.Component{
     let {selecteds,valueData,start,scaleResult1} = this.state;
     const {tableId,formulaResult} = this.props;
     const scaleResult = scaleResult1 || formulaResult&&formulaResult[tableId]; //量表计算结果
-    // const datas = valueData&&valueData.group?valueData:mocks.newData;
-    const datas = valueData&&valueData.group?valueData:'';
+    const datas = valueData&&valueData.group?valueData:'';//console.log(666,datas);
     let content =  datas&&datas.group&&datas.group.map((v,i)=>{
                 return <div className={style['group']}>
                   <p className={style['groupName']}>{v.groupName}</p>
                   {v.rows&&v.rows.map((it,ind)=>{
-                    return <div style={{borderBottom:'1px solid #EBEBEB'}}>
+                    return <div className={style['rows']}>
+                        {it.required==1&&it.row.length>1?<span className={style['tip']}>本组选项可多选或根据需要选择某一条选项</span>:''}
                       {it.row.map((item,index)=>{
                         if(item.controlType==0){
                           return <div className={style['block']} style={{border:it.required==1&&!item.isSelect&&start?'1px solid #f00':'none'}}>
+                              {/*<p className={style['miniName']}>{item.name}</p>*/}
                               <p className={style['miniName']}> 
                                 <i>{index==0?it.indexId + '.':''}</i> 
                                 {item.name}
@@ -239,7 +254,7 @@ class ScaleTable extends React.Component{
                                 return <div className={style['item']}>
                                         <Radio label={vv.detailName+'('+vv.score+')'}
                                            isSelect={vv.select==1||selecteds[item.name]==vv.detailName}
-                                           handleClick={this.handleRadio.bind(this,v.groupName,item.name,vv)}>
+                                           handleClick={this.handleRadio.bind(this,v.groupName,item.name,vv,it.indexId)}>
                                         </Radio>
                                         {vv.state==1?<span className={style['recomand']}>(智能推荐)</span>:''}
                                     </div>
@@ -297,9 +312,9 @@ class ScaleTable extends React.Component{
               }else{
                 return <div className={style['textContent']}>
                   {this.getContent()}
-                  {datas&&datas.noCalc==0?<div className={style['total']}>
+                  {datas&&datas.Calc==1?<div className={style['total']}>
                     <span>总分:</span>
-                    <span>{scaleResult&&scaleResult.calcalculate&&scaleResult.calcalculate.result&&scaleResult.calcalculate.result.value +' '+ scaleResult.calcalculate.result.text||''}</span>
+                    <span>{scaleResult&&scaleResult.calcalculate&&scaleResult.calcalculate.result&&scaleResult.calcalculate.result.value +' '+ (scaleResult.calcalculate.result.text?scaleResult.calcalculate.result.text:'')}</span>
                     <span className={style['totalBtn']} onClick={this.handleFormula}>得分</span>
                   </div>:''}
                 </div>

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

@@ -54,6 +54,16 @@ strong{
     color:#000;
     margin: 25px 0;
   }
+  .rows{
+    border-bottom: 1px solid #EBEBEB;
+    position: relative;
+    .tip{
+      position: absolute;
+      top:-16px;
+      color: #c9c9c9;
+      font-size: 12px;
+    }
+  }
   .subTotal{
     height: 49px;
     line-height: 49px;

+ 111 - 0
src/components/ScaleTableHis/index.jsx

@@ -0,0 +1,111 @@
+import React from 'react';
+import style from './index.less';
+// import mocks from '../../mock/chronicTable.js'
+import { Radio,CheckBtn ,Notify} from '@commonComp';
+ import Information from '../Information';
+ import {deepClone} from '@utils/tools.js';
+ import {getFormulaResult} from '@store/async-actions/fetchModules.js';
+/**
+*量表 具体信息页面
+*title:量表标题/scaleName
+*data:量表内容:scaleName量表标题,calculate量表计算结果,group分组,
+*
+*
+**/
+class ScaleTableHis extends React.Component{
+  constructor(props){
+    super(props);
+  }
+  filterScale(data){//type=1为表格内容
+    let scale = {};
+    for(let i=0; i<data.length; i++){
+      if(data[i].type==1){
+        scale = data[i];
+      }
+    }
+    return scale;
+  }
+
+  getContent(datas){
+    const {title,formulaResult,data} = this.props;
+    // const datas = valueData&&valueData.group?valueData:mocks.newData;
+    let content =  datas&&datas.group&&datas.group.map((v,i)=>{
+                return <div className={style['group']}>
+                  <p className={style['groupName']}>{v.groupName}</p>
+                  {v.rows&&v.rows.map((it,ind)=>{
+                    return <div>
+                      {it.row.map((item,index)=>{
+                        if(item.controlType==0){
+                          return <div className={style['block']} style={{border:it.required==1&&!item.isSelect&&start?'1px solid #f00':'none'}}>
+                              <p className={style['miniName']}>{item.name}</p>
+                              {item.details&&item.details.map((vv,ii)=>{
+                                return <div className={style['item']}>
+                                        <Radio label={vv.detailName+'('+vv.score+')'}
+                                           isSelect={vv.select==1}
+                                               disabled={true}>
+                                        </Radio>
+                                        {vv.state==1?<span className={style['recomand']}>(智能推荐)</span>:''}
+                                    </div>
+                              })}
+                              
+                            </div>
+                          }else{
+                            return <div className={style['block']}>
+                                <p className={style['miniName']}>{item.name}</p>
+                                  {item.details&&item.details.map((vv,ii)=>{
+                                    return <div className={style['item']}>
+                                    <CheckBtn value={vv.detailName}
+                                                    label={vv.detailName}
+                                                    disabled={true}
+                                                    isSelect={vv.select==1}>
+                                          </CheckBtn>
+                                    {vv.state==1?<span className={style['recomand']}>(智能推荐)</span>:''}
+                                    </div>
+                                  })}
+                            </div>
+                          }
+                        
+                      })}
+                    </div>
+                  })}
+                  {v.groupCalculate.isShow==1?<p className={style['subTotal']}>
+                    <span>计分:</span>
+                    {/*<span>{v.groupCalculate.result.value}</span>*/}
+                    <span>{scaleResult&&scaleResult.group.map((m,ii)=>{
+                      if(m.groupName==v.groupName){
+                        return m.groupCalculate.result.value;
+                      }
+                    })}</span>
+                  </p>:''}  
+                </div>
+              })
+    return content;
+  }
+
+  render(){
+    const {title,data,result} = this.props;console.log(this.props)
+    const scale = data && this.filterScale(data);
+    const datas = scale && scale.content && JSON.parse(scale.content);
+    const scaleResult = datas; //量表计算结果
+    return <div className={style['tableBox']} id="printcontent">
+            <div className={style['printShow']}>
+              <Information></Information>
+            </div> 
+            <h1>{datas?datas.scaleName:''}</h1>
+            {data && data.map((v,i)=>{
+              if(v.type==0){
+                return <div dangerouslySetInnerHTML={{__html:v.content}} className={style['textlh']}></div>
+              }else{
+                return <div className={style['textContent']}>
+                  {this.getContent(datas)}
+                  {datas&&datas.Calc==1?<div className={style['total']}>
+                    <span>总分:</span>
+                    <span>{result&&result.calcalculate&&result.calcalculate.result&&result.calcalculate.result.value +' '+ result.calcalculate.result.text||''}</span>
+                  </div>:''}
+                </div>
+              }
+            })}
+          </div>
+  }
+}
+export default ScaleTableHis;

+ 83 - 0
src/components/ScaleTableHis/index.less

@@ -0,0 +1,83 @@
+.tableBox{
+  // height: 690px;
+  overflow-y: auto;
+  padding: 30px;
+  h1{
+    font-size: 16px;
+    font-weight: bold;
+    margin: 10px 0 30px;
+    text-align: center;
+  }
+}
+strong{
+  font-weight: bold;
+}
+.textlh{
+  p{
+    line-height: 22px;
+  }
+}
+.textContent{
+  margin: 40px 0 30px;
+  .group{
+    border-bottom: 4px solid #EBEBEB;
+    padding-bottom: 10px;
+    margin-top: 25px;
+    .item{
+      display: inline-block;
+      margin-right: 24px;
+    }
+    .recomand{
+      color:#3B9ED0;
+    }
+    .block{
+      margin-top: 20px;
+      padding-top: 5px;
+    }
+    .redBorder{
+      border: 1px solid #f00;
+    }
+    // .miniName{
+    //   margin-top: 25px;
+    // }
+  }
+  .groupName{
+    font-size: 14px;
+    font-weight: bold;
+    color:#000;
+    margin: 25px 0;
+  }
+  .subTotal{
+    height: 49px;
+    line-height: 49px;
+    border-top: 1px solid #EBEBEB;
+    text-align: right;
+    margin-top: 10px;
+  }
+  .total{
+    height: 72px;
+    line-height: 72px;
+    border-bottom: 10px solid #EBEBEB;
+    text-align: right;
+    .totalBtn{
+      display: inline-block;
+      width: 64px;
+      height: 32px;
+      line-height: 32px;
+      color:#3B9ED0;
+      border: 1px solid #3B9ED0;
+      border-radius: 4px;
+      margin-left: 40px;
+      text-align: center;
+      cursor: pointer;
+    }
+  }
+}
+.printShow {
+  display: none;
+}
+@media print {
+  .printShow {
+    display: block;
+  }
+}

+ 0 - 1
src/components/Treat/DrugHistory/LastDrug/index.jsx

@@ -16,7 +16,6 @@ class LastDrug extends Component {
     }
     handleMouseEnterDrug(index, item) {
         const drugNameWidth = parseInt($('#'+item.id)[0].offsetWidth)
-        console.log(drugNameWidth,'drugNameWidth')
         const imgLeft = drugNameWidth/2-8
         $('#'+item.id).find('img').css('left', imgLeft)
         this.setState({

+ 2 - 2
src/components/Treat/DrugHistory/index.jsx

@@ -21,8 +21,8 @@ class DrugHistory extends Component {
             <div className={style['last-treat-wrapper']}>
                 <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>
-                {drugHistory['慢病用药内容'] && drugHistory['慢病用药内容'].length > 0 && <LastDrug title='普通病用药内容' lastDrugList = {drugHistory['病用药内容']}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
-                {drugHistory['普通病用药内容'] &&drugHistory['普通病用药内容'].length > 0 && <LastDrug title='慢病用药内容' lastDrugList = {drugHistory['普通病用药内容']}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
+                {drugHistory['普通病用药内容'] && drugHistory['普通病用药内容'].length > 0 && <LastDrug title='普通病用药内容' lastDrugList = {drugHistory['普通病用药内容']}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
+                {drugHistory['慢病用药内容'] &&drugHistory['慢病用药内容'].length > 0 && <LastDrug title='慢病用药内容' lastDrugList = {drugHistory['慢病用药内容']}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
             </div>
         )
     }

+ 0 - 1
src/components/Treat/index.jsx

@@ -83,7 +83,6 @@ class Treat extends Component {
                                     onInput = {this.handleInputFollowUp}>
                                 {followUp}</span>后回访,不适随诊
                         </div>} */}
-                        {console.log('222222', drugHistory)}
                         { drugHistory && (drugHistory['慢病用药内容'] && drugHistory['慢病用药内容'].length > 0 || drugHistory['普通病用药内容'] && drugHistory['普通病用药内容'].length > 0) &&<DrugHistory icon={drugIcon} 
                             titleStyle={{background:'#EAF7FA',opacity:'1', filter:'alpha(opacity=100);',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=100);'}}
                             title='上次用药情况' 

+ 1 - 1
src/containers/AssessResult.js

@@ -26,7 +26,7 @@ function mapStateToProps(state) {
     update:assessResult.update,     //评估数据更新
     update1:assessResult.update1,       //加入记录更新
     timeTypes:assessResult.indexTimeTypes,    //图表切换的维度
-    wholeAssessData:assessResult.wholeAssess,   //评估内容
+    //wholeAssessData:assessResult.wholeAssess,   //评估内容
     wholeIndexs:assessResult.wholeIndexs||{},      //已加入评估记录的推送项
     wholeResults:assessResult.wholeResults,     //整体评估可能结果
     chooseSelecteds:assessResult.chooseSelecteds,    //已选中的选项

+ 0 - 7
src/containers/AssessResultHis.js

@@ -6,7 +6,6 @@ import {billing} from '@store/async-actions/pushMessage';
 import {getAssessHis,getIndexData} from '@store/async-actions/fetchModules';
 import {SET_ASSESS_DATA,SET_INDEX_DATA} from '@types/assessResult';
 import {SET_ASSESS_HISTORY_DATA,SET_ASSESS_HISTORY_LOADING} from '@types/assessResultHis';
-import store from '@store';
 
 /***
  * 管理评估逻辑:
@@ -25,12 +24,6 @@ function mapStateToProps(state) {
     indexData:assessResult.indexData,
     loading:assessResultHis.loading,
     timeTypes:assessResult.indexTimeTypes,    //图表切换的维度
-    /*data:assessResultHis.data,
-    timeTypes:assessResultHis.indexTimeTypes,    //图表切换的维度
-    wholeAssessData:assessResultHis.wholeAssess,   //评估内容
-    wholeIndexs:assessResultHis.wholeIndexs,      //已加入评估记录的推送项
-    chooseSelecteds:assessResultHis.chooseSelecteds,    //已选中的选项
-    wholeAssessText:assessResultHis.wholeAssessText,     //整体评估补充说明*/
   }
 }
 

+ 2 - 1
src/containers/AssistCheck.js

@@ -8,13 +8,14 @@ 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)
+function mapStateToProps(state) {console.log(state)
     return {
         list:state.assistCheck.list,
         assistLabel:state.assistCheck.assistLabel,
         isRead:state.homePage.isRead,
         winWidth:state.homePage.windowWidth,
         assistList:state.homePage.assistList,
+        assistVal:state.assistCheck.assistVal,
     }
 }
 

+ 6 - 0
src/containers/ChronicInfo.js

@@ -62,6 +62,12 @@ function mapDispatchToProps(dispatch){
         }
       }
     },
+    savePossibleResult(data){
+      dispatch({
+        type: 'SAVE_POSSIBLE_RESULT',
+        wholeResults: data
+      })
+    },
     //设置量表推送内容
     setChronicPush(data) {
       dispatch({

+ 2 - 1
src/containers/DiagnosticItem.js

@@ -11,7 +11,8 @@ import {billing, getTips} from '../store/async-actions/pushMessage';
 
 function mapStateToProps(state) {
     return {
-        diagnosticList: state.diagnosticList.diagnosticList
+        diagnosticList: state.diagnosticList.diagnosticList,
+        mode:state.typeConfig.typeConfig
     }
 }
 

+ 1 - 0
src/containers/DiagnosticList.js

@@ -21,6 +21,7 @@ function mapStateToProps(state) {
         showHistoryCase: state.diagnosticList.showHistoryCase,
         items:state.historyTemplates.items,
         chronicMagItem: state.diagnosticList.chronicMagItem,
+        typeConfig: state.typeConfig.typeConfig,
     }
 }
 

+ 1 - 0
src/containers/Inspect.js

@@ -12,6 +12,7 @@ function mapStateToProps(state) {//console.log(state)
         getExcelDataList:state.inspect.getExcelDataList,
         labelListActive:state.inspect.labelListActive,
         inspectList:state.homePage.inspectList,
+        inspectVal:state.inspect.inspectVal
     }
 }
 

+ 3 - 2
src/store/actions/assistCheck.js

@@ -1,8 +1,9 @@
 import {GET_ASSIST_SEARCH_LIST,GET_ASSIST_LABEL,DEL_ASSIST_LABEL,CHANGE_ASSIST_VAL,CHANGE_DATE,CLEAR_ASSIST_DATA,ADD_ASSIST_LABEL} from '../types/assistCheck';
 
-export const searchList = (list) => ({         //获取搜索数据
+export const searchList = (list,val) => ({         //获取搜索数据
     type:GET_ASSIST_SEARCH_LIST,
-    list
+    list,
+    val
 })
 export const assistLable = (id,idx,sign) => ({         //添加数据
     type:GET_ASSIST_LABEL,

+ 36 - 25
src/store/actions/currentIll.js

@@ -145,7 +145,8 @@ export const setData = (state,action) =>{
   }
   
   if (useEmpty) {
-    res.data = res.emptyData&&res.emptyData.length>0?JSON.parse(JSON.stringify(res.emptyData)):moduleData;
+    const data = res.emptyData?JSON.parse(JSON.stringify(res.emptyData)):[];
+    res.data = fullfillText(data).newArr;
   } else {
     if(mainData&&mainData.length>0){//主诉使用模板
       // 目前只需要将第一个主诉病程移植到现病史
@@ -261,18 +262,21 @@ export const setData = (state,action) =>{
       }
       
       let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
-      let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr)));   //过来连续标点
-      //组装好的主症状和伴随症状插入现病史模板(flag=4前)
-      let insertIdx = null;
-      current.map((item,i)=>{
-        if(item.flag&& item.flag==4){
-          insertIdx = i;
+      let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr)));   //过滤连续标点
+      //组装好的主症状和伴随症状插入现病史模板(flag=4前)--现病史是否有模板
+      if(moduleData&&moduleData.length>0){
+        let insertIdx = null;
+        for(let j=0; j<current.length; j++){
+          if(current[j].flag && current[j].flag==4){
+            insertIdx = j;  
+          }
         }
-      })
-   
-      for(let k=0; k<newSymptomArr.length; k++){
-        let pos = insertIdx+k;
-        current.splice(pos,0,newSymptomArr[k]);
+        for(let k=0; k<newSymptomArr.length; k++){
+          let pos = insertIdx+k;
+          current.splice(pos,0,newSymptomArr[k]);
+        }
+      }else{//现病史没有模板
+        current = newSymptomArr;
       }
       let currentData = JSON.parse(JSON.stringify(current));
       res.data = fullfillText(currentData).newArr;
@@ -307,16 +311,19 @@ export const setData = (state,action) =>{
         }
         //组装好的主症状和伴随症状插入现病史模板(flag=4前)
         let endFeatureData = JSON.parse(JSON.stringify(featureData));
-        let insertIdx = null;
-        for(let j=0; j<current.length; j++){
+        if(moduleData&&moduleData.length>0){
+          let insertIdx = null;
+          for(let j=0; j<current.length; j++){
             if(current[j].flag && current[j].flag==4){
               insertIdx = j;  
             }
           }
-     
-        for(let k=0; k<endFeatureData.length; k++){
-          let pos = insertIdx+k;
-          current.splice(pos,0,endFeatureData[k]);
+          for(let k=0; k<endFeatureData.length; k++){
+            let pos = insertIdx+k;
+            current.splice(pos,0,endFeatureData[k]);
+          }
+        }else{//现病史没有模板
+          current = endFeatureData;
         }
         let currentData = JSON.parse(JSON.stringify(current));
         res.data = fullfillText(currentData).newArr;
@@ -338,7 +345,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;console.log(111,action)
+  const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
@@ -594,7 +601,10 @@ export const changeLabelVal = (state,action)=>{
           localStorage.setItem('radio'+item.id,JSON.stringify([li]));
         }
         //取消原选中状态
-        item.questionDetailList.find((it)=>it.selected==true).selected=false;
+        const seld = item.questionDetailList.find((it)=>it.selected==true);
+        if(seld){
+          seld.selected=false;
+        }
       }
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
@@ -603,7 +613,8 @@ export const changeLabelVal = (state,action)=>{
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
-    res.saveText = fullfillText(res.data).saveText;
+    res.saveText.splice(index,num);
+    // res.saveText = fullfillText(res.data).saveText;
   } 
   res.update = Math.random();
   return res;
@@ -634,7 +645,8 @@ export const changeNumLabelVal = (state,action)=>{
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
-    res.saveText = fullfillText(res.data).saveText;
+    res.saveText.splice(index,num);
+    // res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
   return res;
@@ -729,7 +741,7 @@ export function insertLabelData(state,action){
     let resData = JSON.parse(JSON.stringify(res.data));
     resData.splice(focusIndex,1,text,...(FilteredDotMapping2));
     res.data = fullfillText(resData).newArr;
-    res.saveText[focusIndex] = searchData;
+    res.saveText = fullfillText(res.data).saveText;
   }else{
     let resData;
     const searchStr = res.searchStr;
@@ -898,7 +910,6 @@ export function removeId(state,action){
     data[index].name = text;
     data[index].value = text;
   }
-  //console.log(345,action,res);
   res.update = Math.random();
   return res;
 }
@@ -907,7 +918,7 @@ export function removeId(state,action){
 export function multipleComfirn(state,action){
   let res = Object.assign({},state);
   const {ikey,seleData,fullIkey} = action.data;
-  let data = res.data;//console.log(action,data[ikey])
+  let data = res.data;
   let index = fullIkey.substr(fullIkey.length-1,1);
   if(data[ikey].tagType==3){    //在组合项中
     let item = data[ikey].questionMapping;

+ 3 - 2
src/store/actions/inspect.js

@@ -1,8 +1,9 @@
 import {ADD_LABEL,SEARCH_LIST,SET_LABEL,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL,CLEAR_ALL_LABEL,DEL_PART_ITEM,DEL_EXCEL_LIST} from '../types/inspect';
 
-export const searchList = (list) => ({         //初始化数据
+export const searchList = (list,val) => ({         //初始化数据
     type:SEARCH_LIST,
-    list
+    list,
+    val
 })
 
 export const setLabel = (idx,sign) => ({          //搜索后点击选中的结果

+ 2 - 2
src/store/async-actions/assistCheck.js

@@ -7,7 +7,7 @@ import { SET_TIPS } from '../types/pushMessage';
 export const getSearchList = (val) => {
     if(val.trim() == ''){
         const data = [];
-        return (dispatch) => dispatch(searchList(data));
+        return (dispatch) => dispatch(searchList(data,''));
     }
     let baseList = store.getState();
     let sex = baseList.patInfo.message.patientSex;
@@ -20,7 +20,7 @@ export const getSearchList = (val) => {
         })
         .then((res)=>{
             const data = res.data.data;
-            dispatch(searchList(data));
+            dispatch(searchList(data,val.trim()));
         })
     }
 };

+ 7 - 6
src/store/async-actions/fetchModules.js

@@ -154,11 +154,11 @@ export function getInitData(){
     json(api.getBigPush,param).then((res)=>{
       if(+res.data.code === 0){
         const data = res.data.data&&res.data.data.vital;
-        //const str = JSON.stringify(data);
-        //const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
+        const str = JSON.stringify(data);
+        const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
         dispatch({
           type:SET,
-          data:[...data],
+          data:arr,
           isEmpty:false
         });
       }else{
@@ -179,13 +179,14 @@ export function setOtherHisModule(){
   return (dispatch, getStore) => {
     const state = getStore();
     const initData = state.homePage.initData;
+    const block = Object.assign(JSON.parse(config.textLabel),{full:true});
     const mode = state.typeConfig.typeConfig;
-    const model = JSON.parse(JSON.stringify(initData.otherHisModel || null));     //查体模板
+    const model = JSON.parse(JSON.stringify(initData.otherHisModel || null))||[block];     //查体模板
     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 onlyOneText = arr && arr.length == 1 && arr[0].tagType == 8 && !arr[0].value;    //是否只有一个自由文本标签
     const listObj = isHis && (mode == 1 || (!onlyOneText && mode == 0)) ? {
       newArr: arr,
       saveText: arrSave || []
@@ -258,7 +259,7 @@ export function getIndexData(range){
       diseaseId:21773,
       startTime:range[0],
       endTime:range[1],
-      patientId:1001,//patInfo.message.patientId,
+      patientId:patInfo.message.patientId,
     };
     return json(api.getIndexData,param);
   }

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

@@ -20,7 +20,7 @@ function modulesParseJson(data){
   let json = {},obj={},saveTextJson={},moduleName={};
   data.map((it)=>{
     moduleName[config.moduleCP[it.type]] = it.name;//添加病情变化/病程变化子模板需要使用模板名称
-    obj = fullfillText(it.moduleDetailDTOList);
+    obj = it.type==4?fullfillText(it.moduleDetailDTOList,false,false,false):fullfillText(it.moduleDetailDTOList);
     json[config.moduleCP[it.type]] = formatContinueDots(obj.newArr);
     saveTextJson[config.moduleCP[it.type]] = obj.saveText;
   });

+ 2 - 2
src/store/async-actions/inspect.js

@@ -7,7 +7,7 @@ import { SET_TIPS } from '../types/pushMessage';
 export const getSearchList = (val) => {
     if(val.trim() == ''){
         const data = [];
-        return (dispatch) => dispatch(searchList(data));
+        return (dispatch) => dispatch(searchList(data,''));
     }
     let baseList = store.getState();
     let sex = baseList.patInfo.message.patientSex;
@@ -20,7 +20,7 @@ export const getSearchList = (val) => {
         })
         .then((res)=>{
             const data = res.data.data;
-            dispatch(searchList(data));
+            dispatch(searchList(data,val.trim()));
         })
     }
 };

+ 13 - 5
src/store/async-actions/print.js

@@ -14,12 +14,13 @@ export const saveMessage = (bool) => {
     let baseList = store.getState();
     let state = baseList.patInfo.message;
     let whichSign = baseList.typeConfig.typeConfig;
+    const pushMessage = baseList.pushMessage;
     let jsonStr = getAllDataStringList(baseList);
     let jsonData = getAllDataList(baseList);
     const lisData = baseList.inspect.pushItem;
     const lisArr = transferIndexData(lisData);
     const evaluation={
-      htmlContent:JSON.stringify(getEvaluations(baseList.assessResult)),
+      htmlContent:JSON.stringify(getEvaluations(baseList.assessResult,pushMessage)),
       //scaleList:[]
     };//getEvaluation();
     //console.log(baseList)
@@ -118,7 +119,7 @@ function transferIndexData(data) {
    data.map((it)=>{
        if(it.uniqueName&&it.value!=''){
            arr.push({
-             creatTime:it.time,
+             creatTime:it.time+':00',
              indexUnique:it.uniqueName,
              indexUnit:it.units,
              indexValue:it.value,
@@ -129,14 +130,21 @@ function transferIndexData(data) {
    return arr;
 }
 
-function getEvaluations(base){
+function getEvaluations(base,pushMessage){
+    let obj = [];
+    Object.keys(base.wholeIndexs).map((i)=>{
+      obj[i]=pushMessage.chronicPushItems[i];
+    });
     return {
       data:base.data,
       chooseSelecteds:base.chooseSelecteds,
       indexTimeTypes:base.indexTimeTypes,
-      wholeAssess:base.wholeAssess,
+      wholeAssess:obj,
       wholeAssessText:base.wholeAssessText,
-      wholeIndexs:base.wholeIndexs
+      wholeIndexs:base.wholeIndexs,
+      scaleInfo:pushMessage.scaleInfo,
+      scaleResult:pushMessage.formulaResult,
+      wholeResults:base.wholeResults
     };
 }
 

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

@@ -157,7 +157,7 @@ export const getTableList = (id)=>{
 }
 
 // 量表明细
-export const getScaleInfo = (it)=>{console.log('参数:',it)
+export const getScaleInfo = (it)=>{
     return (dispatch,getState)=>{
         const emrData = getEMRParams();
           const params = {

+ 3 - 0
src/store/reducers/assessResult.js

@@ -47,6 +47,9 @@ export default (state=init,action)=>{
       res.indexTimeTypes[index] = rangeType;
       res.update = Math.random();   //对象更新
       return res;
+    case 'SAVE_POSSIBLE_RESULT':
+      res.wholeResults = action.wholeResults||{};
+      return res;
     case SET_SAVE_ASSESS_DATA:
       res.wholeIndexs = action.wholeAssessItems||{};
       res.wholeResults = action.wholeResults||{};

+ 2 - 0
src/store/reducers/assistCheck.js

@@ -12,6 +12,7 @@ const initSearchList = {
     list: [], //点击的结果
     assistLabel: [], //搜索的结果
     dataString:'',      //结果拼接
+    assistVal:''
 }
 function getCurrentDate() {
     let myDate = new Date();
@@ -44,6 +45,7 @@ export default (state = initSearchList, action) => {
     if (action.type == GET_ASSIST_SEARCH_LIST) {    //右侧推送添加到左侧
         const newState = Object.assign({}, state);
         newState.list = action.list
+        newState.assistVal = action.val
         return newState;
     }
     if (action.type == GET_ASSIST_LABEL) {             //默认

+ 4 - 1
src/store/reducers/inspect.js

@@ -26,12 +26,14 @@ const initSearchList = {
     getExcelDataList: [], //导入的数据
     pushItem:[],    //推送的数据
     pushItems:[],    //右侧模板预览的数据
+    inspectVal:''
 }
 
 export default (state = initSearchList, action) => {
     if (action.type == SEARCH_LIST) {
         const newState = Object.assign({}, state);
         newState.list = action.list
+        newState.inspectVal = action.val
         return newState;
     }
     if (action.type == SET_LABEL) {             //选中的结果    
@@ -353,4 +355,5 @@ function getPushLists(data1,data2){     //推送数据
     })
     totalTmpArr = tmpArr1.concat(tmpArr2);
     return totalTmpArr;
-}
+}
+

+ 1 - 1
src/utils/tools.js

@@ -880,7 +880,7 @@ function inspectAndAssist(){
     if (tmpInspect[i].controlType == 0) {
       tmpDetail = tmpInspect[i].questionMapping
     }else if(tmpInspect[i].controlType == 1 || tmpInspect[i].controlType == 6){
-      tmpDetail.push(tmpInspect[i])
+      tmpDetail = new Array(tmpInspect[i])
     }
     tmpObj.questionId = tmpInspect[i].id
     tmpObj.name = tmpInspect[i].name