Pārlūkot izejas kodu

Merge branch 'dev/new1' into dev/zhangxc1

zhangxc 6 gadi atpakaļ
vecāks
revīzija
21e2bf63e1
46 mainītis faili ar 669 papildinājumiem un 456 dzēšanām
  1. 19 5
      src/common/components/EditableSpan/index.jsx
  2. 3 0
      src/components/AddAssistCheck/Textarea/index.jsx
  3. 5 5
      src/components/AddAssistCheck/index.jsx
  4. 2 2
      src/components/AddAssistCheck/index.less
  5. 46 22
      src/components/AddInspect/index.jsx
  6. 2 1
      src/components/AssistCheck/index.jsx
  7. 2 0
      src/components/HistoryCaseContainer/index.jsx
  8. 1 1
      src/components/InfoTitle/index.jsx
  9. 18 7
      src/components/MainSuit/index.jsx
  10. 6 1
      src/components/MultSpread/index.jsx
  11. 8 7
      src/components/NumberDrop/index.less
  12. 4 1
      src/components/NumberUnitDrop/index.jsx
  13. 18 50
      src/components/Operation/index.jsx
  14. 2 2
      src/components/PatInfo/index.jsx
  15. 5 1
      src/components/PatInfo/index.less
  16. 259 245
      src/components/PreviewBody/index.jsx
  17. 2 1
      src/components/PrintPreview/index.jsx
  18. 2 0
      src/components/PushContainer/index.jsx
  19. 4 0
      src/components/RadioDrop/index.jsx
  20. 18 8
      src/components/SpreadDrop/index.jsx
  21. 1 1
      src/components/TemplateItems/index.jsx
  22. 1 0
      src/config/index.js
  23. 4 3
      src/containers/AssistCheck.js
  24. 4 0
      src/containers/CurrentIll.js
  25. 25 4
      src/containers/EditableSpan.js
  26. 4 0
      src/containers/MainSuit.js
  27. 2 0
      src/containers/OtherHistory.js
  28. 3 2
      src/store/actions/assistCheck.js
  29. 16 0
      src/store/actions/checkBody.js
  30. 42 8
      src/store/actions/currentIll.js
  31. 58 22
      src/store/actions/mainSuit.js
  32. 18 2
      src/store/actions/otherHistory.js
  33. 2 1
      src/store/async-actions/fetchModules.js
  34. 2 0
      src/store/async-actions/patInfo.js
  35. 9 5
      src/store/reducers/assistCheck.js
  36. 4 2
      src/store/reducers/checkBody.js
  37. 4 2
      src/store/reducers/currentIll.js
  38. 1 0
      src/store/reducers/homePage.js
  39. 3 1
      src/store/reducers/inspect.js
  40. 4 2
      src/store/reducers/mainSuit.js
  41. 5 2
      src/store/reducers/otherHistory.js
  42. 2 1
      src/store/types/checkBody.js
  43. 1 0
      src/store/types/currentIll.js
  44. 1 0
      src/store/types/mainSuit.js
  45. 2 1
      src/store/types/otherHistory.js
  46. 25 38
      src/utils/tools.js

+ 19 - 5
src/common/components/EditableSpan/index.jsx

@@ -28,7 +28,7 @@ class EditableSpan extends Component{
       labelVal:'',  //存放标签原有的值--主诉字数限制用
       preVal:'',
       index:null,
-      searchPre:''
+      searchPre:'',
     };
     this.$span = React.createRef();
     this.handleFocus = this.handleFocus.bind(this);
