Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev/new1' into optimize

# Conflicts:
#	src/common/components/MiniToast/index.jsx
#	src/common/components/index.js
#	src/common/less/variables.less
#	src/components/Advice/index.jsx
#	src/components/AssessResult/AssessHis/index.jsx
#	src/components/AssessResult/AssessHis/index.less
#	src/components/AssessResult/ScaleItem/index.jsx
#	src/components/AssessResult/index.jsx
#	src/components/AssessResult/index.less
#	src/components/ChronicInfo/index.jsx
#	src/components/ChronicInfo/index.less
#	src/components/DiagnosticList/index.jsx
#	src/components/DiagnosticList/index.less
#	src/components/NumberDrop/index.jsx
#	src/components/PreviewBody/index.jsx
#	src/components/ScaleTable/index.jsx
#	src/components/Treat/AdverseReactions/index.less
#	src/components/Treat/DrugTreat/index.less
#	src/components/TreatDesc/index.less
#	src/containers/AdviceContainer.js
#	src/containers/AssessResult.js
#	src/containers/CheckBody.js
#	src/containers/ChronicInfo.js
#	src/containers/DiagnosticList.js
#	src/containers/MainSuit.js
#	src/store/actions/checkBody.js
#	src/store/async-actions/fetchModules.js
#	src/store/async-actions/treat.js
#	src/store/reducers/assessResult.js
#	src/utils/tools.js
zhouna 6 anni fa
parent
commit
2f5996f0d6
69 ha cambiato i file con 1200 aggiunte e 686 eliminazioni
  1. 2 2
      src/common/components/ConfirmModal/index.less
  2. 44 0
      src/common/components/DelToast/index.jsx
  3. 51 0
      src/common/components/DelToast/index.less
  4. 9 2
      src/common/components/InlineTag/index.jsx
  5. 4 3
      src/common/components/MiniToast/index.jsx
  6. 2 1
      src/common/components/MiniToast/index.less
  7. 18 17
      src/common/components/NumberPan/index.jsx
  8. 5 0
      src/common/components/SearchOption/index.jsx
  9. 2 2
      src/common/components/SearchOption/index.less
  10. 7 0
      src/common/components/index.js
  11. BIN
      src/common/images/del_hor.png
  12. BIN
      src/common/images/del_nor.png
  13. BIN
      src/common/images/info-move.png
  14. BIN
      src/common/images/info-show.png
  15. 2 0
      src/common/less/variables.less
  16. 36 14
      src/components/AddAssistCheck/index.jsx
  17. 22 3
      src/components/AddAssistCheck/index.less
  18. 35 3
      src/components/AddInspect/SlideSelect/index.jsx
  19. 16 7
      src/components/AddInspect/SlideSelect/index.less
  20. 22 34
      src/components/AddInspect/index.jsx
  21. 16 5
      src/components/AddInspect/index.less
  22. 1 1
      src/components/Advice/index.jsx
  23. 19 17
      src/components/AssessResult/AssessHis/index.jsx
  24. 43 0
      src/components/AssessResult/AssessHis/index.less
  25. 82 83
      src/components/AssessResult/ScaleItem/index.jsx
  26. 43 28
      src/components/AssessResult/index.jsx
  27. 7 1
      src/components/AssessResult/index.less
  28. 2 1
      src/components/AssistCheck/index.jsx
  29. 171 187
      src/components/ChronicInfo/index.jsx
  30. 23 4
      src/components/ChronicInfo/index.less
  31. 52 52
      src/components/DiagResultSearch/index.jsx
  32. 48 45
      src/components/Diagnosis/index.jsx
  33. 102 24
      src/components/DiagnosticList/index.jsx
  34. 39 1
      src/components/DiagnosticList/index.less
  35. 2 1
      src/components/Inspect/index.jsx
  36. 31 1
      src/components/MultSpread/index.jsx
  37. 40 36
      src/components/NumberDrop/index.jsx
  38. 0 2
      src/components/RadioInpDrop/index.jsx
  39. 8 13
      src/components/ScaleTable/index.jsx
  40. 13 2
      src/components/SpreadDrop/index.jsx
  41. 2 1
      src/components/Treat/AdverseReactions/index.less
  42. 3 3
      src/components/Treat/DrugHistory/LastDrug/index.jsx
  43. 4 2
      src/components/Treat/DrugHistory/LastDrug/index.less
  44. 1 0
      src/components/Treat/DrugTreat/index.less
  45. 1 0
      src/components/TreatDesc/index.less
  46. 1 1
      src/containers/AdviceContainer.js
  47. 28 16
      src/containers/AssessResult.js
  48. 1 0
      src/containers/AssistCheck.js
  49. 2 2
      src/containers/CheckBody.js
  50. 15 8
      src/containers/ChronicInfo.js
  51. 1 0
      src/containers/Diagnosis.js
  52. 5 2
      src/containers/DiagnosticList.js
  53. 1 1
      src/containers/EditableSpan.js
  54. 1 0
      src/containers/Inspect.js
  55. 3 1
      src/containers/MainSuit.js
  56. 1 1
      src/containers/NumberDrop.js
  57. 1 1
      src/containers/NumberUnitDrop.js
  58. 1 1
      src/containers/RadioDrop.js
  59. 1 1
      src/containers/RadioInpDrop.js
  60. 2 1
      src/containers/SpreadDrop.js
  61. 8 0
      src/store/actions/checkBody.js
  62. 3 0
      src/store/actions/pushMessage.js
  63. 38 20
      src/store/async-actions/fetchModules.js
  64. 27 12
      src/store/async-actions/pushMessage.js
  65. 9 5
      src/store/async-actions/treat.js
  66. 10 6
      src/store/reducers/assessResult.js
  67. 6 3
      src/store/reducers/checkBody.js
  68. 3 5
      src/store/reducers/pushMessage.js
  69. 2 1
      src/store/types/checkBody.js

+ 2 - 2
src/common/components/ConfirmModal/index.less

@@ -7,7 +7,7 @@
     border-radius: 5px;
     background: #fff;
     overflow: hidden;
-    z-index: 9999;
+    z-index: 1999;
 }
 
 .modal-title {
@@ -83,5 +83,5 @@
     opacity: .6;
     filter:alpha(opacity=60);
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
-    z-index: 9998;
+    z-index: 1998;
 }

+ 44 - 0
src/common/components/DelToast/index.jsx

@@ -0,0 +1,44 @@
+import React from 'react';
+import style from './index.less';
+/**
+* 化验辅检删除弹窗 @Liucf 2019-5-22
+* 接收参数:
+* show:展示组件
+* name:删除项的名称
+* confirm:删除事件处理函数
+* cancel:取消事件处理函数
+*/
+
+class DelToast extends React.PureComponent{
+  constructor(props){
+    super(props);
+    this.handleDel = this.handleDel.bind(this);
+    this.handleCancel = this.handleCancel.bind(this);
+  }
+  handleDel(){
+    const {confirm} = this.props;
+    confirm&&confirm();
+  }
+  handleCancel(){
+    const {cancel} = this.props;
+    cancel&&cancel();
+  }
+  render(){
+    const {show,name} = this.props;
+    if(show){
+      return <div className={style['del-box']} id="delBox">
+        <div className={style['del-con']}>
+          <div className={style['del-tri']}></div>
+          <div className={style['del-title']}>删除 {name} ?</div>
+          <div className={style['del-foot']}>
+            <span className={`${style['del-btn']} ${style['del-del']}`} onClick={this.handleDel}>删除</span>
+            <span className={`${style['del-btn']} ${style['del-cancel']}`} onClick={this.handleCancel}>取消</span>
+          </div>
+        </div>
+      </div>
+    }
+    return ''
+  }
+}
+
+export default DelToast;

+ 51 - 0
src/common/components/DelToast/index.less

@@ -0,0 +1,51 @@
+// @import "~@less/mixin.less";
+.del-box{
+  position: absolute;
+  width: 206px;
+  height: 106px;
+  box-shadow: 2px 2px 5px rgba(0,0,0,.4);
+  background: #fff;
+  z-index: 66;
+  text-align: center;
+  padding: 20px;
+  right: -30px;
+  top: 40px;
+}
+.del-con{
+  position: relative;
+  .del-tri{
+    width: 0; 
+    height: 0;
+    border-width: 10px;
+    border-style: solid;
+    border-color: transparent transparent #fff transparent;
+    position: absolute;
+    top: -40px;
+    right: 10px;
+  }
+  .del-title{
+    margin-bottom: 19px;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
+  }
+  .del-foot{
+    .del-btn{
+      display: inline-block;
+      width: 63px;
+      height: 26px;
+      line-height: 26px;
+      text-align: center;
+      cursor: pointer;
+    }
+    .del-del{
+      color: #fff;
+      background: #EC3E3E;
+      margin: 0 20px 0 10px;
+    }
+    .del-cancel{
+      color:#000;
+      background: #E5E5E5;
+    }
+  }
+}

+ 9 - 2
src/common/components/InlineTag/index.jsx

