Explorar el Código

Merge branch 'bugFix20190722' into optimize-zxc

zhangxc hace 5 años
padre
commit
f81483f25c
Se han modificado 48 ficheros con 569 adiciones y 541 borrados
  1. 30 3
      src/common/components/EditableSpan/index.jsx
  2. 1 1
      src/common/components/EditableSpan/index.less
  3. 4 43
      src/common/components/InlineTag/index.jsx
  4. 15 2
      src/components/CheckBody/index.jsx
  5. 1 0
      src/components/DiagnosticList/index.jsx
  6. 7 0
      src/components/Emergency/HisList/index.jsx
  7. 21 5
      src/components/Emergency/index.jsx
  8. 4 3
      src/components/HistoryCaseContainer/HistoryList/index.jsx
  9. 3 42
      src/components/MultSpread/index.jsx
  10. 12 68
      src/components/NumberDrop/index.jsx
  11. 34 26
      src/components/Operation/index.jsx
  12. 1 0
      src/components/Preview/index.jsx
  13. 2 2
      src/components/PreviewBody/Inspect/index.jsx
  14. 3 3
      src/components/PreviewBody/ItemPart/index.jsx
  15. 25 13
      src/components/PreviewBody/index.jsx
  16. 1 0
      src/components/PrintPreview/index.jsx
  17. 16 6
      src/components/PushContainer/index.jsx
  18. 6 1
      src/components/TemplateItems/index.jsx
  19. 6 0
      src/components/TemplateItems/index.less
  20. 0 10
      src/containers/CurrentIll.js
  21. 2 5
      src/containers/DiagnosticList.js
  22. 9 8
      src/containers/EditableSpan.js
  23. 4 4
      src/containers/Emergency.js
  24. 0 25
      src/containers/InlineTag.js
  25. 2 15
      src/containers/MainSuit.js
  26. 5 39
      src/containers/MultSpread.js
  27. 7 81
      src/containers/NumberDrop.js
  28. 1 1
      src/containers/PushContainer.js
  29. 1 1
      src/containers/PushItemsContainer.js
  30. 1 1
      src/containers/TypeConfigContainer.js
  31. 28 13
      src/store/actions/checkBody.js
  32. 61 23
      src/store/actions/currentIll.js
  33. 61 20
      src/store/actions/mainSuit.js
  34. 49 21
      src/store/actions/otherHistory.js
  35. 31 24
      src/store/async-actions/fetchModules.js
  36. 30 7
      src/store/async-actions/historyTemplates.js
  37. 3 3
      src/store/async-actions/patInfo.js
  38. 19 1
      src/store/async-actions/print.js
  39. 1 1
      src/store/async-actions/pushMessage.js
  40. 27 6
      src/store/async-actions/tabTemplate.js
  41. 2 0
      src/store/reducers/assessResult.js
  42. 2 1
      src/store/reducers/currentIll.js
  43. 1 1
      src/store/reducers/historyTemplates.js
  44. 2 1
      src/store/reducers/mainSuit.js
  45. 1 1
      src/store/reducers/otherHistory.js
  46. 13 2
      src/store/reducers/tabTemplate.js
  47. 2 2
      src/utils/config.js
  48. 12 6
      src/utils/tools.js

+ 30 - 3
src/common/components/EditableSpan/index.jsx