@@ -96,8 +96,11 @@ class EditableSpan extends Component{
       temp = newText.replace(searchPre,'');
       isEnd = !(newText.indexOf(searchPre)>0);
       search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
+      if(!search&&searchPre){
+        search = searchPre;
+      }
       //console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
-      if(config.punctuationReg.test(search)){     //只有标点符号时不搜索
+      if(config.punctuationReg.test(search)){    //只有标点符号时不搜索
         handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
       }else{//只有标点符号时要清空搜索结果
         handleClear && handleClear({boxMark})
@@ -156,7 +159,7 @@ class EditableSpan extends Component{
 
   }
   handleKeyup(e){
-    const {boxMark,handleKeydown,i,value,removeId,handleClear} = this.props;
+    const {boxMark,handleKeydown,i,value,removeId,handleClear,delSingleLable} = this.props;
     const {preVal,index} = this.state;
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
@@ -164,16 +167,27 @@ class EditableSpan extends Component{
     if(ev.keyCode==8){
       // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
       // 前面是标签,内容为空时再删一次才移除标签;前面是文本,则直接移除;
+      // console.log(77,innerVal,preVal);
       let preObj = $(this.$span.current).prev();
-      if(index!==0&&preVal.trim().length==1){
+      if(index!==0&&preVal.trim().length==1&& !innerVal){
           removeId && removeId({boxMark,i:index,text:""});
           handleClear && handleClear({boxMark});//删除最后一个字时清空搜索结果,避免现病史搜索框不立即消失的情况
           if(preObj[0].nodeName !=="DIV"){
             this.moveEnd(preObj[0]);
           }
         }
-      
+
       if(innerVal !==preVal){return false}
+      // 中英文数字和下划线--单独删除标签
+      /*const reg = new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9_])");
+      if(index!==0 && reg.test(innerVal)){
+        let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
+        delSingleLable && delSingleLable({boxMark,i:index});
+        this.moveEnd(obj[0]);  
+        this.setState({
+          index: null
+        })
+      }*/
       let data = innerVal.trim();
       //判断是否为空、中英文:, 。、;,且不是第一位
       let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$\s/);

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

@@ -47,6 +47,9 @@ class Textarea extends Component {
     if(next.isRead != isRead){
       this.$dom.current.innerText = next.value||'';
     }
+    if(next.value && next.value.trim() != ''){
+      $("#textareaWarring").html('')
+    }
   }
   componentDidMount(){
     const {value} = this.props;

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

@@ -88,12 +88,12 @@ class AddAssistCheck extends React.Component {
         const {handleSign} = this.props;
         return <ul>
         {
-            list && list.map((item) => {
+            list && list.map((item,idx) => {
                 return <li key={item.id}
                     className={styles.searchLi}
                     title={item.name}
                     onClick={() => {
-                        handleSign(item.questionId);
+                        handleSign(item.questionId,idx);
                         this.setState({ show: false })
                     }}
                 >
@@ -104,12 +104,12 @@ class AddAssistCheck extends React.Component {
     </ul>
     }
     getAssistLabel(){
-        const {assistLabel,handleChangeAssistValue,handleChangeDate,isRead,handlePush} = this.props;
+        const {assistLabel,handleChangeAssistValue,handleChangeDate,isRead,handlePush,winWidth} = this.props;
         return <ul className={styles.labelWrap} id="datePick">
             {
                 assistLabel.map((item,idx) => {
                     return (<li key={item.id} className={styles.assistLists}>
-                        <span className={styles.assistName}>{item.name}:</span>
+                        <span className={styles.assistName} style={{width:winWidth < 1200?'120px':'auto'}}>{item.name}:</span>
                         <div className={styles.textareaWrap}>
                             <Textarea value={item.value} handlePush={handlePush} isRead={isRead} handleChangeAssistValue={handleChangeAssistValue} idx={idx}></Textarea>
                         </div>
@@ -132,7 +132,7 @@ class AddAssistCheck extends React.Component {
         return (
             <div className={styles.wrapper}>
                 {this.getAssistLabel()}
-                <div id="searchWrapAssist" style={{position:"relative"}}>
+                <div id="searchWrapAssist" style={{position:"relative",clear:'both'}}>
                     <Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck"/>
                   {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
                         {this.getSearchList(list)}

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

@@ -69,8 +69,8 @@
             }
         }
         .assistName {
-            height: 20px;
-            line-height: 20px;
+            // height: 20px;
+            // line-height: 20px;
             box-sizing: border-box;
             float: left;
         }

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

@@ -1,6 +1,6 @@
 import React from 'react';
 import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
-import { deepClone,normalVal } from '@utils/tools';
+import { deepClone,normalVal,timestampToTime,filterDataArr } from '@utils/tools';
 import styles from './index.less';
 import date1 from './img/date1.png';
 import date2 from './img/date2.png';
@@ -131,7 +131,7 @@ class Inspect extends React.Component {
         this.setState({dateTime:date})
         return date;
     }
-    changeActivePart(idx,val){
+    changeActivePart(idx,val,clear){
         let nums = this.state.num;
         let fillActive;
         if(nums == 0){
@@ -142,22 +142,33 @@ class Inspect extends React.Component {
         ++nums;
         this.setState({num:nums});
         let tempArr = deepClone(fillActive);
-        let tempNumPlus = 0;
-        for (let i = 0; i < tempArr.details.length; i++) {
-            if (i == idx) {
-                tempArr.details[i].value = val
-            }
-            if(tempArr.details[i].value != undefined && tempArr.details[i].value != ''){
-                tempArr.show = true;
-            }else{
-                ++tempNumPlus;
-                if(tempNumPlus == tempArr.details.length){
-                    tempArr.show = false;
-                }
-            }
+        
+        if(clear){    //点击清空按钮,至清初输入的数字
+          for (let i = 0; i < tempArr.details.length; i++) {
+            tempArr.details[i].value = ''
+            tempArr.show = false;
+          }
+          tempArr.time = this.getCurrentDate();
+          this.setState({currentData:tempArr})
+          return;
+        }else{
+          let tempNumPlus = 0;
+          for (let i = 0; i < tempArr.details.length; i++) {
+              if (i == idx) {
+                  tempArr.details[i].value = val
+              }
+              if(tempArr.details[i].value != undefined && tempArr.details[i].value != ''){
+                  tempArr.show = true;
+              }else{
+                  ++tempNumPlus;
+                  if(tempNumPlus == tempArr.details.length){
+                      tempArr.show = false;
+                  }
+              }
+          }
+          tempArr.time = this.state.dateTime;
+          this.setState({currentData:tempArr})
         }
-        tempArr.time = this.state.dateTime;
-        this.setState({currentData:tempArr})
     }
     getItemList(){        //填写单展示
         let number = this.state.num;
@@ -242,6 +253,18 @@ class Inspect extends React.Component {
             return <td style={{width:'20%'}}><span className={(val.value - 0).toString() == 'NaN'?"red":(val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue?"red":''):''}>{val.value}</span> { val.labelSuffix}</td>
         }
     }
+    toTime(time){
+      let tmpTim = time.split(',').join('')-0
+      if(time && tmpTim.toString() != 'NaN'){
+        let date = new Date('1900-01-01');
+        let dateTim = date.getTime();
+        let times = (tmpTim-2)*24*60*60*1000;
+        let result = timestampToTime(dateTim+times).split(' ')[0]
+        return result;
+      }else{
+        return time;
+      }
+    }
     render() {
         const { handleChangeValue, list, labelList,delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive,getExcelDataList,handleCloseExcel,handlePush } = this.props;
         const {toastText,visible} = this.state;
@@ -269,7 +292,7 @@ class Inspect extends React.Component {
                                                                 <td style={{width:'25%'}}>
                                                                     {normalVal(value.min,value.max)}
                                                                 </td>
-                                                                <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
+                                                                <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+this.toTime(value.time)}</td>
                                                             </tr>
                                                         })
                                                     }
@@ -290,7 +313,7 @@ class Inspect extends React.Component {
                                         // 标签,血常规。。
                                         item.show ?
                                         <p className={styles.staticTagActive}>
-                                            <span data-flg="current" style={{color:"#333"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</span>
+                                            <span data-flg="current" style={{color:"#000"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</span>
                                         </p>:
                                         <p>
                                             <i data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</i>
@@ -321,9 +344,10 @@ class Inspect extends React.Component {
                                                 <InspectCommon
                                                     showFill={this.state.showFill}
                                                     handleClear={(e)=>{
-                                                        handleClear(e,idx)
+                                                        // handleClear(e,idx)
+                                                        this.changeActivePart('','',true)
                                                         this.setState({
-                                                          currentData:fillActive
+                                                          // currentData:fillActive
                                                         })
                                                     }}
                                                     handleConfirm={(e)=>{
@@ -361,7 +385,7 @@ class Inspect extends React.Component {
                         }
                     </ul>
                 </div>
-                <div style={{position:"relative"}}>
+                <div style={{position:"relative",clear:"both"}}>
                     <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap"/>
                   {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
                         {this.getSearchList(list)}

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

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

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

@@ -8,6 +8,7 @@ import store from '@store';
 import { ConfirmModal } from '@commonComp';
 import { pushAllDataList } from '@utils/tools';
 import { CONFIRM_TYPE } from "@store/types/typeConfig";
+import {billing} from '@store/async-actions/pushMessage';
 
 class HistoryCaseContainer extends React.Component {
     constructor(props){
@@ -24,6 +25,7 @@ class HistoryCaseContainer extends React.Component {
         store.dispatch(showHistory(false))
         store.dispatch({type: CONFIRM_TYPE, confirmType: baseObj.sign});
         pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
+        store.dispatch(billing())
     }
     close(){
       store.dispatch(visibleHistory(false));

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

@@ -38,7 +38,7 @@ class InfoTitle extends Component {
         const {disVisible,copyVisible,winWidth} = this.props;
         const {le} = this.state;
         return <div className={style['title-wrapper']} style={{zIndex:disVisible||copyVisible?40:204,left:le}}>
-            <PatInfoContainer sizeFlag={winWidth <= 1035?true:false}/>
+            <PatInfoContainer sizeFlag={winWidth <= 1065?true:false}/>
             <div className={style["operations"]} onClick={this.showHistoryBox}>
                 <span><img src={historyCase} />&nbsp;历史病历</span>
             </div>

+ 18 - 7
src/components/MainSuit/index.jsx

@@ -6,7 +6,7 @@ import SearchDrop from '@components/SearchDrop';
 import CommonSymptom from '@components/CommonSymptom';
 import chooseType from '@containers/eleType.js';
 import config from "@config/index";
-import {isIE,getPageCoordinate,windowEventHandler} from "@utils/tools.js"
+import {isIE,getPageCoordinate,windowEventHandler,filterDataArr} from "@utils/tools.js"
 import $ from 'jquery';
 
 class MainSuit extends Component{
@@ -68,7 +68,8 @@ class MainSuit extends Component{
       if(!innerText.trim()){//有内容就走搜索接口
         getCommonSymptoms && getCommonSymptoms();
         this.setState({
-          symptom:true
+          symptom:true,
+          inpText:innerText
         })    
       }else{
         this.setState({
@@ -112,7 +113,15 @@ class MainSuit extends Component{
 
 
   handleSearchSelect(item){
-    const {clearSearch,insertSearch,datas,span} = this.props;
+    const {clearSearch,insertSearch,datas,span,saveText} = this.props;
+    let mainText = filterDataArr(saveText);//主诉字数
+    const itemL = item.name.length;
+    let lengths = mainText.length + itemL;
+    if(lengths>config.limited){
+      Notify.info(config.limitText);
+      clearSearch && clearSearch();
+      return
+    }
     clearTimeout(this.state.timer);
     if(datas.length==0){//没有使用模板时点击搜索结构要展开模板
       insertSearch &&insertSearch({item,span});
@@ -137,11 +146,12 @@ class MainSuit extends Component{
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
     let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
+    let num = this.props.datas.length == 0?0:60
     if(isIE()){
       leftL = getPageCoordinate(e).boxLeft
     }else{
       const ele = document.activeElement;
-      leftL = ele.offsetLeft+60
+      leftL = ele.offsetLeft+num
     }
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
@@ -161,7 +171,7 @@ class MainSuit extends Component{
   handleChange(e){
     const ev = e || window.event;
     const data = ev.target.innerText;
-    const {getSearchData,searchData,datas,pushMessage,reTotalHide} = this.props;
+    const {getSearchData,searchData,datas,pushMessage,reTotalHide,saveText} = this.props;
     const {overFlag,inpText} = this.state;
     reTotalHide && reTotalHide();//重置homePage中的控制项
     const that = this;
@@ -210,7 +220,7 @@ class MainSuit extends Component{
   }
 
   handleBlur(e){//隐藏常见症状下拉、存自由输入的值
-    const {freeText,saveText,datas} = this.props;
+    const {freeText,saveText,datas,clearSearch} = this.props;
     const that = this;
     let data = this.state.inpText;
     if(!isIE()){
@@ -224,9 +234,10 @@ class MainSuit extends Component{
         freeText && freeText(data);
       }
     }
-    // 延时关闭常见症状下拉,不延时会影响选中
+    // 延时关闭常见症状下拉、清空搜索结果,不延时会影响选中
       clearTimeout(this.state.clearTimer);
       const clearTimer = setTimeout(function(){
+        clearSearch && clearSearch();
         that.setState({
           symptom:false
         })

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

@@ -26,6 +26,7 @@ class MultSpread extends Component{
     this.state = {
       editable: false,
     };
+    this.$cont = React.createRef();
     this.changeToEdit = this.changeToEdit.bind(this);
     this.handleEdit = this.handleEdit.bind(this);
   }
@@ -103,7 +104,10 @@ class MultSpread extends Component{
       this.setState({
         editable: true
       });
-      //e.target.focus();
+      //失焦关闭编辑状态
+      setTimeout(()=>{
+        this.$cont.current.focus();
+      });
       //双击埋点记录
       handleDbclick && handleDbclick({id:copyId});
     }
@@ -135,6 +139,7 @@ class MultSpread extends Component{
     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}>

+ 8 - 7
src/components/NumberDrop/index.less

@@ -1,9 +1,10 @@
 @import "~@less/variables.less";
 .container{
   .tag;
-}
-.no-tag{
-  .no-tag;
+  .blued{
+    background: @blue;
+    color: #fff;
+  }
 }
 .selected{
   .selected-tag;
@@ -13,8 +14,8 @@
   &:after{
     content: unset;
   }
-}
-.blued{
-  background: @blue;
-  color: #fff;
+  .blued{
+    background: @blue;
+    color: #fff;
+  }
 }

+ 4 - 1
src/components/NumberUnitDrop/index.jsx

@@ -151,7 +151,10 @@ class NumberUnitDrop extends Component{
         editable: true,
         labelVal:text
       });
-      e.target.focus();
+      //失焦关闭编辑状态
+      setTimeout(()=>{
+        e.target.focus();
+      })
       //双击埋点记录
       handleDbclick && handleDbclick({id:patId||id});
     }

+ 18 - 50
src/components/Operation/index.jsx

@@ -114,36 +114,7 @@ class Operation extends Component {
       Notify.info('当前页面数据已清空');
     }
   }
-  isClear(){
-    let baseList = store.getState();
-    let jsonData = getAllDataList(baseList);
-    let jsonStr = getAllDataStringList(baseList);
-    if (      //结构化和文本数据都为空
-      JSON.stringify(jsonData.advice) == '{}' &&
-      jsonData.chief.length < 1 &&
-      jsonData.diag.length < 1 &&
-      jsonData.vital.length < 1 &&
-      jsonData.other.length < 1 &&
-      jsonData.pacs.length < 1 &&
-      jsonData.present.length < 1 &&
-      jsonData.lis.labelList.length < 1 &&
-      jsonData.lis.getExcelDataList.length < 1 &&
-      JSON.stringify(jsonData.advice) == '{}' && 
-      jsonStr.chief == '[]' && 
-      jsonStr.present == '[]' && 
-      jsonStr.other == '[]' && 
-      jsonData.vital.length < 1 && 
-      jsonData.diag.length < 1 && 
-      jsonData.pacs.length < 1 && 
-      jsonData.lis.labelList.length < 1 && 
-      jsonData.lis.getExcelDataList.length < 1
-    ) {
-      Notify.info('当前页面数据已清空');
-      return false;
-    }else{
-      return true;
-    }
-  }
+  
   onchange(val) {
     this.setState({
       title: val
@@ -187,34 +158,31 @@ class Operation extends Component {
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.typeConfig;
     let tmpLis = baseList.tabTemplate.items;
-    console.log(jsonStr,'文本')
-    console.log(jsonData,'结构')       //测试需要用到,不要删了
+    // console.log(jsonStr,'文本')
+    // console.log(jsonData.chief,'结构')       //测试需要用到,不要删了
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
-      let jsStr = tmpLis[i].dataJson;
+      let dataJson = tmpLis[i].dataJson;
       // console.log(JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')),111)
-      // if(JSON.stringify(eval('('+JSON.stringify(JSON.parse(dataStr))+')')) == JSON.stringify(jsonStr) && jsStr == JSON.stringify(jsonData)){
-      //   Notify.info('该模板已保存');
-      //   return false;
-      // }
+      console.log(JSON.stringify(jsonData.other) ,787878,JSON.stringify(JSON.parse(dataJson).other))
       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(jsStr).chief) &&    
-        JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(jsStr).present) &&    
-        JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(jsStr).other) &&      
-        JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(jsStr).vital) &&   
-        JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(jsStr).lis) &&  
-        JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(jsStr).pacs) &&     
-        JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(jsStr).diag) &&    
-        JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(jsStr).advice) &&      
-        JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(jsStr).mainSuitSelecteds) &&      
-        JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(jsStr).currentIllSelecteds) &&     
-        JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(jsStr).otherHistorySelecteds) && 
-        JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(jsStr).checkBodySelecteds) &&     
-        JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(jsStr).addItems)
+        JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
+        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;

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

@@ -16,14 +16,14 @@ class PatInfo extends Component {
      return <table className={sizeFlag?`${style["table"]} ${style["newSize"]}`:style["table"]}>
       <tr>
         <td key='1' className={`${style.tdBorderB} ${style.tdBorderR}`}>卡号:{message.patientIdNo && message.patientIdNo}</td>
-        <td key='2' className={`${style.tdBorderB} ${style.tdBorderR}`}>姓名:{message.patientName && message.patientName}</td>
+        <td key='2' className={`${style.tdBorderB} ${style.tdBorderR}`} title={sizeFlag&&message.patientName&&message.patientName.length>3?message.patientName:''}>姓名:{sizeFlag&&message.patientName && message.patientName.length>3?message.patientName.slice(0,3)+'...':message.patientName}</td>
         <td key='3' className={`${style.tdBorderB} ${style.tdBorderR}`}>年龄:{message.patientAge && message.patientAge}</td>
         <td key='4' className={`${style.tdBorderB} ${style.tdBorderR}`}>性别:{message.patientSex && message.patientSex}</td>
       </tr>
       <tr>
         <td key='5' className={`${style.tdBorderR}`} style={{whiteSpace: 'nowrap'}}>就诊时间:{message.systemTime&&message.systemTime.substring(0, 10)}</td>
         <td key='6' className={`${style.tdBorderR}`}>科室:{message.hospitalDeptName && message.hospitalDeptName}</td>
-        <td key='7' className={`${style.tdBorderR}`}>医生:{message.doctorName && message.doctorName}</td>
+        <td key='7' className={`${style.tdBorderR}`} title={sizeFlag&&message.doctorName&&message.doctorName.length>3?message.doctorName:''}>医生:{sizeFlag&&message.doctorName && message.doctorName.length>3?message.doctorName.slice(0,3)+'...':message.doctorName}</td>
         <td key='8' className={`${style.tdBorderR}`}>门诊号:{message.recordId && message.recordId}</td>
       </tr>
     </table>;

+ 5 - 1
src/components/PatInfo/index.less

@@ -9,6 +9,7 @@
     line-height: 30px;
     padding-left: 10px;
     width: 200px;
+    white-space: nowrap;
   }
   .tdBorderB {
       border-bottom: 1px solid @person-table-color;
@@ -19,6 +20,9 @@
 }
 .newSize{
   td{
-  font-size: 13px;
+    overflow: hidden;
+    font-size: 13px;
+    white-space: nowrap;
+    text-overflow: ellipsis;
   }
 }

+ 259 - 245
src/components/PreviewBody/index.jsx

@@ -1,282 +1,296 @@
 import React, { Component } from "react";
 import style from "./index.less";
-import { normalVal } from '@utils/tools';
+import { normalVal, filterDataArr } from '@utils/tools';
+import Notify from '@commonComp/Notify';
 import $ from "jquery";
 
 (function ($) {
   var opt;
 
   $.fn.jqprint = function (options) {
-      opt = $.extend({}, $.fn.jqprint.defaults, options);
+    opt = $.extend({}, $.fn.jqprint.defaults, options);
 
-      var $element = (this instanceof $) ? this : $(this);
+    var $element = (this instanceof $) ? this : $(this);
 
-      if (opt.operaSupport && $.browser.opera) {
-          var tab = window.open("", "jqPrint-preview");
-          tab.document.open();
+    if (opt.operaSupport && $.browser.opera) {
+      var tab = window.open("", "jqPrint-preview");
+      tab.document.open();
 
-          var doc = tab.document;
-      }
-      else {
-          var $iframe = $("<iframe  />");
+      var doc = tab.document;
+    }
+    else {
+      var $iframe = $("<iframe  />");
 
-          if (!opt.debug) { $iframe.css({ position: "absolute", width: "0px", height: "0px", left: "-300px", top: "-300px" }); }
+      if (!opt.debug) { $iframe.css({ position: "absolute", width: "0px", height: "0px", left: "-300px", top: "-300px" }); }
 
-          $iframe.appendTo("body");
-          var doc = $iframe[0].contentWindow.document;
-      }
+      $iframe.appendTo("body");
+      var doc = $iframe[0].contentWindow.document;
+    }
 
-      if (opt.importCSS) {
-          if ($("link[media=print]").length > 0) {
-              $("link[media=print]").each(function () {
-                  doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' media='print' />");
-              });
-          }
-          else {
-              $("link").each(function () {
-                  doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />");
-              });
-          }
+    if (opt.importCSS) {
+      if ($("link[media=print]").length > 0) {
+        $("link[media=print]").each(function () {
+          doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' media='print' />");
+        });
+      }
+      else {
+        $("link").each(function () {
+          doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />");
+        });
       }
+    }
 
-      if (opt.printContainer) { doc.write($element.outer()); }
-      else { $element.each(function () { doc.write($(this).html()); }); }
+    if (opt.printContainer) { doc.write($element.outer()); }
+    else { $element.each(function () { doc.write($(this).html()); }); }
 
-      doc.close();
+    doc.close();
 
-      (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).focus();
-      setTimeout(function () { (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).print(); if (tab) { tab.close(); } }, 1000);
+    (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).focus();
+    setTimeout(function () { (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).print(); if (tab) { tab.close(); } }, 1000);
   }
 
   $.fn.jqprint.defaults = {
-      debug: false,
-      importCSS: true,
-      printContainer: true,
-      operaSupport: true
+    debug: false,
+    importCSS: true,
+    printContainer: true,
+    operaSupport: true
   };
 
   $.fn.outer = function () {
-      return $($('<div></div>').html(this.clone())).html();
+    return $($('<div></div>').html(this.clone())).html();
   }
 })($);
 
-import {filterDataArr} from '@utils/tools'
 class PreviewBody extends Component {
-    constructor(props) {
-        super(props)
-        this.state={
-            dateTime:"",
-        }
-        this.$content = React.createRef();
-        this.getCurrentDate = this.getCurrentDate.bind(this);
-        this.onPrint = this.onPrint.bind(this);
-    }
-    componentDidMount(){
-        this.getCurrentDate();
-    }
-    componentWillReceiveProps(){
-        $(this.$content.current)[0].scrollIntoView(true);
+  constructor(props) {
+    super(props)
+    this.state = {
+      dateTime: "",
     }
-    onPrint() {
-      $("#content").jqprint({
-          debug: false,
-          importCSS: true,
-          printContainer: true,
-          operaSupport: false,
-      });
-      this.props.onClose()
+    this.$content = React.createRef();
+    this.getCurrentDate = this.getCurrentDate.bind(this);
+    this.onPrint = this.onPrint.bind(this);
   }
-    getCurrentDate(){
-        let myDate = new Date();
-        let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
-        let mon = myDate.getMonth()-0+1;       //获取当前月份(0-11,0代表1月)
-        let day = myDate.getDate();            //获取当前日(1-31)
-        let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
-        this.setState({dateTime:date})
+  componentDidMount() {
+    this.getCurrentDate();
+  }
+  componentWillReceiveProps() {
+    $(this.$content.current)[0].scrollIntoView(true);
+  }
+  onPrint() {
+    $("#content").jqprint({
+      debug: false,
+      importCSS: true,
+      printContainer: true,
+      operaSupport: false,
+    });
+    this.props.onClose()
+  }
+
+  surePrint(jsonStr) {
+    if (filterDataArr(JSON.parse(jsonStr.chief)) == '') {
+      Notify.info('主诉不能为空');
+      return false;
+    } else if (!jsonStr.diag || jsonStr.diag.trim().length < 1) {
+      Notify.info('诊断不能为空');
+      return false;
+    } else {
+      this.onPrint();
+      this.props.save(true)
     }
-    showDetails(val){
-        if(val.questionDetailList.length > 0){
-            return val.questionDetailList.map((item)=>{
-                if(val.value == item.name){
-                    return <td style={{width:'16%',fontSize:'12px'}}><span style={{color:item.abnormal != '0' ?"red":null}}>{val.value}</span> { val.labelSuffix}</td>
-                }
-            })
-        }else{ 
-            return <td style={{width:'16%',fontSize:'12px'}}><span style={{color:(val.value - 0).toString() == 'NaN'?"red":(val.maxValue || val.minValue)?(val.value > val.maxValue || val.value < val.minValue?"red":null):null}}>{val.value}</span> { val.labelSuffix}</td>
+    // if(filterDataArr(JSON.parse(jsonStr.chief)) == ''){
+    //   Notify.info('主诉不能为空');
+    //     return false;
+    // }else if(!jsonStr.diag || jsonStr.diag.trim().length < 1){
+    //     Notify.info('诊断不能为空');
+    //     return false;
+    // }else{
+    //     this.onPrint();
+    //     this.props.save(true)
+    // }
+  }
+  getCurrentDate() {
+    let myDate = new Date();
+    let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
+    let mon = myDate.getMonth() - 0 + 1;       //获取当前月份(0-11,0代表1月)
+    let day = myDate.getDate();            //获取当前日(1-31)
+    let date = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day);
+    this.setState({ dateTime: date })
+  }
+  showDetails(val) {
+    if (val.questionDetailList.length > 0) {
+      return val.questionDetailList.map((item) => {
+        if (val.value == item.name) {
+          return <td style={{ width: '16%', fontSize: '12px' }}><span style={{ color: item.abnormal != '0' ? "red" : null }}>{val.value}</span> {val.labelSuffix}</td>
         }
+      })
+    } else {
+      return <td style={{ width: '16%', fontSize: '12px' }}><span style={{ color: (val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : null) : null }}>{val.value}</span> {val.labelSuffix}</td>
     }
-    render() {
-        const { show, preInfo, dataJson, dataStr,baseObj,flg } = this.props;
+  }
+  render() {
+    const { show, preInfo, dataJson, dataStr, baseObj, flg } = this.props;
 
-        return <div className={style['content']} style={{width:flg?'700':'820'}}>
-            <div className={style['contents']} id="content" style={{margin:"0 auto",maxWidth:"600px"}}>
-                <div ref={this.$content} style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px',textAlign:'center' }}>{preInfo.hospitalName}</div>
-                <table className={style['patInfo']} style={{ margin: '0px 0px 30px 0px', borderCollapse: 'collapse', width: "100%" }}>
-                    <tr>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '31%',fontSize:"14px" }}>卡号:{baseObj?baseObj.patientIdNo:JSON.stringify(preInfo) == '{}'?'':preInfo.patientIdNo}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>姓名:{baseObj?baseObj.patientName:JSON.stringify(preInfo) == '{}'?'':preInfo.patientName}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>年龄:{baseObj?baseObj.patientAge:JSON.stringify(preInfo) == '{}'?'':preInfo.patientAge}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>性别:{baseObj?baseObj.patientSex:JSON.stringify(preInfo) == '{}'?'':preInfo.patientSex}</td>
-                    </tr>
-                    <tr>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '31%',fontSize:"14px" }}>就诊时间:{baseObj?baseObj.inquiryDate:(JSON.stringify(preInfo) == '{}'?'':preInfo.systemTime.split(' ')[0])}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>科室:{baseObj?baseObj.hospitalDeptName:(JSON.stringify(preInfo) == '{}'?'':preInfo.hospitalDeptName)}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>医生:{baseObj?baseObj.doctorName:(JSON.stringify(preInfo) == '{}'?'':preInfo.doctorName)}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>门诊号:{baseObj?baseObj.inquiryCode:(JSON.stringify(preInfo) == '{}'?'':preInfo.recordId)}</td>
-                    </tr>
-                </table>
-                <table style={{width:"100%", borderCollapse: 'collapse'}}>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>主诉:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
-                            {
-                                filterDataArr(JSON.parse(dataStr.chief))
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>现病史:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
-                            {
-                                filterDataArr(JSON.parse(dataStr.present))
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>其他史:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px'  }}>
-                            {
-                                filterDataArr(JSON.parse(dataStr.other))
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>查体:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px'  }}>
-                            {
-                                filterDataArr(JSON.parse(dataStr.vital))
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ width: 70, textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>化验:</td>
-                        <td style={{ fontSize: '14px', padding: '4px 0px 8px 0px',lineHeight:'20px',maxWidth:'650px'}}>
-                                {
-                                    dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items)=>{
-                                        return items.lisExcelRes && items.lisExcelRes.map((item)=>{
-                                            return <table style={{marginBottom:'10px',width:'100%',fontSize:'12px'}}>
-                                                <tr style={{fontSize:'14px',lineHeight:'1.5'}}><td><span style={{borderBottom:'1px solid #666666'}}>{item.menus}</span></td></tr>
-                                                {
-                                                    item.lisExcelItem && item.lisExcelItem.map((value)=>{
-                                                        return <tr style={{lineHeight:'1.5',maxWidth:'650px'}}>
-                                                            <td style={{width:'32%',fontSize:'12px'}}>{value.itemName}</td>
-                                                            <td style={{width:'16%',fontSize:'12px'}}><span style={{fontSize:'12px',color:value.type == 1?"red":null}}>{value.value}</span> {value.unit}</td>
-                                                            <td style={{width:'24%',fontSize:'12px'}}>
-                                                                {normalVal(value.min,value.max)}
-                                                            </td>
-                                                            <td style={{width:'28%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
-                                                        </tr>
-                                                    })
-                                                }
-                                            </table>
-                                        })
-                                    })
-                                }
-                                {
-                                    dataJson.lis.labelList && dataJson.lis.labelList.map((item,idx) => {
-                                        if(item.show){
-                                            return <table style={{margin:'8px 0',width:'100%'}}>
-                                                <tr style={{fontSize:'14px',lineHeight:'1.5'}}><td><span style={{borderBottom:'1px solid #666666'}}>{item.name}</span></td></tr>
-                                                {
-                                                    item.details.map((val)=>{
-                                                        if(val.value && val.value != ''){
-                                                            return <tr style={{lineHeight:'1.5',width:'100%',fontSize:'12px'}}>
-                                                                <td style={{width:'32%',fontSize:'12px'}}>{val.name}</td>
-                                                                {this.showDetails(val)}
-                                                                <td style={{width:'24%',fontSize:'12px'}}>
-                                                                    {normalVal(val.minValue,val.maxValue)}
-                                                                </td>
-                                                                <td style={{width:'28%',fontSize:'12px'}}>{'化验时间:'+item.time}</td>
-                                                            </tr>
-                                                        }
-                                                    })
-                                                }
-                                            </table>
-                                        }
-                                    })
-                                }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>辅检:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
-                            {
-                                dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item)=>{
-                                    return <div style={{ fontSize: '14px' }}>{item}</div>
-                                })
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>诊断:</td>
-                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
-                            {
-                                dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item)=>{
-                                    return <div style={{ fontSize: '14px'}}>{item}</div>
-                                })
-                            }
-                        </td>
-                    </tr>
-                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
-                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>医嘱:</td>
-                        <td style={{ fontSize: '14px', padding: '1px 0px 8px 0px',lineHeight:'20px' }}>
-                            {
-                                dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{fontSize:'14px',marginBottom:"8px"}}><span>开单项目</span></p> : ''
-                            }
-                            {
-                                dataJson.advice.assay && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.assay}</div>
-                            }
-                            {
-                                dataJson.advice.check && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.check}</div>
-                            }
-                            {dataJson.advice.scheme && dataJson.advice.scheme.length > 0  && <p style={{fontSize:'14px', marginBottom: '8px',marginTop:'8px'}}><span>治疗方案</span></p>}
-                            {
-                                dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
-                                    return <p>{item.treatment.map((it,ii) =>{
-                                      return(it.treatmentStr && it.treatmentStr.length > 0 ? 
-                                        <div style={{ padding: '0px 0px 5px 0px' }}>{ it.treatmentStr }</div>: '')
-                                    })}</p>
-                                  })
-                            }
-                        </td>
-                    </tr>
-                </table>
-                <table style={{ marginTop: '10px',marginBottom:'30px',position:'absolute',minWidth:'200px',right:'0',display: show ? 'block' : 'none' }}>
-                    <tr style={{textAlign:'right',verticalAlign: 'top',position:'absolute',right:'0'}}>
-                        <td>医生签名:</td>
-                        <td style={{
-                          minWidth:'50px',
-                          padding:'0 5px 2px 5px',
-                          borderBottom:'1px solid #333',
-                        }}>{baseObj?baseObj.doctorName:(JSON.stringify(preInfo) == '{}'?'':preInfo.doctorName)}</td>
-                    </tr>
-                </table>
-            </div>
-            
-            <div onClick={()=>{this.onPrint()}} style={{
-                display: show ? 'inline-block' : 'none',
-                padding: '10px 20px',
-                float:'right',
-                marginTop:'15px',
-                background: '#3B9ED0',
-                color: '#fff',
-                borderRadius: '4px',
-                cursor: 'pointer',
-                position:'absolute',
-                right:'40px'
-            }}>打印</div>
-        </div>
-    }
+    return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>
+      <div className={style['contents']} id="content" style={{ margin: "0 auto", maxWidth: "600px" }}>
+        <div ref={this.$content} style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px', textAlign: 'center' }}>{preInfo.hospitalName}</div>
+        <table className={style['patInfo']} style={{ margin: '0px 0px 30px 0px', borderCollapse: 'collapse', width: "100%" }}>
+          <tr>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '31%', fontSize: "14px" }}>卡号:{baseObj ? baseObj.patientIdNo : JSON.stringify(preInfo) == '{}' ? '' : preInfo.patientIdNo}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>姓名:{baseObj ? baseObj.patientName : JSON.stringify(preInfo) == '{}' ? '' : preInfo.patientName}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>年龄:{baseObj ? baseObj.patientAge : JSON.stringify(preInfo) == '{}' ? '' : preInfo.patientAge}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>性别:{baseObj ? baseObj.patientSex : JSON.stringify(preInfo) == '{}' ? '' : preInfo.patientSex}</td>
+          </tr>
+          <tr>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '31%', fontSize: "14px" }}>就诊时间:{baseObj ? baseObj.inquiryDate : (JSON.stringify(preInfo) == '{}' ? '' : preInfo.systemTime.split(' ')[0])}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>科室:{baseObj ? baseObj.hospitalDeptName : (JSON.stringify(preInfo) == '{}' ? '' : preInfo.hospitalDeptName)}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>医生:{baseObj ? baseObj.doctorName : (JSON.stringify(preInfo) == '{}' ? '' : preInfo.doctorName)}</td>
+            <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%', fontSize: "14px" }}>门诊号:{baseObj ? baseObj.inquiryCode : (JSON.stringify(preInfo) == '{}' ? '' : preInfo.recordId)}</td>
+          </tr>
+        </table>
+        <table style={{ width: "100%", borderCollapse: 'collapse' }}>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>主诉:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                filterDataArr(JSON.parse(dataStr.chief))
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>现病史:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                filterDataArr(JSON.parse(dataStr.present))
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>其他史:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                filterDataArr(JSON.parse(dataStr.other))
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>查体:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                filterDataArr(JSON.parse(dataStr.vital))
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ width: 70, textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>化验:</td>
+            <td style={{ fontSize: '14px', padding: '4px 0px 8px 0px', lineHeight: '20px', maxWidth: '650px' }}>
+              {
+                dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items) => {
+                  return items.lisExcelRes && items.lisExcelRes.map((item) => {
+                    return <table style={{ marginBottom: '10px', width: '100%', fontSize: '12px' }}>
+                      <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}>{item.menus}</span></td></tr>
+                      {
+                        item.lisExcelItem && item.lisExcelItem.map((value) => {
+                          return <tr style={{ lineHeight: '1.5', maxWidth: '650px' }}>
+                            <td style={{ width: '32%', fontSize: '12px' }}>{value.itemName}</td>
+                            <td style={{ width: '16%', fontSize: '12px' }}><span style={{ fontSize: '12px', color: value.type == 1 ? "red" : null }}>{value.value}</span> {value.unit}</td>
+                            <td style={{ width: '24%', fontSize: '12px' }}>
+                              {normalVal(value.min, value.max)}
+                            </td>
+                            <td style={{ width: '28%', fontSize: '12px' }}>{value.time == '' ? ('导入时间: ' + this.state.dateTime) : '化验时间: ' + value.time}</td>
+                          </tr>
+                        })
+                      }
+                    </table>
+                  })
+                })
+              }
+              {
+                dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
+                  if (item.show) {
+                    return <table style={{ margin: '8px 0', width: '100%' }}>
+                      <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}>{item.name}</span></td></tr>
+                      {
+                        item.details.map((val) => {
+                          if (val.value && val.value != '') {
+                            return <tr style={{ lineHeight: '1.5', width: '100%', fontSize: '12px' }}>
+                              <td style={{ width: '32%', fontSize: '12px' }}>{val.name}</td>
+                              {this.showDetails(val)}
+                              <td style={{ width: '24%', fontSize: '12px' }}>
+                                {normalVal(val.minValue, val.maxValue)}
+                              </td>
+                              <td style={{ width: '28%', fontSize: '12px' }}>{'化验时间:' + item.time}</td>
+                            </tr>
+                          }
+                        })
+                      }
+                    </table>
+                  }
+                })
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>辅检:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item) => {
+                  return <div style={{ fontSize: '14px' }}>{item}</div>
+                })
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>诊断:</td>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item) => {
+                  return <div style={{ fontSize: '14px' }}>{item}</div>
+                })
+              }
+            </td>
+          </tr>
+          <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>医嘱:</td>
+            <td style={{ fontSize: '14px', padding: '1px 0px 8px 0px', lineHeight: '20px' }}>
+              {
+                dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{ fontSize: '14px', marginBottom: "8px" }}><span>开单项目</span></p> : ''
+              }
+              {
+                dataJson.advice.assay && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.assay}</div>
+              }
+              {
+                dataJson.advice.check && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.check}</div>
+              }
+              {dataJson.advice.scheme && dataJson.advice.scheme.length > 0 && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>治疗方案</span></p>}
+              {
+                dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
+                  return <p>{item.treatment.map((it, ii) => {
+                    return (it.treatmentStr && it.treatmentStr.length > 0 ?
+                      <div style={{ padding: '0px 0px 5px 0px' }}>{it.treatmentStr}</div> : '')
+                  })}</p>
+                })
+              }
+            </td>
+          </tr>
+        </table>
+        <p style={{textAlign:'right',marginTop:'15px'}}>医生签名:<span style={{minWidth: '60px',padding: '0 5px 2px 5px',borderBottom: '1px solid #333',}}>{baseObj ? baseObj.doctorName : (JSON.stringify(preInfo) == '{}' ? '' : preInfo.doctorName)}</span></p>
+      </div>
+
+      <div onClick={() => { this.surePrint(dataStr) }} style={{
+        display: show ? 'inline-block' : 'none',
+        padding: '10px 20px',
+        float: 'right',
+        marginTop: '15px',
+        background: '#3B9ED0',
+        color: '#fff',
+        borderRadius: '4px',
+        cursor: 'pointer',
+        position: 'absolute',
+        right: '40px'
+      }}>打印</div>
+    </div>
+  }
 }
 
 export default PreviewBody;

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

@@ -24,7 +24,7 @@ class PrintPreview extends Component {
         }
     }
     render() {
-        const { onClose, visible, preInfo } = this.props;
+        const { onClose, visible, preInfo,save } = this.props;
         let baseList = store.getState();
         const dataJson = getAllDataList(baseList);
         const dataStr = getAllDataStringList(baseList);
@@ -40,6 +40,7 @@ class PrintPreview extends Component {
                         dataStr={dataStr}
                         show={true}
                         onClose={onClose}
+                        save={save}
                     ></PreviewBody>
                 {/* </div> */}
             </div>

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

@@ -7,6 +7,7 @@ import { initItemList,delItem,delBatchItem,changeTitleAsync,saveTemplateDetail }
 import { CHANGE_TYPE } from "@store/types/typeConfig";
 import { connect } from "react-redux";
 import store from '@store';
+import {billing} from '@store/async-actions/pushMessage';
 
 import TemplateContainer from '@components/TemplateContainer';
 import TemplateItems from '@components/TemplateItems';
@@ -223,6 +224,7 @@ class PushContainer extends Component {
                     let typeConfig = part.type;
                     store.dispatch(keepPushData(part,'part'))                 //引用数据的存储,用于保存模板是判断数据是否变化
                     pushAllDataList(typeConfig,'push',part,'template')       //引用
+                    store.dispatch(billing())
                 }
             })
             store.dispatch(changeVisible(false))

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

@@ -135,6 +135,10 @@ class RadioDrop extends Component{
         editable: true
       });
     };
+    //失焦关闭编辑状态
+    setTimeout(()=>{
+      e.target.focus();
+    })
     handleDbclick&&handleDbclick({id:patId||id});
   }
   render(){

+ 18 - 8
src/components/SpreadDrop/index.jsx

@@ -104,7 +104,10 @@ class SpreadDrop extends Component{
         labelVal:text,
         editable:true
       });
-      e.target.focus();
+      //失焦关闭编辑状态
+      setTimeout(()=>{
+        e.target.focus();
+      })
       handleDbclick && handleDbclick({value,id,placeholder});
     }
   }
@@ -197,7 +200,7 @@ class SpreadDrop extends Component{
     //点确定后隐藏弹窗
     this.props.handleHide();
   }
-  handleSelect(item,isExclu,joint,listIndex,selected){
+  handleSelect(item,isExclu,joint,listIndex,selected){//console.log(item,selected)
     let {withOn,withs,noneOn,exclusion,exists,nowOn,nones,noneIds,ban} = this.state;
     /*if(this.props.selecteds)
     console.log(exists,this.props.selecteds.exists,exists===this.props.selecteds.exists)*/
@@ -222,9 +225,9 @@ class SpreadDrop extends Component{
     }
     //操作单选项
     if(selected){
-      const tIndex= exists.findIndex((it)=>it.id===selected.id);
+      const tIndex= exists.findIndex((it)=>it.questionId===item.questionId);
       if(tIndex!=-1){
-        exists.splice(tIndex,1,{id,name,listIndex});
+        exists.splice(tIndex,1,item);
         this.setState({
           exists,
         })
@@ -286,7 +289,7 @@ class SpreadDrop extends Component{
       }else if(nowOn=='with'){
         withs.push({id:id,name:name});
       }else{
-        exists.push({id:id,name:name,listIndex});
+        exists.push({id:id,name:name,listIndex,questionId:item.questionId});
       }
     }
     this.setState({
@@ -407,9 +410,16 @@ class ListItem extends Component{
     const index=listIndex+''+i;
     //列单选处理
     if(isRadio){
-      const selected = data.find((it)=>{
-        return exists.findIndex((i)=>i.id===it.id)!==-1||noneIds.includes(it.id)||withs.findIndex((i)=>i.id===it.id)!==-1;
+      let selected = exists.find((i)=>{
+        return i.questionId===item.questionId;
+      })||withs.find((i)=>{
+        return i.questionId===item.questionId;
+      })||noneIds.find((i)=>{
+        return i.id===item.questionId;
       });
+      /*const selected = data.find((it)=>{console.log(exists)
+        return exists.findIndex((i)=>i.questionId===it.id)!==-1||noneIds.includes(it.id)||withs.findIndex((i)=>i.questionId===it.id)!==-1;
+      });*/
       if(selected&&selected.id!=item.id){     //该列已有选中项,传回已选中的id,name取消选中
         handleClick&&handleClick(item,isExclu,joint,index,{id:selected.id,name:selected.name});
       }else{
@@ -428,7 +438,7 @@ class ListItem extends Component{
         return style['exclusion'];
       }
     }else{
-      if(isExclu&&[...noneIds,...exists,...withs].length>0){
+      if(isExclu&&([...noneIds,...exists,...withs].length>0||ban.id)){
         return style['exclusion'];
       }
       if(noneIds.includes(id)){

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

@@ -66,7 +66,7 @@ class TemplateItems extends React.Component {
                         </div> :
                         <div className={style.wrapperTop}>
                             <span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
-                    </div>) : null
+                    </div>) : <div style={{height:'36px'}}></div>
                 }
                 <div className={style.tempLists} ref={this.$cont}>
                     {

+ 1 - 0
src/config/index.js

@@ -31,6 +31,7 @@ export default {
     delayPushTime:1000,    //延迟推送时间
     pushDelay:1000,
     punctuationReg:/[^,,.。;;、]/g,       //正则表达式,全局查找不是括号内标点的字符
+    punReg:/[,,.。;;、]+/g,
     currentText:"患者XX因XX诊断为(**),经XX治疗后,目前XX症状已缓解,仍有XX,各项指标情况:XX,辅助检查:XX。今来复诊,进一步治疗",
     timeUnit:{
       minute:"分",

+ 4 - 3
src/containers/AssistCheck.js

@@ -7,11 +7,12 @@ import { assistLable,delAssistLabel,changeAssistVal,changeDate } from '@store/ac
 import { getSearchList } from '@store/async-actions/assistCheck';
 import {billing} from '@store/async-actions/pushMessage';
 
-function mapStateToProps(state) {  
+function mapStateToProps(state) {
     return {
         list:state.assistCheck.list,
         assistLabel:state.assistCheck.assistLabel,
         isRead:state.homePage.isRead,
+        winWidth:state.homePage.windowWidth,
     }
 }
 
@@ -20,8 +21,8 @@ function mapDispatchToProps(dispatch, store) {
         handleChangeValue(val) {
             dispatch(getSearchList(val))
         },
-        handleSign(id){
-            dispatch(assistLable(id))
+        handleSign(id,idx){
+            dispatch(assistLable(id,idx))
         },
         handleDelAssist(idx){
             dispatch(delAssistLabel(idx))

+ 4 - 0
src/containers/CurrentIll.js

@@ -115,6 +115,10 @@ function mapDispatchToProps(dispatch) {
                   })
                 }
             });
+          //右侧推送
+          setTimeout(function(){ 
+            dispatch(billing());
+          },200);
         },
         changeEditIll(bool){
             dispatch({

+ 25 - 4
src/containers/EditableSpan.js

@@ -1,9 +1,9 @@
 import {connect} from 'react-redux';
 import {EditableSpan} from '@commonComp';
-import {SETCHECKTEXT,SETSEARCHDATA,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,DEL_CHECKBODY} from '@types/checkBody';
-import {SET_SEARCH,MAIN_FOCUS_INDEX,CLEAR_SEARCH,SETMAINTEXT,DEL_MAIN,REMOVE_MAIN_ID} from '@types/mainSuit';
-import {SETOTHERTEXT,SETOTHERSEARCHDATA,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,DEL_OTHERHIS,REMOVE_OTHER_ID} from '@types/otherHistory';
-import {SET_CURRENT_SEARCH,CURRENT_CLEAR,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,DEL_CURRENT,REMOVE_CURR_ID} from '@types/currentIll';
+import {SETCHECKTEXT,SETSEARCHDATA,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,DEL_CHECKBODY,DEL_CHECKBODY_LABLE} from '@types/checkBody';
+import {SET_SEARCH,MAIN_FOCUS_INDEX,CLEAR_SEARCH,SETMAINTEXT,DEL_MAIN,REMOVE_MAIN_ID,DEL_MAIN_LABLE} from '@types/mainSuit';
+import {SETOTHERTEXT,SETOTHERSEARCHDATA,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,DEL_OTHERHIS,REMOVE_OTHER_ID,DEL_OTHERHIS_LABLE} from '@types/otherHistory';
+import {SET_CURRENT_SEARCH,CURRENT_CLEAR,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,DEL_CURRENT,REMOVE_CURR_ID,DEL_CURRENT_LABLE} from '@types/currentIll';
 import {getSearch} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {didPushParamChange} from '@utils/tools.js';
@@ -253,6 +253,27 @@ function mapDispatchToProps(dispatch,state) {
     dispatch({
       type:ISREAD
     })
+    },
+    delSingleLable(obj){//光标在第一位时 只删除标签
+      switch (+obj.boxMark){
+        case 1:
+          dispatch({type:DEL_MAIN_LABLE,index:obj.i,text:obj.text});
+          break;
+        case 2:
+          dispatch({type:DEL_CURRENT_LABLE,index:obj.i});
+          break;
+        case 3:
+          dispatch({type:DEL_OTHERHIS_LABLE,index:obj.i});
+          break;
+        case 4:
+          dispatch({type:DEL_CHECKBODY_LABLE,index:obj.i});
+          break;
+        default:
+          break;
+      }
+      dispatch({
+        type:ISREAD
+      })
     }
   }
 }

+ 4 - 0
src/containers/MainSuit.js

@@ -118,6 +118,10 @@ function mapDispatchToProps(dispatch) {
         dispatch({
           type:ISREAD
         })
+        //右侧推送
+        setTimeout(function(){ 
+          dispatch(billing());
+        },200);
       },
       clearSearch:()=>{
         dispatch({

+ 2 - 0
src/containers/OtherHistory.js

@@ -40,11 +40,13 @@ function mapDispatchToProps(dispatch,store){
         const model = JSON.parse(JSON.stringify(initData.otherHisModel));
         const arr = JSON.parse(JSON.stringify(initData.otherHis||null));
         const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave||null));
+        const selects = JSON.parse(JSON.stringify(initData.otherSelecteds||null));
         const isHis = initData.otherIsHis;
         const listObj = isHis?{newArr:arr,saveText:arrSave||[]}:fullfillText(model);
         dispatch({
           type:SETDATA,
           data:listObj.newArr,
+          selecteds:selects,
           save:listObj.saveText,
           isEmpty:false
         });

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

@@ -4,9 +4,10 @@ export const searchList = (list) => ({         //获取搜索数据
     type:GET_ASSIST_SEARCH_LIST,
     list
 })
-export const assistLable = (id) => ({         //添加数据
+export const assistLable = (id,idx) => ({         //添加数据
     type:GET_ASSIST_LABEL,
-    id
+    id,
+    idx
 })
 export const delAssistLabel = (idx) => ({         //删除数据
     type:DEL_ASSIST_LABEL,

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

@@ -348,4 +348,20 @@ export function multipleComfirn(state,action){
   res.selecteds[ikey] = action.data;
   res.update = Math.random();
   return res;
+}
+
+export function delSingleLable(state,action){
+  let res = Object.assign({},state);
+  const {index} = action;
+  let data = res.data;
+  // 前一个不是文本标签 并且不是子模板,则删除
+  if(data[index-1].flag&&data[index-1].flag==3){
+
+  }
+  else if(data[index-1].tagType != 8){
+    data.splice(index-1,1);
+    res.saveText.splice(index-1,1);
+  }
+  res.update = Math.random();
+  return res;
 }

+ 42 - 8
src/store/actions/currentIll.js

@@ -135,16 +135,24 @@ export const setData = (state,action) =>{
       // 主症状添加tongYong标签选中文字
       let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
       let mainCopy = JSON.parse(JSON.stringify(main));
-      if(tongYText){
-        /*for(let j=0; j<main.length; j++){
-          mainCopy.splice(j*2,0,tongYText);
-        }*/
+      /*if(tongYText){
         for(let j=0; j<mainCopy.length; j++){
-          mainCopy[j].name = tongYong + mainCopy[j].name;
-          mainCopy[j].value = tongYong + mainCopy[j].value;
+          mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
+          mainCopy[j].value = tongYong + (mainCopy[j].value).replace('、',"");
         }
+      }*/
+      for(let j=0; j<mainCopy.length; j++){
+        if(tongYText){
+          mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
+          mainCopy[j].value = tongYong + (mainCopy[j].value).replace('、',"");
+        }else{
+          mainCopy[j].name = (mainCopy[j].name).replace('、',"");
+          mainCopy[j].value = (mainCopy[j].value).replace('、',"");
+        }
+        
       }
 
+
        // 将ids接口获取到的模板匹配到对应主症状后面
       // 主症状
       let newMainCopy = JSON.parse(JSON.stringify(mainCopy));
@@ -173,11 +181,20 @@ export const setData = (state,action) =>{
         })
       }
       // 伴随
-      let newWiths = JSON.parse(JSON.stringify(withs));
+      // 去掉顿号
+     /* for(let b=0; b<withs.length; b++){
+        withs[b].name = withs[b].name.replace('、',"");
+      }*/
+      // let newWiths = JSON.parse(JSON.stringify(withs));console.log(123,withs,newWiths);
+      let newWiths = [];
       if(withs.length>0){
+        for(let b=0; b<withs.length; b++){
+          withs[b].name = withs[b].name.replace('、',"");
+          withs[b].value = withs[b].value.replace('、',"");
+        }
+        newWiths = JSON.parse(JSON.stringify(withs));
         let withInd = 0;
         let withInsertInd = 0;
-        // let withPreLength = 0;
         let withLengArr=[];
         for(let d=0; d <withs.length;d++){
           mainLabelModuleArr.map((v,i)=>{
@@ -697,4 +714,21 @@ export function multipleComfirn(state,action){
   res.selecteds[ikey] = action.data;
   res.update = Math.random();
   return res;
+}
+
+
+export function delSingleLable(state,action){
+  let res = Object.assign({},state);
+  const {index} = action;
+  let data = res.data;
+  // 前一个不是文本标签 并且不是子模板,则删除
+  if(data[index-1].flag&&data[index-1].flag==3){
+
+  }
+  else if(data[index-1].tagType != 8){
+    data.splice(index-1,1);
+    res.saveText.splice(index-1,1);
+  }
+  res.update = Math.random();
+  return res;
 }

+ 58 - 22
src/store/actions/mainSuit.js

@@ -121,6 +121,13 @@ function getTextLabel(id,name,flag){
   return {id:id,name:name,value:name,tagType:config.tagType,exist:flag};
 }
 
+function addPoint(data,num){//给伴随添加顿号
+  for(let i=num; i<data.length; i++){
+    data[i].name = '、'+ data[i].name;
+  }
+  return data;
+}
+
 //多选标签选中确定处理
 export const confirm = (state,action) =>{
   const res = Object.assign({},state);
@@ -151,14 +158,16 @@ export const confirm = (state,action) =>{
     let index = text.indexOf('伴');
     if(index==-1){//没有伴,直接插入ikey前
       if(exists.length > 0){
-        for(let i=0; i<exists.length; i++){
+        let withsAddP = addPoint(exists,1);
+        for(let i=0; i<withsAddP.length; i++){
           let pos = labelIndx + i;
-          arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
-          res.saveText[pos] = exists[i].name;
+          arr.splice(pos,0,getTextLabel(withsAddP[i].id,withsAddP[i].name,1));
+          res.saveText[pos] = withsAddP[i].name;
         }
       }
       if(withs.length > 0){
-        let newWiths = JSON.parse(JSON.stringify(withs));
+        let withsAddP = addPoint(withs,1);
+        let newWiths = JSON.parse(JSON.stringify(withsAddP));
         if(banText){
          newWiths.unshift(banText);
        }
@@ -172,17 +181,18 @@ export const confirm = (state,action) =>{
       if(exists.length > 0){
         for(let i=0; i<exists.length; i++){
           let pos = index + i;
-          arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
+          arr.splice(pos,0,getTextLabel(exists[i].id,'、'+exists[i].name,1));
           res.saveText[pos] = exists[i].name;
         }
       }
       
-      if(withs.length>0){//有伴插到ikey前既可     
-        for(let j=0; j<withs.length; j++){
+      if(withs.length>0){//有伴插到ikey前既可
+        let withsAddP = addPoint(withs,0);     
+        for(let j=0; j<withsAddP.length; j++){
           // let withsPos = labelIndx + j;
           let withsPos = labelIndx +length + j;
-          arr.splice(withsPos,0,getTextLabel(withs[j].id,withs[j].name,2));
-          res.saveText[withsPos] = withs[j].name;
+          arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2));
+          res.saveText[withsPos] = withsAddP[j].name;
         }
       }
     }
@@ -193,12 +203,16 @@ export const confirm = (state,action) =>{
       if(exists.length > 0){
         for(let i=0; i<exists.length; i++){
           let pos = labelIndx + i;
-          arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
+          arr.splice(pos,0,getTextLabel(exists[i].id,'、'+exists[i].name,1));
           res.saveText[pos] = exists[i].name;
         }
       }
       if(withs.length > 0){
-        let newWiths = JSON.parse(JSON.stringify(withs));
+        /*for(let k=1; k<withs.length; k++){
+          withs[k].name = '、'+ withs[k].name;
+        }*/
+        let withsAddP = addPoint(withs,1);
+        let newWiths = JSON.parse(JSON.stringify(withsAddP));
         if(banText){
          newWiths.unshift(banText);
        }
@@ -212,17 +226,18 @@ export const confirm = (state,action) =>{
       if(exists.length > 0){
         for(let i=0; i<exists.length; i++){
           let pos = index + i;
-          arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
+          arr.splice(pos,0,getTextLabel(exists[i].id,'、'+exists[i].name,1));
           res.saveText[pos] = exists[i].name;
         }
       }
       
-      if(withs.length>0){//有伴插到ikey前既可     
-        for(let j=0; j<withs.length; j++){
+      if(withs.length>0){//有伴插到ikey前既可
+        let withsAddP = addPoint(withs,0);     
+        for(let j=0; j<withsAddP.length; j++){
           // let withsPos = labelIndx + j;
           let withsPos = labelIndx +length + j;
-          arr.splice(withsPos,0,getTextLabel(withs[j].id,withs[j].name,2));
-          res.saveText[withsPos] = withs[j].name;
+          arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2));
+          res.saveText[withsPos] = withsAddP[j].name;
         }
       }
     }
@@ -231,7 +246,7 @@ export const confirm = (state,action) =>{
     
     res.data = arr;
     res.saveText = fullfillText(arr).saveText;
-    res.update=Math.random();
+    res.update=Math.random();console.log(789,res);
     return res;
   };
 
@@ -346,10 +361,15 @@ export const insertSearch = (state,action)=>{
     const value = innerText.replace(searchStr,"");
     let index = innerText.indexOf(searchStr);
     if(index < 1){//前
-      res.data.splice(focusIndex,0,nText);
-      res.saveText.splice(focusIndex,0,searchData);
-      res.data[focusIndex+1].value = value;
-      res.saveText[focusIndex+1] = value;
+      if(data[focusIndex].value==searchStr){//为空标签则替换
+        res.data.splice(focusIndex,1,nText);
+        res.saveText.splice(focusIndex,1,searchData);
+      }else{
+        res.data.splice(focusIndex,0,nText);
+        res.saveText.splice(focusIndex,0,searchData);
+        res.data[focusIndex+1].value = value;
+        res.saveText[focusIndex+1] = value;
+      }  
     }else{
       res.data.splice(focusIndex+1,0,nText);
       res.saveText.splice(focusIndex+1,0,searchData);
@@ -641,6 +661,22 @@ export function multipleComfirn(state,action){
   data[ikey].value = seleData;
   res.saveText[ikey] = seleData;
   res.selecteds[ikey] = action.data;
-  res.update = Math.random();console.log(123,action,res);
+  res.update = Math.random();
+  return res;
+}
+
+export function delSingleLable(state,action){
+  let res = Object.assign({},state);
+  const {index} = action;
+  let data = res.data;
+  // 前一个不是文本标签 并且不是子模板,则删除
+  if(data[index-1].flag&&data[index-1].flag==3){
+
+  }
+  else if(data[index-1].tagType != 8){
+    data.splice(index-1,1);
+    res.saveText.splice(index-1,1);
+  }
+  res.update = Math.random();
   return res;
 }

+ 18 - 2
src/store/actions/otherHistory.js

@@ -307,7 +307,7 @@ export function backspaceText(state,action){
   const {delIndex} = 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){
+  // 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);
@@ -330,7 +330,7 @@ export function removeId(state,action){
   if(!data[index].value && data[index-1].tagType==8){
     data.splice(index,1);
     res.saveText.splice(index,1);
-  }
+  } 
   res.update = Math.random();
   return res;
 }
@@ -345,4 +345,20 @@ export function multipleComfirn(state,action){
   res.selecteds[ikey] = action.data;
   res.update = Math.random();
   return res;
+}
+
+export function delSingleLable(state,action){
+  let res = Object.assign({},state);
+  const {index} = action;
+  let data = res.data;
+  // 前一个不是文本标签 并且不是子模板,则删除
+  if(data[index-1].flag&&data[index-1].flag==3){
+
+  }
+  else if(data[index-1].tagType != 8){
+    data.splice(index-1,1);
+    res.saveText.splice(index-1,1);
+  }
+  res.update = Math.random();
+  return res;
 }

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

@@ -78,6 +78,7 @@ export const getOtherHisRecord = ()=>{
           dispatch({
             type:SETOTHERHISTORY,
             data:arr,
+            selecteds:obj.otherHistorySelecteds,
             save:objStr
           });
         }
@@ -99,7 +100,7 @@ export function getInitData(){
       pacs: emrData.pacs,
       sex: emrData.sex,
       vital:emrData.vital,
-      symptom: emrData.current||emrData.main
+      symptom: emrData.current+emrData.main
     };
     json(api.getBigPush,param).then((res)=>{
       if(+res.data.code === 0){

+ 2 - 0
src/store/async-actions/patInfo.js

@@ -57,6 +57,8 @@ export const initHistoryDetails = (dispatch) => {
                     if(baseList.tabTemplate.items.length == 0){
                       dispatch(initItemList());        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
                     }
+                }else{
+                  dispatch(initItemList(baseList.typeConfig.typeConfig))
                 }
             } else {
                 console.log(res)

+ 9 - 5
src/store/reducers/assistCheck.js

@@ -32,14 +32,15 @@ export default (state = initSearchList, action) => {
         const tempArrs = newState.assistLabel;
         let tmpString = '';
         for (let i = 0; i < tempArr.length; i++) {
-            if (tempArr[i].questionId == action.id) {
+            if (tempArr[i].questionId == action.id && i == action.idx) {
                 tempArr[i].time = getCurrentDate();
                 tempArrs.push(tempArr[i]);
                 newState.assistLabel = [...tempArrs];
             }
         }
         for (let j = 0; j < tempArrs.length; j++) {
-            tmpString += (tempArrs[j].name+(tempArrs[j].value?(':'+tempArrs[j].value)+', ':': ')+(tempArrs[j].time?'报告日期:'+tempArrs[j].time:'')+';')
+            let tmpVal = tempArrs[j].value?tempArrs[j].value.trim():tempArrs[j].value;
+            tmpString += (tempArrs[j].name+(tmpVal?(':'+tmpVal)+', ':': ')+(tempArrs[j].time?'报告日期:'+tempArrs[j].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
@@ -54,7 +55,8 @@ export default (state = initSearchList, action) => {
             return
         }
         for (let i = 0; i < tempArr.length; i++) {
-            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value)+', ':': ')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
+            let tmpVal = tempArr[i].value?tempArr[i].value.trim():tempArr[i].value;
+            tmpString += (tempArr[i].name+(tmpVal?(':'+tmpVal)+', ':': ')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
         }
         newState.assistLabel = [...tempArr]
         newState.dataString = tmpString
@@ -69,7 +71,8 @@ export default (state = initSearchList, action) => {
                 tempArr[i].value = action.val
                 newState.assistLabel = [...tempArr]
             }
-            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value)+', ':': ')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
+            let tmpVal = tempArr[i].value?tempArr[i].value.trim():tempArr[i].value;
+            tmpString += (tempArr[i].name+(tmpVal?(':'+tmpVal)+', ':': ')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
@@ -83,7 +86,8 @@ export default (state = initSearchList, action) => {
                 tempArr[i].time = action.date
                 newState.assistLabel = [...tempArr]
             }
-            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value)+', ':': ')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
+            let tmpVal = tempArr[i].value?tempArr[i].value.trim():tempArr[i].value;
+            tmpString += (tempArr[i].name+(tmpVal?(':'+tmpVal)+', ':': ')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;

+ 4 - 2
src/store/reducers/checkBody.js

@@ -1,9 +1,9 @@
 import {SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEARCHDATA,
   SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,
-  SETCHECKINPUT,DEL_CHECKBODY,CHANGECHECKTEXTLABEL_NUMBER,CHECKCONFIRMSELECTED,CHECKBODY_MUL} from '../types/checkBody.js';
+  SETCHECKINPUT,DEL_CHECKBODY,CHANGECHECKTEXTLABEL_NUMBER,CHECKCONFIRMSELECTED,CHECKBODY_MUL,DEL_CHECKBODY_LABLE} from '../types/checkBody.js';
 import {set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,
   setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText,
-  changeNumLabelVal,confirm,multipleComfirn} from '../actions/checkBody.js';
+  changeNumLabelVal,confirm,multipleComfirn,delSingleLable} from '../actions/checkBody.js';
 import config from '@config/index.js';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
@@ -55,6 +55,8 @@ export default function(state=initState,action){
       return backspaceText(state,action);
     case CHECKBODY_MUL:
       return multipleComfirn(state,action);
+    case DEL_CHECKBODY_LABLE:
+      return delSingleLable(state,action);
     default:
       return res;
   }

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

@@ -1,9 +1,9 @@
 // 现病史
 import {SET_CURRENT,CURRENT_CONFIRM,INSERT_PROCESS,SET_CURRENT_DATA,SET_LABEL_MODULE,SETMAINCHECKBOX,
   CURRENT_RADIO,CURRENT_NUMBER,CURRENT_TEXT_LABEL,CLEAR_CURRENT_ILL,SETTEXTMODEVALUE,CURRENT_GET_BIGDATAPUSH,CURRENT_CLEAR,
-  SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID,CURRENT_MUL} from '../types/currentIll';
+  SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE} from '../types/currentIll';
 import {confirm,insertProcess,setData,setCheckBox,setRadioValue,setNumberValue,changeLabelVal,clearCurrentIll,
-  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn} from '../actions/currentIll';
+  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable} from '../actions/currentIll';
 
 const initState = {
   moduleData:[],
@@ -73,6 +73,8 @@ export default function(state=initState,action){
       return removeId(state,action);
     case CURRENT_MUL://单列多选
       return multipleComfirn(state,action);
+    case DEL_CURRENT_LABLE:
+      return delSingleLable(state,action);
     default:
       return state;
   }

+ 1 - 0
src/store/reducers/homePage.js

@@ -44,6 +44,7 @@ export default function (state=initState,action) {
     case SETOTHERHISTORY:
       res.initData.otherHis = action.data;
       res.initData.otherHisSave = action.save;
+      res.initData.otherSelecteds = action.selecteds;
       res.initData.otherIsHis = action.otherIsHis!=undefined?action.otherIsHis:true;
       return res;
     /*case SETTEXTFOCUS:

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

@@ -65,7 +65,7 @@ export default (state = initSearchList, action) => {
         let tmpArr = newState.getExcelDataList;
         let tmpArr2 = newState.labelList;
         for (let i = 0; i < tempArr.length; i++) {
-            tempArr[i].value = ''
+          // tempArr[i].value = ''
         }
         tempArrs.show = false;
         newState.pushItem = getPushList(tmpArr,tmpArr2);
@@ -97,6 +97,7 @@ export default (state = initSearchList, action) => {
     }
     if (action.type == CHECK_VALUE_IS_CHANGE) {     //数据添加后显示与否
         const newState = Object.assign({}, state);
+        // const tempArrAct = newState.fillActive;
         const tempArr = action.arr;
         tempArr.time = action.time;
         let tmpArr = newState.getExcelDataList;
@@ -104,6 +105,7 @@ export default (state = initSearchList, action) => {
         tempArrs[action.idx] = tempArr;
         newState.fillActive = tempArr;
         newState.labelList = tempArrs;
+        // tempArrAct.show = true;
         newState.pushItem = getPushList(tmpArr,tempArrs);
         newState.inspectStrPlus = getStringPlus(newState.pushItem)
         return newState;

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

@@ -1,9 +1,9 @@
 import {COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   SET_SEARCH,CLEAR_SEARCH,GET_BIGDATAPUSH,SET_MAINSUIT,MIX_CONFIRM,NUMBER_SELECT,
   RADIO_SELECT,COMM_CONFIRM,CHANGE_LABELVAL,SAVE_FREE,CLEAR_MAIN_SUIT,SET_DATA,
-  INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,REMOVE_MAIN_ID,MAINSUIT_MUL} from '../types/mainSuit'
+  INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE} from '../types/mainSuit'
 import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
-  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn} from '../actions/mainSuit'
+  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable} from '../actions/mainSuit'
 
 
 const initState = {
@@ -86,6 +86,8 @@ export default function(state=initState,action){
       return removeId(state,action);
     case MAINSUIT_MUL://单列多选
       return multipleComfirn(state,action);
+    case DEL_MAIN_LABLE://单独删除标签
+      return delSingleLable(state,action);
     default:
       return state;
   }

+ 5 - 2
src/store/reducers/otherHistory.js

@@ -1,6 +1,6 @@
 import {SETDATA,CONFIRMSELECTED,SETRADIO,SETNUMBER,SETOTHERCHECKBOX,SETOTHERTEXT,SETOTHERSEARCHDATA,
-  SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,CHANGEOTHERTEXTLABEL_NUMBER,OTHERHIS_MUL,REMOVE_OTHER_ID} from '../types/otherHistory';
-import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal,multipleComfirn,removeId} from '../actions/otherHistory';
+  SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,CHANGEOTHERTEXTLABEL_NUMBER,OTHERHIS_MUL,REMOVE_OTHER_ID,DEL_OTHERHIS_LABLE} from '../types/otherHistory';
+import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal,multipleComfirn,removeId,delSingleLable} from '../actions/otherHistory';
 import config from '@config/index.js';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
@@ -17,6 +17,7 @@ export default function(state=initState,action){//console.log(state)
   switch (action.type){
     case SETDATA:
       res.data = action.data;
+      res.selecteds = action.selecteds;
       res.saveText = action.save||[];
       res.isEmpty = action.isEmpty;
       return res;
@@ -60,6 +61,8 @@ export default function(state=initState,action){//console.log(state)
         return multipleComfirn(state,action);
     case REMOVE_OTHER_ID:
         return removeId(state,action);
+    case DEL_OTHERHIS_LABLE:
+        return delSingleLable(state,action);
     default:
       return res;
   }

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

@@ -15,4 +15,5 @@ export const SETCHECKINPUT = 'set_check_body_input_label';
 export const DEL_CHECKBODY = 'DEL_CHECKBODY';//backspace
 export const CHANGECHECKTEXTLABEL_NUMBER = 'CHANGECHECKTEXTLABEL_NUMBER';//数字键盘
 export const CHECKCONFIRMSELECTED = 'spread_check_body_labels';
-export const CHECKBODY_MUL = 'CHECKBODY_MUL';//单列多选
+export const CHECKBODY_MUL = 'CHECKBODY_MUL';//单列多选
+export const DEL_CHECKBODY_LABLE = 'DEL_CHECKBODY_LABLE';

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

@@ -24,4 +24,5 @@ export const DEL_CURRENT = 'DEL_CURRENT';     //backspace删除
 export const CURRENT_TEXT_LABEL_NUMBER = 'CURRENT_TEXT_LABEL_NUMBER';     //数字键盘输入
 export const REMOVE_CURR_ID = 'REMOVE_CURR_ID';     //删除后移除id
 export const CURRENT_MUL = 'CURRENT_MUL';     //单列多选
+export const DEL_CURRENT_LABLE = 'DEL_CURRENT_LABLE';     //
 

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

@@ -25,3 +25,4 @@ export const DEL_MAIN = 'DEL_MAIN';     //删除标签
 export const CHANGE_LABELVAL_NUMBER = 'CHANGE_LABELVAL_NUMBER';     //数字键盘输入存值
 export const REMOVE_MAIN_ID = 'REMOVE_MAIN_ID';     //移除id
 export const MAINSUIT_MUL = 'MAINSUIT_MUL';     //单列多选
+export const DEL_MAIN_LABLE = 'DEL_MAIN_LABLE';     

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

@@ -19,4 +19,5 @@ export const OTHEREDICLEAR = 'OTHEREDICLEAR';    //文本框是否可以编辑
 export const DEL_OTHERHIS = 'DEL_OTHERHIS';    //backspace
 export const CHANGEOTHERTEXTLABEL_NUMBER = 'CHANGEOTHERTEXTLABEL_NUMBER';    //数字键盘
 export const OTHERHIS_MUL = 'OTHERHIS_MUL';    //单列多选
-export const REMOVE_OTHER_ID = 'REMOVE_OTHER_ID';    
+export const REMOVE_OTHER_ID = 'REMOVE_OTHER_ID';    
+export const DEL_OTHERHIS_LABLE = 'DEL_OTHERHIS_LABLE';    

+ 25 - 38
src/utils/tools.js

@@ -490,37 +490,18 @@ function filterArr(arr){
 
 function filterDataArr(arrTmp){   //数据处理
     let tmpArr = [];
-    let arr = arrTmp.join('').split('');
-    for(let i = 0;i < arr.length;i++){
-        if(!(arr[i].match(config.punctuationReg)||arr[i-1])){        //只有标点符号或者前一个标签无值是(说明本标点灰显,不显示在预览中)
-            arr.splice(i,1,'');
-        }
-        if(arr[i] && arr[i].indexOf('undefined') == -1){
-            if(tmpArr[tmpArr.length-1] != ',' && tmpArr[tmpArr.length-1] != ',' ){
-                tmpArr.push(arr[i])
-            }else if((tmpArr[tmpArr.length-1] == ',' && (arr[i] != ',' || arr[i] != ',')) || (tmpArr[tmpArr.length-1] == ',' && (arr[i] != ',' || arr[i] != ','))) {
-              if(arr[i] == '。'){     //前面逗号后面句号 [',','。']
-                tmpArr.pop();
-                tmpArr.push(arr[i]);
-              }else if(tmpArr[tmpArr.length-2] == '。' && (tmpArr[tmpArr.length-1] == ',' || tmpArr[tmpArr.length-1] == ',')){//前面句号后面逗号 ['。',',']
-                tmpArr.pop();
-                tmpArr.push(arr[i]);
-              }else if(arr[i] == ',' || arr[i] == ','){    //  中英文逗号交替[',',',']
-                tmpArr.pop();
-                tmpArr.push(arr[i]);
-              }else if(arr[i] == '、'){    //前面逗号后面句号 [',','、']
-                tmpArr.pop();
-                tmpArr.push(arr[i]);
-              }else if(tmpArr[tmpArr.length-2] == '、' && (tmpArr[tmpArr.length-1] == ',' || tmpArr[tmpArr.length-1] == ',')){    //前面逗号后面句号 ['、',',']
-                tmpArr.splice(tmpArr.length-2,1);
-                tmpArr.push(arr[i]);
-              }else{
-                tmpArr.push(arr[i]);
-              }
-            }
-        }
-    }
-    return (tmpArr.join('')).replace(/^,+/,"").replace(/,+$/,"").replace(/^,+$/,"").replace(/,+$/,"").replace(/^。+/,"").replace(/。+$/,"。");
+    tmpArr = arrTmp.map((it,i)=>{     //连续的标点符号保留第一个
+      if(!it.match(config.punctuationReg)&&!arrTmp[i-1]){        //只有标点符号或者前一个标签无值是(说明本标点灰显,不显示在预览中)
+          return '';
+      }
+      return it.replace(config.punReg,function(word){
+        return word.substr(0,1);
+      });
+    });
+
+    return tmpArr.join('').replace(config.punReg,function(word){
+      return word.substr(0,1);
+    }).replace(/^[,,.。;;、]+/,'');      //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
 }
 // 取消默认行为
 function preventDefault(event) {
@@ -608,15 +589,10 @@ function isAllClear(jsonData,jsonStr,baseList){
     jsonData.pacs.length < 1 &&
     jsonData.lis.labelList.length < 1 &&
     jsonData.lis.getExcelDataList.length < 1 &&
-    JSON.stringify(jsonData.advice) == '{}' &&
     filterDataArr(JSON.parse(jsonStr.chief)) == '' &&
     filterDataArr(JSON.parse(jsonStr.present)) == '' &&
     filterDataArr(JSON.parse(jsonStr.other)) == '' &&           //这里都是filterDataArr不是filterArr,要去符号的
-    filterDataArr(JSON.parse(jsonStr.vital)) == '' &&
-    jsonData.diag.length < 1 &&
-    jsonData.pacs.length < 1 &&
-    jsonData.lis.labelList.length < 1 &&
-    jsonData.lis.getExcelDataList.length < 1
+    filterDataArr(JSON.parse(jsonStr.vital)) == ''
   ) {
     return false;
   }else{
@@ -650,6 +626,16 @@ function getPageCoordinate(event){
     }
     return obj;
 }
+function timestampToTime(timestamp) {     //excel导入2019年5月1日会转换成时间戳
+  var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+  var Y = date.getFullYear() + '-';
+  var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
+  var D = date.getDate() + ' ';
+  var h = date.getHours() + ':';
+  var m = date.getMinutes() + ':';
+  var s = date.getSeconds();
+  return Y+M+D+h+m+s;
+}
 module.exports = {
     checkType: Type.checkType,
     regexp,
@@ -675,5 +661,6 @@ module.exports = {
     isAllClear,
     normalVal,
     getPageCoordinate,
-    windowRemoveEventHandler
+    windowRemoveEventHandler,
+    timestampToTime
 };