@@ -32,6 +32,11 @@ class InlineTag extends Component {
   }
   changeToEdit(e){
     const {handledbClick,id} = this.props;
+    // 输入框有值才可以双击编辑
+    const text = this.$span.current.innerText;
+    if(!text.trim()){
+      return
+    }
     this.setState({
       editable:true
     });
@@ -64,6 +69,7 @@ class InlineTag extends Component {
    // e.target.innerText = text;  
   }
   handleBlur(e){         //鼠标离开是保存值到store中
+    e.stopPropagation(); //不阻止会触发外层div的失焦事件
     const {value} = this.state;
     const {handleInput,ikey,prefix,suffix} = this.props;
     this.$span.current.innerText?(this.$span.current.innerText=''):(this.$span.current.innerHTML='');      //修改生成文字变成输入的2倍bug
@@ -118,12 +124,13 @@ class InlineTag extends Component {
   }
   render(){
     const {placeholder,value,prefix,suffix} = this.props;
+    const {editable} = this.state;
     const inp = this.state.value;
     return <div className={this.getStyle()}
                  onDoubleClick={this.changeToEdit}
-                  onClick={this.handleFixClick}
+                  onClick={!editable?this.handleFixClick:''}
                  onkeydown={handleEnter}
-                 onBlur={this.changeToClick} ref={this.$box} contentEditable={this.state.editable}>
+                 onBlur={this.changeToClick} ref={this.$box} contentEditable={editable}>
                 {prefix}
                 <span className={style['free-in']}
                       contentEditable={true}

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

@@ -9,13 +9,14 @@ import closeIcon from "../../images/close-icon.png";
 * children:弹窗内容
 * show:弹窗显示
 * footer:是否显示底部“确定”按钮,默认不显示
+* confirmText:确认按钮文字
 * close:关闭弹窗事件
 * confirm:确定事件
 * 使用时,父元素需要加相对定位position: relative;
 **/
 class MiniToast extends React.PureComponent{
   render(){
-    const {show,title,icon,children,footer,close,confirm} = this.props;
+    const {show,title,icon,children,footer,close,confirm,confirmText} = this.props;
     if(show){
       return <div className={style["infoBox"]}>
               <p className={style["infoTitle"]}>
@@ -25,11 +26,11 @@ class MiniToast extends React.PureComponent{
               </p>
               <div className={style["infoCon"]}>{children}</div>
               {footer?<div className={style["infoFoot"]}>
-                        <span onClick={confirm}>确定</span>
+                        <span onClick={confirm}>{confirmText?confirmText:'确定'}</span>
                       </div>:''}
             </div>
     }
-    return ''  
+    return ''
   }
 }
 

+ 2 - 1
src/common/components/MiniToast/index.less

@@ -5,7 +5,8 @@
   background: #fff;
   z-index: 40;
   border: 1px solid #EAEDF1;
-  box-shadow: 0 5px 10px 0 rgba(0,0,0,0.10);
+  /*box-shadow: 0 5px 10px 0 rgba(0,0,0,0.10);*/
+  box-shadow: 0 10px 20px 0 #989DA3;
   .infoTitle{
     height: 40px;
     line-height: 40px;

+ 18 - 17
src/common/components/NumberPan/index.jsx

@@ -9,6 +9,7 @@ class NumberPan extends Component{
     this.state = {
       value:''
     }
+    this.handleSelect = this.handleSelect.bind(this);
   }
   handleSelect(e){
     e.stopPropagation();
@@ -57,7 +58,7 @@ class NumberPan extends Component{
     }
   }
   render(){
-    const select = this.handleSelect.bind(this); 
+    const select = this.handleSelect;
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(
        <div className={style['panBox']} 
@@ -66,28 +67,28 @@ class NumberPan extends Component{
                 onDoubleClick={(e)=>e.stopPropagation()}>
       <table className={style['pan']} >
         <tr>
-          <td><button onClick={select}>1</button></td>
-          <td><button onClick={select}>2</button></td>
-          <td><button onClick={select}>3</button></td>
-          <td><button onClick={select}>/</button></td>
+          <td><button onMouseUp={select}>1</button></td>
+          <td><button onMouseUp={select}>2</button></td>
+          <td><button onMouseUp={select}>3</button></td>
+          <td><button onMouseUp={select}>/</button></td>
         </tr>
         <tr>
-          <td><button onClick={select}>4</button></td>
-          <td><button onClick={select}>5</button></td>
-          <td><button onClick={select}>6</button></td>
-          <td><button onClick={this.handleBack.bind(this)}><img src={backspace} onClick={this.handleBack.bind(this)} /></button></td>
+          <td><button onMouseUp={select}>4</button></td>
+          <td><button onMouseUp={select}>5</button></td>
+          <td><button onMouseUp={select}>6</button></td>
+          <td><button onMouseUp={this.handleBack.bind(this)}><img src={backspace} onClick={this.handleBack.bind(this)} /></button></td>
         </tr>
         <tr>
-          <td><button onClick={select}>7</button></td>
-          <td><button onClick={select}>8</button></td>
-          <td><button onClick={select}>9</button></td>
-          <td><button onClick={this.handleClear.bind(this)} className={style['clearN']}>清空</button></td>
+          <td><button onMouseUp={select}>7</button></td>
+          <td><button onMouseUp={select}>8</button></td>
+          <td><button onMouseUp={select}>9</button></td>
+          <td><button onMouseUp={this.handleClear.bind(this)} className={style['clearN']}>清空</button></td>
         </tr>
         <tr>
-          <td><button onClick={select}>.</button></td>
-          <td><button onClick={select}>0</button></td>
-          <td><button onClick={select}>~</button></td>
-          <td><button onClick={this.handleClose.bind(this)} className={style['confirm']}>确定</button></td>
+          <td><button onMouseUp={select}>.</button></td>
+          <td><button onMouseUp={select}>0</button></td>
+          <td><button onMouseUp={select}>~</button></td>
+          <td><button onMouseUp={this.handleClose.bind(this)} className={style['confirm']}>确定</button></td>
         </tr>
       </table>
       </div>

+ 5 - 0
src/common/components/SearchOption/index.jsx

@@ -4,6 +4,7 @@ import clear from './imgs/clear.png';
 import search from './imgs/search.png';
 import PropTypes from "prop-types";
 import config from '@config/index';
+import $ from 'jquery';
 /**
  * 前提条件父元素有定位
  * visible  搜索显示隐藏
@@ -39,6 +40,10 @@ class SearchOption extends React.Component {
     componentDidMount(){
       this.props.handleChangeValue('');
       this.textInput.current.focus();
+      const {windowHeight,pageTop,height} = this.props;
+      if(windowHeight - pageTop < height){
+        $("#searchOption")[0].scrollIntoView(false);
+      }
     }
     handleClearVal(){
         const { handleChangeValue } = this.props;

+ 2 - 2
src/common/components/SearchOption/index.less

@@ -5,10 +5,10 @@
     padding: 8px;
     box-sizing: border-box;
     position: absolute;
-    top: 40px;
+    top: 30px;
     z-index: 99;
     background-color: #fff;
-    margin-bottom: 80px;
+    // margin-bottom: 80px;
     .llStyle;
     .autoList {
         // max-height: 225px;

+ 7 - 0
src/common/components/index.js

@@ -10,17 +10,20 @@ import ItemBox from './ItemBox';
 import Tab from './Tab';
 import DropList from './DropList';
 import NumberPan from './NumberPan';
+import SlideSide from './SlideSide';
 import ConfirmModal from './ConfirmModal';
 import Calendar from "./Calendar";
 import SearchOption from "./SearchOption";
 import InspectCommon from "./InspectCommon";
 import Notify from "./Notify";
+import MixCheckBox from "./MixCheckBox";
 import EditableSpan from "./EditableSpan";
 import Textarea from "./Textarea";
 import NumberUnitPan from "./NumberUnitPan";
 import Add from "./Add";
 import ComplexModal from "./ComplexModal";
 import MiniToast from "./MiniToast";
+import DelToast from "./DelToast";
 import TailInlineTag from "./TailInlineTag";
 import Footer from "./Footer";
 
@@ -37,17 +40,21 @@ module.exports = {
     Tab,
     DropList,
     NumberPan,
+    SlideSide,
     ConfirmModal,
     Calendar,
     SearchOption,
     InspectCommon,
     Notify,
+    MixCheckBox,
     EditableSpan,
     Textarea,
     NumberUnitPan,
     Add,
     ComplexModal,
     MiniToast,
+    DelToast,
+    MiniToast,
     TailInlineTag,
     Footer
 };

BIN
src/common/images/del_hor.png


BIN
src/common/images/del_nor.png


BIN
src/common/images/info-move.png


BIN
src/common/images/info-show.png


+ 2 - 0
src/common/less/variables.less

@@ -45,6 +45,8 @@
 @dropdwon-height:200px;
 @selected-bg:#fff;
 @import-color:#ffad5f;
+@closeIcon:url(../images/del_nor.png);
+@closeHor:url(../images/del_hor.png);
 
 /*********推送内容容器宽度*************/
 @push-width: 450px;

+ 36 - 14
src/components/AddAssistCheck/index.jsx

@@ -1,8 +1,9 @@
 import React from 'react';
-import { SearchOption, Calendar, ConfirmModal, Notify, Add } from '@commonComp';
+import { SearchOption, Calendar, ConfirmModal, Notify, Add ,DelToast} from '@commonComp';
 import styles from './index.less';
 import $ from 'jquery';
 import Textarea from './Textarea';
+import { getPageCoordinate } from '@utils/tools';
 import close from './img/close.png';
 
 class AddAssistCheck extends React.Component {
@@ -14,7 +15,9 @@ class AddAssistCheck extends React.Component {
       dateTime: "",
       active: '',
       visible: false,
-      id: null
+      pageTop:'',
+      id: null,
+      activeName:''
     }
     this.handleShowDate = this.handleShowDate.bind(this)
     this.getCurrentDate = this.getCurrentDate.bind(this)
@@ -25,10 +28,11 @@ class AddAssistCheck extends React.Component {
     this.handleCancel = this.handleCancel.bind(this)
   }
 
-  handleDelClick(id) {
+  handleDelClick(id,item) {
     this.setState({
       visible: true,
-      id: id
+      id: id,
+      activeName:item.name
     })
   }
 
@@ -39,7 +43,8 @@ class AddAssistCheck extends React.Component {
     handlePush && handlePush();           //右侧推送
     this.setState({
       visible: false,
-      id: null
+      id: null,
+      activeName:''
     })
     Notify.success("删除成功");
   }
@@ -47,7 +52,8 @@ class AddAssistCheck extends React.Component {
   handleCancel() {
     this.setState({
       visible: false,
-      id: null
+      id: null,
+      activeName:''
     })
   }
 
@@ -55,18 +61,28 @@ class AddAssistCheck extends React.Component {
     $(document).click((event) => {
       let _con = $('#searchWrapAssist');   // 设置目标区域
       let _cons = $('#datePick');   // 设置目标区域
+      let _del = $('#delBox')[0];   // 删除弹窗
+      let _close = $('#assiClose')[0];   // 删除icon
+      // console.log(111,event.target,_del,_close)
       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
         this.setState({ date: false });
       }
+      if(event.target != _close && event.target != _del && event.target.parentNode != _del){
+          this.setState({
+            visible: false,
+            id: null,
+            activeName:''
+          })
+      }
     });
     this.getCurrentDate();
   }
   handleSearchShow(e) {
     let tmpShow = this.state.show;
-    this.setState({ show: !tmpShow })
+    this.setState({ show: !tmpShow,pageTop:getPageCoordinate(e).boxTop })
     // e.stopPropagation();
   }
   handleShowDate(idx) {
@@ -124,10 +140,11 @@ class AddAssistCheck extends React.Component {
   }
   getAssistLabel() {
     const { assistLabel, handleChangeAssistValue, handleChangeDate, isRead, handlePush, winWidth,getInfomation } = this.props;
+    const { visible,activeName,id } = this.state;
     return <ul className={styles.labelWrap} id="datePick">
       {
         assistLabel.map((item, idx) => {
-          return (<li key={item.id} className={styles.assistLists}>
+          return (<li key={item.questionId} className={styles.assistLists}>
             <span className={styles.assistName} style={{ width: winWidth < 1200 ? '120px' : 'auto' }}>
               <span className={styles.tagSpan}>
                 {item.name}:
@@ -140,25 +157,30 @@ class AddAssistCheck extends React.Component {
             <div className={styles.pointerFinger}>
               <p onClick={() => this.handleShowDate(idx)}>报告日期:<span>{item.time || this.state.dateTime}</span></p>
               <i onClick={() => this.handleShowDate(idx)}></i>
-              <a href="javascript:void(0);" onClick={() => { this.handleDelClick(idx) }}><img src={close} alt="" /></a>
+              {/*<a href="javascript:void(0);" onClick={() => { this.handleDelClick(idx,item) }}><img src={close} alt="" /></a>*/}
+              <span className={styles.closeIcon} id="assiClose" onClick={() => { this.handleDelClick(idx,item) }}></span>
               <div style={{ display: this.state.date && idx == this.state.active ? "block" : "none", position: "relative" }}>
                 <Calendar isShow={true} handleChange={(info) => { handleChangeDate(info, idx); this.setState({ date: false }) }}></Calendar>
               </div>
             </div>
+          <DelToast show={idx==id?visible:false}
+                    name={activeName} 
+                    cancel={this.handleCancel}
+                    confirm={this.delConfirm}/>
           </li>)
         })
       }
     </ul>
   }
   render() {
-    const { handleChangeValue, list,assistVal } = this.props;
-    const { visible } = this.state;
+    const { handleChangeValue, list,assistVal,windowHeight } = this.props;
+    const { visible,pageTop } = this.state;
     return (
       <div className={styles.wrapper}>
         {this.getAssistLabel()}
         <div id="searchWrapAssist" style={{ position: "relative", clear: 'both' }}>
           <Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck" />
-          {this.state.show ? <SearchOption handleChangeValue={handleChangeValue} visible={true}>
+          {this.state.show ? <SearchOption windowHeight={windowHeight} pageTop={pageTop} height={280} handleChangeValue={handleChangeValue} visible={true}>
             {list && list.length>0?this.getSearchList(list):(assistVal == ''?'':<p style={{padding:'5px 30px',color:'#bfbfbf'}}>暂无筛选项</p>)}
             {
               list && list.length>0 || (assistVal != '')?'':<div>
@@ -170,7 +192,7 @@ class AddAssistCheck extends React.Component {
             }
           </SearchOption> : ''}
         </div>
-        <ConfirmModal
+        {/*<ConfirmModal
           visible={visible}
           confirm={this.delConfirm}
           close={this.handleCancel}
@@ -182,7 +204,7 @@ class AddAssistCheck extends React.Component {
           oKBg={'#3B9ED0'}
         >
           <p className={styles['center']}>是否删除该辅检项?</p>
-        </ConfirmModal>
+        </ConfirmModal>*/}
       </div>
     )
   }

+ 22 - 3
src/components/AddAssistCheck/index.less

@@ -1,5 +1,4 @@
 @import "~@less/variables.less";
-
 .staticTag {
     cursor: pointer;
     color: @blue;
@@ -38,6 +37,7 @@
         box-sizing: border-box;
         position: relative;
         clear: both;
+        border-radius: 4px;
         .pointerFinger {
             width: 222px;
             position: absolute;
@@ -50,7 +50,7 @@
                 cursor: pointer;
                 background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAAH6ji2bAAAABGdBTUEAALGPC/xhBQAAANtJREFUOBHFU90RwiAMDj3H8FV3KQ4AxwAO5QQwgbvoY90DQ+/gUpogXj3bF/L75ctXANj7c85pY0zMPKy1U7bLmQqG4hFjwPIL8UEp9aI+UOxFotcRZ3MALEmu8I+xWoGk2VpiQqhoWneSmoXZvfWehaubsVgBoGxdxb93EekhdbVyKjWh5iNSvcUYjxJIK57WxN5rCOE+13E/scWCy2WMzLC81haTTzlkOONtf6I4KTM8SFPTWqjLicujZk/v/ZnLdV9ZrpmLiQwlBhwIjWVAjStOG6+NpsA/s99BMkpktdAgdAAAAABJRU5ErkJggg==') no-repeat;
             }
-            a {
+            /* a {
                 img {
                   width: 13px;
                   height: 13px;
@@ -58,9 +58,21 @@
                   cursor: pointer;
                   display: inline-block;
                   position: absolute;
-                  right: -4px;
+                  // right: -4px;
+                  right: 3px;
                   top: 2px;
                 }
+            } */
+            .closeIcon{
+              display: inline-block;
+              width: 15px;
+              height: 15px;
+              cursor: pointer;
+              position: absolute;
+              right: 3px;
+              top: 2px;
+              background: @closeIcon;
+              background-size: 100% 100%;
             }
             p{
                 display: inline-block;
@@ -85,6 +97,13 @@
           width: 100%;
         }
     }
+    .assistLists:hover{
+      background:#F2F2F2;
+      .closeIcon{
+        background: @closeHor;
+        background-size: 100% 100%;
+      }
+    }
 }
 .center {
     text-align: center;

+ 35 - 3
src/components/AddInspect/SlideSelect/index.jsx

@@ -1,7 +1,7 @@
 import React, { Component } from "react";
 import styles from "./index.less";
 import { normalVal,timestampToTime } from '@utils/tools';
-import { InspectCommon, Calendar} from '@commonComp';
+import { InspectCommon, Calendar,DelToast} from '@commonComp';
 import slideUp from "@common/images/slide-up.png";
 import slideDown from "@common/images/slide-down.png";
 import date1 from '../img/date1.png';
@@ -12,9 +12,14 @@ class SlideSelect extends Component {
     super(props);
     this.state = {
       show:false,
+      activeInd:false,
+      activeName:''
     };
     this.toTime = this.toTime.bind(this)
     this.handleSlide = this.handleSlide.bind(this)
+    this.handleDel = this.handleDel.bind(this)
+    this.handleCancel = this.handleCancel.bind(this)
+    this.delConfirm = this.delConfirm.bind(this)
   }
   toTime(time){
     let tmpTim = time.split(',').join('')-0
@@ -34,9 +39,31 @@ class SlideSelect extends Component {
       show:!tmpShow
     })
   }
+  handleDel(){
+    const {handleDelClick,idx,item} = this.props;
+    this.setState({
+      activeInd:true,
+      activeName:item.name
+    })
+    handleDelClick&&handleDelClick(1,idx);
+  }
+  handleCancel(){
+    this.setState({
+      activeInd:false,
+      activeName:''
+    })
+  }
+  delConfirm(){
+    const {handleDelConfirm} = this.props;
+    handleDelConfirm&&handleDelConfirm();
+    this.setState({
+      activeInd:false,
+      activeName:''
+    })
+  }
   render() {
     const {getInfomation,handleConfirm,changeActivePart,handleDelClick,getItemList,date,item,idx,handleFillShow,showDetails,handleLabelSub,showFill,changeShowFill,handlePush,dateTime,currentIdx,currentData,fillActive,handleShowDate,handleChangeDate} = this.props;
-    const {show} = this.state;
+    const {show,activeInd,activeName} = this.state;
     let numPlus = 0,numPlus1 = 0;
     return (
       <li key={item.questionId} className={styles.slideLi}> 
@@ -153,7 +180,12 @@ class SlideSelect extends Component {
                 : null
             }
         </div>
-        <img className={styles.partDel} src={close} alt="删除项" onClick={()=>{handleDelClick(1,idx)}}/>
+        {/*<img className={styles.partDel} src={close} alt="删除项" onClick={()=>{handleDelClick(1,idx)}}/>*/}
+        <span className={styles.partDel} onClick={this.handleDel}></span>
+        <DelToast show={activeInd?true:false}
+                    name={activeName} 
+                    cancel={this.handleCancel}
+                    confirm={this.delConfirm}/>
     </li>
     );
   }

+ 16 - 7
src/components/AddInspect/SlideSelect/index.less

@@ -3,8 +3,7 @@
     // cursor: pointer;
     color: #767676;
     position: relative;
-    padding-top: 10px;
-    padding-bottom: 10px;
+    padding: 10px 10px 10px 0;
     border-bottom:1px dashed #989DA3;
     i {
         font-style: normal;
@@ -26,17 +25,27 @@
         vertical-align: top;
     } 
     .partDel {
-        width: 13px;
-        height: 13px;
+        width: 15px;
+        height: 15px;
         margin-bottom: 11px;
         cursor: pointer;
         display: inline-block;
         position: absolute;
-        right: 0;
-        top: 12px;
-        background-color: #fff;
+        right: 3px;
+        top: 13px;
+        // background-color: #fff;
+        background: @closeIcon;
+        background-size: 100% 100%;
     }
 }
+.slideLi:hover{
+    background:#F2F2F2;
+    border-radius: 4px;
+       .partDel{
+        background: @closeHor;
+        background-size: 100% 100%;
+      } 
+}
 .staticTagActive {
     cursor: pointer;
     color: #333;

+ 22 - 34
src/components/AddInspect/index.jsx

@@ -1,8 +1,8 @@
 import React from 'react';
-import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
+import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add,DelToast} from '@commonComp';
 import SlideExcel from './SlideExcel';
 import SlideSelect from './SlideSelect';
-import { deepClone } from '@utils/tools';
+import { deepClone,getPageCoordinate } from '@utils/tools';
 import styles from './index.less';
 import date1 from './img/date1.png';
 import close from './img/close.png';
@@ -22,11 +22,11 @@ class Inspect extends React.Component {
       currentData: {},
       numPlus: 0,     //判断是否所有的填写单都是空
       num: 0,            //暂存数据,获取一次,不能每次都是新的数据
-      toastText: '',
-      visible: false,
       type: null,
       id: null,
-      tmpIds: [],      //内层外层
+      pageTop:'',
+      // tmpIds: [],      //内层外层
+      importFlag:false   //导入数据删除标识
     }
     this.handleChangeDate = this.handleChangeDate.bind(this)
     this.handleShowDate = this.handleShowDate.bind(this)
@@ -52,9 +52,9 @@ class Inspect extends React.Component {
       handleCloseExcel(id)
     }
     this.setState({
-      visible: false,
       type: null,
       id: null,
+      importFlag:false
     })
     Notify.success("删除成功");
     handlePush && handlePush();       //右侧推送
@@ -62,24 +62,19 @@ class Inspect extends React.Component {
   handleDelClick(type, idx) {
     this.setState({
       type: type,
-      id: idx,
-      visible: true
+      id: idx
     })
-    if (type == 1) {//单项
+    if (type == 2){
       this.setState({
-        toastText: '是否删除该化验项?'
-      })
-    } else if (type == 2) {//导入项
-      this.setState({
-        toastText: '是否删除导入项?'
+        importFlag: true
       })
     }
   }
   handleCancel() {
     this.setState({
-      visible: false,
       type: null,
       id: null,
+      importFlag:false
     })
   }
   componentDidMount() {
@@ -114,7 +109,7 @@ class Inspect extends React.Component {
   }
   handleSearchShow(e) {
     let tmpShow = this.state.show;
-    this.setState({ show: !tmpShow })
+    this.setState({ show: !tmpShow,pageTop:getPageCoordinate(e).boxTop })
     // e.stopPropagation();
   }
   handleFillShow(e, idx) {
@@ -284,18 +279,23 @@ class Inspect extends React.Component {
     }
   }
   render() {
-    const { getInfomation,handleChangeValue,inspectVal, list, labelList, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
-    const { toastText, visible, tmpId, tmpIdx } = this.state;
+    const { getInfomation,handleChangeValue,inspectVal, list, labelList,windowHeight, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
+    const { tmpId, tmpIdx,id ,importFlag,pageTop} = this.state;
 
     return (
       <div className={styles.wrapper}>
         <div className={styles.check}>
           {
-            getExcelDataList.length > 0 && getExcelDataList.map((items, id) => {
+            getExcelDataList.length > 0 && getExcelDataList.map((items, ind) => {
               return <div style={{ marginTop: '10px' }}>
                 {
                   items && items.lisExcelRes.length > 0 ? <ul className={styles.excelDataLists}>
-                    <img className={styles.close} src={close} alt="关闭导入excel数据" onClick={() => { this.handleDelClick(2, id) }} />
+                    {/*<img className={styles.close} src={close} alt="关闭导入excel数据" onClick={() => { this.handleDelClick(2, id) }} />*/}
+                    <span className={styles.close} onClick={() => { this.handleDelClick(2, ind) }}></span>
+                    <DelToast show={id==ind && importFlag?true:false}
+                    name="该导入项" 
+                    cancel={this.handleCancel}
+                    confirm={this.delConfirm}/>
                     {
                       items.lisExcelRes.map((item, idx) => {
                         return <SlideExcel
@@ -334,6 +334,7 @@ class Inspect extends React.Component {
                   getItemList={this.getItemList}
                   changeActivePart={this.changeActivePart}
                   handleDelClick={this.handleDelClick}
+                  handleDelConfirm={this.delConfirm}
                   handleConfirm={handleConfirm}
                   getInfomation={getInfomation}
                 ></SlideSelect>
@@ -343,7 +344,7 @@ class Inspect extends React.Component {
         </div>
         <div style={{ position: "relative", clear: "both" }}>
           <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap" />
-          {this.state.show ? <SearchOption handleChangeValue={handleChangeValue} visible={true}>
+          {this.state.show ? <SearchOption windowHeight={windowHeight} height={280} pageTop={pageTop} handleChangeValue={handleChangeValue} visible={true}>
             {list && list.length>0?this.getSearchList(list):(inspectVal == ''?'':<p style={{padding:'5px 30px',color:'#bfbfbf'}}>暂无筛选项</p>)}
             {
               list && list.length>0 || (inspectVal != '')?'':<div>
@@ -355,19 +356,6 @@ class Inspect extends React.Component {
             }
           </SearchOption> : ''}
         </div>
-        <ConfirmModal
-          visible={visible}
-          confirm={this.delConfirm}
-          close={this.handleCancel}
-          cancel={this.handleCancel}
-          okText="删除"
-          cancelText='取消'
-          okBorderColor={'#3B9ED0'}
-          okColor={'#fff'}
-          oKBg={'#3B9ED0'}
-        >
-          <p className={styles['center']}>{toastText}</p>
-        </ConfirmModal>
       </div>
     )
   }

+ 16 - 5
src/components/AddInspect/index.less

@@ -174,14 +174,17 @@
     background-color: rgba(237,237,237,0.4);
     border: 1px solid #ccc;
     .close {
-        width: 13px;
-        height: 13px;
+        display: inline-block;
+        width: 15px;
+        height: 15px;
         position: absolute;
-        top: -5px;
-        right: -5px;
+        top: -10px;
+        right: -6px;
         z-index: 30;
-        background-color: #fff;
         border-radius: 50%;
+        background: @closeIcon;
+        background-size: 100% 100%;
+        background-color: #fff;
     }
     .excelDataLis {
         padding: 2px 0px;
@@ -211,6 +214,14 @@
         }
     }
 }
+.excelDataLists:hover{
+    .close{
+        background: @closeHor;
+        background-size: 100% 100%;
+        background-color: #fff;
+        cursor: pointer;
+    }   
+}
 .center {
     text-align: center;
     font-size: 16px;

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

@@ -93,7 +93,7 @@ class Advice extends Component{
             {/* {advice.commontreatment && <div className={style['treat-input']}  onInput={this.handleComTreatInput}  contentEditable={true} style = {{outline: 'none'}}></div>} */}
             {<Textarea value={advice.commontreatment} isRead={isRead} handleChangeAssistValue={this.handleComTreatInput} ></Textarea>}
         </div>}
-        {!isFirstMainDiag && followUp &&<div><FollowUp  noHeader="true" textStyle={{padding: '0 10px'}}  setFollowUp={saveFollowUp} followUp = {followUp} isRead={isRead}></FollowUp></div>}
+        {!isFirstMainDiag && hasFollowUp &&<div><FollowUp  noHeader="true" textStyle={{padding: '0 10px'}}  setFollowUp={saveFollowUp} followUp = {followUp} isRead={isRead}></FollowUp></div>}
         {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={style['scheme']}>
           {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}
           {scheme}

+ 19 - 17
src/components/AssessResult/AssessHis/index.jsx

@@ -42,7 +42,7 @@ class AssessResultHis extends Component {
       this.props.getAssessHis(this.props.inquiryId);
     }
   }
-  handoutTypes(obj,item,i){
+  handoutTypes(obj,item,i,id){
     const {wholeAssess,wholeIndexs,chooseSelecteds,scaleResult,wholeResults,wholeAssessText,calcuResult,calcuValues,scaleItems} =obj;
     const {getIndexData,inquiryDate,indexData,timeTypes,indexNames} = this.props;
     const {chartTimeTypes} = this.state;
@@ -61,8 +61,7 @@ class AssessResultHis extends Component {
                           scaleItems={scaleItems}
                           result={wholeResults}
                           disabled={true}
-                          text={wholeAssessText}
-                          isRecommend={item.isRecommend}></ScaleItem>;
+                          text={wholeAssessText[id]}></ScaleItem>;
       case 1:     //数据来源于大数据
         return <ChooseItem title={name} data={list} selecteds={chooseSelecteds&&chooseSelecteds[i]} disabled={true}></ChooseItem>;
       case 10:    //数据来源于后台
@@ -78,25 +77,28 @@ class AssessResultHis extends Component {
         return '';
     }
   }
-  getAssessContent(){
+  getMultAssess(){
     const { list,inquiryId } = this.props;
     const obj = list&&list[inquiryId];
-    const data = obj&&obj.data;
+    const items = obj&&obj.data;
+    let arr = [];
+    for(let name in items){
+      arr.push(<div className={style['dis-item']}><p>{name}:</p>{this.getAssessContent(items[name],obj,name)}</div>)
+    }
+    return arr;
+  }
+  getAssessContent(data,obj,name){
     if(data&&data.length>0){
       return data.map((it,i)=>{
-        return this.handoutTypes(obj,it,i);
+        return this.handoutTypes(obj,it,i,name);
       });
     }else{
       return data===null||(data&&data.length==0)?<p className={style['no-data']}>没有历史评估记录!</p>:'';
     }
   }
-  showScaleFn(item,pid){
+  showScaleFn(item){
     const { list,inquiryId } = this.props;
     const obj = list&&list[inquiryId];
-    if(item&&item.id&&!(obj.scaleInfo&&obj.scaleInfo[item.id])){
-      Notify.info("未保存该量表数据");
-      return ;
-    }
     if(item){
       this.setState({
         tableName:item.name,
@@ -127,21 +129,21 @@ class AssessResultHis extends Component {
     }
   }
   render() {
-    const { loading,isChronic, list,inquiryId } = this.props;
+    const { loading, list,inquiryId } = this.props;
     const {tableName,tableId,showScale,showAssess} = this.state;
     const obj = list&&list[inquiryId];
     const scaleFooter = <Footer print={true}
-                        footText="关闭"
-                        handlePrint={this.onPrint}
-                        handleConfirm={this.showScaleFn}/>
+                                footText="关闭"
+                                handlePrint={this.onPrint}
+                                handleConfirm={this.showScaleFn}/>;
     return <div className={style['assess-cont']}>
       <div className={style['assess-result']}>
-        <p className={style['enter']}>{isChronic?'管理和评估':'推荐'}结果:{showAssess?<a onClick={this.showAssessFn}>收起结果<img src={arrowDown} /></a>:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a>}</p>
+        <p className={style['enter']}>管理和评估结果:{showAssess?<a onClick={this.showAssessFn}>收起结果<img src={arrowDown} /></a>:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a>}</p>
       </div>
       <div className={style['assess-box']} style={{display:showAssess?'block':'none'}}>
         {loading?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
         {/*以下必须做判断再执行getAssessContent,否则再次打开评估历史时图表显示有问题,因为提前渲染*/}
-        {showAssess?this.getAssessContent():''}
+        {showAssess?<div className='his-item'>{this.getMultAssess()}</div>:''}
       </div>
       {showScale?<ComplexModal onclose={this.showScaleFn} footer={scaleFooter}
                                           title={tableName}

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

@@ -31,3 +31,46 @@
     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;
+  }
+}
+.dis-item{
+  p{
+    padding-left: 15px;
+    line-height: 30px;
+    background: #e4e4e4;
+    font-weight: bold;
+  }
+}

+ 82 - 83
src/components/AssessResult/ScaleItem/index.jsx

@@ -27,8 +27,8 @@ class ScaleItem extends Component {
       radioVal:Object.assign({},radioVal)||{},
       formulaId:'',
       text:props.text,
-      formulaData:{},       //计算公式值
-      isFormulaConfirm:false,
+      isCalculated:false,
+      calcuValues:deepClone(props.calcuValues),   //计算公式填的值
     };
     this.getItems = this.getItems.bind(this);
     this.getDetailItems = this.getDetailItems.bind(this);
@@ -43,9 +43,13 @@ class ScaleItem extends Component {
     })
   }
   closeOption(){
+    const {result} = this.props;
+    const possible=result&&result.possible;
+    let {radioVal} = this.state;
     this.setState({
-      optionId:null
-    })
+      radioVal:Object.assign({},radioVal,possible),
+      optionId:null,
+    });
   }
   confirmOption(){
     const {handleRes} = this.props;
@@ -54,17 +58,14 @@ class ScaleItem extends Component {
       possible:Object.assign({},radioVal),
       radioVal:Object.assign({},radioVal),//不设置radioVal只有最近一次选中的值
     });
-    this.closeOption();
+    this.setState({
+      optionId:null,
+    });
   }
-  handleShowScale(item,parentId,pIndex){
-    const {showScaleFn,closeAssess,showListScale} = this.props;
-    closeAssess&&closeAssess();    //关闭评估弹窗
-    if(!parentId){                //显示量表
-      showListScale&&showListScale(item);
-    }else{
-      showScaleFn&&showScaleFn(item,parentId,pIndex);
-    }
-
+  handleShowScale(item){
+    const {showScaleFn,closeAssess} = this.props;
+    //closeAssess&&closeAssess();    //关闭评估弹窗
+    showScaleFn&&showScaleFn(item);
   }
   handleRadio(item,parent){
     let {result} = this.props;
@@ -73,58 +74,66 @@ class ScaleItem extends Component {
       radioVal:Object.assign({},radioVal,{[parent.id]:item.detailName})
     })
   }
-  handleForRadio(id,idd, ind){
-    const {formulaData} = this.state;
-    const {calcuValues} = this.props;
-    const obj = deepClone(formulaData);
-    const data = obj&&obj[id];
-    data.content = calcuValues&&calcuValues[id];
-    if (data) {
-      for(let z = 0; z <  data.content.details[idd].details.length; z++) {
-        data.content.details[idd].details[z].state = 0;
-      }
-      data.content.details[idd].details[ind].state = 1;
-    };
+  handleInputformula(id,calcuContent,i,e) {
+    const {calcuValues} = this.state;
+    let obj = deepClone(calcuValues);
+    let values = (obj&&obj[id])||deepClone(calcuContent);
+    values[i].value = e.target.value;
+    obj[id] = values;
     this.setState({
-      formulaData:obj
+      isCalculated:false,
+      calcuValues:obj
     });
   }
-  showFormula(id,it){
-    const {formulaData} = this.state;
-    const obj = deepClone(formulaData)||{};
-    if(!obj[id]){
-      obj[id] = it;
+  handleForRadio(id,calcuContent,i,fidx){//计算公式
+    const { calcuValues } = this.state;
+    let obj = deepClone(calcuValues);
+    let values = (obj&&obj[id])||deepClone(calcuContent);
+    let details = values[i].details;
+    for(let x=0;x<details.length;x++){
+      if(x!=fidx){
+        details[x].state=0;
+      }else{
+        details[x].state=1;
+      }
     }
+    obj[id] = values;
     this.setState({
-      formulaId:id,
-      formulaData:obj
+      isCalculated:false,
+      calcuValues:obj
     });
   }
-  confirmFormula(){//计算公式确定
+  showFormula(id){
     this.setState({
-      isFormulaConfirm:true,
-      formulaId:null
+      formulaId:id
     });
   }
   closeFormula(){
-    this.setState({
-      formulaId:null
-    })
+    if(this.state.isCalculated){
+      this.setState({
+        formulaId:null,
+      });
+    }else{
+      this.setState({
+        formulaId:null,
+        calcuValues:deepClone(this.props.calcuValues)
+      });
+    }
   }
-  calcuFormula() { //计算公式计算
+  calcuFormula(item) { //计算公式计算
     const { calcuResult,handleCalcu } = this.props;
-    const {formulaId,formulaData} = this.state;
-    let it=formulaData&&formulaData[formulaId];
+    const {formulaId,calcuValues} = this.state;
+    let it=calcuValues&&calcuValues[formulaId];
     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) {
+    for (let i = 0; i < it.length; i++) {
+      if(it[i].controlType == 2) {  //输入框类型的有没有填值
+        if(!it[i].value) {
           allHasInfo = false
         }
-      } else if(it.content.details[i].controlType == 0) {
+      } else if(it[i].controlType == 0) {
         let hasSelect = false;
-        for( let z = 0; z <it.content.details[i].details.length; z++) {
-          if(it.content.details[i].details[z].state == 1) {
+        for( let z = 0; z <it[i].details.length; z++) {
+          if(it[i].details[z].state == 1) {
             hasSelect= true
           }
         }
@@ -132,15 +141,18 @@ class ScaleItem extends Component {
           allHasInfo = false
         }
       }
-
     }
+    item.content.details = calcuValues[formulaId];
     if(allHasInfo) { //所有都有值,则计算
       let results = deepClone(calcuResult);
-      getFormulaResult({type:2,data:it}).then((res)=>{
+      getFormulaResult({type:2,data:item}).then((res)=>{
         if(+res.data.code==0){
           const result = res.data.data.result;
           results[formulaId] = result;
-          handleCalcu&&handleCalcu(results);
+          handleCalcu&&handleCalcu(calcuValues,results);
+          this.setState({
+            isCalculated:true
+          });
         }else{
           Notify.error(res.data.msg||'计算没有结果返回');
         }
@@ -149,49 +161,35 @@ class ScaleItem extends Component {
       Notify.info('请填写计算公式内容')
     }
   }
-  handleInputformula(id,idd,text) {
-    const {formulaData} = this.state;
-    const {calcuValues} = this.props;
-    const obj = deepClone(formulaData);
-    const data = obj&&obj[id];
-    data.content = calcuValues&&calcuValues[id];
-    if (data) {
-      data.content.details[idd].value = text;
-    }
-    this.setState({
-      formulaData:obj
-    });
-  }
   getDetailItems(item,i){
     let arr = [],temp='';
-    const {indexs,result,formulaResult,calcuValues,disabled,calcuResult} = this.props;
-    const {optionId,formulaId,radioVal,formulaData} = this.state;
+    const {indexs,result,formulaResult,disabled,calcuResult} = this.props;
+    const {optionId,formulaId,radioVal,calcuValues} = this.state;
     const possible=result&&result.possible;
 
     item.details.map((its,j)=>{
+      let it=its;
       if(indexs[i]&&indexs[i].includes(j)){
-        let it=null;
         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,i)}>
+                      onClick={()=>this.handleShowScale(it.content)}>
                         {scaleRes&&scaleRes.result?(' 【'+it.content.name+'】 结果:'+scaleRes.result.value+" "+(scaleRes.result.text||'')):'【'+it.content.name+'】'}
                         </span>;
         }else if(its.type==2){      //计算公式
-          it=formulaData[formulaId]||deepClone(its);
           const showRes = calcuResult&&calcuResult[item.id]||it.content.result;
-          const details = calcuValues&&calcuValues[item.id]&&calcuValues[item.id].details||it.content.details;
+          const details = calcuValues&&calcuValues[item.id]||it.content.details;
           const cresult = showRes&&showRes[1]&&showRes[1].text;
                     temp = <div className={style['results']}>
                     <span>计算公式结果:</span>
                     <span className={style["blue"]} onClick={this.showFormula.bind(this,item.id,it)}>{cresult?cresult:'请选择'}</span>
                     <img src={level1} />
                     <MiniToast title={it.content.name}
+                               confirmText='关闭'
                                icon={allTableIcon}
                                show={formulaId&&formulaId==item.id?true:false}
                                close={this.closeFormula}
-                               confirm={this.confirmFormula.bind(this,item,i)}
+                               confirm={this.closeFormula}
                                footer="true">
                       <table>
                         {details.map((item1,idd)=>{
@@ -206,7 +204,7 @@ class ScaleItem extends Component {
                                     <Radio label={ii.detailName}
                                            isSelect={ii.state == 1}
                                            disabled={disabled}
-                                           handleClick={this.handleForRadio.bind(this,item.id,idd, ind)}>
+                                           handleClick={this.handleForRadio.bind(this,item.id,details,idd,ind)}>
                                       >
                                     </Radio>
                                   </div>
@@ -219,7 +217,7 @@ class ScaleItem extends Component {
                                 <span>{'请输入'+item1.name+':'}</span>
                               </td>
                               <td>
-                                {disabled?item1.value:<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,details,idd,e)}/>}
                               </td>
                               <td>
                                 <span>{item1.uint}</span>
@@ -229,7 +227,7 @@ class ScaleItem extends Component {
                           }
                         })}
                       </table>
-                      {disabled?"":<div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this)}>计算</div>}
+                      {disabled?"":<div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,its)}>计算</div>}
                       <table>
                         {showRes && Array.isArray(showRes) &&showRes.map((itemResult) => {
                           return <tr>
@@ -245,7 +243,6 @@ class ScaleItem extends Component {
                     </MiniToast>
                 </div>
         }else if(its.type==3){
-          it=deepClone(its);
           temp = <div className={style['results']}>
                     <span>可能结果:</span>
                     <span onClick={this.showOption.bind(this,item.id)} className={style["blue"]}>{possible&&possible[item.id]?possible[item.id]:'请选择'}</span>
@@ -261,6 +258,7 @@ class ScaleItem extends Component {
                           {it.content.details&&it.content.details.map((lis,ind)=>{
                             return <div className={style["chooseItem"]}>
                               <Radio label={lis.detailName}
+                                     disabled={disabled}
                                      isSelect={radioVal&&radioVal[item.id]==lis.detailName}
                                      handleClick={this.handleRadio.bind(this,lis,item,i)}>
                               </Radio>
@@ -271,13 +269,14 @@ class ScaleItem extends Component {
                     </MiniToast>
                   </div>;
         }
+        const passId = item.details[j].type==1?item.details[j].content.id:undefined;
         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>
-          <div className={style["recommend"]} onClick={()=>this.props.handleRemove(false,i,j)}>
+          <div className={style["recommend"]} onClick={()=>this.props.handleRemove(false,i,passId,j)}>
             <img className={style["deleteIcon"]} src={deleteIcon} />
           </div>
         </li>;
@@ -307,7 +306,7 @@ class ScaleItem extends Component {
       </li>:<li>
         <span>相关量表:</span>
         <div className={style['row']}>{temp}</div>
-        <div className={style["recommend"]} onClick={()=>this.props.handleRemove(true,i)}>
+        <div className={style["recommend"]} onClick={()=>this.props.handleRemove(true,i,it.id)}>
           <img className={style["deleteIcon"]} src={deleteIcon} />
         </div>
       </li>;
@@ -330,9 +329,9 @@ class ScaleItem extends Component {
     }
   }
   render() {
-    const {title,handleInp,disabled,isRecommend} = this.props;
+    const {title,handleInp,disabled} = this.props;
     return <div className={style['assess-item']}>
-      {isRecommend?'':<h2>{title}</h2>}
+      <h2>{title}</h2>
       <div className={style['item-content']}>
         <ul>
           {
@@ -341,7 +340,7 @@ class ScaleItem extends Component {
           {
             this.getScales()
           }
-          {isRecommend?'':<li>
+          <li>
             <textarea className={style['edit-row']}
                       ref={this.$area}
                       type="text"
@@ -350,7 +349,7 @@ class ScaleItem extends Component {
                       onBlur={()=>handleInp(this.state.text)}
                       onInput={this.handleInput.bind(this)}>{this.state.text}</textarea>
             <div className={style['textareaStatic']}>评估描述:{this.state.text}</div>
-          </li>}
+          </li>
         </ul>
       </div>
     </div>;

+ 43 - 28
src/components/AssessResult/index.jsx

@@ -21,12 +21,14 @@ class AssessResult extends Component {
       chartTimeTypes:{},      //图表模块
       wholeAssessItems:wholeIndexs,     //整体评估模块
       wholeScaleItems:wholeScale,
-      wholeAssessText:props.wholeAssessText||'',     //整体评估补充说明
+      wholeAssessText:props.wholeAssessText||{},     //整体评估补充说明
       wholeResults:{
         possible:props.possible,
         radioVal:props.radioVal
       },
       calcuResult:props.calcuResult,     //计算公式结果
+      calcuValues:props.calcuValues,    //计算公式填的值
+      addedScaleIds:props.addedScaleIds,    //已加入量表的id
     };
     this.handleChooseChange = this.handleChooseChange.bind(this);
     this.handleScaleDel = this.handleScaleDel.bind(this);
@@ -34,30 +36,40 @@ class AssessResult extends Component {
     this.handleResult = this.handleResult.bind(this);
   }
   componentWillMount(){
+    const {disId,disName,getAssess} = this.props;
     //获取评估
-    this.props.getAssess(this.props.isRecommend);
+    getAssess&&getAssess(disId,disName);
   }
   handleScaleText(text){
+    const {disName} = this.props;
+    const obj = Object.assign({},this.state.wholeAssessText);
+    obj[disName] = text;
       this.setState({
-        wholeAssessText:text
+        wholeAssessText:obj
       })
   }
-  handleScaleDel(isList,i,j){
+  handleScaleDel(isList,i,id,j){
+    let ids = [...this.state.addedScaleIds||[]],idIndex='';
+    if(id){
+      idIndex = ids.findIndex((ii)=>id==ii);
+      ids.splice(idIndex,1);
+    }
     if(isList){         //删除全部量表中的项目
       const items = [...this.state.wholeScaleItems];
-      items.splice(i,1);
+      items[i]=null;
       this.setState({
-        wholeScaleItems: items
+        wholeScaleItems: items,
+        addedScaleIds:ids
       });
     }else{
       const items = Object.assign({},this.state.wholeAssessItems);
       const inx = items[i].findIndex(x=>x==j);
       items[i].splice(inx,1);
       this.setState({
-        wholeAssessItems: items
+        wholeAssessItems: items,
+        addedScaleIds:ids
       });
     }
-
   }
   handleResult(opt){
     const {wholeResults} = this.state.wholeResults;
@@ -78,35 +90,41 @@ class AssessResult extends Component {
       chartTimeTypes:Object.assign(chartTimeTypes,{[i]:selects})
     });
   }
-  handleCalcu(ret){
+  handleCalcu(values,ret){
     this.setState({
-      calcuResult:ret
+      calcuResult:ret,
+      calcuValues:values
     });
   }
   componentWillUnmount(){
     //点确定关闭弹窗时把参数传到父组件去
-    const {handleSave,isAssessConfirm,clearChartData,handleSaveCalcu,isRecommend,saveCalcuResult} = this.props;
+    const {saveAssessInfos,isAssessConfirm,clearChartData,handleSavePossible} = this.props;
     clearChartData&&clearChartData();
-    if(!isRecommend&&isAssessConfirm && readyKeepHistory() == 1){
+    if(isAssessConfirm && readyKeepHistory() == 1){
       Notify.error("主诉不能为空");
-    }else if(!isRecommend&&isAssessConfirm && readyKeepHistory() == 2){
+    }else if(isAssessConfirm && readyKeepHistory() == 2){
       Notify.info('诊断不能为空');
     }
-    handleSaveCalcu&&handleSaveCalcu(this.state.wholeResults);
+    handleSavePossible&&handleSavePossible(this.state.wholeResults);
     if(isAssessConfirm){
-      handleSave(this.state,readyKeepHistory(),isRecommend);
-    }else{
-      saveCalcuResult&&saveCalcuResult(this.state.calcuResult);
+      saveAssessInfos(this.state,readyKeepHistory());
+    }
+  }
+  componentWillReceiveProps(next){
+    if(JSON.stringify(next.addedScaleIds)!=JSON.stringify(this.props.addedScaleIds)){
+      this.setState({
+        addedScaleIds:[...next.addedScaleIds||[]]
+      })
     }
   }
   handoutTypes(item,i){
-    const {getIndexData,indexData,timeTypes,wholeIndexs,closeAssess,showScaleFn,isRecommend,chronicPushItems,
-      formulaResult,calcuValues,indexNames,showListScale} =this.props;
+    const {getIndexData,indexData,timeTypes,wholeIndexs,closeAssess,showScaleFn,chronicPushItems,
+      formulaResult,indexNames,disName} =this.props;
     let obj = [];
     Object.keys(wholeIndexs).map((i)=>{
       obj[i]=chronicPushItems[i];
     });
-    const {chooseSelecteds,wholeAssessItems,wholeScaleItems,wholeAssessText,chartTimeTypes,wholeResults,calcuResult} = this.state;
+    const {chooseSelecteds,wholeAssessItems,wholeScaleItems,wholeAssessText,chartTimeTypes,wholeResults,calcuResult,calcuValues} = this.state;
     const chartData = indexData;
     const name = item.regionName+":";
     const list = item.data&&item.data.rows;
@@ -118,16 +136,14 @@ class AssessResult extends Component {
                           handleInp={this.handleScaleText}
                           handleRes={this.handleResult}
                           handleCalcu={this.handleCalcu.bind(this)}
-                          text={wholeAssessText}
+                          text={wholeAssessText[disName]}
                           indexs={wholeAssessItems}
                           scaleItems ={wholeScaleItems}
                           result={wholeResults}
                           showScaleFn={showScaleFn}
-                          showListScale={showListScale}
                           calcuResult={calcuResult}
                           calcuValues={calcuValues}
                           formulaResult={formulaResult}
-                          isRecommend={isRecommend}
                           chronicPushItems={chronicPushItems}
                           closeAssess={closeAssess}></ScaleItem>;
       case 1:     //数据来源于大数据
@@ -148,15 +164,14 @@ class AssessResult extends Component {
     }
   }
   render() {
-    //const {data} =this.props;
-    let { isRecommend } = this.props;
-    const wholeItems = [{regionName: "整体评估",regionType: "0"}];
-    const data = isRecommend?wholeItems:this.props.data;
+    const {disName} =this.props;
+    const data = this.props.data&&this.props.data[disName];
     return <div className={style['assess-cont']} id="AssistResult">
       <div className={style['printShow']}>
         <Information></Information>
       </div>
-      {!(data&&data.length>0)?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
+      {!data?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
+      {data&&data.length==0?<p className={style['no-data']}>暂无数据!</p>:''}
       {data && data.map((it, i) => {
         return this.handoutTypes(it, i);
       })}

+ 7 - 1
src/components/AssessResult/index.less

@@ -186,7 +186,13 @@
     width: 40px;
   }
 }
-
+.no-data{
+  color: #a5a3a3;
+  text-align: center;
+  margin-top: 40px;
+  font-size: 18px;
+  font-weight: bold;
+}
 @media print {
   .printShow,.textareaStatic {
     display: block;

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

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

+ 171 - 187
src/components/ChronicInfo/index.jsx

@@ -3,8 +3,6 @@ import style from './index.less';
 import infoPic from "../../common/images/info-pic.png";
 import chronicPic from "../../common/images/chronic.png";
 import level1 from "../../common/images/级别1.png";
-import printIcon from '@common/images/team.png';
-import manageIcon from '@common/images/manage.png';
 import tableIcon from '@common/images/table.png';
 import allTableIcon from '@common/images/all-table.png';
 import add from '@common/images/add-result.png';
@@ -12,7 +10,10 @@ import added from '@common/images/first.png';
 import checkIcon from '@common/images/check.png';
 import {ComplexModal,ConfirmModal,MiniToast, Radio,CheckBtn,Footer,Notify} from '@commonComp';
 import AssessResult from '@containers/AssessResult';
+import infoShow from '@common/images/info-show.png';
+import infoMove from '@common/images/info-move.png';
 import ScaleTable from '@containers/ScaleTable';
+import Notify from '@commonComp/Notify';
 import {deepClone} from '@utils/tools';
 import $ from 'jquery';
 
@@ -28,20 +29,21 @@ class ChronicInfo extends React.Component{
   constructor(props){
     super(props);
     this.state = {
+      show:true,
+      showInfo:false,
+      showOption:false,
       showAssess:false,      //评估弹窗
       infoId:null,  //静态知识
       formulaId:null, //计算公式
       optionId:null,  //可能结果,
       isAssessConfirm:false,    //是否点击评估弹窗确定按钮
-      tableName:'' , //点击的量表名称
-      tableId:null ,//点击的量表id
-      parentId:null ,
-      parentIndex:null,
       radioVal:{},  //可能结果选择内容
       possible:{},  //可能结果
       formulaParam: {}, //量表计算公式计算入参
-      showRecommend:false,      //显示推荐结果弹窗
-      isRecommendConfirm:false,   //推荐结果确定
+      isCalculated:false,     //是否刚计算过,关闭时值与结果对应
+      calcuValues:deepClone(props.calcuValues),       //计算公式填的值
+      hasEnterImg: false, //是否移入info
+      currentIndex: -1 //当前index
     };
 
     this.showInfo = this.showInfo.bind(this);
@@ -50,15 +52,12 @@ class ChronicInfo extends React.Component{
     this.closeOption = this.closeOption.bind(this);
     this.showTable = this.showTable.bind(this);//显示量表弹窗
     this.closeTable = this.closeTable.bind(this);//关闭量表弹窗
-    this.showAssessFn = this.showAssessFn.bind(this); //开关评估弹窗
     this.close = this.close.bind(this); //关闭量表列表
     this.showFormula = this.showFormula.bind(this); //打开计算公式
-    this.closeFormula = this.closeFormula.bind(this); //关闭计算公式
+    //this.closeFormula = this.closeFormula.bind(this); //关闭计算公式
     this.handleAddAssessItem = this.handleAddAssessItem.bind(this);   //加入病例记录
-    this.handleSaveAssess = this.handleSaveAssess.bind(this);       //评估弹窗确定
-    this.onPrint = this.onPrint.bind(this); 
+    this.onPrint = this.onPrint.bind(this);
     this.handleForRadio = this.handleForRadio.bind(this);
-    this.showRecommendFn = this.showRecommendFn.bind(this);
     this.handleSaveCalcu = this.handleSaveCalcu.bind(this);     //保存评估修改的计算和可能结果
     this.getAddBtnState = this.getAddBtnState.bind(this);
   }
@@ -86,7 +85,7 @@ class ChronicInfo extends React.Component{
   }
   handleListClick(item){//量表列表单项点击
     this.showTable(item,null);
-    this.close();
+    //this.close()
   }
 
   showInfo(id){
@@ -122,10 +121,10 @@ class ChronicInfo extends React.Component{
         radioVal:Object.assign({},radioVal,possible),
         optionId:null,
       });
-    } 
+    }
   }
-  showTable(it,parentId,parentIndex){
-    const {formulaResult,scaleInfo} = this.props;
+  showTable(it){
+    const {scaleInfo} = this.props;
     // 密西根糖尿病周围神经病评分(MDNS), id:40744
     const item = {
       id:it.id,
@@ -133,103 +132,84 @@ class ChronicInfo extends React.Component{
     };
     // 判断:store里已经有该量表就无需重新调接口
     if(scaleInfo&&scaleInfo[it.id]){
-      this.props.hideList({name:'showTable',value:true});
+      this.props.hideList({name:'showTable',value:true},it);
     }else{
       this.props.getScaleInfo(item);
     }
 
     this.setState({
-      tableName:it.name,
-      tableId:it.id,
-      parentId:parentId,
-      parentIndex:parentIndex,
       formulaId:null, //关闭计算公式和可能结果弹窗
       optionId:null
     })
   }
   closeTable(){
-    this.setState({
-      tableName:'',
-      tableId:null,
-      parentId:null,
-    })
     this.props.hideList({name:'showTable',value:false});
   }
-  showAssessFn(){
-    this.setState({
-      showAssess:!this.state.showAssess,
-      isAssessConfirm:false
-    });
-  }
-  showRecommendFn(){
-    this.setState({
-      isRecommendConfirm:false,
-      showRecommend:!this.state.showRecommend,
-    });
-  }
   showFormula(id){//计算公式
     this.setState({
       formulaId:id,
       optionId:null  //关闭可能结果
     })
   }
-  closeFormula(){
+  closeFormula(it){
+    const {formulaId,isCalculated} =this.state;
+    if(!isCalculated){
+      //没有计算结果时,保存输入的值
+      const {calcuResult,calcuValues} = this.props;
+      const cres = calcuResult&&calcuResult[formulaId]||it.content.result;
+      const result = cres&&cres[1]&&cres[1].text;
+      if(result){
+        this.setState({
+          calcuValues:deepClone(calcuValues)
+        });
+      }
+    }
     this.setState({
-      formulaId:null
-    })
+      formulaId:null,
+    });
   }
   handleAddAssessItem(v,pIndex,i){
     const {addAssessItem} = this.props;
     addAssessItem(v,pIndex,i);
   }
-  handleSaveRecommend(){
-    this.setState({
-      isRecommendConfirm:true
-    });
-    const that=this;
-    setTimeout(()=>{
-      that.showRecommendFn();
-    });
+  handleReg(e){   //只能输入数字
+    const hasDot = e.target.value.indexOf('.')!=-1;
+    const key = e.key;
+    if(key!='Backspace'&&((/[^\d]/.test(key)&&key!='.')||(key=='.'&&(hasDot||!e.target.value)))){
+      e.preventDefault();
+    }
   }
-  handleSaveAssess(){
+  handleInputformula(id,calcuContent,i,e) {
+    const {calcuValues} = this.state;
+    let obj = deepClone(calcuValues);
+    let values = (obj&&obj[id])||deepClone(calcuContent);
+    const txt = e.target.value;
+    values[i].value = txt.replace(/[\u4e00-\u9fa5]|[^\d|.]/g,'');       //处理中文输入法的情况
+    obj[id] = values;
+    if(/[\u4e00-\u9fa5]|[^\d|.]/g.test(txt)){
+      e.target.value = txt.replace(/[\u4e00-\u9fa5]|[^\d|.]/g,'');
+    }
     this.setState({
-      isAssessConfirm:true
-    });
-    const that=this;
-    setTimeout(()=>{
-      that.showAssessFn();
+      isCalculated:false,
+      calcuValues:obj
     });
   }
-  handleInputformula(v,i, j,idd,  e) {
-    const { data, setChronicPush,calcuValues } = this.props;
-    let data1 = JSON.parse(JSON.stringify(data));
-    if(calcuValues&&calcuValues[data1[i].id]){
-      data1[i].details[j].content=calcuValues&&calcuValues[data1[i].id];
-    }
-    const text = e.target.value;
-    if (data1[i].details) {
-      data1[i].details[j].content.details[idd].value = text
-    }
-
-    setChronicPush(data1,data1[i].id,data1[i].details[j].content)
-  }
-  handleForRadio(ii,v,i, j,idd, ind){//计算公式
-    const { data, setChronicPush,calcuValues } = this.props;
-    const data1 = JSON.parse(JSON.stringify(data));
-    if(calcuValues&&calcuValues[data1[i].id]){
-      data1[i].details[j].content=calcuValues&&calcuValues[data1[i].id];
-    }
-    if (data1[i].details) {
-      for(let z = 0; z <  data1[i].details[j].content.details[idd].details.length; z++) {
-        data1[i].details[j].content.details[idd].details[z].state = 0
+  handleForRadio(id,calcuContent,i,fidx){//计算公式
+    const { calcuValues } = this.state;
+    let obj = deepClone(calcuValues);
+    let values = (obj&&obj[id])||deepClone(calcuContent);
+    let details = values[i].details;
+    for(let x=0;x<details.length;x++){
+      if(x!=fidx){
+        details[x].state=0;
+      }else{
+        details[x].state=1;
       }
-      data1[i].details[j].content.details[idd].details[ind].state = 1
     }
-    setChronicPush(data1,data1[i].id,data1[i].details[j].content);
-  }
-  confirmFormula(){//计算公式确定
+    obj[id] = values;
     this.setState({
-      formulaId:null
+      isCalculated:false,
+      calcuValues:obj
     });
   }
   handleRadio(item,parent){//可能结果
@@ -254,51 +234,55 @@ class ChronicInfo extends React.Component{
       radioVal:Object.assign({},obj.radioVal),//不设置radioVal只有最近一次选中的值
     })
   }
-  calcuFormula(item,j, v, i) { //计算公式计算
-    const { calcuFormula ,data,calcuValues} = this.props;
-    let pushObj = deepClone(data);
-    if(calcuValues&&calcuValues[pushObj[i].id]){
-      pushObj[i].details[j].content=calcuValues&&calcuValues[pushObj[i].id];
-    }
-    let it = pushObj[i].details[j];
+  calcuFormula(id,it) { //计算公式计算
+    const { calcuFormula } = this.props;
+    let item = deepClone(it);
+    const values = this.state.calcuValues;
+    const calcuValues = Object.keys(values).length&&values[id]?values[id]:item.content.details;
     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) {
-          allHasInfo = false
+    for (let i = 0; i < calcuValues.length; i++) {
+      if(calcuValues[i].controlType == 2) {  //输入框类型的有没有填值
+        if(!calcuValues[i].value) {
+          allHasInfo = false;
         }
-      } else if(it.content.details[i].controlType == 1) {
-        let hasSelect = false
-        for( let z = 0; z <it.content.details[i].details.length; z++) {
-          if(it.content.details[i].details[z].state == 1) {
-            hasSelect= true
+      } else if(calcuValues[i].controlType == 1) {
+        let hasSelect = false;
+        for( let z = 0; z <calcuValues[i].details.length; z++) {
+          if(calcuValues[i].details[z].state == 1) {
+            hasSelect= true;
           }
         }
         if(!hasSelect) {
-          allHasInfo = false
+          allHasInfo = false;
         }
       }
-
     }
+    item.content.details = calcuValues;
     if(allHasInfo) { //所有都有值,则计算
       let param = {
         type: 2,
-        data: it,
-        disId: v.id,
-        pIndex: j,
-        ppIndex: i
+        data: item,
+        disId: id
       };
-      calcuFormula({param,chronicPushItems:pushObj})
+      calcuFormula(param);
+      this.setState({
+        isCalculated:true
+      });
     } else {  //不是所有值都填过了
       Notify.info('请填写计算公式内容')
     }
   }
   getAddBtnState(flag,v,i,j){
-    const {indexs,wholeScaleItems,addScaleItems} = this.props;
-    let btn = '';
+    const {indexs,wholeScaleItems,addScaleItems,chronicMagItem,chronicDesease,addedScaleIds} = this.props;
+    let btn = '',reCheck=false;
+    let show = chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name;
+    if(!show){
+      return '';
+    }
     if(flag){     //有结果
       if(j!==undefined){
-        btn = indexs[i]&&indexs[i].includes(j)?<span className={style["add-record"]}>
+        reCheck = addedScaleIds.includes(v.details[j].content.id);      //列表中是否加入同一量表
+        btn = (indexs[i]&&indexs[i].includes(j))||reCheck?<span className={style["add-record"]}>
                    <img src={added} />
                    已加入
                  </span>:<span className={style["listResult"]} onClick={()=>this.handleAddAssessItem(v,i,j)}>
@@ -306,7 +290,8 @@ class ChronicInfo extends React.Component{
                    加入病历记录
                  </span>;
       }else{
-        btn = wholeScaleItems&&wholeScaleItems[i]?<span className={style["add-record"]}>
+        reCheck = addedScaleIds.includes(v.id);         //推送中是否加入同一量表
+        btn = (wholeScaleItems&&wholeScaleItems[i])||reCheck?<span className={style["add-record"]}>
                    <img src={added} />
                    已加入
                  </span>:<span className={style["listResult"]} onClick={()=>addScaleItems(v,i)}>
@@ -324,16 +309,57 @@ class ChronicInfo extends React.Component{
 
     return btn;
   }
+  handleMouseEnterDrug(index) {
+    this.setState({
+        currentIndex: index,
+    })
+  }
+  handleMouseLeaveDrug() {
+    this.setState({
+        currentIndex: -1,
+    })
+  }
+  handleMouseEnterImg() {
+    this.setState({
+      hasEnterImg: true
+    })
+  }
+  handleMouseLeaveImg() {
+    this.setState({
+      hasEnterImg: false
+    })
+  }
   getDetail(){
-    const {data,formulaResult,calcuResult,calcuValues} = this.props;
-    const {formulaId,optionId,possible,radioVal} = this.state;
+    const {data,formulaResult,calcuResult} = this.props;
+    const {formulaId,optionId,possible,radioVal,calcuValues,currentIndex,hasEnterImg} = this.state;
     let list = data&&data.map((v,i)=>{
                     return <div className={style["list"]}>
                       {v.name?<p>
-                                <span>{'患者可能有'+v.name}</span>
-                                <img src={infoPic} className={style["infoPic"]} onClick={this.showInfo.bind(this,v.id)}/>
+                                <span>患者可能有</span>
+                                <span
+                                  className={style['dis-name']}
+                                  onMouseEnter={this.handleMouseEnterDrug.bind(this, i)}
+                                  onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
+                                >
+                                  {v.name}
+                                  {<img className={style['info-img']}
+                                    style ={currentIndex === i  ? {display: "inline-block"} : {display: "none"}}
+                                    src={currentIndex === i ?(hasEnterImg ? infoMove : infoShow ): infoShow}
+                                    onMouseEnter={this.handleMouseEnterImg.bind(this)}
+                                    onMouseLeave = {this.handleMouseLeaveImg.bind(this)}
+                                    onClick={this.showInfo.bind(this,v.id)}/>}
+
+                                </span>
+                                {/* <img src={infoShow} className={style["infoPic"]} onClick={this.showInfo.bind(this,v.id)}/> */}
+
                               </p>:''}
+                      {/*<MiniToast title='静态知识'
+                                icon={allTableIcon}
+                                show={infoId&&infoId==v.id?true:false}
+                                close={this.closeInfo}>
+                          {pureText}
+                      </MiniToast>*/}
                       {v.details&&v.details.map((it,j)=>{
                         if(it.type==1){
                           return <p>
@@ -341,14 +367,19 @@ class ChronicInfo extends React.Component{
                                   <i onClick={this.showTable.bind(this,it.content,v.id,i)}>{'【'+it.content.name+'】'}</i>
                                   {formulaResult&&formulaResult[it.content.id]?<i>{'结果:'}{formulaResult[it.content.id].calcalculate&&formulaResult[it.content.id].calcalculate.result.value +' '+ formulaResult[it.content.id].calcalculate.result.text}</i>:''}
                                 </span>
-                                {
-                                  this.getAddBtnState(formulaResult&&formulaResult[it.content.id],v,i,j)
+                                {indexs[i]&&indexs[i].includes(j)?<span className={style["addResult"]}>
+                                  <img src={added} />
+                                  已加入
+                                </span>:<span className={style["listResult"]} onClick={()=>this.handleAddAssessItem(v,i,j)}>
+                                  <img src={add} />
+                                  加入病历记录
+                                </span>
                                 }
                               </p>
                         }else if(it.type==2){
                           const cres = calcuResult&&calcuResult[v.id]||it.content.result;
                           const result = cres&&cres[1]&&cres[1].text;
-                          const details = calcuValues&&calcuValues[v.id]&&calcuValues[v.id].details||it.content.details;
+                          const details = calcuValues&&calcuValues[v.id]||it.content.details;
                           return <div className={style["marTop"]}>
                             <span className={style["limit"]}>
                               计算公式结果:
@@ -360,9 +391,10 @@ class ChronicInfo extends React.Component{
                             }
                             {formulaId&&formulaId==v.id&&<MiniToast title={it.content.name}
                                 icon={allTableIcon}
+                                confirmText='关闭'
                                 show={formulaId&&formulaId==v.id?true:false}
-                                close={this.closeFormula}
-                                confirm={this.confirmFormula.bind(this,v,i)}
+                                close={this.closeFormula.bind(this,it)}
+                                confirm={this.closeFormula.bind(this,it)}
                                 footer="true">
                                 <table>
                                 {details.map((item,idd)=>{
@@ -376,7 +408,7 @@ class ChronicInfo extends React.Component{
                                             return <div className={style["chooseItem"]}>
                                                     <Radio label={ii.detailName}
                                                              isSelect={ii.state == 1}
-                                                             handleClick={this.handleForRadio.bind(this,ii,v,i, j,idd, ind)}>
+                                                             handleClick={this.handleForRadio.bind(this,v.id,details,idd,ind)}>
                                                       </Radio>
                                                   </div>
                                           })}
@@ -388,17 +420,17 @@ class ChronicInfo extends React.Component{
                                           <span>{'请输入'+item.name+':'}</span>
                                         </td>
                                         <td>
-                                          <input type="text" placeholder="请输入"  value={item.value} onInput={this.handleInputformula.bind(this,v,i, j,idd)}/>
+                                          <input type="text" placeholder="请输入"  value={item.value} onKeyDown={this.handleReg.bind(this)} onInput={this.handleInputformula.bind(this,v.id,details,idd)}/>
                                         </td>
                                         <td>
                                           <span>{item.uint}</span>
                                         </td>
-                                        
+
                                       </tr>
                                     }
                                 })}
                                 </table>
-                                <div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,it,j, v, i)}>计算</div>
+                                <div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,v.id,it)}>计算</div>
                                 <table>
                                   {cres && Array.isArray(cres) &&cres.map((itemResult, resultIndex) => {
                                     return <tr>
@@ -434,7 +466,7 @@ 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>
@@ -450,48 +482,30 @@ class ChronicInfo extends React.Component{
                   })
     return list;
   }
-
+  componentWillReceiveProps(next){
+    if(JSON.stringify(next.calcuValues)!=JSON.stringify(this.props.calcuValues)){
+      this.setState({
+        calcuValues:next.calcuValues
+      })
+    }
+  }
   render(){
-    const footer = <Footer print={true}
-                      footText="确定"
-                      handlePrint={this.onPrint}
-                      handleConfirm={this.handleSaveAssess} />
-    const recFooter = <Footer print={false}
-                      footText="确定"
-                      handleConfirm={this.handleSaveRecommend}/>
     const scaleFooter = <Footer print={true}
-                      footText="确定"
-                      handlePrint={this.onPrint}
-                      handleConfirm={this.closeTable}/>
-    const {chronicMagItem,tableList,saveAssessInfos,chronicDesease,formulaResult,showHide} = this.props;
-    const {showAssess,isAssessConfirm,tableName,tableId,parentId,parentIndex,isRecommendConfirm,showRecommend,radioVal,possible} = this.state;
-    return <div className={style["tips"]}>
-              <div className={style["tips-title"]}>
+                                footText="确定"
+                                handlePrint={this.onPrint}
+                                handleConfirm={this.closeTable}/>;
+    const {chronicMagItem,tableList,chronicDesease,formulaResult,showHide} = this.props;
+    return <div className={style["tips"]} style={{marginBottom:'15px'}}>
+              <div className={`${style["tips-title"]} ${style["chronic"]}`}>
                 <div className={style["tips-name"]}>
                   <img src={chronicPic} />
                   <h2>{chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name||'病情提示'}</h2>
                   <span className={style["redTips"]}>(页面信息有更新可能影响评估结果)</span>
                 </div>
                 <div className={style["tips-btn"]} style={{display:chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name?'block':'none'}}>
-                  <span
-                    className={style["tipsDetails"]}
-                    style={{width:'70px'}}
-                    onClick={this.showAssessFn}
-                  >
-                    管理和评估
-                  </span>
                   <span className={style["tipsDetails"]} onClick={() => this.showTableList(chronicDesease&&chronicDesease.id||chronicMagItem&&chronicMagItem.id)}>量表
                   </span>
                 </div>
-                <div className={style["tips-btn"]} style={{display:chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name?'none':'block'}}>
-                <span
-                  className={style["tipsDetails"]}
-                  style={{width:'70px'}}
-                  onClick={this.showRecommendFn}
-                >
-                    推荐结果
-                  </span>
-                </div>
               </div>
               <div className={style["content"]}> 
                   {this.getDetail()}
@@ -512,42 +526,12 @@ class ChronicInfo extends React.Component{
                       </ul>
               </ConfirmModal>
               {showHide&&showHide.showTable?<ComplexModal onclose={this.closeTable} footer={scaleFooter}
-                      title={tableName}
+                      title={showHide.name}
                       icon={tableIcon}
                       top={20}
                       bottom={20}
                       width={820}>
-                <ScaleTable tableId={tableId} parentId={parentId} parentIndex={parentIndex}></ScaleTable>
-              </ComplexModal>:''}
-              {showAssess?<ComplexModal onclose={this.showAssessFn} footer={footer}
-                      title='管理和评估'
-                      icon={manageIcon}
-                      top={'3%'}
-                      bottom={'3%'}
-                      width={820}>
-                <AssessResult handleSave={saveAssessInfos}
-                              handleSaveCalcu={this.handleSaveCalcu}
-                              closeAssess={this.showAssessFn}
-                              showScaleFn={this.showTable.bind(this)}
-                              showListScale={this.handleListClick.bind(this)}
-                              radioVal={radioVal}
-                              possible={possible}
-                              isAssessConfirm={isAssessConfirm}></AssessResult>
-              </ComplexModal>:''}
-              {showRecommend?<ComplexModal onclose={this.showRecommendFn} footer={recFooter}
-                                        title='推荐结果'
-                                        icon={manageIcon}
-                                        top={20}
-                                        bottom={20}
-                                        width={820}>
-                <AssessResult handleSave={saveAssessInfos}
-                              handleSaveCalcu={this.handleSaveCalcu}
-                              closeAssess={this.showRecommendFn}
-                              isRecommend={true}
-                              showScaleFn={this.showTable.bind(this)}
-                              radioVal={radioVal}
-                              possible={possible}
-                              isAssessConfirm={isRecommendConfirm}></AssessResult>
+                <ScaleTable title={showHide.name} tableId={showHide.id}></ScaleTable>
               </ComplexModal>:''}
       </div>
   }

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

@@ -111,10 +111,9 @@
     .toast-cont{
       line-height: 24px;
       font-size: 14px;
-      // margin-top: 15px;
-      height: 365px;
+      height: 370px;
       overflow-y: auto;
-      padding: 10px 0 0 10px;
+      padding: 10px;
       li{
         margin-top: 10px;
         cursor: pointer;
@@ -123,6 +122,14 @@
         color:#3B9ED0;
         margin-left: 10px;
       }
+      .scaleName{
+        display: inline-block;
+        max-width: 290px;
+      }
+      .listResult{
+        .add-record;
+        cursor: pointer;
+      }
     }
   .chooseItem{
     display: inline-block;
@@ -139,4 +146,16 @@
   }
   .recomand{
     color:#3B9ED0;
-  }
+  }
+  .dis-name {
+    position: relative;
+    cursor: pointer;
+  }
+  .info-img {
+    position: absolute;
+    width: 15px;
+    top: -14px;
+    left: 50%;
+    margin-left: -7px;
+    cursor: pointer;
+}

+ 52 - 52
src/components/DiagResultSearch/index.jsx

@@ -3,67 +3,67 @@ import style from './index.less';
 import close from './img/close.png'
 import search from './img/search.png'
 import DiagnosticItem from '@containers/DiagnosticItem'
-import { SearchOption} from '@commonComp';
+import { SearchOption } from '@commonComp';
 import config from '@config/index';
 import $ from 'jquery';
 class DiagResultSearch extends Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-           
-        };
-      
-        this.getSearchList =  this.getSearchList.bind(this)
+  constructor(props) {
+    super(props);
+    this.state = {
 
-    }
-    componentWillReceiveProps(nextProps){
-    }
-    componentDidMount () {
-        const that = this
-        $(document).click(function (e) {
-            var diagSearch=$('#diagSearch')[0];
-            var addDiag = $('#addDiag')[0];
-            var confirm = $('#confirm')[0];
-            if(diagSearch) {
-                if(confirm) {
-                    
-                } else {
-                    if (e.target!= diagSearch && e.target!= addDiag && e.target.parentNode!= addDiag && !$.contains(diagSearch, e.target) ) {
-                        that.props.hideSearch();
-                    }
+    };
 
+    this.getSearchList = this.getSearchList.bind(this)
+
+  }
+  componentWillReceiveProps(nextProps) {
+  }
+  componentDidMount() {
+    const that = this
+    $(document).click(function (e) {
+      var diagSearch = $('#diagSearch')[0];
+      var addDiag = $('#addDiag')[0];
+      var confirm = $('#confirm')[0];
+      if (diagSearch) {
+        if (confirm) {
+
+        } else {
+          if (e.target != diagSearch && e.target != addDiag && e.target.parentNode != addDiag && !$.contains(diagSearch, e.target)) {
+            that.props.hideSearch();
+          }
 
-                }
-                
-            }
-            
-        })
-    }
 
-    getSearchList(searchResult) {
-        return <div className={style['search-result']}>
-                    
-        {
-            searchResult && searchResult.map((item) => {
-                return(<div  key={item.id} className={style['search-result-item']}><DiagnosticItem title={true} item={item} clearInput={this.clearInput}/></div>)
-            })
         }
+
+      }
+
+    })
+  }
+
+  getSearchList(searchResult) {
+    return <div className={style['search-result']}>
+
+      {
+        searchResult && searchResult.map((item) => {
+          return (<div key={item.id} className={style['search-result-item']}><DiagnosticItem title={true} item={item} clearInput={this.clearInput} /></div>)
+        })
+      }
     </div>
-    }
-   
-    render(){
-        const  { show, searchResult, getSearchResult, handleChangeValue } = this.props
-       
-        return(
-            show&&<div id='diagSearch' className={style['search-box']}>
-                <SearchOption handleChangeValue={handleChangeValue} visible={true}>
-                    {this.getSearchList(searchResult)}
-                </SearchOption>
-            </div>
-        )
-       
-       
-    }
+  }
+
+  render() {
+    const { show, searchResult, getSearchResult, handleChangeValue,pageTop,windowHeight } = this.props
+
+    return (
+      show && <div id='diagSearch' className={style['search-box']}>
+        <SearchOption handleChangeValue={handleChangeValue} pageTop={pageTop} windowHeight={windowHeight} height={180} visible={true}>
+          {this.getSearchList(searchResult)}
+        </SearchOption>
+      </div>
+    )
+
+
+  }
 }
 
 export default DiagResultSearch;

+ 48 - 45
src/components/Diagnosis/index.jsx

@@ -1,60 +1,63 @@
 import React, { Component } from 'react';
 import style from './index.less';
-import {Button, ItemBox, ConfirmModal, Loading, Message,Add} from '@commonComp';
+import { Button, ItemBox, ConfirmModal, Loading, Message, Add } from '@commonComp';
 import DiagnosticList from '@containers/DiagnosticList.js';
 // import TreatDrug from '@containers/TreatDrug.js'
+import { getPageCoordinate } from '@utils/tools';
 import DiagResultSearch from '@containers/DiagResultSearch'
 import $ from 'jquery';
 
 class Diagnosis extends Component {
-    constructor(props) {
-        super(props);
-
-        this.state = {
-            diagType: 0,
-            showSearch: props.show,
-        }
-        this.showSearch = this.showSearch.bind(this);
-        this.hideSearch = this.hideSearch.bind(this);
-        this.handleshowSearch = this.handleshowSearch.bind(this);
-        
-    }
-    componentWillReceiveProps() {
-        this.setState({
-            showSearch: this.props.show
-        })
+  constructor(props) {
+    super(props);
+
+    this.state = {
+      diagType: 0,
+      showSearch: props.show,
+      pageTop: ''
     }
+    this.showSearch = this.showSearch.bind(this);
+    this.hideSearch = this.hideSearch.bind(this);
+    this.handleshowSearch = this.handleshowSearch.bind(this);
 
+  }
+  componentWillReceiveProps() {
+    this.setState({
+      showSearch: this.props.show
+    })
+  }
 
-    showSearch() {
-        const { showSearch } = this.props
-        showSearch && showSearch()
-    }
-    hideSearch() {
-        const { hideSearch } = this.props
-        hideSearch && hideSearch()
-    }
-    handleshowSearch() {
-        this.props.show ? this.hideSearch() : this.showSearch()
-    }
 
-    render() {
-        
-        
-        return (<div id="diagnosisResult">
-            <ItemBox  id="diagnosis" title='诊断'  boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
-                <DiagnosticList></DiagnosticList>
-                <div style={{marginLeft:'10px', position:'relative'}}>
-                    <Add showText="添加诊断结果" handleClick={this.handleshowSearch} id="addDiag" height="50px"/>
-                    <DiagResultSearch></DiagResultSearch>
-                </div>
-               
-                
-            </ItemBox>
-            {/* <TreatDrug></TreatDrug> */}
-            <Message></Message>
-        </div>)
-    }
+  showSearch() {
+    const { showSearch } = this.props
+    showSearch && showSearch()
+  }
+  hideSearch() {
+    const { hideSearch } = this.props
+    hideSearch && hideSearch()
+  }
+  handleshowSearch(e) {
+    this.props.show ? this.hideSearch() : this.showSearch()
+    this.setState({ pageTop:getPageCoordinate(e).boxTop })
+  }
+
+  render() {
+
+
+    return (<div id="diagnosisResult">
+      <ItemBox id="diagnosis" title='诊断' boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
+        <DiagnosticList></DiagnosticList>
+        <div style={{ marginLeft: '10px', position: 'relative' }}>
+          <Add showText="添加诊断结果" handleClick={this.handleshowSearch} id="addDiag" height="50px" />
+          <DiagResultSearch windowHeight={this.props.windowHeight} pageTop={this.state.pageTop} height={150}></DiagResultSearch>
+        </div>
+
+
+      </ItemBox>
+      {/* <TreatDrug></TreatDrug> */}
+      <Message></Message>
+    </div>)
+  }
 }
 
 export default Diagnosis;

+ 102 - 24
src/components/DiagnosticList/index.jsx

@@ -3,17 +3,21 @@ import style from './index.less';
 import del_icon from './img/delete.png'
 import diagUp from './img/diagUp.png'
 import diagDown from './img/diagDown.png'
-import {ConfirmModal, Message} from '@commonComp';
+import printIcon from '@common/images/team.png';
+import manageIcon from '@common/images/manage.png';
+import {ConfirmModal, Message,ComplexModal} from '@commonComp';
 import Notify from '@commonComp/Notify';
 import Treat from '@containers/Treat'
 import store from '@store';
 import { initItemList ,setInitHistory} from '@store/async-actions/historyTemplates';
-import { pushAllDataList,inspectAndAssist } from '@utils/tools';
+import { pushAllDataList,inspectAndAssist ,deepClone} from '@utils/tools';
 import iconRadioDefault from '@common/images/icon-radio-default.png'
 import iconRadioActive from '@common/images/icon-radio-active.png'
+import AssessResult from '@containers/AssessResult';
 import tableIcon from '@common/images/table.png';
 import { delFollowUp } from '../../store/actions/treat';
 import { CONFIRM_TYPE } from "@store/types/typeConfig";
+import $ from "jquery";
 
 class DiagnosticList extends Component {
     constructor(props) {
@@ -23,7 +27,13 @@ class DiagnosticList extends Component {
             delItem: {},
             treatTitle: '',
             activeHistory: -1,
-            sign:-1
+            sign:-1,
+            showAssess:false,
+            assessId:'',
+            disName:'',
+            isAssessConfirm:false,
+            radioVal:{},  //可能结果选择内容
+            possible:{},  //可能结果
         }
         this.deleteItem = this.deleteItem.bind(this);
         this.cancel = this.cancel.bind(this);
@@ -35,15 +45,19 @@ class DiagnosticList extends Component {
         this.getHistoryCase = this.getHistoryCase.bind(this);
         this.closeHistoryCaseModal = this.closeHistoryCaseModal.bind(this);
         this.referCase = this.referCase.bind(this);
+        this.handleSaveAssess = this.handleSaveAssess.bind(this);       //评估弹窗确定
+        this.handleSavePossible = this.handleSavePossible.bind(this);
+        this.onPrint = this.onPrint.bind(this);
     }
-
-    componentWillReceiveProps(nextprops) {
-        if (this.props.diagnosticStr != nextprops.diagnosticStr) {
-            this.props.getBilling();
-        }
-        
+    onPrint() {
+      let dom = $("#AssistResult");
+      dom.jqprint({
+        debug: false,
+        importCSS: true,
+        printContainer: true,
+        operaSupport: false,
+      });
     }
-
     upDiagnostic(index) {
         const { upDiagnostic } = this.props;
         upDiagnostic && upDiagnostic(index)
@@ -56,8 +70,8 @@ class DiagnosticList extends Component {
         const { delItem } = this.state;
         const { delDiagnostic, delReact,delFollowUp } = this.props;
         delDiagnostic && delDiagnostic(delItem);
-        delReact && delReact(delItem)
-        delFollowUp && delFollowUp(delItem)
+        delReact && delReact(delItem);
+        delFollowUp && delFollowUp(delItem);
         this.setState({
             visible: false,
         })
@@ -177,36 +191,100 @@ class DiagnosticList extends Component {
             })}
         </div>)
     }
-    
-    
-
+    showAssessFn(item){
+        if(item&&item.id){         //显示评估弹窗
+          this.setState({
+            showAssess:true,
+            isAssessConfirm:false,
+            assessId:item.id,
+            disName:item.name
+          });
+        }else{          //关闭评估弹窗
+            this.setState({
+              showAssess:false,
+              isAssessConfirm:false,
+            });
+        }
+    }
+    handleSavePossible(obj){
+      this.setState({
+        possible:Object.assign({},obj.possible),
+        radioVal:Object.assign({},obj.radioVal),//不设置radioVal只有最近一次选中的值
+      })
+    }
+    handleSaveAssess(){
+      this.setState({
+        isAssessConfirm:true
+      });
+      const that=this;
+      setTimeout(()=>{
+        that.setState({
+          showAssess:false
+        });
+      });
+    }
+    componentWillReceiveProps(nextprops) {
+      if (this.props.diagnosticStr != nextprops.diagnosticStr) {
+        this.props.getBilling();
+      }
+      if(deepClone(nextprops.wholeResults)!=deepClone(this.props.wholeResults)){
+          this.setState({
+            radioVal:Object.assign({},nextprops.wholeResults.radioVal),
+            possible:Object.assign({},nextprops.wholeResults.possible),
+          })
+      }
+    }
     render(){
-        const { list, treatment, showReferRecord, showHistoryCase } = this.props
-        const { visible, treatTitle } = this.state
-        const lastIndex = list.length -1;
+        const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem} = this.props;
+        const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName} = this.state;
+        const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
+        const chronicLine = chronicMagItem&&chronicMagItem.name;     //当前是否走的慢病流程
+        let isChronic = false;      //是否要显示管理评估
+        const footer = <div className={style['footer']}>
+          <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
+          <span className={style['okBtn']} onClick={()=>this.handleSaveAssess()}>确定</span>
+        </div>;
         return(
                 <div className={style['diaglist-wrap']}>
                     {list && (list.length > 0) && list.map((item, index) => {
                         const hasTreat = item.treat && (item.treat.commonTreatment.content || item.treat.surgeryTreatment.content || item.treat.treatment.length>0 ||(item.adverseReactions&&item.adverseReactions.length > 0)
-                           || (item.drugHistory && item.drugHistory['慢病用药内容'] &&  item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory &&item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow) 
-                        // const hasTreat= true;
+                           || (item.drugHistory && item.drugHistory['慢病用药内容'] &&  item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory &&item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow)
+                        isChronic = chronicLine&&item.type==2&&chronicList.findIndex((it)=>it.id==item.id)!=-1;
                         return (<div draggable={true} className={style['diag-box'] + ' clearfix'}  key={item.id} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
                                     {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}
-                                    <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '主' : index+1}</span>
+                                    <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '1' : index+1}</span>
                                     <span className={style['diag-name']} onClick={()=>{this.handleClickDiag(item)}}>{item.name}<span></span></span> 
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
                                     <span className={style['treat']}
-                                        //   style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'1px solid #3B9ED0' : '1px solid gray', cursor: hasTreat ? '' : 'text'}}
-                                          style ={hasTreat ? '' : { color: 'gray', border: '1px solid gray', cursor: 'text'}}
+                                          style ={hasTreat ? '' : { color: 'gray', cursor: 'text'}}
                                           onClick={() =>{hasTreat && this.showTreat(item, index)}}>
                                           治疗方案
                                     </span>
+                                    {isChronic?<span className={style['assess']}
+                                          onClick={this.showAssessFn.bind(this,item)}>
+                                        管理评估
+                                    </span>:''}
                                     <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item)}}/>
                         </div>)
                     })}
                      {treatment&&<Treat title={treatTitle}></Treat>}
-                    <ConfirmModal visible={visible} 
+                     {showAssess?<ComplexModal onclose={this.showAssessFn.bind(this)} footer={footer}
+                                               title='管理和评估'
+                                               icon={manageIcon}
+                                               top={'3%'}
+                                               bottom={'3%'}
+                                               width={820}>
+                       <AssessResult handleSavePossible={this.handleSavePossible}
+                                     closeAssess={this.showAssessFn.bind(this)}
+                                     disId={assessId}
+                                     disName={disName}
+                                     radioVal={radioVal}
+                                     possible={possible}
+                                     isAssessConfirm={isAssessConfirm}
+                                     ></AssessResult>
+                      </ComplexModal>:''}
+                    <ConfirmModal visible={visible}
                                   okText='删除' 
                                   cancelText='取消' 
                                   confirm={this.deleteItem}  

+ 39 - 1
src/components/DiagnosticList/index.less

@@ -78,7 +78,45 @@
     top: 11px;
     border: 1px solid #3B9ED0;
 }
-
+.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;
+    }
+}
+.assess{
+    .treat;
+    right: 106px;
+}
 .diag-del {
     position: absolute;
     right: 0;

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

@@ -147,7 +147,7 @@ class Inspect extends React.Component {
         </ul>
     }
     render() {
-        const {fetchPushInfos,getInfomation,inspectVal, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList,delPartItem,inspectList } = this.props;
+        const {fetchPushInfos,getInfomation,inspectVal,windowHeight, 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} >
@@ -186,6 +186,7 @@ class Inspect extends React.Component {
                             inspectList={inspectList}
                             getInfomation={getInfomation}
                             inspectVal={inspectVal}
+                            windowHeight={windowHeight}
                         >
                         </AddInspect>
                     </div>

+ 31 - 1
src/components/MultSpread/index.jsx

@@ -27,6 +27,7 @@ class MultSpread extends Component{
     super(props);
     this.state = {
       editable: false,
+      numDoms:[]
     };
     this.$cont = React.createRef();
     this.changeToEdit = this.changeToEdit.bind(this);
@@ -41,11 +42,36 @@ class MultSpread extends Component{
     const hasAdd = showAdd?style['add']:'';
     return classNames(isSelected,hasAdd,orgBorder);
   }
+  saveDoms(it){
+    const doms = this.state.numDoms;
+    doms.push(it);
+    this.setState({
+      numDoms:doms
+    });
+  }
+  moveEnd(obj) {
+    if(window.getSelection){//ie11 10 9 ff safari
+      obj.focus(); //解决ff不获取焦点无法定位问题
+      var range = window.getSelection();//创建range
+      range.selectAllChildren(obj);//range 选择obj下所有子内容
+      range.collapseToEnd();//光标移至最后
+    }
+    else if (document.selection) {//ie10 9 8 7 6 5
+      var range = document.selection.createRange();//创建选择对象
+      range.moveToElementText(obj);//range定位到obj
+      range.collapse(false);//光标移至最后
+      range.select();
+    }
+  }
+  setNextFocus(i){
+    const doms = this.state.numDoms;
+    doms[i+1]&&this.moveEnd(doms[i+1].current)
+  }
   getLabels(){
     const {data,ikey,showArr,copyId,selecteds,boxMark} = this.props;
     const {editable}= this.state;
     let show = false;
-    let inx = '';
+    let inx = '',count=0;
     const list = data.map((it,i)=>{
       inx=ikey+''+i;
       show = editable?false:showArr&&showArr[inx];
@@ -104,6 +130,10 @@ class MultSpread extends Component{
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
                              placeholder={it.name}
+                             //inputRef = {this['$inp'+(count++)]}
+                             saveDoms={this.saveDoms.bind(this)}
+                             reFocus={this.setNextFocus.bind(this)}
+                             num = {count++}
                              min={min}
                              max={max}
                              show={show}

+ 40 - 36
src/components/NumberDrop/index.jsx

@@ -21,6 +21,7 @@ class NumberDrop extends Component{
       editable:false,      //标签是否可输入
       timer:null,
       sltTimer:null,
+      blurTimer:null,
       hasSelect:false,       //是否点过下拉键盘
       boxLeft:0,
       boxTop:0,
@@ -32,19 +33,21 @@ class NumberDrop extends Component{
     this.$pre = React.createRef();
     this.$suf = React.createRef();
     this.$cont = React.createRef();
-    this.select = this.select.bind(this);
+    //this.select = this.select.bind(this);
     this.numInpBlur = this.numInpBlur.bind(this);
     this.handleSpanInp = this.handleSpanInp.bind(this);
     this.handleNumClick = this.handleNumClick.bind(this);
     this.handleNumFocus = this.handleNumFocus.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
     this.changeToEdit = this.changeToEdit.bind(this);
-    // this.handleKeyDowm = this.handleKeyDowm.bind(this);
+    this.handleKeyDowm = this.handleKeyDowm.bind(this);
     this.beyondArea = this.beyondArea.bind(this);
   }
   select(text){        //选中键盘上数字事件
+    //placeholder修改后,第一次点击键盘触发blur后onClick不触发,原因未知,改为onMouseup可触发
     let timer = null;
     clearTimeout(this.state.sltTimer);
+    clearTimeout(this.state.blurTimer);
     const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max} = this.props;
     const needCompare=min!=undefined&&max!=undefined;
     if(!text){
@@ -93,6 +96,13 @@ class NumberDrop extends Component{
     }
     e.stopPropagation();
   }
+  handleKeyDowm(e){
+    if(e.keyCode==13){
+      const {reFocus,num,handleHide} = this.props;
+      reFocus&&reFocus(num);
+      handleHide && handleHide();
+    }
+  }
   handleNumClick(e){     //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
     const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
     if(show) {
@@ -157,28 +167,31 @@ class NumberDrop extends Component{
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
     const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,show} = this.props;
-    if(show){      //修改清空后第一次点击键盘不触发click事件bug
+    /*if(show){      //修改清空后第一次点击键盘不触发click事件bug--失焦placehoder消失,弃用
       return;
-    }
+    }*/
     //输入超出合理范围或输入不是数字提示且清空
     const needCompare=min!=undefined&&max!=undefined;
-    //if(needCompare){
-      const txt = e.target.innerText.trim();
-      const isFine = this.validSymbols(txt,min,max);      //有~或/时是否合理
-      const hasSymbol = /[\/|\~]/g.test(txt);           //是否有~或/
-      const singleFine = (!isNaN(+txt)&&!needCompare)||(!isNaN(+txt)&&needCompare&&parseFloat(min)<=parseFloat(txt)&&parseFloat(txt)<=parseFloat(max));   //无~或/时是否合理
-      if(txt!=''&&(!hasSymbol&&!singleFine)||(hasSymbol&&!isFine)){
-        this.beyondArea();
-        return;
-      }
-    //}
+    const txt = e.target.innerText.trim();
+    const isFine = this.validSymbols(txt,min,max);      //有~或/时是否合理
+    const hasSymbol = /[\/|\~]/g.test(txt);           //是否有~或/
+    const singleFine = (!isNaN(+txt)&&!needCompare)||(!isNaN(+txt)&&needCompare&&parseFloat(min)<=parseFloat(txt)&&parseFloat(txt)<=parseFloat(max));   //无~或/时是否合理
+    if(txt!=''&&(!hasSymbol&&!singleFine)||(hasSymbol&&!isFine)){
+      this.beyondArea();
+      return;
+    }
 
     //输入为空时显示placeholder
-    if(!e.target.innerText.trim()){
-      this.setState({
-        placeholder:this.props.placeholder
-      });
-    }
+    const timer = setTimeout(()=>{
+      if(!e.target.innerText.trim()){
+        this.setState({
+          placeholder:this.props.placeholder
+        });
+      }
+    },200);
+    this.setState({
+      blurTimer:timer
+    });
 
     const val = e.target.innerText.trim();
     const {placeholder} = this.state;
@@ -191,21 +204,9 @@ class NumberDrop extends Component{
     const {handleHide} = this.props;
     handleHide&&handleHide();
   }
-  // handleKeyDowm(e){
-    // handleEnter();
-    //只能输入数字
-    /*const key = e.key;
-    const ctrlOn = e.ctrlKey;
-    const isCopyPaste = ctrlOn&&(key=='v'||key=='c');
-    if((!/[0-9|.|~|\/]/.test(key)&&key.length==1&&!isCopyPaste)){
-      e.preventDefault();
-      return false;
-    }*/
-  // }
   getClasses(){         //整个标签是否有值的状态
     const {hideTag,placeholder,value,isImports} = this.props;
-    const $span = this.$span.current;
-    const val = value;//$span&&$span.innerText.trim()||value;
+    const val = value;
     const blueBorder = this.state.editable?style['blue-border']:'';
     const isSelected = val&&val!=placeholder?style['selected']:style['container'];
     const orgBorder = isImports&&!(val&&val!=placeholder)?style['orange-border']:'';
@@ -232,7 +233,6 @@ class NumberDrop extends Component{
   }
   handleBlur(e){     //双击编辑blur
     const {handleLabelChange,ikey,boxMark,value} = this.props;
-    //if(!this.state.editable) return;
     this.setState({
       editable: false
     });
@@ -244,7 +244,6 @@ class NumberDrop extends Component{
     handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix});
   }
   getSpanClass(){       //将被替换的文字选中状态显示
-    //const {hasSelect} = this.state;
     const cls = this.props.show?style['blued']:'';
     return cls;
   }
@@ -252,10 +251,14 @@ class NumberDrop extends Component{
     //设置最小宽度避免输入后宽度跳动
     const spanWidth = window.getComputedStyle(this.$span.current).width;
     this.$span.current.style.minWidth=spanWidth;
+    //保存输入框dom以便聚焦
+    const {saveDoms} = this.props;
+    saveDoms&&saveDoms(this.$span);
   }
   render(){
     const {prefix,suffix,show,value,handleHide,allClick} = this.props;
-    const {numEditable,placeholder,editable,hasSelect,boxTop,boxLeft} = this.state;
+    const {placeholder,editable,hasSelect,boxTop,boxLeft} = this.state;
+    //console.log(prefix,value,placeholder+'1',this.props.placeholder)
     return <div className={this.getClasses()}
                 ref={this.$cont}
                 onDoubleClick={this.changeToEdit}
@@ -270,12 +273,13 @@ class NumberDrop extends Component{
             contentEditable={true}
             style={{minWidth:'10px',display:'inline-block',textAlign:'center'}}
             ref = {this.$span}
+            onkeydown={this.handleKeyDowm}
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
             >&nbsp;{value||placeholder}</span>
       <span ref = {this.$suf}>&nbsp;{suffix}</span>
-      <NumberPan handleSelect={(text)=>this.select(text)}
+      <NumberPan handleSelect={this.select.bind(this)}
                  onClose={handleHide}
                  show={show} 
                  toClear={!hasSelect}

+ 0 - 2
src/components/RadioInpDrop/index.jsx

@@ -13,8 +13,6 @@ import $ from "jquery";
  * placeholder:灰显文字
  * data:下拉内容数据
  * handleSelect:选中事件
- * prefix:前缀
- * suffix:后缀
  *
  * ***/
 

+ 8 - 13
src/components/ScaleTable/index.jsx

@@ -130,8 +130,7 @@ class ScaleTable extends React.Component{
   }
 
   handleFormula(data){//得分计算
-    const {tableId,parentId,scaleInfo,parentIndex} = this.props; 
-    const {valueData} = this.state; 
+    const {valueData} = this.state;
     this.setState({
       start:true
     })
@@ -156,10 +155,7 @@ class ScaleTable extends React.Component{
     // 将计算结果存在state,防止页面跳动问题
     const params = {
       type:1,
-      data:valueData,
-      pId:parentId,
-      id:tableId,
-      pIndex:parentIndex
+      data:valueData
     }
     const that = this;
     getFormulaResult(params).then((res)=>{
@@ -204,8 +200,8 @@ class ScaleTable extends React.Component{
   }
   componentWillUnmount(){
     // 储存计算结果和选择后的data
-    const {tableId,getResult,parentId,parentIndex,scaleInfo,saveScaleData,formulaResult} = this.props; 
-    const {valueData,scaleResult1,start} = this.state; 
+    const {tableId,getResult,scaleInfo,saveScaleData,formulaResult} = this.props;
+    const {valueData,scaleResult1,start} = this.state;
     // 替换表格内容--1)没有点计算且没有计算结果;2)点了计算
     const scaleResult = scaleResult1 || formulaResult&&formulaResult[tableId]; //量表计算结果
     if(start || !scaleResult){
@@ -221,21 +217,20 @@ class ScaleTable extends React.Component{
       }
     }
     
-    if(scaleResult1){
+     if(scaleResult1){
       const params = {
         type:1,
         data:scaleResult1,
         id:tableId,
-        pIndex:parentIndex
       }
       getResult&&getResult(params);
-    }  
+    }
   }
   getContent(){ 
     let {selecteds,valueData,start,scaleResult1} = this.state;
     const {tableId,formulaResult} = this.props;
     const scaleResult = scaleResult1 || formulaResult&&formulaResult[tableId]; //量表计算结果
-    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>
@@ -288,7 +283,7 @@ class ScaleTable extends React.Component{
                         return m.groupCalculate.result.value;
                       }
                     })}</span>
-                  </p>:''}
+                  </p>:''}  
                 </div>
               })
     return content;

+ 13 - 2
src/components/SpreadDrop/index.jsx

@@ -55,6 +55,7 @@ class SpreadDrop extends Component{
   }
   handleShow(e){//单击
     e&&e.stopPropagation();
+    const {ikey,handleShow,placeholder,flag,id,value,tagType,type,data,windowWidth} = this.props;
     // let boxLeft = e.pageX -175 + 'px';
     // let offsetTop = e.target.offsetTop;
     // const ht = e.target.offsetHeight;   //如杂音选中文字有多行时,写死会遮挡
@@ -63,8 +64,19 @@ class SpreadDrop extends Component{
     //   boxLeft:boxLeft,
     //   boxTop:boxTop
     // })
+    let num = 0,leftLen;//判断为五类切超出页面
+    data && data.map((item)=>{
+      if(item.formPosition != 1){
+        ++num
+      }
+    })
+    if(num >= 5 && windowWidth-getPageCoordinate(e).boxLeft < 760){
+      leftLen = windowWidth-780
+    }else{
+      leftLen = getPageCoordinate(e).boxLeft
+    }
     this.setState({
-      boxLeft:getPageCoordinate(e).boxLeft,
+      boxLeft:leftLen,
       boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop
@@ -77,7 +89,6 @@ class SpreadDrop extends Component{
     },$("#addScrollEvent")[0])
     // window.event? window.event.cancelBubble = true : e.stopPropagation();
      this.setStateInit();      //恢复初始选中状态
-    const {ikey,handleShow,placeholder,flag,id,value,tagType,type} = this.props;
     const that = this;
     this.btnClickFlag = false;
     clearTimeout(this.state.timer);

+ 2 - 1
src/components/Treat/AdverseReactions/index.less

@@ -38,6 +38,7 @@
     top: -15px;
     left: 50%;
     margin-left: -8px;
+    cursor: pointer;
 }
 .last-treat-big-name-box {
     display: inline-block;
@@ -55,6 +56,6 @@
     input, label {
         cursor: pointer;
     }
-    
+
 }
 

+ 3 - 3
src/components/Treat/DrugHistory/LastDrug/index.jsx

@@ -15,9 +15,9 @@ class LastDrug extends Component {
         this.setDrugInfo = this.setDrugInfo.bind(this);
     }
     handleMouseEnterDrug(index, item) {
-        const drugNameWidth = parseInt($('#'+item.id)[0].offsetWidth)
-        const imgLeft = drugNameWidth/2-8
-        $('#'+item.id).find('img').css('left', imgLeft)
+        // const drugNameWidth = parseInt($('#'+item.id)[0].offsetWidth)
+        // const imgLeft = drugNameWidth/2-8
+        // $('#'+item.id).find('img').css('left', imgLeft)
         this.setState({
             currentIndex: index,
         })

+ 4 - 2
src/components/Treat/DrugHistory/LastDrug/index.less

@@ -11,12 +11,14 @@
 }
 .last-common-warpper {
     position: relative;
-    margin: 0 20px 0 0;
+    margin: 0 4px 0 0;
     display: inline-block;
 }
 .info-img {
     position: absolute;
     width: 15px;
-    position: absolute;
     top: -8px;
+    left: 50%;
+    margin-left: -7px;
+    cursor: pointer;
 }

+ 1 - 0
src/components/Treat/DrugTreat/index.less

@@ -37,6 +37,7 @@
     top: -15px;
     left: 50%;
     margin-left: -7px;
+    cursor: pointer;
 }
 .info-flag {
     display: inline-block;

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

@@ -65,6 +65,7 @@
     top: -15px;
     left: 50%;
     margin-left: -7px;
+    cursor: pointer;
 }
 .info-flag {
     display: inline-block;

+ 1 - 1
src/containers/AdviceContainer.js

@@ -10,7 +10,7 @@ function mapStateToProps(state) {
         adviceInput: state.pushMessage.advice.adviceInput,
         isFirstMainDiag:  state.treat.isFirstMainDiag,
         followUp: state.pushMessage.advice.followUp,
-        hasFollowUp: state.treat.hasFollowUp,
+        hasFollowUp: state.pushMessage.advice.hasFollowUp,
         typeConfig: state.typeConfig.typeConfig
     })
 }

+ 28 - 16
src/containers/AssessResult.js

@@ -6,6 +6,10 @@ import {billing} from '@store/async-actions/pushMessage';
 import {getAssessData,getIndexData} from '@store/async-actions/fetchModules';
 import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_INDEX_SUB_TYPE,REMOVE_ASSESS_ITEMS,CLEAR_INDEX_DATA,SET_CHRONIC_CALCU_RESULT} from '@types/assessResult';
 import {parseChartData,deepClone} from '@utils/tools';
+import {SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
+import {saveMessage} from "../store/async-actions/print";
+import {SET_SAVE_ASSESS_DATA} from "@types/assessResult";
+import {saveClickNum} from '@store/async-actions/homePage';
 
 /***
  * 管理评估逻辑:
@@ -28,6 +32,7 @@ function mapStateToProps(state) {
     timeTypes:assessResult.indexTimeTypes,    //图表切换的维度
     //wholeAssessData:assessResult.wholeAssess,   //评估内容
     wholeIndexs:assessResult.wholeIndexs||{},      //已加入评估记录的推送项
+    addedScaleIds:assessResult.addedScaleIds,      //已进入量表的id
     wholeResults:assessResult.wholeResults,     //整体评估可能结果
     chooseSelecteds:assessResult.chooseSelecteds,    //已选中的选项
     wholeAssessText:assessResult.wholeAssessText,     //整体评估补充说明
@@ -42,24 +47,13 @@ function mapStateToProps(state) {
 
 function mapDispatchToProps(dispatch) {
   return {
-    getAssess(isRecommend){        //获取评估内容数据
-      if(isRecommend){
-        const data = {
-          regionName: "整体评估",
-          regionType: "0",
-          isRecommend:true
-        };
-        dispatch({
-          type:SET_ASSESS_DATA,
-          data:[data]
-        });
-        return;
-      }
-      dispatch(getAssessData()).then((res)=>{
+    getAssess(disId,disName){        //获取评估内容数据
+      dispatch(getAssessData(disId,disName)).then((res)=>{
         if(res.data.code=='0'){
           dispatch({
             type:SET_ASSESS_DATA,
-            data:res.data.data
+            data:res.data.data,
+            name:disName
           })
         }
       }).catch(error=>{
@@ -94,7 +88,25 @@ function mapDispatchToProps(dispatch) {
         type: SET_CHRONIC_CALCU_RESULT,
         data:deepClone(data)
       })
-    }
+    },
+    showScaleFn(item){
+      dispatch({
+        type:SHOW_TABLE_LIST,
+        name:'showTable',
+        value:true,
+        item:Object.assign({},item)
+      });
+    },
+    //保存管理评估
+    saveAssessInfos(obj,flg,noSave){     //noSave未true则不调页面保存接口
+      dispatch(Object.assign({},obj,{type:SET_SAVE_ASSESS_DATA}));
+      if(!noSave){
+        dispatch(saveClickNum);
+        if(flg != 1 && flg != 2){
+          dispatch(() => saveMessage())
+        }
+      }
+    },
   }
 }
 

+ 1 - 0
src/containers/AssistCheck.js

@@ -16,6 +16,7 @@ function mapStateToProps(state) {
         winWidth:state.homePage.windowWidth,
         assistList:state.homePage.assistList,
         assistVal:state.assistCheck.assistVal,
+        windowHeight:state.homePage.windowHeight
     }
 }
 

+ 2 - 2
src/containers/CheckBody.js

@@ -29,10 +29,10 @@ function mapStateToProps(state){
   }
 }
 
-function mapDispatchToProps(dispatch,state){
+function mapDispatchToProps(dispatch){
   return {
     getInit(){
-      dispatch({type:MODI_LOADING,flag:true});
+      //dispatch({type:MODI_LOADING,flag:true});
       dispatch(getInitData());
     },
     fetchModules(param){

+ 15 - 8
src/containers/ChronicInfo.js

@@ -26,6 +26,7 @@ function mapStateToProps(state){
     calcuResult:assessResult.calcuResult,      //计算公式结果
     calcuValues:assessResult.calcuValues,      //计算公式填的值
     wholeScaleItems:assessResult.wholeScaleItems,     //全部量表中已加入病例的量表
+    addedScaleIds:assessResult.addedScaleIds,      //已加入的量表id
   }
 }
 
@@ -35,11 +36,12 @@ function mapDispatchToProps(dispatch){
       dispatch(getTableList(id))
       // dispatch({type:SHOW_TABLE_LIST})
     },
-    hideList(item){
+    hideList(param,item){
       dispatch({
         type:SHOW_TABLE_LIST,
-        name:item.name,
-        value:item.value
+        name:param.name,
+        value:param.value,
+        item:item?Object.assign({},item):undefined
       })
     },
     getScaleInfo(item){
@@ -47,12 +49,13 @@ function mapDispatchToProps(dispatch){
     },
     addAssessItem(row,pIndex,i){         //加入评估记录
       let obj = Object.assign({},row);
-      //obj.details[i].add=true;
+      const it = obj.details[i];
       dispatch({
         type:ADD_ASSESS_ITEMS,
         data:obj,
         index:pIndex,
-        subIndex:i
+        subIndex:i,
+        id:it.type==1?it.content.id:undefined,      //只有量表需要记录id,去重用
       })
     },
     addScaleItems(obj,i){
@@ -91,15 +94,19 @@ function mapDispatchToProps(dispatch){
       });
     },
     // 计算公式计算
-    calcuFormula(item) {
-      const {param} = item;
+    calcuFormula(param) {
       getFormulaResult(param).then((res)=>{
         if(+res.data.code==0){
           const result = res.data.data.result;
           dispatch({
             type: SET_CHRONIC_CALCU_RESULT,
             result:deepClone(result),
-            id:item.param.disId
+            id:param.disId
+          });
+          dispatch({
+            type:SET_CALCU_VALUES,
+            data:param.data.content.details,
+            id:param.disId
           })
         }else{
           Notify.error(res.data.msg||'计算没有结果返回');

+ 1 - 0
src/containers/Diagnosis.js

@@ -6,6 +6,7 @@ import { SHOW_SEARCH,  HIDE_SEARCH } from '@store/types/diagnosticSearch';
 function mapStateToProps(state) {
     return {
         show: state.diagnosticSearch.show,
+        windowHeight:state.homePage.windowHeight
     }
 }
 

+ 5 - 2
src/containers/DiagnosticList.js

@@ -13,7 +13,7 @@ import { initItemList } from '@store/async-actions/historyTemplates';
 import {MODI_LOADING} from '@store/types/homePage.js';
 
 function mapStateToProps(state) {
-    const {diagnosticList} = state;
+    const {diagnosticList,assessResult,pushMessage } = state;
     let diagnC = diagnosticList.chronicMagItem;
     return {
         list: diagnosticList.diagnosticList,
@@ -25,6 +25,9 @@ function mapStateToProps(state) {
         items:state.historyTemplates.items,
         chronicMagItem: diagnC&&diagnC.name?diagnC:state.mainSuit.chronicDesease,
         typeConfig: state.typeConfig.typeConfig,
+        wholeResults:assessResult.wholeResults,
+        scaleInfo: pushMessage.scaleInfo,//量表内容
+        showHide: pushMessage.showHide,
     }
 }
 
@@ -109,7 +112,7 @@ function mapDispatchToProps(dispatch) {
         },
         autoFillModules(){
             dispatch(autoFillModules())//自动分发模板
-        },  
+        },
     }
 }
 

+ 1 - 1
src/containers/EditableSpan.js

@@ -182,7 +182,7 @@ function mapDispatchToProps(dispatch,state) {
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing());
+          dispatch(billing('',obj.boxMark));
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 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,
+        windowHeight:state.homePage.windowHeight,
         inspectVal:state.inspect.inspectVal
     }
 }

+ 3 - 1
src/containers/MainSuit.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import MainSuit from '@components/MainSuit';
-import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE,SET_FEATURE,SAVE_CHRONIC} from '@store/types/mainSuit';
+import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE,SET_FEATURE,SAVE_CHRONIC,SHOW_HISTORY_BOX,HIDE_HISTORY_BOX} from '@store/types/mainSuit';
 import {RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION,MODI_LOADING} from '@store/types/homePage.js';
 import {getCommSymptoms,getCommSymptomPush} from '@store/async-actions/mainSuit.js'
 import {CLEAR_DIAGNOSE} from '@store/types/diagnosticList';
@@ -39,6 +39,8 @@ function mapStateToProps(state) {
     currentData:state.currentIll.data,
     allModules:homePage.allModules,
     chronicDesease:mainSuit.chronicDesease&&mainSuit.chronicDesease.name?mainSuit.chronicDesease:diagnosticList.chronicMagItem,
+    items:state.historyTemplates.items,
+    showHisBox:mainSuit.showHisBox,
   }
 }
 

+ 1 - 1
src/containers/NumberDrop.js

@@ -127,7 +127,7 @@ function mapDispatchToProps(dispatch,store){
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing());
+          dispatch(billing('',params.ikey.substr(0,1)));
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 1 - 1
src/containers/NumberUnitDrop.js

@@ -134,7 +134,7 @@ function mapDispatchToProps(dispatch,store){
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing());
+          dispatch(billing('',params.ikey.substr(0,1)));
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 1 - 1
src/containers/RadioDrop.js

@@ -109,7 +109,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing());
+          dispatch(billing('',params.ikey.substr(0,1)));
         }
       },500);
     },

+ 1 - 1
src/containers/RadioInpDrop.js

@@ -137,7 +137,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing());
+          dispatch(billing('',params.ikey.substr(0,1)));
         }
       },500);
     },

+ 2 - 1
src/containers/SpreadDrop.js

@@ -18,6 +18,7 @@ function mapStateToProps(state) {//console.log(state);
   return {
     mainSaveText:state.mainSuit.saveText,
     mainData:state.mainSuit.data,
+    windowWidth:state.homePage.windowWidth
   }
 }
 
@@ -456,7 +457,7 @@ function handleLabel(dispatch,params){
       break;
     default:
   }
-  dispatch(billing());
+  dispatch(billing('',type));
   dispatch({
     type:ISREAD
   })

+ 8 - 0
src/store/actions/checkBody.js

@@ -1,5 +1,12 @@
 import config from '@config/index.js';
 import {formatContinueDots,getLabelIndex,fullfillText} from '@utils/tools.js';
+
+export function preSetCheckbody(state,action) {
+  let res = Object.assign({},state);
+  const {data} = action;
+  res.preData = data;
+  return res;
+}
 //设置查体数据
 export function set(state,action){
   let res = Object.assign({},state);
@@ -400,6 +407,7 @@ export const changeNumLabelVal = (state,action)=>{
 export function clearCheckBody(state,action){  //清空
   let res = Object.assign({},state);
   res.data = action.data;
+  res.preData = [];
   res.saveText = action.saveText;
   res.isEmpty = action.isEmpty;
   res.selecteds = action.selecteds?action.selecteds:[];

+ 3 - 0
src/store/actions/pushMessage.js

@@ -292,6 +292,9 @@ export const setAdviceInput = (state, action) => {
 export const saveFollowUp = (state, action) => {
 	const res = JSON.parse(JSON.stringify(state));
 	res.advice.followUp = action.followUp;
+	if(action.hasFollowUp) {
+		res.advice.hasFollowUp = action.hasFollowUp 
+	}
 	return res;
 }
 

+ 38 - 20
src/store/async-actions/fetchModules.js

@@ -1,5 +1,5 @@
 import {json} from '@utils/ajax.js';
-import {SET} from '@types/checkBody.js';
+import {SET,PRESET} from '@types/checkBody.js';
 import {SETDATA} from '@store/types/otherHistory';
 import store from '@store';
 import {getEMRParams,didPushParamChange,inspectAndAssist,fullfillText} from '@utils/tools.js';
@@ -137,9 +137,12 @@ export const getOtherHisRecord = ()=>{
   }
 };
 
-//查体模板数据获取
-export function getInitData(){
+//预取查体模板数据-现病史触发推送时获取
+export function pregetCheckbodyData(flag){     //flag=true获取到数据后立即显示
   return (dispatch)=>{
+    if(flag){
+      dispatch({type:MODI_LOADING,flag:true});
+    }
     const emrData = getEMRParams();
     const param = {
       age: emrData.age,
@@ -154,29 +157,44 @@ export function getInitData(){
     };
     json(api.getBigPush,param).then((res)=>{
       if(+res.data.code === 0){
-        dispatch({type:MODI_LOADING,flag:false});
         const data = res.data.data&&res.data.data.vital;
-        const str = JSON.stringify(data);
-        const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
         dispatch({
-          type:SET,
-          data:arr,
-          isEmpty:false
+          type:PRESET,
+          data:data
         });
+        if(flag){
+          const arr = fullfillText(data,false,false,false).newArr;
+          dispatch({
+            type:SET,
+            data:arr,
+            isEmpty:false
+          });
+          dispatch({type:MODI_LOADING,flag:false});
+        }
       }else{
-        dispatch({type:MODI_LOADING,flag:false});
-        const block = Object.assign(JSON.parse(config.textLabel),{full:true});      //无数据时保留一个自由文本标签可输入
-        dispatch({
-          type:SET,
-          data:[block],
-          isEmpty:true
-        });
         Notify.error(res.data.msg);
       }
     });
   }
 }
 
+//查体模板数据获取
+export function getInitData(){
+  return (dispatch,getStore)=>{
+    const state =  getStore();
+    const preData = [...state.checkBody.preData];
+    if(!preData||preData.length==0){
+      dispatch(pregetCheckbodyData(true));
+    }
+      const arr = fullfillText(preData,false,false,false).newArr;
+      dispatch({
+        type:SET,
+        data:arr,
+        isEmpty:false
+      });
+  }
+}
+
 //其他史模板填充-先取最近记录,无则用模板
 export function setOtherHisModule(){
   return (dispatch, getStore) => {
@@ -229,14 +247,14 @@ export function saveMode(mode){
 }
 
 //慢病-获取管理评估
-export function getAssessData(){
+export function getAssessData(disId,disName){
   return ()=>{
     const emrData = getEMRParams();
     const param = {
-      diseaseId:21773,
+      diseaseId:disId,
       disType:1,
-      diag:'糖尿病',
-      diseaseName:'糖尿病',
+      diag:disName,
+      diseaseName:disName,
       featureType:11,
       lis:emrData.lis,
       sex:emrData.sex,

+ 27 - 12
src/store/async-actions/pushMessage.js

@@ -4,6 +4,7 @@ import { SET_CLICK_DIAG } from '../types/diagnosticList';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
 import { Notify} from '@commonComp';
+import {pregetCheckbodyData} from '@store/async-actions/fetchModules';
 
 const api={
   push:'/push/pushInner',
@@ -12,7 +13,7 @@ const api={
 }
 
 //获取右侧推送信息
-export const billing = (mdata) => {
+export const billing = (mdata,boxMark) => {
  return (dispatch, getState) =>{
   const state = getState();
   let url = api.push;
@@ -22,7 +23,7 @@ export const billing = (mdata) => {
   const emrData = getEMRParams();
   const params = {
     age: emrData.age,
-    featureType: "4,5,6,7,22",
+    featureType: "5,6,7",
     // featureType: "22",
     diag: emrData.dis,
     lis: emrData.lis,
@@ -34,7 +35,7 @@ export const billing = (mdata) => {
   };
   storageLocal.set('emrParam',params);      //推送数据存储,用作推送前对比是否有变,有变才推送
     json(url, params).then((data) => {
-        let {dis, lab, pacs,markedVitalIds,medicalIndications} = data.data.data||{};
+        let {dis, lab, pacs,markedVitalIds} = data.data.data||{};
         lab = lab||[];
         pacs = pacs||[];
         // console.log('推送数据', data.data.data);
@@ -65,11 +66,6 @@ export const billing = (mdata) => {
             lab: lab||[],
             pacs: pacs||[],
         });
-        //慢病推送模块数据
-        dispatch({
-          type:SET_CHRONIC_PUSHS,
-          data:medicalIndications
-        });
         //查体高亮标签
         dispatch({
           type:SET_IMPORT_CHECKBODY_LABEL,
@@ -77,12 +73,30 @@ export const billing = (mdata) => {
         })
   }).catch((e) =>{
       console.log(e)
-  }) 
+  });
+   //单独调指标
+   const ps = Object.assign({},params,{featureType:'22'});
+   json(url, ps).then((data) => {
+     let {medicalIndications} = data.data.data||{};
+
+     //慢病推送模块数据
+     dispatch({
+       type:SET_CHRONIC_PUSHS,
+       data:medicalIndications
+     });
+   }).catch((e) =>{
+     console.log(e)
+   });
+
+   //调查体,现病史触发推送且查体无数据时获取查体模板
+   const checkBody = state.checkBody.data;
+   if(boxMark==2&&!(checkBody&&checkBody.length>0&&!checkBody[0].full)){
+     dispatch(pregetCheckbodyData());
+   }
  }
 };
 
-
-export const getTips = (diagItem) =>{
+  export const getTips = (diagItem) =>{
     return (dispatch, getState) =>{
         dispatch({
             type: SET_CLICK_DIAG,
@@ -186,7 +200,8 @@ export const getScaleInfo = (it)=>{
                 dispatch({
                     type:SHOW_TABLE_LIST,
                     name:'showTable',
-                    value:true
+                    value:true,
+                    item:Object.assign({},it)
                 })
             }else{
                 Notify.info(result.msg||'暂无量表信息')

+ 9 - 5
src/store/async-actions/treat.js

@@ -247,7 +247,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
             }
             if(followUp) {  
                 const followUpList = state.treat.followUpList
-                if(followUpList) {  //判断之前有没有存过的回访时间,如果有替换掉
+                if(followUpList) {  //判断之前有没有存过的回访时间,如果有替换掉
                     for(let i = 0; i < followUpList.length; i++) {
                         if(item.id == followUpList[i].id) {
                             followUp = followUpList[i].followUp
@@ -396,10 +396,14 @@ export const commonTreatAddToAdvice = () => {
                 type: SET_COMMONTREATMENT,
                 commontreatment: state.treat.treatItem.treat.commonTreatment.text
             })
-            dispatch({
-                type: SAVE_FOLLOW_UP,
-                followUp: state.treat.followUp
-            })
+            if(followUp) {
+                dispatch({
+                    type: SAVE_FOLLOW_UP,
+                    followUp: followUp,
+                    hasFollowUp: true
+                })
+            }
+            
         } else {
             return
         }

+ 10 - 6
src/store/reducers/assessResult.js

@@ -3,13 +3,13 @@ import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_SAVE_ASSESS_DATA,SET_INDEX_SUB_TYPE,A
 import config from "@config";
 
 const init = {
-  data:[],        //评估模块数据
+  data:{},        //评估模块数据
   indexData:{},     //评估图表数据
   indexNames:{},
   indexTimeTypes:{},    //单个图表选中的维度
   wholeAssess:[],     //整体评估数据
   wholeIndexs:{},     //已加入的评估数据的index,加入按钮状态用
-  wholeAssessText:'',   //整体评估补充说明
+  wholeAssessText:{},   //整体评估补充说明
   chooseSelecteds:{},   //选项勾选状态
   wholeResults:{
     possible:{},
@@ -18,13 +18,15 @@ const init = {
   calcuResult:{},       //计算公式结果
   calcuValues:{},       //计算公式填的值
   wholeScaleItems:[],   //全部量表中添加的整体评估项
+  addedScaleIds:[]
 };
 export default (state=init,action)=>{
   const res = Object.assign({},state);
   const {data,range,index,rangeType,pindex,getNew} = action;
   switch (action.type){
     case SET_ASSESS_DATA:
-      res.data = action.data;
+      res.data[action.name] = action.data;
+      res.update1 = Math.random();
       return res;
     case SET_INDEX_DATA:
       res.indexData[range[0]+range[1]] = data.obj;
@@ -56,28 +58,30 @@ export default (state=init,action)=>{
       return res;
     case SET_SAVE_ASSESS_DATA:
       res.wholeIndexs = action.wholeAssessItems||{};
+      res.addedScaleIds = action.addedScaleIds||[];
       res.wholeResults = action.wholeResults||{};
       res.wholeScaleItems = action.wholeScaleItems||[];
-      res.wholeAssessText = action.wholeAssessText||'';
+      res.wholeAssessText = action.wholeAssessText||{};
       res.chooseSelecteds = action.chooseSelecteds||{};
       res.calcuResult = action.calcuResult||{};
+      res.calcuValues = action.calcuValues||{};
       return res;
-    //case CLEAR_ASSESS_DATA:
     case ADD_ASSESS_ITEMS:
       res.wholeAssess[action.index] = action.data;
       let arr = res.wholeIndexs[action.index];
       res.wholeIndexs[action.index] = arr?[...arr,action.subIndex]:[action.subIndex];
+      action.id?res.addedScaleIds.push(action.id):'';
       res.update1 = Math.random();   //对象更新,与其他字段名不同因为绑定在pushItems,避免不必要的渲染
       return res;
     case ADD_WHOLE_SCALE_ITEMS:
       res.wholeScaleItems[action.index] = action.data;
+      res.addedScaleIds.push(action.data.id);
       res.update1 = Math.random();
       return res;
     case REMOVE_ASSESS_ITEMS:
       const {index,pIndex} = action;
       const temp =[...res.wholeIndexs[pIndex]];
       res.wholeIndexs[pIndex].splice(temp.findIndex((i)=>i==index),1);
-      //res.wholeAssess[pIndex].details[index].add=false;
       return res;
     case SET_CHRONIC_CALCU_RESULT:
       if(action.id){

+ 6 - 3
src/store/reducers/checkBody.js

@@ -1,10 +1,10 @@
 import {SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEARCHDATA,
   SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,
   SETCHECKINPUT,DEL_CHECKBODY,CHANGECHECKTEXTLABEL_NUMBER,CHECKCONFIRMSELECTED,
-  CHECKBODY_MUL,DEL_CHECKBODY_LABLE,SET_CK_RADIO_INPUT_VAL,SET_IMPORT_CHECKBODY_LABEL} from '../types/checkBody.js';
+  CHECKBODY_MUL,DEL_CHECKBODY_LABLE,SET_CK_RADIO_INPUT_VAL,SET_IMPORT_CHECKBODY_LABEL,PRESET} from '../types/checkBody.js';
 import {set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,
   setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText,
-  changeNumLabelVal,confirm,multipleComfirn,delSingleLable,setRadioInputValue,setImportCheckbodyLabel} from '../actions/checkBody.js';
+  changeNumLabelVal,confirm,multipleComfirn,delSingleLable,setRadioInputValue,setImportCheckbodyLabel,preSetCheckbody} from '../actions/checkBody.js';
 import config from '@config/index.js';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
@@ -16,11 +16,14 @@ const initState = {
                 focusIndex:'',
                 isEmpty:true,      //是否为空白,需要请求数据
                 showSearchBox:false,
-                importLabel:[]//[430,436,40,278,435,279,28,442,447,448,449,450,453,454,457,456,282]
+                importLabel:[],//[430,436,40,278,435,279,28,442,447,448,449,450,453,454,457,456,282]
+                preData:[],     //预存的查体模板
           };
 export default function(state=initState,action){
   let res = Object.assign({},state);
   switch(action.type){
+    case PRESET:
+      return preSetCheckbody(state,action);
     case SET:
       return set(state,action);
     case SETNUMBER4:

+ 3 - 5
src/store/reducers/pushMessage.js

@@ -1,8 +1,8 @@
 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, 
+        CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT,
         SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,
-        SAVE_TABLE_RESULT, SAVE_FOLLOW_UP, DEL_FOLLOW_UP} from '../types/pushMessage';
+        SAVE_TABLE_RESULT, SAVE_FOLLOW_UP, DEL_FOLLOW_UP,PRESET} from '../types/pushMessage';
 import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, 
         setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails, 
         setCommontreatment, isFirstMainDiag, setAdviceInput, saveFollowUp, delFollowUp } from '../actions/pushMessage';
@@ -55,8 +55,6 @@ export default function(state = initState, action) {
       return hideTipsDetails(state, action);
     case SET_COMMONTREATMENT:
       return setCommontreatment(state, action);
-    case IS_FIRST_MAIN_DIAG:
-      return isFirstMainDiag(state, action);
     case SET_ADVICE_INPUT:
       return setAdviceInput(state, action);
     case SAVE_FOLLOW_UP: 
@@ -67,7 +65,7 @@ export default function(state = initState, action) {
       res.tableList = action.data;
       return res;
     case SHOW_TABLE_LIST://显示、隐藏量表列表
-      res.showHide = Object.assign({},res.showHide,{[action.name]:action.value});
+      res.showHide = Object.assign({},res.showHide,{[action.name]:action.value},action.item);
       return res;
     case SET_CHRONIC_PUSHS:
       res.chronicPushItems = action.data;

+ 2 - 1
src/store/types/checkBody.js

@@ -18,4 +18,5 @@ export const CHECKCONFIRMSELECTED = 'spread_check_body_labels';
 export const CHECKBODY_MUL = 'CHECKBODY_MUL';//单列多选
 export const DEL_CHECKBODY_LABLE = 'DEL_CHECKBODY_LABLE';
 export const SET_CK_RADIO_INPUT_VAL = 'SET_CK_RADIO_INPUT_VAL';
-export const SET_IMPORT_CHECKBODY_LABEL='SET_IMPORT_CHECKBODY_LABEL';
+export const SET_IMPORT_CHECKBODY_LABEL='SET_IMPORT_CHECKBODY_LABEL';
+export const PRESET = 'PRESET_CHECKBODY_DATA';