@@ -151,8 +151,8 @@ class EditableSpan extends Component{
     let innerVal = target.innerText || target.innerHTML,ele,boxTop;
     //禁止回车事件
     if(ev.keyCode==13){return false;}
-    //backspace事件
-    if(ev.keyCode==8){
+    //backspace事件 和delete
+    if(ev.keyCode==8 || ev.keyCode==46){
       //用于对比backspace前后的值
       this.setState({
         preVal:innerVal
@@ -196,6 +196,33 @@ class EditableSpan extends Component{
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
     let innerVal = target.innerText || target.innerHTML,ele,boxTop;
+    if(ev.keyCode==46){//delete
+      //判断nexObj
+      let nextObj = $(this.$span.current).next();
+      if(preVal.trim().length==1&& !innerVal){
+        removeId && removeId({boxMark,i:index,text:"",flag:'del'});
+        handleClear && handleClear({boxMark});//删除最后一个字时清空搜索结果,避免现病史搜索框不立即消失的情况
+        //如果后一个不是标签,则光标移到最前
+        if(nextObj && nextObj[0].nodeName !=="DIV"){
+          nextObj.focus();
+        }
+      }
+      //action里往后删除
+      if(innerVal == preVal){
+        let data = innerVal.trim();
+        if(nextObj && !config.punctuationReg.test(data)){
+          handleKeydown&&handleKeydown({boxMark,i:index,text:data,flag:'del'});
+          // nextObj.focus();  
+          if(nextObj[0].nodeName !=="DIV"){
+            nextObj.focus();
+          }
+          /*this.setState({
+            index: null
+          })*/
+        }
+      }
+    }
+
     if(ev.keyCode==8){     
       // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
       // 前面是标签,内容为空时再删一次才移除标签;前面是文本,则直接移除;
@@ -229,7 +256,7 @@ class EditableSpan extends Component{
         if(index!==0 && !config.punctuationReg.test(data)){
           // let preObj = $(this.$span.current).prev();
           let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
-          handleKeydown&&handleKeydown({boxMark,i:index,text:data});
+          handleKeydown&&handleKeydown({boxMark,i:index,text:data,flag:'backsp'});
           this.moveEnd(obj[0]);  
           this.setState({
             index: null

+ 1 - 1
src/common/components/EditableSpan/index.less

@@ -5,7 +5,7 @@
   word-break: break-word;
   min-width: 10px;
   // line-height: 2;
-  height: 16px;
+  /*height: 16px;*/
   line-height: 16px;
   vertical-align: middle;
   text-align: left;

+ 4 - 43
src/common/components/InlineTag/index.jsx

@@ -15,49 +15,16 @@ import {handleEnter} from '@utils/tools.js';
 class InlineTag extends Component {
   constructor(props){
     super(props);
-    this.$box = React.createRef();
     this.$span = React.createRef();
-    this.$pre = React.createRef();
-    this.$suf = React.createRef();
     this.state = {
-      editable:false,
       value:props.value||'',
       placeholder:props.placeholder||''
     };
-    this.changeToEdit = this.changeToEdit.bind(this);
-    this.changeToClick = this.changeToClick.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
     this.handleFixClick = this.handleFixClick.bind(this);
   }
-  changeToEdit(e){
-    const {handledbClick,id} = this.props;
-    // 输入框有值才可以双击编辑
-    const text = this.$span.current.innerText;
-    if(!text.trim()){
-      return
-    }
-    this.setState({
-      editable:true
-    });
-    //埋点记录
-    handledbClick&&handledbClick({id});
-  }
-  changeToClick(e){
-    e.stopPropagation();
-    const {saveEditText,ikey} = this.props;
-    this.setState({
-      editable:false
-    });
-    saveEditText&&saveEditText({
-      changeVal:this.$span.current.innerText,
-      totalVal:this.$box.current.innerText,
-      prefix:this.$pre.current.innerText,
-      suffix:this.$suf.current.innerText,
-      ikey
-    });
-  }
   handleInput(e){       //输入时保存临时值,在修改灰显为黑色时判断用
     e.stopPropagation();
   }
@@ -125,24 +92,18 @@ class InlineTag extends Component {
   }
   render(){
     const {prefix,suffix} = this.props;
-    const {editable,placeholder,value} = this.state;
+    const {placeholder,value} = this.state;
     return <div className={this.getStyle()}
-                 onDoubleClick={this.changeToEdit}
-                 /*onClick={!editable?this.handleFixClick:''}*/
-                 onKeyDown={handleEnter}
-                 onBlur={this.changeToClick} 
-                 ref={this.$box} 
-                 contentEditable={editable}>
-                <span ref={this.$pre}>&nbsp;{prefix}</span>
+                onClick={this.handleFixClick}>
+                <span>{prefix}</span>
                 <span className={style['free-in']}
                       contentEditable={true}
                       onBlur={this.handleBlur}
                       onInput={this.handleInput}
                       onFocus={this.handleFocus}
-                      /*onClick={e=>e.stopPropagation()}*/
                       onKeyDown={handleEnter}
                       ref={this.$span}>&nbsp;{value||placeholder}</span>
-                <span ref={this.$suf}>&nbsp;{suffix}</span>
+                <span>{suffix}</span>
             </div>;
     }
 }

+ 15 - 2
src/components/CheckBody/index.jsx

@@ -34,19 +34,32 @@ class CheckBody extends Component{
     }
     this.setState({boxLeft:next.boxLeft})
   }
+  isThereHigh(arr,ids){
+    if(!arr||!ids){
+      return false;
+    }
+    const item = arr.find((it)=>{
+      return ids.includes(it.id);
+    });
+    if(item){
+      return true;
+    }
+    return false;
+  }
   getLabels(){
     const {data,showArr,saveText,selecteds,importLabel} = this.props;
     let arr = [],list=[];
     const {boxMark,showAll} = this.state;
     const moreNum =data.length-[...data].reverse().findIndex((it)=>it.showInCheck)-1;//被隐藏的位置
     const moreText = filterDataArr([...saveText].splice(moreNum+1));     //被收起的标签中是否有有值得,有则不能再收起showMoreBtn?more:''
+    const hasHigh = this.isThereHigh([...data].splice(moreNum+1),importLabel);         //隐藏的标签中是否有高亮的
     const more = showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
-    const showMoreBtn = data.length>config.showCheckNum&&(data.length-1>moreNum&&!data[0].full)&&!moreText;
+    const showMoreBtn = data.length>config.showCheckNum&&(data.length-1>moreNum&&!data[0].full)&&!moreText&&!hasHigh;
     let showArray = data.filter((it)=>{
       if(it.showInCheck)
         return it;
     });
-    const showData = moreText||showAll?[...data]:showArray;//[...data].splice(0,config.showCheckNum*2+1);
+    const showData = moreText||hasHigh||showAll?[...data]:showArray;//[...data].splice(0,config.showCheckNum*2+1);
     if(showData){
       list = showData;
       arr = list.map((it,i)=>{

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

@@ -113,6 +113,7 @@ class DiagnosticList extends Component {
         // showHistoryCaseModal && showHistoryCaseModal()
         // store.dispatch(initItemList(chronicMagItem))
         initItemList(chronicMagItem).then((res)=>{
+          console.log(99999,chronicMagItem)
             const result = res.data;
             if(result.code==0 && result.data){
               store.dispatch(setInitHistory(result.data));

+ 7 - 0
src/components/Emergency/HisList/index.jsx

@@ -154,6 +154,13 @@ class HisList extends Component {
     return style['export'];
   }
 
+  shouldComponentUpdate(next){
+    if(next.changeInd !==this.props.changeInd){
+      this.setState({index:0})
+    }
+    return true;
+  }
+
   getList(){
     const { data } = this.props;
     let list = data&&data.map((v,i)=>{

+ 21 - 5
src/components/Emergency/index.jsx

@@ -17,7 +17,9 @@ class EmergencyHis extends Component{
       index:0,
       timer:null,
       valChange:true,
-      chooseItem:''
+      chooseItem:'',
+      filtFlag:-1 , //筛选标识
+      changeInd:false
     }
     this.searInp = React.createRef();
     this.handleClose = this.handleClose.bind(this);
@@ -48,6 +50,9 @@ class EmergencyHis extends Component{
   handleFilter(obj){//筛选
     const {filterData} = this.props;
     filterData&&filterData(obj);
+    this.setState({
+      filtFlag:obj.flag
+    }) 
   }
 
   showDetail(index){//病历详情
@@ -96,15 +101,24 @@ class EmergencyHis extends Component{
   }
   // 确认添加
   handleAdd(){
-    const {chooseItem,index} = this.state;
+    const {chooseItem,index,filtFlag,changeInd} = this.state;
     const {addSecond,data} = this.props;
     if(chooseItem.trim()){
+      // 在非默认筛选条件下添加二次诊断后重新调筛选接口
+      if(filtFlag !== -1){
+        if(filtFlag ==0){//无二次诊断添加后重置index
+          this.setState({
+            index:0,
+            changeInd:!changeInd //重置list中的index标识
+          })
+        }
+      }
       // 添加接口
       const item = {
         name:chooseItem,
         id:data[index].inquiryId
       }
-      addSecond&&addSecond(item);
+      addSecond&&addSecond({item,flag:filtFlag});
       this.searInp.current.value = "";
       this.setState({
         valChange:true,
@@ -122,7 +136,8 @@ class EmergencyHis extends Component{
 
   render(){
     const {show,data,total,preInfo,searchData} = this.props;
-    const {index,valChange} = this.state;
+    // const {index,valChange,changeInd} = this.state;
+    const {index,valChange,changeInd} = this.state;
     // const searchData = [];
     let baseObj = data[index];
     let dataJson,dataStr;
@@ -153,7 +168,8 @@ class EmergencyHis extends Component{
                         getMore={this.getMore} 
                         handleFilter={this.handleFilter}
                         detail={this.showDetail}
-                        handleDownload={this.handleDownload}/>
+                        handleDownload={this.handleDownload}
+                        changeInd={changeInd}/>
               </div>
               <div className={style['emer-right']}>
                 {

+ 4 - 3
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -13,6 +13,7 @@ import { ConfirmModal } from '@commonComp';
 import {showHistory} from "@store/actions/historyTemplates";
 import { CONFIRM_TYPE } from "@store/types/typeConfig";
 import {billing} from '@store/async-actions/pushMessage';
+import {getHistempDetail} from '@store/async-actions/historyTemplates';
 
 
 class HistoryCaseContainer extends React.Component {
@@ -54,7 +55,7 @@ class HistoryCaseContainer extends React.Component {
         activeId:idx,
         activeHis:tmpItems,
         dataStr:tmpItems.detailList||[],
-        dataJson:JSON.parse(tmpItems.dataJson)||{},
+        // dataJson:JSON.parse(tmpItems.dataJson)||{},
       })
     }
     makeSure(){
@@ -62,7 +63,7 @@ class HistoryCaseContainer extends React.Component {
         this.setState({visible:false})
         store.dispatch(showHistory(false))
         store.dispatch({type: CONFIRM_TYPE, confirmType: activeHis.sign});
-        pushAllDataList(activeHis.sign,'push',activeHis,'history')       //引用
+        store.dispatch(getHistempDetail(activeHis))
         if(didPushParamChange()){
           store.dispatch(billing())
         }
@@ -81,7 +82,7 @@ class HistoryCaseContainer extends React.Component {
         activeId:idx,
         activeHis:val,
         dataStr:val.detailList||[],
-        dataJson:JSON.parse(val.dataJson)||{},
+        // dataJson:JSON.parse(val.dataJson)||{},
       })
     }
     render(){

+ 3 - 42
src/components/MultSpread/index.jsx

@@ -33,12 +33,8 @@ class MultSpread extends Component{
   constructor(props){
     super(props);
     this.state = {
-      editable: false,
       numDoms:[]
     };
-    this.$cont = React.createRef();
-    this.changeToEdit = this.changeToEdit.bind(this);
-    this.handleEdit = this.handleEdit.bind(this);
   }
   getClass(){
     const {saveText,ikey,showAdd} = this.props;
@@ -76,12 +72,11 @@ class MultSpread extends Component{
   }
   getLabels(){
     const {data,ikey,showArr,copyId,selecteds,boxMark} = this.props;
-    const {editable}= this.state;
     let show = false;
     let inx = '',count=0;
     const list = data.map((it,i)=>{
       inx=ikey+'-'+i;
-      show = editable?false:showArr&&showArr[inx];
+      show = showArr&&showArr[inx];
       switch (true){
         case +it.tagType===8:
           return it.name;
@@ -166,33 +161,6 @@ class MultSpread extends Component{
     });
     return list;
   }
-  changeToEdit(e){
-    const {name,copyId,ikey,placeholder,handleDbclick,saveText,prefix,suffix} = this.props;
-    const labelInx = tools.getLabelIndex(ikey);
-    const text = saveText&&saveText[+labelInx];
-    //clearTimeout(this.state.timer);//取消延时的单击事件
-    e.preventDefault();
-    if(text&&text.trim()) {//有选中值的标签才能双击编辑
-      this.setState({
-        editable: true
-      });
-      //失焦关闭编辑状态
-      setTimeout(()=>{
-        this.$cont.current.focus();
-      });
-      //双击埋点记录
-      handleDbclick && handleDbclick({id:copyId});
-    }
-  }
-  handleEdit(e){
-    const {saveEditText,ikey} = this.props;
-    if(!this.state.editable) return;
-    this.setState({
-      editable: false
-    });
-    let totalVal = e.target.innerText || e.target.innerHTML;
-    saveEditText && saveEditText({ikey,type:ikey.split("-")[0],totalVal});
-  }
   componentDidMount(){
     //挂载完成保存有加号的项目数据
     const {saveAddItem,fullData,copyId,showAdd} = this.props;
@@ -204,23 +172,16 @@ class MultSpread extends Component{
     }
   }
   getContClass(){
-    const {editable} = this.state;
     const {isImports,ikey,saveText} = this.props;
     const labelInx = tools.getLabelIndex(ikey);
     const text = saveText&&saveText[+labelInx];
     const orgBorder = isImports&&!text?style['orange-border']:'';
-    const edit = editable?style['blue-border']:'';
-    return classNames(edit,orgBorder);
+    return classNames(orgBorder);
   }
   render(){
     const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix} = this.props;
     return (<div className={this.getContClass()}
-                 style={{display:'inline-block'}}
-                 onDoubleClick={this.changeToEdit}
-                 ref = {this.$cont}
-                 contentEditable={this.state.editable}
-                 onBlur={this.handleEdit}
-                 onKeyDown={tools.handleEnter}>
+                 style={{display:'inline-block'}}>
       {textPrefix?<span>{textPrefix}</span>:''}
       <div className={this.getClass()}>
       {this.getLabels()}

+ 12 - 68
src/components/NumberDrop/index.jsx

@@ -3,7 +3,7 @@ import className from 'classnames';
 import {NumberPan,Notify} from '@commonComp';
 import style from './index.less';
 import $ from "jquery";
-import {handleEnter,getPageCoordinate} from '@utils/tools.js';
+import {getPageCoordinate} from '@utils/tools.js';
 /***
  * author:zn@2018-11-19
  * 接收参数:
@@ -18,7 +18,7 @@ class NumberDrop extends Component{
   constructor(props){
     super(props);
     this.state={
-      editable:false,      //标签是否可输入
+      /*editable:false,      //标签是否可输入*/
       timer:null,
       sltTimer:null,
       blurTimer:null,
@@ -30,16 +30,10 @@ class NumberDrop extends Component{
       placeholder:props.placeholder
     };
     this.$span = React.createRef();
-    this.$pre = React.createRef();
-    this.$suf = React.createRef();
-    this.$cont = React.createRef();
-    //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.beyondArea = this.beyondArea.bind(this);
   }
@@ -109,23 +103,12 @@ class NumberDrop extends Component{
       handleHide && handleHide();
       return;
     }else{
-      const {editable} = this.state;
-      if(editable){
-        return;
-      }
-      const that = this;
-      //双击时不显示下拉
-      clearTimeout(that.state.timer);
-      const timer = setTimeout(function(){
-        //只有弹窗关闭则点击数字键盘会清空当前数据
-        that.$span.current.focus();
-        that.setState({
-          hasSelect:false
-        });
-        handleShow&&handleShow({ikey,id:patId||id});
-      },300);
+      this.$span.current.focus();
+      this.setState({
+        hasSelect:false
+      });
+      handleShow&&handleShow({ikey,id:patId||id});
       this.setState({
-        timer,
         boxLeft:getPageCoordinate(e).boxLeft,
         boxTop:getPageCoordinate(e).boxTop,
         tmpScroll: $("#addScrollEvent")[0].scrollTop,
@@ -207,42 +190,10 @@ class NumberDrop extends Component{
   getClasses(){         //整个标签是否有值的状态
     const {hideTag,placeholder,value,isImports} = this.props;
     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']:'';
     const noTag = hideTag?style['no-tag']:'';
-    return className(isSelected,noTag,blueBorder,orgBorder);
-  }
-  changeToEdit(e){        //整个标签双击编辑状态
-    window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
-    const {value,id,handleDbclick,patId,handleHide,show} = this.props;
-    clearTimeout(this.state.timer);//取消延时的单击事件
-    e.preventDefault();
-    if(show){
-      handleHide&&handleHide();
-    }
-    if(value&&value.trim()) {//有选中值的标签才能双击编辑
-      this.setState({
-        editable: true
-      });
-      setTimeout(()=>{
-        this.$cont.current.focus();
-      })
-      //双击埋点记录
-      handleDbclick && handleDbclick({id:patId||id});
-    }
-  }
-  handleBlur(e){     //双击编辑blur
-    const {handleLabelChange,ikey,boxMark,value} = this.props;
-    this.setState({
-      editable: false
-    });
-    let totalVal = e.target.innerText.trim();
-    let changeVal = this.$span.current.innerText.trim();//数字框值-修改后;去掉前空格避免多空格叠加
-    let prefix = this.$pre.current.innerText.trim(); //前缀值-修改后
-    let suffix = this.$suf.current.innerText.trim(); //后缀值-修改后
-    // console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
-    handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix});
+    return className(isSelected,noTag,orgBorder);
   }
   getSpanClass(){       //将被替换的文字选中状态显示
     const cls = this.props.show?style['blued']:'';
@@ -264,17 +215,10 @@ class NumberDrop extends Component{
   }
   render(){
     const {prefix,suffix,show,value,handleHide,allClick} = this.props;
-    const {placeholder,editable,hasSelect,boxTop,boxLeft} = this.state;
-    //console.log(prefix,value,placeholder+'1',this.props.placeholder)
+    const {placeholder,hasSelect,boxTop,boxLeft} = this.state;
     return <div className={this.getClasses()}
-                ref={this.$cont}
-                onDblClick ={this.changeToEdit}
-                onClick={allClick?this.handleNumClick:null}
-                contentEditable={editable}
-                onBlur={this.handleBlur}
-                onKeyDown={handleEnter}
-                onFocus={this.stopBubble.bind(this)}>
-      <span ref = {this.$pre}>&nbsp;{prefix}</span>
+                onClick={allClick?this.handleNumClick:null}>
+      <span>{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={allClick?null:this.handleNumClick}
             contentEditable={true}
@@ -285,7 +229,7 @@ class NumberDrop extends Component{
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
             >&nbsp;{value||placeholder}</span>
-      <span ref = {this.$suf}>&nbsp;{suffix}</span>
+      <span>{suffix}</span>
       <NumberPan handleSelect={this.select.bind(this)}
                  onClose={handleHide}
                  show={show}

+ 34 - 26
src/components/Operation/index.jsx

@@ -160,33 +160,37 @@ class Operation extends Component {
       Notify.info('模板数据不能为空')
       return false
     }
-    console.log(jsonStr,'文本')
-    console.log(jsonData,'结构')       //测试需要用到,不要删了
+    // console.log(jsonStr,'文本')
+    // console.log(jsonData,'结构')       //测试需要用到,不要删了
+    // console.log(tmpLis,'接口返回的')
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
-      let dataJson = tmpLis[i].dataJson;
+      // let dataJson = tmpLis[i].dataJson;
       // console.log(jsonStr.chief , JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')))
-      // console.log(jsonData.chief , JSON.parse(dataJson).chief)
       if(whichSign == 0){
         if(
           jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
           jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
           jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
-          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
-          JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
-          JSON.stringify(jsonData.checkedListImport) == JSON.stringify(JSON.parse(dataJson).checkedListImport) &&    
-          JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
-          JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&
-          JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
-          JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
-          JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
-          JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
-          JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
-          JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
-          JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
-          JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
-          JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
-          JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
+          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')')) &&
+          jsonStr.lis == JSON.parse(dataStr).lis &&
+          jsonStr.pacs == JSON.parse(dataStr).pacs &&
+          jsonStr.diag == JSON.parse(dataStr).diag &&
+          jsonStr.advice == JSON.parse(dataStr).advice
+          // JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
+          // JSON.stringify(jsonData.checkedListImport) == JSON.stringify(JSON.parse(dataJson).checkedListImport) &&    
+          // JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
+          // JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&
+          // JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
+          // JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
+          // JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
+          // JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
+          // JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
+          // JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
+          // JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
+          // JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
+          // JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
+          // JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
         ){
           Notify.info('该模板已保存');
           return false;
@@ -197,13 +201,17 @@ class Operation extends Component {
           jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
           jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
           jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
-          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
-          JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
-          JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
-          JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
-          JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
-          JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&        
-          JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
+          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')')) &&
+          jsonStr.lis == JSON.parse(dataStr).lis &&
+          jsonStr.pacs == JSON.parse(dataStr).pacs &&
+          jsonStr.diag == JSON.parse(dataStr).diag &&
+          jsonStr.advice == JSON.parse(dataStr).advice
+          // JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
+          // JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
+          // JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
+          // JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
+          // JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&        
+          // JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
         ){
           Notify.info('该模板已保存');
           return false;

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

@@ -28,6 +28,7 @@ class Preview extends Component {
             dataJson={dataJson}
             dataStr={dataStr}
             show={false}
+            come={'preview'}
         ></PreviewBody>
       </div>
     </div>

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

@@ -7,7 +7,7 @@ const PreviewInspect = (props) => {
       <td className={style['patInfoSec']}>化验:</td>
       <td className={style['patInfoSec']}>
         {
-          dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items) => {
+          dataJson&&dataJson.getExcelDataList && dataJson.getExcelDataList.map((items) => {
             return items.lisExcelRes && items.lisExcelRes.map((item) => {
               return <table style={style.assistTable}>
                 <tr style={style.assistTableTrFst}><td><span>{item.menus}</span></td></tr>
@@ -32,7 +32,7 @@ const PreviewInspect = (props) => {
           })
         }
         {
-          dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
+          dataJson&&dataJson.labelList && dataJson.labelList.map((item, idx) => {
             return <table style={{ margin: '8px 0', width: '100%' }}>
               {
                 item.show?<tr className={style.assistTableTrFst}><td><span> {item.name} </span></td></tr>:

+ 3 - 3
src/components/PreviewBody/ItemPart/index.jsx

@@ -22,9 +22,9 @@ const ItemPart = (props) => {
       </td>:
       <td className={style['patInfoSec']}>
       {
-        other_yjs.str1
+        other_yjs&&other_yjs.str1
       }
-      {dataJson['yjs_1']||dataJson['yjs_2']||dataJson['yjs_3']||dataJson['yjs_4']?<table className={style['formulaTable']}>
+      {(dataJson&&dataJson['yjs_1'])||(dataJson&&dataJson['yjs_2'])||(dataJson&&dataJson['yjs_3'])||(dataJson&&dataJson['yjs_4'])?<table className={style['formulaTable']}>
         <tr>
           <td rowSpan='2' className={style['alignMiddle']}>月经史:(</td>
           <td rowSpan='2' className={style['alignMiddle']}>{dataJson['yjs_1']||'初潮年龄'}</td>
@@ -36,7 +36,7 @@ const ItemPart = (props) => {
         </tr>
       </table>:''}
       {
-        other_yjs.str2
+       other_yjs&&other_yjs.str2
       }
     </td>
 

+ 25 - 13
src/components/PreviewBody/index.jsx

@@ -101,8 +101,20 @@ class PreviewBody extends Component {
     }
   }
   render() {
-    const { show, preInfo, dataJson, dataStr, baseObj, flg ,showAssessBtn,showHistoryCases} = this.props;
-    const other_yjs = dataStr.other?filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other):'';
+    const { show, preInfo, dataJson, dataStr, baseObj, flg ,come,showAssessBtn,showHistoryCases} = this.props;
+    let other_data={},lis_data={},pas_data={},other_yjs='',access='',adviceData={};
+    if(!come){
+      other_data = JSON.parse(baseObj.detailList[2].contentJson)
+      lis_data = JSON.parse(baseObj.detailList[4].contentJson)
+      pas_data = JSON.parse(baseObj.detailList[5].contentJson)
+      adviceData = JSON.parse(baseObj.detailList[7].contentJson)
+      other_yjs = other_data&&other_data.pfix;
+      access = other_data&&other_data.haveAssess
+    }else{
+      other_yjs = dataStr.other?filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other):'';
+      access = dataJson.haveAssess
+      adviceData=dataJson.advice
+    }
     //const isChronic = (dataJson.diagChronicMagItem&&dataJson.diagChronicMagItem.name)||(dataJson.mainChronicDesease&&dataJson.mainChronicDesease.name);
     const noData = JSON.stringify(preInfo) == '{}';
     return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>
@@ -111,26 +123,26 @@ class PreviewBody extends Component {
         <table className={style['infos']}>
           <ItemPart dataStr={dataStr.chief} title={'主诉:'} type={1}></ItemPart>
           <ItemPart dataStr={dataStr.present} title={'现病史:'} type={1}></ItemPart>
-          <ItemPart dataStr={dataStr.present} title={'其他史:'} dataJson={dataJson} other_yjs={other_yjs} type={3}></ItemPart>
+          <ItemPart dataStr={dataStr.present} title={'其他史:'} dataJson={come?dataJson:other_data} other_yjs={other_yjs} type={3}></ItemPart>
           <ItemPart dataStr={dataStr.vital} title={'查体:'} type={1}></ItemPart>
-          <PreviewInspect dataJson={dataJson} toTime={this.toTime} dateTime={this.state.dateTime} showDetails={this.showDetails}></PreviewInspect>
+          <PreviewInspect dataJson={come?dataJson.lis:lis_data} toTime={this.toTime} dateTime={this.state.dateTime} showDetails={this.showDetails}></PreviewInspect>
           <ItemPart dataStr={dataStr.pacs} title={'辅检:'} type={2}></ItemPart>
           <ItemPart dataStr={dataStr.diag} title={'诊断:'} type={2}></ItemPart>
           <tr className={style['patInfoFst']}>
             <td className={style['patInfoSec']}>医嘱:</td>
             <td className={`${style['patInfoSec']} ${style['pushMessage']} ${style['font14']}`}>
-              {((dataJson.advice.assay && dataJson.advice.assay.length > 0) || (dataJson.advice.check && dataJson.advice.assay.check > 0)) && <p className={style.pushMessageTitle}><span>开单项目</span></p>}
+              {((adviceData&&adviceData.assay && adviceData.assay.length > 0) || ((adviceData&&adviceData.check)&& (adviceData&&adviceData.assay.check > 0))) && <p className={style.pushMessageTitle}><span>开单项目</span></p>}
               {
-                ((dataJson.advice.assay && dataJson.advice.assay.length > 0) || (dataJson.advice.check && dataJson.advice.assay.check > 0)) && <div className={style.pushMessageDes}>{dataJson.advice.check?dataJson.advice.check+',':''} {dataJson.advice.assay}</div>
+                ((adviceData&&adviceData.assay && adviceData.assay.length > 0) || ((adviceData&&adviceData.check) && (adviceData&&adviceData.assay.check > 0))) && <div className={style.pushMessageDes}>{adviceData.check?adviceData.check+',':''} {adviceData.assay}</div>
               }
-              {dataJson.advice.commontreatment && dataJson.advice.commontreatment.length > 0 && <p  className={style.pushMessageTitle}><span>一般治疗</span></p>}
+              {adviceData&&adviceData.commontreatment && adviceData.commontreatment.length > 0 && <p  className={style.pushMessageTitle}><span>一般治疗</span></p>}
               {
-                dataJson.advice.commontreatment && <div dangerouslySetInnerHTML={{__html: dataJson.advice.commontreatment}} className={style.pushMessageDes}></div>
+                adviceData&&adviceData.commontreatment && <div dangerouslySetInnerHTML={{__html: adviceData.commontreatment}} className={style.pushMessageDes}></div>
               }
-              {dataJson.advice.followUp && dataJson.advice.followUp.length > 0 && <p className={style.pushMessageTitle}><span>回访时间:<span className={style['bbtm']}>{dataJson.advice.followUp}</span> 后回访,不适随诊</span></p>}
-              {dataJson.advice.scheme && dataJson.advice.scheme.length > 0 && <p className={style.pushMessageTitle}><span>治疗方案</span></p>}
+              {adviceData&&adviceData.followUp && adviceData.followUp.length > 0 && <p className={style.pushMessageTitle}><span>回访时间:<span className={style['bbtm']}>{adviceData.followUp}</span> 后回访,不适随诊</span></p>}
+              {adviceData&&adviceData.scheme && adviceData.scheme.length > 0 && <p className={style.pushMessageTitle}><span>治疗方案</span></p>}
               {
-                dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
+                adviceData&&adviceData.scheme && adviceData.scheme.map((item, index) => {
                   return <p>{item.treatment.map((it, ii) => {
                     return (it.treatmentStr && it.treatmentStr.length > 0 ?
                       <div className={style.pushMessageDes}>{it.treatmentStr}</div> : '')
@@ -138,13 +150,13 @@ class PreviewBody extends Component {
                   })
               }
               {
-                dataJson.advice.adviceInput && <div className={style.pushMessageDes}>{dataJson.advice.adviceInput}</div>
+                adviceData&&adviceData.adviceInput && <div dangerouslySetInnerHTML={{__html: adviceData.adviceInput}} className={style.pushMessageDes}></div>
               }
             </td>
           </tr>
         </table>
         <p className={style.docName}>医生签名:<span>{baseObj ? baseObj.doctorName : (noData ? '' : preInfo.doctorName)}</span></p>
-        {showAssessBtn&&dataJson.haveAssess?<AssessResultHis showHistoryCases={showHistoryCases} inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
+        {showAssessBtn&&access?<AssessResultHis showHistoryCases={showHistoryCases} inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
         <div onClick={() => { this.surePrint(dataStr) }} className={style.printBtn} style={{
           display: show ? 'inline-block' : 'none',
         }}>打印</div>

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

@@ -33,6 +33,7 @@ class PrintPreview extends Component {
                       show={true}
                       onClose={onClose}
                       save={save}
+                      come={'preview'}
                   ></PreviewBody>
             </div>
         </div>

+ 16 - 6
src/components/PushContainer/index.jsx

@@ -2,8 +2,7 @@ import React, { Component } from 'react';
 import style from './index.less';
 import { Tab, ConfirmModal, Notify } from '@commonComp';
 import { tabChange, allChecked, changeVisible, keepPushData, allCheckedShow } from '@store/actions/tabTemplate';
-import { initItemList, delItem, delBatchItem, changeTitleAsync, saveTemplateDetail } from '@store/async-actions/tabTemplate';
-import { CHANGE_TYPE } from "@store/types/typeConfig";
+import { initItemList, delItem, delBatchItem, changeTitleAsync, setPageView } from '@store/async-actions/tabTemplate';
 import { connect } from "react-redux";
 import store from '@store';
 import { billing } from '@store/async-actions/pushMessage';
@@ -66,7 +65,7 @@ class PushContainer extends Component {
    */
   handleActiveClick(id) {
     if (id == '1') {
-      store.dispatch(initItemList());
+      store.dispatch(initItemList("",1));
     }
     store.dispatch(tabChange(id))
   }
@@ -205,6 +204,11 @@ class PushContainer extends Component {
     })
     store.dispatch(changeVisible(true))
   }
+  handleClickGetMore(page){
+    let tmpPage = ++page
+    store.dispatch(initItemList("",tmpPage,true))
+  }
+  
   makeSure() {
     if (this.state.type == 1) {
       store.dispatch(delItem(this.state.id))
@@ -225,11 +229,12 @@ class PushContainer extends Component {
       store.dispatch(changeTitleAsync(tempObj))
     } else if (this.state.type == 4) {        //模板引入
       const { items } = this.props;
+      store.dispatch(setPageView(this.state.id,items[0].type))
       items && items.map((part) => {
         if (this.state.id == part.id) {
           let typeConfig = part.type;
-          store.dispatch(keepPushData(part, 'part'))                 //引用数据的存储,用于保存模板是判断数据是否变化
-          pushAllDataList(typeConfig, 'push', part, 'template')       //引用
+          // store.dispatch(keepPushData(part, 'part'))//引用数据的存储,用于保存模板是判断数据是否变化
+          // pushAllDataList(typeConfig, 'push', part, 'template')//引用
           if (didPushParamChange()) {
             store.dispatch(billing())
           }
@@ -242,7 +247,7 @@ class PushContainer extends Component {
     store.dispatch(changeVisible(false));
   }
   render() {
-    const { activeId, checkItems, visible, showMsg, items, allCheckShow } = this.props;
+    const { activeId, checkItems, visible, showMsg,hasMore,current, items, allCheckShow } = this.props;
     return <div className={style["container"]} ref={this.$cont} >
       <Tab tabs={this.state.tabs}
         activeId={activeId}
@@ -252,6 +257,8 @@ class PushContainer extends Component {
           <PushItemsContainer></PushItemsContainer>
           <TemplateItems
             items={items}
+            current={current}
+            hasMore={hasMore}
             checkItems={checkItems}
             allCheckShow={allCheckShow}
             handleContentClick={this.handleContentClick}
@@ -260,6 +267,7 @@ class PushContainer extends Component {
             handleDelList={this.handleDelList}
             handleMangerTemplate={this.handleMangerTemplate}
             handleAllCheckbox={this.handleAllCheckbox}
+            handleClickGetMore={this.handleClickGetMore}
           ></TemplateItems>
           <MedicalInfoContainer></MedicalInfoContainer>
           <ScaleSearchContainer></ScaleSearchContainer>
@@ -285,6 +293,8 @@ class PushContainer extends Component {
 const mapStateToProps = (state) => {
   return {
     items: state.tabTemplate.items,
+    current: state.tabTemplate.current,
+    hasMore: state.tabTemplate.hasMore,
     activeId: state.tabTemplate.activeId,
     checkItems: state.tabTemplate.checkItems,
     allChecked: state.tabTemplate.allChecked,

+ 6 - 1
src/components/TemplateItems/index.jsx

@@ -50,7 +50,8 @@ class TemplateItems extends React.Component {
         }
     }
     render() {
-        const { allCheckShow, handleMangerTemplate, handleDelList, handleAllCheckbox, items,checkItems } = this.props;
+        const { allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
+        // console.log(hasMore,current,7877877)
         return (
             <div className={style.wrapper}>
                 {
@@ -75,6 +76,10 @@ class TemplateItems extends React.Component {
                         this.genItems().length > 0?this.genItems():
                         <Empty message={'还没有保存模板'}></Empty>
                     }
+                    {
+                      hasMore?<p onClick={()=>handleClickGetMore(current)} className={style.loadMore}>点击查看更多</p>:null
+                    }
+                    
                 </div>
             </div>
         )

+ 6 - 0
src/components/TemplateItems/index.less

@@ -52,5 +52,11 @@
             color: @template-color;
         }
     }
+    .loadMore {
+      text-align: center;
+      color: #2a9bd5;
+      cursor: pointer;
+      margin-top: 15px;
+    }
 }
 

+ 0 - 10
src/containers/CurrentIll.js

@@ -56,18 +56,8 @@ function mapDispatchToProps(dispatch) {
           clickType:'单击',
           num:1
         });
-        // 判断是否有子模板数据
-        const sonId = obj.relationModule;//子模板id
-        let sonArr = allModules.filter((item)=>{return item.id==sonId})
-        if(sonArr.length==0){//未匹配到子模板
-          Notify.info("未找到相关内容");
-          return
-        }
         dispatch({
           type:INSERT_PROCESS,
-          // id:obj.relationModule,
-          // allModules:allModules
-          addSmoduleData:JSON.parse(JSON.stringify(sonArr[0].moduleDetailDTOList))
         });
         dispatch({
           type:ISREAD

+ 2 - 5
src/containers/DiagnosticList.js

@@ -1,16 +1,13 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
-import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING} from '@store/types/diagnosticList'; 
+import { DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING} from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
 import {billing, getConceptDetail} from '../store/async-actions/pushMessage';
 import {keepPushData} from '@store/actions/tabTemplate';
-import { showHistory,sortHistory,activeHistory,visibleHistory } from '@store/actions/historyTemplates'
-import {CURRENT_CHRONIC} from '@store/types/currentIll';
+import { visibleHistory } from '@store/actions/historyTemplates'
 import {autoFillModules} from '@store/async-actions/fetchModules';
-import { initItemList } from '@store/async-actions/historyTemplates';
-import {MODI_LOADING} from '@store/types/homePage.js';
 import {SET_ASSESS_DATA} from '@types/assessResult';
 
 function mapStateToProps(state) {

+ 9 - 8
src/containers/EditableSpan.js

@@ -223,20 +223,20 @@ function mapDispatchToProps(dispatch,state) {
           break;
       }
     },
-    handleKeydown(obj){//backspace删除
+    handleKeydown(obj){//backspace删除 + delete
       if(obj.i==null){return}
       switch (+obj.boxMark){
         case 1:
-          dispatch({type:DEL_MAIN,delIndex:obj.i,text:obj.text});
+          dispatch({type:DEL_MAIN,delIndex:obj.i,text:obj.text,flag:obj.flag});
           break;
         case 2:
-          dispatch({type:DEL_CURRENT,delIndex:obj.i,text:obj.text});
+          dispatch({type:DEL_CURRENT,delIndex:obj.i,text:obj.text,flag:obj.flag});
           break;
         case 3:
-          dispatch({type:DEL_OTHERHIS,delIndex:obj.i});
+          dispatch({type:DEL_OTHERHIS,delIndex:obj.i,flag:obj.flag});
           break;
         case 4:
-          dispatch({type:DEL_CHECKBODY,delIndex:obj.i});
+          dispatch({type:DEL_CHECKBODY,delIndex:obj.i,flag:obj.flag});
           break;
         default:
           break;
@@ -247,15 +247,16 @@ function mapDispatchToProps(dispatch,state) {
       })
     },
     removeId(obj){//删除时移除id
+      if(obj.i==null){return}
       switch (+obj.boxMark){
         case 1:
-          dispatch({type:REMOVE_MAIN_ID,index:obj.i,text:obj.text});
+          dispatch({type:REMOVE_MAIN_ID,index:obj.i,text:obj.text,flag:obj.flag});
           break;
         case 2:
-          dispatch({type:REMOVE_CURR_ID,index:obj.i,text:obj.text});
+          dispatch({type:REMOVE_CURR_ID,index:obj.i,text:obj.text,flag:obj.flag});
           break;
         case 3:
-          dispatch({type:REMOVE_OTHER_ID,index:obj.i});//移除多余空标签
+          dispatch({type:REMOVE_OTHER_ID,index:obj.i,flag:obj.flag});//移除多余空标签
           break;
         default:
           break;

+ 4 - 4
src/containers/Emergency.js

@@ -35,12 +35,12 @@ const mapDispatchToProps = function(dispatch){
     handleChangeValue(val){
       dispatch(getSearchList(val,true))
     },
-    async addSecond(item){
-      // dispatch(addSecondDiag(item))
-      let resData = await addSecondDiag(item);
+    async addSecond(obj){
+      let resData = await addSecondDiag(obj.item);
       if(resData&&resData.data.code==0){
         Notify.info("添加成功");
-        dispatch(getFilterHis({flag:-1}));
+        // dispatch(getFilterHis({flag:-1}));
+        dispatch(getFilterHis({flag:obj.flag}));
       }
       
     }

+ 0 - 25
src/containers/InlineTag.js

@@ -6,7 +6,6 @@ import {SETCURRENTINPUT,CURRENT_TEXT_LABEL} from '@types/currentIll';
 import {SETCHECKINPUT} from "@types/checkBody";
 import InlineTag from "../common/components/InlineTag";
 import {getLabelIndex} from '@utils/tools.js';
-import {CLICKCOUNT} from '@types/homePage.js';
 import {CHANGEOTHERTEXTLABEL} from "../store/types/otherHistory";
 import {CHANGECHECKTEXTLABEL} from "../store/types/checkBody";
 import {CHANGE_LABELVAL} from "../store/types/mainSuit";
@@ -22,13 +21,6 @@ const tagInpActions = {
   4:SETCHECKINPUT
 };
 
-const inpEditActions = {
-  1:CHANGE_LABELVAL,
-  2:CURRENT_TEXT_LABEL,
-  3:CHANGEOTHERTEXTLABEL,
-  4:CHANGECHECKTEXTLABEL
-};
-
 function mapDispatchToProps(dispatch,store){
   return {
     handleInput(params) {
@@ -45,23 +37,6 @@ function mapDispatchToProps(dispatch,store){
         subIndex:inner
       })
     },
-    handledbClick(obj){
-      dispatch({
-        type:CLICKCOUNT,
-        data:obj,
-        clickType:'双击',
-        num:1
-      });
-    },
-    saveEditText(obj){
-      const i = getLabelIndex(obj.ikey);
-      const type = obj.ikey.substr(0,1);
-      obj.ikey = i;
-      dispatch({
-        type:inpEditActions[type],
-        data:obj
-      })
-    }
   }
 }
 

+ 2 - 15
src/containers/MainSuit.js

@@ -59,7 +59,8 @@ function mapDispatchToProps(dispatch) {
             type: CLEAR_COMSYMPTOMS
           })
         },
-        handleTailClick:(obj,saveText,allModules)=>{//点击带尾巴的标签,如添加病程变化
+        handleTailClick:(obj,saveText,allModules)=>{
+        //点击带尾巴的标签,如添加病程变化
           let text = filterDataArr(saveText);
           if(text.length >= config.limited){
             Notify.info(config.limitText);
@@ -72,22 +73,8 @@ function mapDispatchToProps(dispatch) {
             clickType:'单击',
             num:1
           });
-          // 判断是否有子模板数据
-          const sonId = obj.relationModule;
-          let sonArr = allModules.filter((item)=>{return item.id==sonId})
-          if(sonArr.length==0){//未匹配到子模板
-            Notify.info("未找到相关内容");
-            return
-          }
-          /*dispatch({
-            type: SHOW_TAIL,
-            info:obj.questionMapping,
-            id:obj.relationModule,
-            allModules:allModules
-          })*/
           dispatch({
             type: SHOW_TAIL,
-            addSmoduleData:JSON.parse(JSON.stringify(sonArr[0].moduleDetailDTOList))
           })
           dispatch({
             type:ISREAD

+ 5 - 39
src/containers/MultSpread.js

@@ -1,11 +1,11 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import MultSpread from "@components/MultSpread";
-import {SETSELECTED,CLEARSELECTED,CONFIRMSELECTED,CHANGEOTHERTEXTLABEL,OTHERADDLABELITEM} from '@types/otherHistory';
-import {CHANGECHECKTEXTLABEL,ADDLABELITEM} from '@types/checkBody.js';
-import {CHANGE_LABELVAL,MAINADDLABELITEM} from '@store/types/mainSuit.js';
-import {CURRENTADDLABELITEM,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
-import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD} from '@store/types/homePage.js';
+import {OTHERADDLABELITEM} from '@types/otherHistory';
+import {ADDLABELITEM} from '@types/checkBody';
+import {MAINADDLABELITEM} from '@store/types/mainSuit';
+import {CURRENTADDLABELITEM} from '@store/types/currentIll';
+import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD} from '@store/types/homePage';
 
 function mapStateToProps(state){
   return {}
@@ -34,15 +34,6 @@ const getCopyData = (copyId,inx,boxMark)=>{
   }
 };
 
-/**************************双击标签输入*********************************/
-
-const editTypes={
-  1:CHANGE_LABELVAL,      //主诉
-  2:CURRENT_TEXT_LABEL,                   //现病史
-  3:CHANGEOTHERTEXTLABEL,  //其他史
-  4:CHANGECHECKTEXTLABEL    //查体
-};
-
 function mapDispatchToProps(dispatch){
   return {
     resetHide(){
@@ -50,14 +41,6 @@ function mapDispatchToProps(dispatch){
         type: RESET
       })
     },
-    handleDbclick(obj){
-      dispatch({
-        type:CLICKCOUNT,
-        data:obj,
-        clickType:'双击',
-        num:1
-      });
-    },
     saveAddItem(id,data){      //保存有加号的标签原始数据
       dispatch({
         type:SETADDITEMINIT,
@@ -78,16 +61,6 @@ function mapDispatchToProps(dispatch){
       });
       dispatch(getCopyData(copyId,inx,boxMark));
     },
-    saveEditText(params){
-      const {type} = params;
-      const index = params.ikey;
-      let ikey = index.split("-")[1];
-      const {changeVal,totalVal} = params;
-      dispatch({
-        type:editTypes[+type],
-        data:{changeVal:changeVal,ikey:ikey,totalVal}
-      });
-    },
     handleClick(obj){
       dispatch({
         type:CLICKCOUNT,
@@ -96,13 +69,6 @@ function mapDispatchToProps(dispatch){
         num:1
       });
     }
-    /*handleConfirm(checks,key){
-      dispatch({
-        type: CONFIRMSELECTED,
-        checks,
-        key
-      })
-    }*/
   }
 }
 

+ 7 - 81
src/containers/NumberDrop.js

@@ -1,15 +1,15 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import NumberDrop from "@components/NumberDrop";
-import {SETNUMBER,CHANGEOTHERTEXTLABEL,CHANGEOTHERTEXTLABEL_NUMBER} from '@types/otherHistory';
-import {SETNUMBER4,CHANGECHECKTEXTLABEL,CHANGECHECKTEXTLABEL_NUMBER} from '@types/checkBody.js';
-import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage.js';
-import {NUMBER_SELECT,CHANGE_LABELVAL,CHANGE_LABELVAL_NUMBER} from '@store/types/mainSuit.js';
-import {CURRENT_NUMBER,CURRENT_TEXT_LABEL,CURRENT_TEXT_LABEL_NUMBER} from '@store/types/currentIll.js';
+import {SETNUMBER,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
+import {SETNUMBER4} from '@types/checkBody';
+import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage';
+import {NUMBER_SELECT} from '@store/types/mainSuit';
+import {CURRENT_NUMBER} from '@store/types/currentIll';
 import {billing} from '@store/async-actions/pushMessage';
 import {Notify} from '@commonComp';
-import {filterArr,didPushParamChange,filterDataArr,getLabelIndex} from '@utils/tools.js';
-import config from '@config/index.js';
+import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools';
+import config from '@config/index';
 
 function mapStateToProps(state){
   return {
@@ -69,55 +69,7 @@ function handleModuleDiff(dispatch,params){
     default:
   }
 }
-/**************************双击标签输入*********************************/
-// 主诉
-function mainSuitLabel(dispatch,params){
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
-  const {changeVal,totalVal} = params;
-  dispatch({
-    // type:CHANGE_LABELVAL,
-    type:CHANGE_LABELVAL_NUMBER,
-    data:Object.assign({},params,{ikey})
-  })
-}
-// 现病史
-function currentLabel(dispatch,params){
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
-  dispatch({
-    // type:CURRENT_TEXT_LABEL,
-    type:CURRENT_TEXT_LABEL_NUMBER,
-    data:Object.assign({},params,{ikey})
-  });
-  dispatch({
-    type:ISREAD
-  })
-}
-
-//其他史
-function otherHisLabelEdit(dispatch,params){
-  const index = params.ikey;
-  //const {changeVal,totalVal} = params;
-  let ikey = getLabelIndex(index);
-  dispatch({
-    // type:CHANGEOTHERTEXTLABEL,
-    type:CHANGEOTHERTEXTLABEL_NUMBER,
-    data:Object.assign({},params,{ikey})
-  })
-}
 
-//查体
-function checkBodyLabelEdit(dispatch,params){
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
-  //const {changeVal,totalVal} = params;
-  dispatch({
-    // type:CHANGECHECKTEXTLABEL,
-    type:CHANGECHECKTEXTLABEL_NUMBER,
-    data:Object.assign({},params,{ikey})
-  })
-}
 function mapDispatchToProps(dispatch,store){
   return {
     handleSelect(params){
@@ -130,14 +82,6 @@ function mapDispatchToProps(dispatch,store){
         }
       },config.delayPushTime);
     },
-    handleDbclick(obj){
-      dispatch({
-        type:CLICKCOUNT,
-        data:obj,
-        clickType:'双击',
-        num:1
-      });
-    },
     handleHide(){
       dispatch({
         type:HIDEDROP
@@ -158,24 +102,6 @@ function mapDispatchToProps(dispatch,store){
         type: RESET
       });*/
     },
-    handleLabelChange(params){
-      const {type} = params;
-      switch (+type){
-        case 1:
-          mainSuitLabel(dispatch,params);
-          break;
-        case 2:
-          currentLabel(dispatch,params);
-          break;
-        case 3:
-          otherHisLabelEdit(dispatch,params);
-          break;
-        case 4:
-          checkBodyLabelEdit(dispatch,params);
-          break;
-        default:
-      }
-    }
   }
 }
 

+ 1 - 1
src/containers/PushContainer.js

@@ -7,7 +7,7 @@ function mapStateToProps(state) {
     return {
         showHistoryCases:state.historyTemplates.showHistoryCases,
         activeHistory:state.historyTemplates.activeHistory,
-        items:state.historyTemplates.items,
+        items:state.historyTemplates.items
     }
 }
 

+ 1 - 1
src/containers/PushItemsContainer.js

@@ -17,7 +17,7 @@ function mapStateToProps(state) {//console.log(state)
         tableList: pushMessage.tableList,
         showList: pushMessage.showList,
         chronicPushItems: pushMessage.chronicPushItems,
-        setPushEmergencyIdx: state.pushMessage.setPushEmergencyIdx || '',  
+        setPushEmergencyIdx: state.pushMessage.setPushEmergencyIdx || '',
         sysConfig:state.homePage.sysConfig,
         windowHeight:state.homePage.windowHeight,
     }

+ 1 - 1
src/containers/TypeConfigContainer.js

@@ -49,7 +49,7 @@ function mapDispatchToProps(dispatch) {
           });
           dispatch(getOtherHisRecord());        //获取其他史最近记录
           Notify.success("模式切换成功");
-          dispatch(initItemList(confirmType));
+          dispatch(initItemList(confirmType,1));//切换模式调用模板接口
           dispatch(allCheckedShow(false))    //全选反选显示重置
           dispatch({//推送重置
             type: BILLING_ADVICE,

+ 28 - 13
src/store/actions/checkBody.js

@@ -456,20 +456,35 @@ export function setInputLabel(state,action){
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);
-  const {delIndex} = action;
+  const {delIndex,flag} = action;
   const data = res.data;
-  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // 前一个是文本标签或者子模板 不做处理
-  }else if(data[delIndex-1].tagType==8){
-    data.splice(delIndex,1);
-    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex,1);
-  }
-  else{
-    data.splice(delIndex-1,2);
-    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex-1,2);
+  if(flag == 'backsp'){
+    // 前一个是文本标签或者子模板,只改变值
+    if(data[delIndex-1].flag&&data[delIndex-1].flag==3){//子模板不删  
+      // data[delIndex].value = text;
+    }else if(data[delIndex-1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex-1,2);
+      res.selecteds.splice(delIndex-1,2); 
+      res.saveText.splice(delIndex-1,2);
+    }
+  }else if(flag == 'del'){
+    if(data[delIndex+1] && data[delIndex+1].flag&&data[delIndex+1].flag==3){//子模板不删  
+      
+    }else if(data[delIndex+1] && data[delIndex+1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex,2);
+      res.selecteds.splice(delIndex,2);  
+      res.saveText.splice(delIndex,2);
+    }
   }
   // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();

+ 61 - 23
src/store/actions/currentIll.js

@@ -1,6 +1,6 @@
 import config from '@config/index.js';
 import {formatContinueDots,getLabelIndex,fullfillText,getIds} from '@utils/tools';
-
+import {Notify} from '@commonComp';
 //插入病程变化模板
 function insertPro(data,processModule){
   let index;
@@ -63,7 +63,16 @@ export const setModule = (state,action)=>{
 //插入病程变化
 export const insertProcess = (state,action)=>{
   const res = Object.assign({},state);
-  let addSmoduleData = action.addSmoduleData;
+  let addSmoduleData = [];
+  if(res.currReadSonM.length>0){
+    addSmoduleData = JSON.parse(JSON.stringify(res.currReadSonM))
+  }else{
+    addSmoduleData = res.processModule.length>0?JSON.parse(JSON.stringify(res.processModule)):[];
+  }
+  if(addSmoduleData.length==0){//未匹配到子模板
+    Notify.info("未找到相关内容");
+    return
+  }
   let data = res.data;
   let newData = insertPro(data,addSmoduleData);
   res.data = fullfillText(newData).newArr;
@@ -670,6 +679,7 @@ export const clearCurrentIll = (state,action)=>{
   res.saveText = action.saveText;
   res.selecteds = action.selecteds?action.selecteds:[];
   res.symptomIds = action.symptomIds;
+  res.currReadSonM = action.currReadSonM||[];
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -887,21 +897,36 @@ export function setInputLabel(state,action){
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);
-  const {delIndex,text} = action;
+  const {delIndex,text,flag} = action;
   const data = res.data;
   // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-  // 前一个是文本标签或者子模板,只改变值
-  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){//子模板不删  
-    // data[delIndex].value = text;
-  }else if(data[delIndex-1].tagType==8){
-    data.splice(delIndex,1);
-    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex,1);
-  }
-  else{
-    data.splice(delIndex-1,2);
-    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex-1,2);
+  if(flag == 'backsp'){
+    // 前一个是文本标签或者子模板,只改变值
+    if(data[delIndex-1].flag&&data[delIndex-1].flag==3){//子模板不删  
+      // data[delIndex].value = text;
+    }else if(data[delIndex-1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex-1,2);
+      res.selecteds.splice(delIndex-1,2); 
+      res.saveText.splice(delIndex-1,2);
+    }
+  }else if(flag == 'del'){
+    if(data[delIndex+1] && data[delIndex+1].flag&&data[delIndex+1].flag==3){//子模板不删  
+      
+    }else if(data[delIndex+1] && data[delIndex+1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex,2);
+      res.selecteds.splice(delIndex,2);  
+      res.saveText.splice(delIndex,2);
+    }
   }
   // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
@@ -911,7 +936,7 @@ export function backspaceText(state,action){
 //删除后移除id
 export function removeId(state,action){
   let res = Object.assign({},state);
-  const {index,text} = action;
+  const {index,text,flag} = action;
   const data = res.data;
   // const id = data[index].id;
   const id = data[index].conceptId;
@@ -919,15 +944,28 @@ export function removeId(state,action){
   if(ids.includes(id)){
     ids.splice(ids.indexOf(id),1);
   }
-  if(!data[index].value && data[index-1].tagType==8){
-    data.splice(index,1);
-    res.saveText.splice(index,1);
+  if(flag == 'del'){
+    if(!data[index].value && data[index+1] && data[index+1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    }else{
+      data[index].id = "";
+      data[index].conceptId = "";
+      data[index].name = text;
+      data[index].value = text;
+    }
   }else{
-    data[index].id = "";
-    data[index].conceptId = "";
-    data[index].name = text;
-    data[index].value = text;
+    if(!data[index].value && data[index-1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    }else{
+      data[index].id = "";
+      data[index].conceptId = "";
+      data[index].name = text;
+      data[index].value = text;
+    }
   }
+  
   res.update = Math.random();
   return res;
 }

+ 61 - 20
src/store/actions/mainSuit.js

@@ -1,6 +1,6 @@
 import {getLabelIndex,fullfillText,getIds} from '@utils/tools.js';
 import config from '@config/index.js';
-
+import {Notify} from '@commonComp';
 
 function insertPro(data,processModule){//插入添加病情变化模板
   let index;
@@ -97,7 +97,17 @@ export const handleTailClick = (state,action)=>{
   const res = Object.assign({},state);
   let num = res.moduleNum.num;
   num++;
-  let addSmoduleData = action.addSmoduleData;
+  // 有回读的子模板,则优先用回读的
+  let addSmoduleData = [];
+  if(res.mainReadSonM.length>0){
+    addSmoduleData = JSON.parse(JSON.stringify(res.mainReadSonM))
+  }else{
+    addSmoduleData = res.addSmoduleData.length>0?JSON.parse(JSON.stringify(res.addSmoduleData)):[];
+  }
+  if(addSmoduleData.length==0){//未匹配到子模板
+    Notify.info("未找到相关内容");
+    return
+  }
   let datas = JSON.parse(JSON.stringify(res.data));
   
   for(let i=0; i<addSmoduleData.length; i++){
@@ -655,6 +665,11 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   res.mainIds = action.mainIds;
   res.mainTailIds = action.mainTailIds || [];
   res.chronicDesease = action.chronicDesease;//慢病疾病字段
+  res.mainReadSonM = action.mainReadSonM || [];//子模板
+  /*const readModule = action.mainReadSonM;
+  if(readModule&&readModule.length>0){//有回读子模板,则覆盖
+    res.addSmoduleData = readModule;
+  }*/
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -734,19 +749,33 @@ export function setInputLabel(state,action){
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);
-  const {delIndex} = action;
+  const {delIndex,flag} = action;
   const data = res.data;
-  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
-  // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // 前一个是文本标签或者子模板 不做处理
-  }else if(data[delIndex-1].tagType==8){
-    data.splice(delIndex,1);
-    res.saveText.splice(delIndex,1);
-  }
-  else{
-    data.splice(delIndex-1,2);
-    res.saveText.splice(delIndex-1,2);
+  if(flag == 'backsp'){
+    if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
+    // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
+      // 前一个是文本标签或者子模板 不做处理
+    }else if(data[delIndex-1].tagType==8){
+      data.splice(delIndex,1);
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex-1,2);
+      res.saveText.splice(delIndex-1,2);
+    }
+  }else if(flag == 'del'){
+    if(data[delIndex+1] && data[delIndex+1].flag&&data[delIndex+1].flag==3){
+      // 后一个是文本标签或者子模板 不做处理
+    }else if(data[delIndex+1] && data[delIndex+1].tagType==8){
+      data.splice(delIndex,1);
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex,2);
+      res.saveText.splice(delIndex,2);
+    }
   }
+  
   // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
@@ -755,7 +784,7 @@ export function backspaceText(state,action){
 //删除后移除id
 export function removeId(state,action){
   let res = Object.assign({},state);
-  const {index,text} = action;
+  const {index,text,flag} = action;
   const data = res.data;
   // 获取尾巴id-questionId
   const id = data[index].id;
@@ -769,14 +798,26 @@ export function removeId(state,action){
   if(ids.includes(copid)){
     ids.splice(ids.indexOf(copid),1);
   }
-  if(!data[index].value && data[index-1].tagType==8){
-    data.splice(index,1);
-    res.saveText.splice(index,1);
+  if(flag == 'del'){
+    if(!data[index].value && data[index+1] &&data[index+1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    }else{
+      data[index].id = "";
+      data[index].name = text;
+      data[index].value = text;
+    }
   }else{
-    data[index].id = "";
-    data[index].name = text;
-    data[index].value = text;
+    if(!data[index].value && data[index-1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    }else{
+      data[index].id = "";
+      data[index].name = text;
+      data[index].value = text;
+    }
   }
+  
   res.update = Math.random();
   return res;
 }

+ 49 - 21
src/store/actions/otherHistory.js

@@ -448,25 +448,45 @@ export const otherEditClear = (state,action)=>{
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);
-  const {delIndex} = action;
+  const {delIndex,flag} = action;
   const data = res.data;
-  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
-  // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // 前一个是文本标签或者子模板 不做处理
-  }else if(data[delIndex-1].tagType==8){
-    data.splice(delIndex,1);
-    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex,1);
-  }
-  else{
-    //月经史删除处理
-    if(data[delIndex-1].formulaCode){
-      res[data[delIndex-1].formulaCode]=undefined;
+  if(flag == 'backsp'){
+    if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
+    // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
+      // 前一个是文本标签或者子模板 不做处理
+    }else if(data[delIndex-1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      //月经史删除处理
+      if(data[delIndex-1].formulaCode){
+        res[data[delIndex-1].formulaCode]=undefined;
+      }
+      data.splice(delIndex-1,2);
+      res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex-1,2);
+    }
+  }else if(flag == 'del'){
+    if(data[delIndex+1] && data[delIndex+1].flag&&data[delIndex+1].flag==3){//子模板不删  
+      
+    }else if(data[delIndex+1] && data[delIndex+1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      //月经史删除处理
+      if(data[delIndex+1] &&data[delIndex+1].formulaCode){
+        res[data[delIndex+1].formulaCode]=undefined;
+      }
+      data.splice(delIndex,2);
+      res.selecteds.splice(delIndex,2);  
+      res.saveText.splice(delIndex,2);
     }
-    data.splice(delIndex-1,2);
-    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex-1,2);
   }
+  
   // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
@@ -475,12 +495,20 @@ export function backspaceText(state,action){
 //删除后移除空标签
 export function removeId(state,action){
   let res = Object.assign({},state);
-  const {index} = action;
+  const {index,flag} = action;
   const data = res.data;
-  if(!data[index].value && data[index-1].tagType==8){
-    data.splice(index,1);
-    res.saveText.splice(index,1);
-  } 
+  if(flag == 'del'){//delete
+    if(!data[index].value && data[inde+1] && data[inde+1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    } 
+  }else{ //backspace
+    if(!data[index].value && data[index-1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    } 
+  }
+  
   res.update = Math.random();
   return res;
 }

+ 31 - 24
src/store/async-actions/fetchModules.js

@@ -1,15 +1,15 @@
-import {json,expJson} from '@utils/ajax.js';
-import {SET,PRESET} from '@types/checkBody.js';
+import {json,expJson} from '@utils/ajax';
+import {SET,PRESET} from '@types/checkBody';
 import {SETDATA} from '@store/types/otherHistory';
 import store from '@store';
-import {getEMRParams,didPushParamChange,inspectAndAssist,fullfillText,checkFullfillText,deepClone} from '@utils/tools.js';
+import {getEMRParams,didPushParamChange,inspectAndAssist,fullfillText,checkFullfillText,deepClone,filterDataArr} from '@utils/tools';
 import {Notify} from '@commonComp';
 import {billing} from '@store/async-actions/pushMessage';
 import {SETOTHERHISTORY,ISREAD} from "../types/homePage";
 import config from "@config/index";
 import {CURRENT_CHRONIC} from '@store/types/currentIll';
-import {MODI_LOADING} from '@store/types/homePage.js';
-import {GET_ALL_HIS,FILTER_ALL_HIS} from '@store/types/emergencyHis.js';
+import {MODI_LOADING} from '@store/types/homePage';
+import {GET_ALL_HIS,FILTER_ALL_HIS} from '@store/types/emergencyHis';
 import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
 
 const api={
@@ -120,17 +120,18 @@ export const getOtherHisRecord = ()=>{
               save:[objStr[0]]
             });
           }else{
+            const text = filterDataArr(objStr);
             dispatch({
               type:SETOTHERHISTORY,
-              data:arr,
-              period:{
+              data:[{tagType:8,name:'',controlType:0,value:text}],
+              /*period:{
                 yjs_1: obj.yjs_1,
                 yjs_2: obj.yjs_2,
                 yjs_3: obj.yjs_3,
                 yjs_4: obj.yjs_4,
               },
-              selecteds:obj.otherHistorySelecteds,
-              save:objStr
+              selecteds:obj.otherHistorySelecteds,*/
+              save:[text]
             });
           }
         }
@@ -148,7 +149,7 @@ export function pregetCheckbodyData(flag){     //flag=true获取到数据后立
     const emrData = getEMRParams();
     const param = {
       age: emrData.age,
-      featureType: "1,4,41,7",
+      featureType: "1,42,41,7",
       diag: emrData.dis,
       lis: emrData.lis,
       other: emrData.other,
@@ -336,23 +337,27 @@ export function getAllHis(item){
   return (dispatch,getStore)=>{
     const state = getStore();
     const {message} = state.patInfo;
-    const params = {
-      "current": item.current,
-      // "endDate": item.endDate,
-      "hospitalDeptId": message.hospitalDeptId,
-      "hospitalId": message.hospitalId,
-      "size": 6,
-      // "startDate": item.startDate,
+    const {params} = state.emergencyHis;
+    let param = {};
+    if(JSON.stringify(params) == '{}'){
+      param = {
+        "current": item.current,
+        "hospitalDeptId": message.hospitalDeptId,
+        "hospitalId": message.hospitalId,
+        "size": 6,
+      }
+    }else{
+      param = Object.assign({},params,{current:item.current})
     }
 
-    json(api.getAllHisURL,params).then((res)=>{
+    json(api.getAllHisURL,param).then((res)=>{
       const result = res.data;
       if(result.code == 0){
         dispatch({
           type:GET_ALL_HIS,
           data:result.data.inquiryList,
           total:result.data.total,
-          params:params,
+          params:param,
         })
       }
     })
@@ -366,13 +371,14 @@ export function getFilterHis(obj){
     const {params} = state.emergencyHis;
     let newParam = {};
     if(obj.flag == 999){//时间筛选
-      newParam = Object.assign(params,{startDate:obj.startDate,endDate:obj.endDate})
+      newParam = Object.assign(params,{startDate:obj.startDate,endDate:obj.endDate,current:1})
     }else{
-      if(obj.flag==-1){
+      /*if(obj.flag==-1){
         newParam = Object.assign(params,{current:1})
       }else{
-        newParam = Object.assign({},params,{isHasSecond:obj.flag})
-      }
+        newParam = Object.assign({},params,{isHasSecond:obj.flag,current:1})
+      }*/
+      newParam = Object.assign({},params,{isHasSecond:obj.flag,current:1})
     }
 
     json(api.getAllHisURL,newParam).then((res)=>{
@@ -382,7 +388,8 @@ export function getFilterHis(obj){
           type:FILTER_ALL_HIS,
           data:result.data.inquiryList,
           total:result.data.total,
-          params:Object.assign(params,{current:1}),
+          // params:Object.assign(params,{current:1}),
+          params:Object.assign(newParam,{current:1}),
         })
       }
     })

+ 30 - 7
src/store/async-actions/historyTemplates.js

@@ -1,17 +1,20 @@
 import axios from '@utils/ajax';
-
+import { pushAllDataList } from '@utils/tools';
 import { initHistory } from '@store/actions/historyTemplates';
+import Notify from '@commonComp/Notify';
 import store from '@store';
 
 export const initItemList = (item) => {
-    let baseList = store.getState();
-    // let whichSign = baseList.typeConfig.typeConfig;
-    let state = baseList.patInfo.message;
-    const param = {
+  let baseList = store.getState();
+  // let whichSign = baseList.typeConfig.typeConfig;
+  let state = baseList.patInfo.message;
+  const param = {
       "hospitalId": state.hospitalId,
       "patientId": state.patientId,
-      "disName":item?item.name : 'dis',
-      "disType":item?1:0
+      "disName":item&&item.name?item.name : 'dis',
+      "disType":item?1:0,
+      "current": 1,
+      "size": 9999
     }
     /*return (dispatch) => {
         axios.json('/inquiryInfo/hisInquirys',param).then((res)=>{
@@ -25,6 +28,26 @@ export const initItemList = (item) => {
     }*/
     return axios.json('/inquiryInfo/hisInquirys',param);
 };
+export const getHistempDetail = (item) => {
+  const param = {
+      "inquiryId": item.id
+    }
+    return (dispatch) => {
+        axios.json('/inquiryInfo/getInquiryDetail',param).then((res)=>{
+            const data =res.data;
+            if(data.code == 0){
+                let tmpData = data.data
+                // let tmpList = tmpData.inquiryDetailList
+                // tmpData.detailList = tmpList
+                // console.log(tmpData)
+                pushAllDataList(item.sign,'push',tmpData,'history')       //引用                
+            }else{
+                console.log(data)
+                Notify.error(data.msg);
+            }
+        })
+    }
+};
 
 export function setInitHistory(data){
   return (dispatch) => {

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

@@ -74,10 +74,10 @@ export const initHistoryDetails = (dispatch) => {
                         confirmType: detail.sign
                     })
                     if(baseList.tabTemplate.items.length == 0){
-                      dispatch(initItemList());        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+                      dispatch(initItemList("",1));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
                     }
                 }else{
-                  dispatch(initItemList(baseList.typeConfig.typeConfig))
+                  dispatch(initItemList(baseList.typeConfig.typeConfig,1))
                 }
                 dispatch({type:MODI_LOADING,flag:false});
             } else {
@@ -104,7 +104,7 @@ export async function getPatientMessage(dispatch, getState){
   let res2 = await json(api.getPatBaseInfo, params);
   /*console.log(res2);
   console.log(2);*/
-  let data1 = {},data2={};
+  let data1 = {},data2 = {};
   if(res1.data.code=='0'){
     data1 = res1.data.data;
   }

+ 19 - 1
src/store/async-actions/print.js

@@ -7,7 +7,8 @@ import {
     getAllDataList,
     getAllDataStringList,
     pushAllDataList,
-    filterDataArr
+    filterDataArr,
+    filterOtherDataArr
 } from '@utils/tools';
 
 export const saveMessage = (bool) => {
@@ -20,12 +21,21 @@ export const saveMessage = (bool) => {
     const lisData = baseList.inspect.pushItem;
     const lisArr = transferIndexData(lisData);
     const haveAssess = Object.keys(baseList.assessResult.data).length>0;
+    let otherData = {},pacsData={};
     const evaluation={
       htmlContent:haveAssess?JSON.stringify(getEvaluations(baseList.assessResult,pushMessage)):'{}',
       //scaleList:[]
     };//getEvaluation();
     //console.log(baseList)
     // console.log(jsonStr.diag,'保存历史病历')
+    otherData['yjs_1']=jsonData['yjs_1']||''
+    otherData['yjs_2']=jsonData['yjs_2']||''
+    otherData['yjs_3']=jsonData['yjs_3']||''
+    otherData['yjs_4']=jsonData['yjs_4']||''
+    otherData['haveAssess']=haveAssess
+    otherData['pfix']=jsonStr.other?filterOtherDataArr(JSON.parse(jsonStr.other),jsonData.other):''
+    pacsData.pacs = jsonData.pacs
+    pacsData.checkedListImport = jsonData.checkedListImport
     json('/inquiryInfo/saveInquiry', {
         "doctorId": state.doctorId,
         "hospitalDeptId": state.hospitalDeptId,
@@ -37,34 +47,42 @@ export const saveMessage = (bool) => {
         "detailList": [{
             "content": jsonStr.chief,
             "contentValue":filterDataArr(JSON.parse(jsonStr.chief)),
+            "contentJson":'',
             "type": 1
         }, {
             "content": jsonStr.present,
             "contentValue":filterDataArr(JSON.parse(jsonStr.present)),
+            "contentJson":'',
             "type": 2
         }, {
             "content": jsonStr.other,
             "contentValue":filterDataArr(JSON.parse(jsonStr.other)),
+            "contentJson":JSON.stringify(otherData),
             "type": 3
         }, {
             "content": jsonStr.vital,
             "contentValue":filterDataArr(JSON.parse(jsonStr.vital)),
+            "contentJson":'',
             "type": 4
         }, {
             "content": jsonStr.lis,
             "contentValue":jsonStr.lis,
+            "contentJson":JSON.stringify(jsonData.lis),
             "type": 5
         }, {
             "content": jsonStr.pacs,
             "contentValue":jsonStr.pacs,
+            "contentJson":JSON.stringify(pacsData),
             "type": 6
         }, {
             "content": jsonStr.diag,
             "contentValue":jsonStr.diag,
+            "contentJson":'',
             "type": 7
         }, {
             "content": jsonStr.advice,
             "contentValue":jsonStr.advice,
+            "contentJson":JSON.stringify(jsonData.advice),
             "type": 8
         }],
         "sign": whichSign, //类型0结构化 1文本

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

@@ -25,7 +25,7 @@ export const billing = (mdata,boxMark) => {
   const emrData = getEMRParams();
   const params = {
     age: emrData.age,
-    featureType: getCheck?"4,41,5,6,7":"4,5,6,7",    //41只返回查体模板,4只返回查体高亮
+    featureType: getCheck?"42,41,5,6,7":"42,5,6,7",    //41只返回查体模板,4只返回查体高亮
     // featureType: "22",
     diag: emrData.dis,
     lis: emrData.lis,

+ 27 - 6
src/store/async-actions/tabTemplate.js

@@ -12,24 +12,29 @@ import Notify from '@commonComp/Notify';
 import store from '@store';
 import {
   getAllDataList,
-  getAllDataStringList
+  getAllDataStringList,
+  pushAllDataList
 } from '@utils/tools';
 
-export const initItemList = (type) => { //初始化数据
+export const initItemList = (type,current,flg) => { //初始化数据
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.typeConfig;
   let state = baseList.patInfo.message;
 
   return (dispatch) => {
-    axios.json('/templateInfo/getByDoctorIdTemplates', {
+    axios.json('/templateInfo/getTemplatePageAlls', {
       "doctorId": state.doctorId,
       "hospitalDeptId": state.hospitalDeptId,
       "hospitalId": state.hospitalId,
       "type": type || whichSign,
+      "current": current,
+      "sex":[1,2,3],
+      "size": 9999
     }).then((res) => {
       const data = res.data;
       if (data.code == 0) {
-        dispatch(initItems(data));
+        // data.data.flg = flg||false  //获取下一页,暂时不用
+        dispatch(initItems(data.data));
       } else {
         Notify.error(data.msg)
       }
@@ -71,7 +76,7 @@ export const saveTemplateDetail = (val,sex) => { //保存为模板
       const data = res.data;
       if (data.code == 0) {
         Notify.success('模板保存成功');
-        dispatch(initItemList());
+        dispatch(initItemList("",1));
         dispatch(keepPushData(getdata(1),'part'));
         dispatch({
           type: DIAG_SHOW,
@@ -124,6 +129,7 @@ export const delBatchItem = (ids) => { //批量删除
     })
   }
 };
+
 export const changeTitleAsync = (obj) => { //改标题
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.typeConfig;
@@ -147,9 +153,24 @@ export const changeTitleAsync = (obj) => { //改标题
         Notify.success('标题修改成功');
         store.dispatch(changeVisible(false))
       } else {
-        console.log(data)
+        // console.log(data)
         Notify.error(data.msg)
       }
     })
   }
+};
+
+export const setPageView = (id,typeConfig) => { //批量删除
+  return (dispatch) => {
+    axios.json('/templateInfo/getTemplateIdAlls', {
+      id: id
+    }).then((res) => {
+      let data = res.data;
+      if (data.code == 0) {
+        pushAllDataList(typeConfig, 'push', data.data, 'template')//引用
+      } else {
+        Notify.error(data.msg);
+      }
+    })
+  }
 };

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

@@ -47,6 +47,8 @@ export default (state=init,action)=>{
       res.indexTimeTypes = {};
       return res;
     case CLEAR_ASSESS_RESULT_VALUE:
+      res.data = {};
+      res.indexNames = {};
       res.addedScaleIds = [];
       res.calcuResult = {};
       res.calcuValues = {};

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

@@ -16,7 +16,8 @@ const initState = {
   editClear:true,
   addModule:[],
   emptyData:[],
-  symptomIds:[] //搜索去重
+  symptomIds:[], //搜索去重
+  currReadSonM:[] //回读的子模板
 };
 export default function(state=initState,action){    
   const res = Object.assign({},state);

+ 1 - 1
src/store/reducers/historyTemplates.js

@@ -28,7 +28,7 @@ export default (state = initHistoryList, action) => {
     }
     if (action.type === HISTORY_INIT) {
         const newState = Object.assign({}, state);
-        const tempArr = action.data || [];
+        const tempArr = action.data.records || [];
         newState.items = [...tempArr];
         newState.activeHistory = tempArr[0];
         return newState;

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

@@ -28,7 +28,8 @@ const initState = {
     refresh:false //用于数据更新
   },
   chronicDesease:null, //慢病
-  mainTailIds:[]  //获取症状尾巴用
+  mainTailIds:[],  //获取症状尾巴用
+  mainReadSonM:[] //回读的子模板
 }
 
 export default function(state=initState,action){

+ 1 - 1
src/store/reducers/otherHistory.js

@@ -4,7 +4,7 @@ import {SETDATA,CONFIRMSELECTED,SETRADIO,SETNUMBER,SETOTHERCHECKBOX,SETOTHERTEXT
 import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,
   changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal,multipleComfirn,
   removeId,delSingleLable,setRadioInputValue} from '../actions/otherHistory';
-import config from '@config/index.js';
+import config from '@config/index';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
 const initState = {data:[block],isEmpty:true,saveText:[],selecteds:[],focusIndex:'',editClear:true};

+ 13 - 2
src/store/reducers/tabTemplate.js

@@ -27,6 +27,8 @@ const initDataList = {
   activeItem: {}, //引用的模板
   activeItemHis: {}, //引用的历史病例
   allCheckShow: false, //全选反选是否显示
+  current:1,//当前页
+  hasMore:true,//是否显示更多
 }
 export default (state = initDataList, action) => {
   if (action.type === DEL_ITEMS) {
@@ -49,7 +51,17 @@ export default (state = initDataList, action) => {
   }
   if (action.type === INIT_ITEMS) {
     const newState = Object.assign({}, state);
-    newState.items = action.state.data;
+    // let tmpItems = JSON.parse(JSON.stringify(newState.items))
+    // let tmpCurrent = JSON.parse(JSON.stringify(newState.current))
+    // console.log(action.state.flg,action.state.pages,tmpCurrent,45544)
+    // if(action.state.current == 1&&!action.state.flg){//进入页面会调取分页相关先去掉
+    //   newState.items = action.state.records
+    // }else{
+    //   newState.items = tmpItems.concat(action.state.records);
+    // }
+    newState.items = action.state.records
+    newState.current = action.state.current;
+    newState.hasMore = action.state.current<action.state.pages;
     return newState;
   }
   if (action.type === CHANGE_VISIBLE) {
@@ -89,7 +101,6 @@ export default (state = initDataList, action) => {
       tempArr.splice(tempArr.findIndex(item => item === action.id), 1)
       newState.checkItems = [...tempArr]
     }
-    console.log(newState.checkItems)
     return newState;
   }
   if (action.type === KEEP_PUSH_DATA) {

+ 2 - 2
src/utils/config.js

@@ -1,8 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
-const host='http://192.168.2.241:5050';//后端接口访问地址
+// const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-// const host='http://192.168.2.236:5050';//后端接口访问地址
+const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:5050'; //周铁刚

+ 12 - 6
src/utils/tools.js

@@ -181,6 +181,8 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.diagChronicMagItem = baseList.diagnosticList.chronicMagItem;      //诊断慢病{}
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
     jsonData.isFirstMainDiag = baseList.treat.isFirstMainDiag;      //治疗方案
+    jsonData.mainReadSonM = baseList.mainSuit.addSmoduleData;      //主诉-子模板
+    jsonData.currReadSonM = baseList.currentIll.currReadSonM;      //现病史-子模板
     // console.log(jsonData,'结构化数据获取')
     return jsonData;
 }
@@ -233,8 +235,8 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
 const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清空所有的数据
     if(action == 'clear'){     //清空
       const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
-      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainTailIds:[],clearAction:true,symptomFeature:[],chronicDesease:null});
-        store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
+      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainTailIds:[],clearAction:true,symptomFeature:[],chronicDesease:null,mainReadSonM:[]});
+        store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[],currReadSonM:[]});
         store.dispatch({type: CLEAROTHERHISTORY,data:[block],isEmpty:true,saveText:[],selecteds:[],editClear:true,yjs_1:'',yjs_2:'',yjs_3:'',yjs_4:''});
         store.dispatch({type: CLEARCHECKBODY,data:[block],isEmpty:true,saveText:[],selecteds:[]});
         store.dispatch(clearAssistData([],'',[]));
@@ -286,7 +288,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
           //其他史data
           const oData = dataJson.other;
           const onlyOneText = oData.length==1&&oData[0].tagType==8&&!(oData[0].name||oData[0].value);
-            if(type == 'template'){        //结构化模板回读
+          if(type == 'template'){        //结构化模板回读
               let dataJsonStr = JSON.parse(reData.preview);
                 // console.log(dataJson,dataJsonStr,'结构化模板引用')
                 store.dispatch({
@@ -296,13 +298,15 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     saveText:JSON.parse(dataJsonStr.chief),
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
                     chronicDesease:dataJson.mainChronicDesease,
+                    mainReadSonM:dataJson.mainReadSonM,
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
                     data:dataJson.present,
                     selecteds:dataJson.currentIllSelecteds?dataJson.currentIllSelecteds:[],
                     saveText:JSON.parse(dataJsonStr.present),
-                    symptomIds:dataJson.currentIds?dataJson.currentIds:[]
+                    symptomIds:dataJson.currentIds?dataJson.currentIds:[],
+                    currReadSonM:dataJson.currReadSonM
                 });
                 store.dispatch({
                     type: CLEAROTHERHISTORY,
@@ -354,7 +358,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
             }else{    //结构化历史病历回读
                 /*let dataJson = JSON.parse(reData.dataJson);*/
                 let dataJsonStr = reData.detailList;
-              // console.log(dataJson,dataJsonStr,'结构化历史病历回读')
+              // console.log(dataJsonStr,'结构化历史病历回读')
                 // console.log(dataJson.mainSuitSelecteds,7887)
                 store.dispatch({
                     type: CLEAR_MAIN_SUIT,
@@ -363,13 +367,15 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     saveText:dataJsonStr[0].content ? JSON.parse(dataJsonStr[0].content) :[],
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
                     chronicDesease:dataJson.mainChronicDesease,
+                    mainReadSonM:dataJson.mainReadSonM,
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
                     data:dataJson.present,
                     selecteds:dataJson.currentIllSelecteds?dataJson.currentIllSelecteds:[],
                     saveText:dataJsonStr[1].content ? JSON.parse(dataJsonStr[1].content):[],
-                    symptomIds:dataJson.currentIds?dataJson.currentIds:[]
+                    symptomIds:dataJson.currentIds?dataJson.currentIds:[],
+                    currReadSonM:dataJson.currReadSonM
                 });
                 store.dispatch({
                     type: CLEAROTHERHISTORY,