zhouna 6 سال پیش
والد
کامیت
edb84b07ad
79فایلهای تغییر یافته به همراه667 افزوده شده و 369 حذف شده
  1. 4 1
      src/common/components/ConfirmModal/index.jsx
  2. 0 1
      src/common/components/ConfirmModal/index.less
  3. 2 2
      src/common/components/EditableSpan/index.jsx
  4. 1 1
      src/common/components/InspectCommon/index.less
  5. 9 0
      src/common/components/NumberUnitPan/index.jsx
  6. 1 1
      src/common/components/NumberUnitPan/index.less
  7. 1 1
      src/common/components/SearchOption/index.less
  8. 7 2
      src/common/js/func.js
  9. 2 1
      src/common/js/util.js
  10. 1 1
      src/common/less/variables.less
  11. 7 0
      src/components/AddAssistCheck/Textarea/index.less
  12. 6 6
      src/components/AddInspect/index.jsx
  13. 3 2
      src/components/AddInspect/index.less
  14. 0 1
      src/components/CopyRight/index.jsx
  15. 1 1
      src/components/DiagnosticList/index.jsx
  16. 1 1
      src/components/EMRContainer/index.less
  17. 6 1
      src/components/HistoryCaseContainer/HistoryList/index.jsx
  18. 12 10
      src/components/HistoryCaseContainer/HistoryList/index.less
  19. 18 6
      src/components/Inspect/index.jsx
  20. 2 2
      src/components/NumberDrop/index.jsx
  21. 4 2
      src/components/NumberUnitDrop/index.jsx
  22. 45 24
      src/components/Operation/index.jsx
  23. 2 1
      src/components/Operation/index.less
  24. 22 76
      src/components/PreviewBody/index.jsx
  25. 5 1
      src/components/PreviewBody/index.less
  26. 11 8
      src/components/PushContainer/index.jsx
  27. 4 4
      src/components/PushItems/index.jsx
  28. 20 14
      src/components/PushItems/index.less
  29. 3 3
      src/components/TemplateItems/index.jsx
  30. 1 1
      src/components/TemplateItems/index.less
  31. 22 17
      src/components/Treat/DrugTreat/index.jsx
  32. 9 2
      src/components/Treat/DrugTreat/index.less
  33. 3 2
      src/components/Treat/GeneralTreat/index.jsx
  34. 12 0
      src/components/Treat/GeneralTreat/index.less
  35. 18 15
      src/components/Treat/index.jsx
  36. 37 18
      src/components/Treat/index.less
  37. 1 1
      src/components/TreatDesc/DrugInfo/index.less
  38. 7 6
      src/components/TreatDesc/index.jsx
  39. 19 5
      src/components/TreatDesc/index.less
  40. 2 0
      src/config/index.js
  41. 1 1
      src/containers/CurrentIll.js
  42. 2 2
      src/containers/EditableSpan.js
  43. 12 8
      src/containers/NumberDrop.js
  44. 10 1
      src/containers/NumberUnitDrop.js
  45. 10 5
      src/containers/OperationContainer.js
  46. 5 1
      src/containers/RadioDrop.js
  47. 9 3
      src/containers/SpreadDrop.js
  48. 2 1
      src/containers/Treat.js
  49. 3 1
      src/containers/eleType.js
  50. 1 1
      src/main.js
  51. 26 2
      src/store/actions/checkBody.js
  52. 61 30
      src/store/actions/currentIll.js
  53. 49 19
      src/store/actions/mainSuit.js
  54. 21 1
      src/store/actions/otherHistory.js
  55. 6 0
      src/store/actions/print.js
  56. 1 1
      src/store/actions/pushMessage.js
  57. 1 1
      src/store/actions/tabTemplate.js
  58. 6 0
      src/store/actions/treat.js
  59. 0 1
      src/store/async-actions/assistCheck.js
  60. 9 5
      src/store/async-actions/diagnosticList.js
  61. 2 2
      src/store/async-actions/fetchModules.js
  62. 4 0
      src/store/async-actions/homePage.js
  63. 18 2
      src/store/async-actions/tabTemplate.js
  64. 6 3
      src/store/async-actions/treat.js
  65. 10 10
      src/store/reducers/assistCheck.js
  66. 4 2
      src/store/reducers/checkBody.js
  67. 4 2
      src/store/reducers/currentIll.js
  68. 4 2
      src/store/reducers/mainSuit.js
  69. 4 2
      src/store/reducers/otherHistory.js
  70. 6 3
      src/store/reducers/print.js
  71. 1 1
      src/store/reducers/tabTemplate.js
  72. 4 2
      src/store/reducers/treat.js
  73. 2 1
      src/store/types/checkBody.js
  74. 1 0
      src/store/types/currentIll.js
  75. 2 1
      src/store/types/mainSuit.js
  76. 2 1
      src/store/types/otherHistory.js
  77. 2 1
      src/store/types/print.js
  78. 1 0
      src/store/types/treat.js
  79. 24 9
      src/utils/tools.js

+ 4 - 1
src/common/components/ConfirmModal/index.jsx

@@ -68,6 +68,7 @@ const defaultProps = {
     cancelBorderColor: '#414141',
     cancelBg: '#fff',
     width: '300px',
+    height: '200px',
 };
 
 class ConfirmModal extends Component {
@@ -123,10 +124,12 @@ class ConfirmModal extends Component {
             closable, 
             noFooter
         } = this.props;
+        const marginLeft = -parseInt(width)/2
+        const marginTop = -parseInt(height)/2
         return (
             <NewPortal visible={visible}>
                 <div className={styles['modal-wrapper']} id='confirm'>
-                    <div className={styles[['modal']]} style = {{width: width, height:height}}>
+                    <div className={styles[['modal']]} style = {{width: width, marginLeft:marginLeft, height:height, marginTop:marginTop}}>
                         <div className={styles['modal-title']} style={{background: titleBg}}>{title ? title : ''} {closable ? <img onClick={this.closeModal} className={styles['modal-close']} src = {close}/> : false}</div>
                         <div className={styles['modal-content']}>{children}</div>
                         {noFooter ? '' : <div className={styles['modal-operator']+' clearfix'}>

+ 0 - 1
src/common/components/ConfirmModal/index.less

@@ -2,7 +2,6 @@
     position: fixed;
     top: 50%;
     left: 50%;
-    transform: translate(-50%,-50%);
     margin: auto;
     border-radius: 5px;
     background: #fff;

+ 2 - 2
src/common/components/EditableSpan/index.jsx

@@ -132,13 +132,13 @@ class EditableSpan extends Component{
     const target = ev.target||ev.srcElement;
     let innerVal = target.innerText;
     if(ev.keyCode==8){
-      if(innerVal !==preVal){return}
+      if(innerVal !==preVal){return false}
       let data = innerVal.trim();
       //判断是否为空、中英文:, 。、;,且不是第一位
       let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$\s/);
       // if(i!==0 &&data==""||data==","||data==","||data==":"||data==":"||data=="."||data=="。"||data=="、"||data==";"||data==";"){
       if(index!==0 && pattern.test(data)){
-        handleKeydown&&handleKeydown({boxMark,i:index});
+        handleKeydown&&handleKeydown({boxMark,i:index,text:data});
         this.setState({
           // index:index-1 //连续往前删除,体验不佳
           index: null

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

@@ -2,7 +2,7 @@
 .wrapper {
     position: absolute;
     top: 40px;
-    z-index: 20;
+    z-index: 99;
     background-color: #fff;
     padding:28px 8px 8px 8px;
     min-width: 300px;

+ 9 - 0
src/common/components/NumberUnitPan/index.jsx

@@ -55,6 +55,14 @@ class NumberUnitPan extends Component{
     });
     onSelect&&onSelect(text);
   }
+  componentWillReceiveProps(nextProps){
+    //重新选择的值替换 不追加
+     if(!nextProps.show){
+      this.setState({
+        value:''
+      });
+     }
+  }
   render(){
     // const select = this.handleSelect.bind(this);
     const {show} = this.props;      //table onBlur阻止冒泡是为了修复multSpread中数字键盘点击触发最外层数字组件onBlur事件
@@ -88,6 +96,7 @@ class NumberUnitPan extends Component{
         <td><span onClick={this.handleSelect}>{config.timeUnit.minute}</span></td>
         <td><span onClick={this.handleSelect}>{config.timeUnit.hour}</span></td>
         <td><span onClick={this.handleSelect}>{config.timeUnit.day}</span></td>
+        <td><span onClick={this.handleSelect}>{config.timeUnit.age}</span></td>
       </tr>
       <tr>
         <td><span onClick={this.handleSelect}>{config.timeUnit.week}</span></td>

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

@@ -18,7 +18,7 @@
     height: 100%;
     text-align: center;
     line-height: 44px;
-    color: #666;
+    color: #333;
     cursor: pointer;
   }
   span:hover{

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

@@ -6,7 +6,7 @@
     box-sizing: border-box;
     position: absolute;
     top: 40px;
-    z-index: 20;
+    z-index: 99;
     background-color: #fff;
     box-shadow: 0 6px 20px 0 #989DA3;
     margin-bottom: 80px;

+ 7 - 2
src/common/js/func.js

@@ -79,11 +79,13 @@ function notTextLabel(label){
 * 入参:arr源数组,
 *       noPre是否不添加前置文本标签,默认false即添加
 *       noEnd是否不添加后置文本标签,默认false即添加
+*       ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体
 * */
-export const fullfillText = (arr,noPre=false,noEnd=false)=>{
+export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
   let newArr =[],
       pre={},
       textLabel={},
+      _textLabel={},
       notText = true,
       saveText=[],
       tempText = '',
@@ -92,6 +94,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false)=>{
     notText = notTextLabel(it);
     value = it.value||'';
     textLabel = JSON.parse(config.textLabel);
+    _textLabel = JSON.parse(config._textLabel);
     if(i===0){
       //第一个标签不是文本标签时在前面添加文本标签
       if(!noPre&&notText){
@@ -106,7 +109,8 @@ export const fullfillText = (arr,noPre=false,noEnd=false)=>{
       pre = arr[i-1];
       //如果本身不是文本标签且前面一个也不是文本标签,该标签前面添加文本标签
       if(notTextLabel(pre)&&notText){
-          newArr.push(textLabel,it);
+          // newArr.push(textLabel,it);
+          ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,it);
           tempText = value?it.labelPrefix+value+it.labelSuffix:'';
           saveText.push("",tempText); 
         //最后一个非文本标签,后面添加一个文本标签
@@ -130,6 +134,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false)=>{
   return {newArr,saveText};
 };
 
+
 //获取标签index,入参:病例项index+标签index+标签内index
 export const getLabelIndex = (index)=>{
   let ikey = '';

+ 2 - 1
src/common/js/util.js

@@ -32,4 +32,5 @@ export const setLastPosition=(dom)=>{
 //         range.collapse(false);//光标移至最后
 //         range.select();
 //     }
-// }
+// }
+

+ 1 - 1
src/common/less/variables.less

@@ -46,7 +46,7 @@
 @selected-bg:#fff;
 
 /*********推送内容容器宽度*************/
-@push-width: 460px;
+@push-width: 450px;
 /****电子病历容器宽度*****/
 @EMR-width: calc(~"100% - "@push-width);
 

+ 7 - 0
src/components/AddAssistCheck/Textarea/index.less

@@ -10,4 +10,11 @@
   line-height: 20px;
   resize: none;
   font-family: inherit;
+}
+.divTextarea:empty:before{ 
+  content: '报告描述或意见'; 
+  color: gray; 
+} 
+.divTextarea:focus:before{
+  content:none;
 }

+ 6 - 6
src/components/AddInspect/index.jsx

@@ -3,7 +3,6 @@ import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@
 import { deepClone } from '@utils/tools';
 import styles from './index.less';
 import date1 from './img/date1.png';
-import date2 from './img/date2.png';
 import close from './img/close.png';
 import store from '@store';
 import $ from 'jquery';
@@ -110,12 +109,11 @@ class Inspect extends React.Component {
     handleFillShow(e,idx) {
         let tmpShow = this.state.showFill;
         let baseList = store.getState().inspect.fillActive;
-        const tmpTime = this.state.dateTime
         this.setState({
             showFill: !tmpShow, 
             currentIdx:idx,
             currentData:baseList,
-            dateTime:baseList.time?baseList.time:tmpTime
+            dateTime:baseList.time?baseList.time:this.getCurrentDate()
         })
         e.stopPropagation();
     }
@@ -131,7 +129,7 @@ class Inspect extends React.Component {
         let day = myDate.getDate();            //获取当前日(1-31)
         let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
         this.setState({dateTime:date})
-        
+        return date;
     }
     changeActivePart(idx,val){
         let nums = this.state.num;
@@ -341,7 +339,7 @@ class Inspect extends React.Component {
                                                     handleClear={(e)=>{
                                                         handleClear(e,idx)
                                                         this.setState({
-                                                            showFill:false
+                                                            currentData:fillActive
                                                         })
                                                     }}
                                                     handleConfirm={(e)=>{
@@ -358,7 +356,9 @@ class Inspect extends React.Component {
                                                     <div className={styles.searchResultT}>
                                                         <img style={{"position":"absolute","top":"8px","right":"8px"}} src={date1} alt="" onClick={this.handleShowDate}/>
                                                         <p style={{position:"absolute",right:"38px",top:"4px",lineHeight:"28px"}}>
-                                                            {this.state.dateTime}
+                                                            {
+                                                              this.state.dateTime
+                                                            }
                                                         </p>
                                                         <div style={{display:this.state.date?"block":"none",position:"relative"}}>
                                                             {/* 日期组件 */}

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

@@ -119,10 +119,11 @@
 }
 .itemPart {
     height: 28px;
-    line-height: 28px;
+    // line-height: 28px;
     overflow: hidden;
     padding-top: 0 !important;
-    width: 292px;
+    // width: 292px;
+    width: 290px;
     float: left;
     padding: 0 15px;
     box-sizing: border-box;

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

@@ -79,7 +79,6 @@ class CopyRight extends Component {
 
     return (
       <div className={style["container"]}>
-        {disContent.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: disContent.data.data[1].description}}></div>}
         <div className={style["copy"]}>
           版本信息:{" "}
           <a href="javascript:;" onClick={showCopyModal}>

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

@@ -88,7 +88,7 @@ class DiagnosticList extends Component {
                                     <span className={style['diag-name']} onClick={()=>{this.handleClickDiag(item)}}>{item.name}<span></span></span> 
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
                                     <span className={style['treat']}
-                                          style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'' : '1px solid gray'}}
+                                          style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'1px solid #3B9ED0' : '1px solid gray'}}
                                           onClick={() =>{hasTreat && this.showTreat(item)}}>
                                           治疗方案
                                     </span>

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

@@ -6,7 +6,7 @@
   padding: 0px 0 10px 0 ;
   box-sizing: border-box;
   position: relative;
-  min-width: 720px;
+  min-width: 700px;
 }
 .inner{
 //   overflow-y: auto;

+ 6 - 1
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -49,11 +49,16 @@ class HistoryCaseContainer extends React.Component {
                                 items && items.length > 0? items.map((val,idx)=>{
                                     return <li key={val.id} className={val.id == activeHistory.id?styles.bgc:''} onClick={(e)=>{handleCaseClick(e,idx)}}>
                                         <span title={val.diagnose}>{val.diagnose}</span>
-                                        <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>
+                                        {/* <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>
                                         <button 
                                             className={val.id == activeHistory.id?`${styles.quote} ${styles.quoteShow}`:styles.quote} 
                                             onClick={(e)=>{handleQuoteClick(e,val)}}
+                                        >引 用</button> */}
+                                        <button 
+                                            className={styles.quote} 
+                                            onClick={(e)=>{handleQuoteClick(e,val)}}
                                         >引 用</button>
+                                        <span className={styles.time}>{val.inquiryDate}</span>
                                     </li>
                                 }):<Empty message={'无历史病历'}></Empty>
                             }

+ 12 - 10
src/components/HistoryCaseContainer/HistoryList/index.less

@@ -6,7 +6,7 @@
     right: 0;
     bottom:0;
     margin: auto;
-    width: 1080px;
+    width: 1120px;
     top: 70px;
     bottom: 70px;
     background-color: #fff;
@@ -17,7 +17,7 @@
         right: 0;
     }
     .mainHistoryLeft {
-        width: 260px;
+        width: 300px;
         height: 100%;
         background: #F1F1F1;
         position: relative;
@@ -50,7 +50,7 @@
             height: 100%;
             span {
                 display: inline-block;
-                max-width: 150px;
+                max-width: 130px;
                 overflow: hidden;
                 text-overflow: ellipsis;
                 white-space: nowrap;
@@ -58,7 +58,7 @@
             li {
                 height: 54px;
                 line-height: 54px;
-                padding: 0 20px;
+                padding: 0 10px;
                 font-size: 14px;
                 cursor: pointer;
                 border: 1px solid transparent;
@@ -73,17 +73,19 @@
                 background-color: #fff;
             }
             .quote {
-                width: 60px;
-                height: 30px;
-                line-height: 30px;
+                width: 50px;
+                height: 22px;
+                line-height: 22px;
                 border-radius: 15px;
                 border: 0 none;
                 color: #fff;
                 background-color: @template-color;
                 float: right;
-                margin-top: 12px;
-                display: none;
+                margin-top: 16px;
+                font-size: 12px;
+                // display: none;
                 outline: none;
+                margin-left: 10px;
             }
             .quoteShow {
                 display: block;
@@ -94,6 +96,6 @@
         }
     }
     .mainHistoryRight {
-        margin-left: 260px;
+        margin-left: 300px;
     }
 }

+ 18 - 6
src/components/Inspect/index.jsx

@@ -39,13 +39,22 @@ class Inspect extends React.Component {
             val: '',
             visible:false,
             dom:[],
-            isIE:isIE()
+            isIE:isIE(),
+            ieVersion:null
         }
         this.handleImportExcel = this.handleImportExcel.bind(this)
         this.cancel = this.cancel.bind(this)
         this.getWarings = this.getWarings.bind(this)
     }
-    componentDidMount(){
+    componentDidMount(){ 
+        var ua = navigator.userAgent;  
+        var _isIE = ua.indexOf("MSIE")>-1;
+        if(_isIE){  
+            let version =  ua.match(/MSIE ([\d.]+)/)[1];
+            this.setState({
+                ieVersion:version
+            })
+        }      
         $('iframe').bind( 'load', function(){} )
       const {fetchPushInfos} = this.props;
         // FileAPI.debug = true
@@ -68,7 +77,7 @@ class Inspect extends React.Component {
             },
             function (files, rejected){
                 if( files.length ){
-                    console.log(files[0])
+                    // console.log(files[0])
                     FileAPI.upload({
                         // url: '/api/icss/lisExcelRes/lisExcelAnalysis',
                         url: api.upload,
@@ -110,7 +119,8 @@ class Inspect extends React.Component {
         this.setState({visible:false})
     }
   getStyle(){
-        if(this.state.isIE){
+    const {ieVersion} = this.state;
+        if(ieVersion&&ieVersion<=9){
             return styles.disabledBtn;
         }else{
             return styles.button;
@@ -129,14 +139,16 @@ class Inspect extends React.Component {
     }
     render() {
         const {fetchPushInfos, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList,delPartItem } = this.props;
+        const {ieVersion,isIE} = this.state;
         return (
             <div className={styles.wrapper} >
                 {/* 导入功能插件,ie8/9权限问题暂未解决,先隐藏 */}
 
                 <div className={styles.top}>
                     <span>化验结果数据</span>
-                    <div className={this.getStyle()} onClick={this.state.isIE?null:this.handleImportExcel}>
-                        <button disabled={this.state.isIE?true:false}>导入化验结果</button>
+                    <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}>
+                       {/* <button disabled={ieVersion&&ieVersion>9?true:false}>导入化验结果</button>*/}
+                        <button>导入化验结果</button>
                         <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
                     </div>
                 </div>

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

@@ -38,7 +38,7 @@ class NumberDrop extends Component{
     });
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
-  handleNumFocus(e){        //数字框可编辑状态下聚集事件,处理是否显示下拉等
+  handleNumFocus(e){       //数字框可编辑状态下聚集事件,处理是否显示下拉等
     e.stopPropagation();
     const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
     const that = this;
@@ -85,7 +85,7 @@ class NumberDrop extends Component{
     const text = e.target.innerText===placeholder?'':e.target.innerText;
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
-  handleSpanInp(e){      //数字框输入事件
+  handleSpanInp(e){    //数字框输入事件
     e.stopPropagation();
     //const {value} = this.props;
   }

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

@@ -70,12 +70,14 @@ class NumberUnitDrop extends Component{
   //数字框失焦,保存值到store中
   numInpBlur(e){
     e.stopPropagation();
-    const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark} = this.props;
     const {editable} = this.state;
     if(editable){
       const text = e.target.innerText;
       // this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug 
-      handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+      // handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+      handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark});
+      
     }
     this.setState({
       isClosed:false,

+ 45 - 24
src/components/Operation/index.jsx

@@ -6,7 +6,6 @@ import saveHistory from '@common/images/saveHistory.png';
 import PrintPreviewContainer from '@containers/PrintPreviewContainer';
 import PreviewContainer from '@containers/PreviewContainer';
 import { ConfirmModal, Notify } from '@commonComp';
-import { changeVisible } from '@store/actions/tabTemplate';
 import {getAllDataList,getAllDataStringList} from '@utils/tools';
 import store from '@store';
 
@@ -143,17 +142,18 @@ class Operation extends Component {
       title: val
     })
   }
-  keypress(e) {
+  keypress(event) {
+    let e = event?event:window.event;
     if (e.keyCode == 13) {
-      this.makeSure()
-      store.dispatch(changeVisible(false))
+      // this.makeSure()
+      // store.dispatch(changeVisible(false))
     }
   }
   saveHis(type) {
-    let flg = this.getAllData()
+    const { diagShowTmp } = this.props;
+    let flg = this.getAllData();
     if(flg){
       this.setState({
-        visible: true,
         title: '',
         type: type,
         okText: '保存',
@@ -162,6 +162,7 @@ class Operation extends Component {
         oKBg: '#3B9ED0',
         msg: this.changeTitle()
       })
+      diagShowTmp(true)
     }
   }
   getAllData(){
@@ -169,16 +170,18 @@ class Operation extends Component {
     let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.typeConfig;
-    let activeItemData = baseList.tabTemplate.activeItem;
-    // let preview = (activeItemData.preview).split('-').join('');
-
+    let tmpLis = baseList.tabTemplate.items;
     if (whichSign == 0) {
-      if (activeItemData && JSON.stringify(activeItemData) != '{}' && (activeItemData.dataJson == JSON.stringify(jsonData)) && (JSON.stringify(jsonStr) == JSON.stringify(JSON.parse(activeItemData.preview)))) {
-        Notify.info('该模板已保存');
-        return false;
-      }else if (
+      for(let i = 0;i <tmpLis.length;i++){
+        let dataStr = tmpLis[i].dataJson;
+        if(dataStr == JSON.stringify(jsonData)){
+          Notify.info('该模板已保存');
+          return false;
+        }
+      }
+      if (
         JSON.stringify(jsonData.advice) == '{}' &&
-        jsonData.chief.length < 1 &&
+        (jsonData.chief.length < 1 && jsonStr.chief == '[]') &&
         jsonData.diag.length < 1 &&
         jsonData.vital.length < 1 &&
         jsonData.other.length < 1 &&
@@ -193,10 +196,16 @@ class Operation extends Component {
         return true;
       }
     } else if(whichSign == 1) {
-      if (activeItemData && JSON.stringify(activeItemData) != '{}' && (JSON.stringify(jsonStr) == JSON.stringify(JSON.parse(activeItemData.preview)))) {
-        Notify.info('该模板已保存');
-        return false;
-      }else if (JSON.stringify(jsonData.advice) == '{}' && 
+      for(let i = 0;i <tmpLis.length;i++){
+        let dataStr = tmpLis[i].preview;
+        let jsStr = tmpLis[i].dataJson;
+        console.log(dataStr == JSON.stringify(jsonStr))
+        if(JSON.stringify(JSON.parse(dataStr)) == JSON.stringify(jsonStr) && jsStr == JSON.stringify(jsonData)){
+          Notify.info('该模板已保存');
+          return false;
+        }
+      }
+      if (JSON.stringify(jsonData.advice) == '{}' && 
           jsonStr.chief == '[]' && 
           jsonStr.present == '[]' && 
           jsonStr.other == '[]' && 
@@ -236,7 +245,7 @@ class Operation extends Component {
     </div>
   }
   makeSure() {
-    const { save, clear, saveDataAll } = this.props;
+    const { save, clear, saveDataAll,diagShowTmp } = this.props;
     const { type } = this.state;
     if (type == 1) {
       this.setState({ visible: false, title: '' })
@@ -249,15 +258,15 @@ class Operation extends Component {
         Notify.error('请输入模板名称')
         return;
       }
+      // diagShowTmp(false)
       saveDataAll(this.state.title);
-      this.setState({ visible: false, title: '' });
     }
   }
   render() {
     const { showPrint, closePrint, showPreview, closePreview } = this;
-    const { visible, preVisible } = this.props.print;
+    const { visible, preVisible,diagShow } = this.props.print;
+    const { diagShowTmp } = this.props;
     const {zIndex} = this.state;
-
     return <div className={style['container']} style={{zIndex:zIndex}}>
       <button className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</button>
       <button className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</button>
@@ -269,8 +278,20 @@ class Operation extends Component {
       <ConfirmModal
         visible={this.state.visible}
         confirm={() => { this.makeSure() }}
-        close={() => { this.setState({ visible: false, title: '' }) }}
-        cancel={() => { this.setState({ visible: false, title: '' }) }}
+        close={() => {this.setState({ visible: false, title: '' }) }}
+        cancel={() => {this.setState({ visible: false, title: '' }) }}
+        okText={this.state.okText}
+        okBorderColor={this.state.borderColor}
+        okColor={this.state.okColor}
+        oKBg={this.state.oKBg}
+      >
+        {this.state.msg}
+      </ConfirmModal>
+      <ConfirmModal
+        visible={diagShow}
+        confirm={() => { this.makeSure() }}
+        close={() => { diagShowTmp(false); this.setState({ title: '' }) }}
+        cancel={() => { diagShowTmp(false); this.setState({ title: '' }) }}
         okText={this.state.okText}
         okBorderColor={this.state.borderColor}
         okColor={this.state.okColor}

+ 2 - 1
src/components/Operation/index.less

@@ -5,7 +5,8 @@
     position: fixed;
     bottom: 0;
     left: 10px;
-    right: 480px;
+    right: 470px;
+    min-width: 720px;
     background-color: #fff;
     // z-index: 240;
     padding-bottom: 10px;

+ 22 - 76
src/components/PreviewBody/index.jsx

@@ -2,75 +2,22 @@ import React, { Component } from "react";
 import style from "./index.less";
 import $ from "jquery";
 import {filterDataArr} from '@utils/tools'
-(function ($) {
-    var opt;
-
-    $.fn.jqprint = function (options) {
-        opt = $.extend({}, $.fn.jqprint.defaults, options);
-
-        var $element = (this instanceof $) ? this : $(this);
-
-        if (opt.operaSupport && $.browser.opera) {
-            var tab = window.open("", "jqPrint-preview");
-            tab.document.open();
-
-            var doc = tab.document;
-        }
-        else {
-            var $iframe = $("<iframe  />");
-
-            if (!opt.debug) { $iframe.css({ position: "absolute", width: "200px", height: "0px", left: "-300px", top: "-300px" }); }
-
-            $iframe.appendTo("body");
-            var doc = $iframe[0].contentWindow.document;
-        }
-
-        if (opt.importCSS) {
-            if ($("link[media=print]").length > 0) {
-                $("link[media=print]").each(function () {
-                    doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' media='print' />");
-                });
-            }
-            else {
-                $("link").each(function () {
-                    doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />");
-                });
-            }
-        }
-
-        if (opt.printContainer) { doc.write($element.outer()); }
-        else { $element.each(function () { doc.write($(this).html()); }); }
-
-        doc.close();
-
-        (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).focus();
-        setTimeout(function () { (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).print(); if (tab) { tab.close(); } }, 1000);
-    }
-
-    $.fn.jqprint.defaults = {
-        debug: false,
-        importCSS: true,
-        printContainer: true,
-        operaSupport: true
-    };
-
-    $.fn.outer = function () {
-        return $($('<div></div>').html(this.clone())).html();
-    }
-})($);
 class PreviewBody extends Component {
     constructor(props) {
         super(props)
         this.state={
             dateTime:"",
         }
-        this.onPrint = this.onPrint.bind(this);
+        this.$content = React.createRef();
         this.normalVal = this.normalVal.bind(this);
         this.getCurrentDate = this.getCurrentDate.bind(this);
     }
     componentDidMount(){
         this.getCurrentDate();
     }
+    componentWillReceiveProps(){
+        // this.$content.current.scrollTo(0,0)
+    }
     getCurrentDate(){
         let myDate = new Date();
         let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
@@ -79,15 +26,6 @@ class PreviewBody extends Component {
         let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
         this.setState({dateTime:date})
     }
-    onPrint() {
-        $("#content").jqprint({
-            debug: false,
-            importCSS: true,
-            printContainer: true,
-            operaSupport: false
-        });
-        this.props.onClose()
-    }
     normalVal(min,max){
         if((min-0) && (max-0)){
             return `正常值: (${min}~${max})`
@@ -116,7 +54,8 @@ class PreviewBody extends Component {
     }
     render() {
         const { show, preInfo, dataJson, dataStr,baseObj } = this.props;
-        return <div className={style['content']}>
+
+        return <div className={style['content']} ref={this.$content}>
             <div style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px',textAlign:'center' }}>{preInfo.hospitalName}</div>
             <table className={style['patInfo']} style={{ margin: '0px 15px 30px 0px', borderCollapse: 'collapse', width: "100%",fontSize:'12px' }}>
                 <tr>
@@ -177,12 +116,12 @@ class PreviewBody extends Component {
                                             {
                                                 item.lisExcelItem && item.lisExcelItem.map((value)=>{
                                                     return <tr style={{lineHeight:'1.5',width:'650px'}}>
-                                                        <td style={{width:'23%',fontSize:'12px'}}>{value.itemName}</td>
+                                                        <td style={{width:'25%',fontSize:'12px'}}>{value.itemName}</td>
                                                         <td style={{width:'23%',fontSize:'12px'}}><span className={value.type == 1?'red':null} style={{fontSize:'12px'}}>{value.value}</span> {value.unit}</td>
                                                         <td style={{width:'24%',fontSize:'12px'}}>
                                                             {this.normalVal(value.min,value.max)}
                                                         </td>
-                                                        <td style={{width:'30%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
+                                                        <td style={{width:'28%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
                                                     </tr>
                                                 })
                                             }
@@ -199,14 +138,14 @@ class PreviewBody extends Component {
                                                 item.details.map((val)=>{
                                                     if(val.value && val.value != ''){
                                                         return <tr style={{lineHeight:'1.5',width:'100%',fontSize:'12px'}}>
-                                                            <td style={{width:'23%'}}>{val.name}</td>
+                                                            <td style={{width:'25%'}}>{val.name}</td>
                                                             {/* <td style={{width:'23%'}} className={item.abnormal != '0' ?"red":'' }>{val.value} { val.labelSuffix}</td> */}
                                                             {this.showDetails(val)}
                                                             
                                                             <td style={{width:'24%'}}>
                                                                 {this.normalVal(val.minValue,val.maxValue)}
                                                             </td>
-                                                            <td style={{width:'30%'}}>{'化验时间:'+item.time}</td>
+                                                            <td style={{width:'28%'}}>{'化验时间:'+item.time}</td>
                                                         </tr>
                                                     }
                                                 })
@@ -262,10 +201,11 @@ class PreviewBody extends Component {
                     </td>
                 </tr>
             </table>
-            <table className={style.partTtable} style={{ marginTop: '10px',display: show ? 'block' : 'none' }}>
-                <tr className={style.verticalT}>
-                    <td style={{ width: 70, textAlign: 'right',verticalAlign:'top', padding: '0px 5px 16px 0px', fontSize: '14px' }}>签名:</td>
-                    <td style={{ width: '220px',
+            <table className={style.partTtable} style={{ marginTop: '10px',marginBottom:'30px',display: show ? 'block' : 'none' }}>
+                <tr className={`${style.verticalT} ${style.siginNature}`}>
+                    <td style={{ width: 80, textAlign: 'right',verticalAlign:'top', padding: '0px 5px 0 0px', fontSize: '14px' }}>医生签名:</td>
+                    {/* <td style={{ 
+                        width: '220px',
                         height: '60px',
                         textAlign: 'center',
                         lineHeight: '60px',
@@ -273,7 +213,13 @@ class PreviewBody extends Component {
                         color: '#cbc7c7',
                         border: '1px solid #cbc7c7',
                         paddingBottom: '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>

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

@@ -4,7 +4,7 @@
       overflow: auto;
       top:120px;
       width: 820px;
-      padding: 0 40px 20px 40px;
+      padding: 0 40px 60px 40px;
     }
 
     .foot{
@@ -78,6 +78,10 @@
       .verticalT {
           vertical-align: top;
       }
+      .siginNature {
+        vertical-align: bottom;
+        float: right;
+      }
       .partTtableList {
           width: 70px;
           text-align: right;

+ 11 - 8
src/components/PushContainer/index.jsx

@@ -13,6 +13,7 @@ import TemplateItems from '@components/TemplateItems';
 import {getWindowInnerHeight} from '@common/js/func';
 import PushItemsContainer from '@containers/PushItemsContainer';
 import { pushAllDataList } from '@utils/tools';
+import CopyRightContainer from "@containers/CopyRightContainer";
 class PushContainer extends Component {
     constructor(props) {
         super(props);
@@ -26,11 +27,11 @@ class PushContainer extends Component {
             }],
             visible:false,
             message:'',                 //提示的内容
-            type:'',                   //1:删除模板 2:批量删除   3.修改标题   4.引用  
+            type:'',                    //1:删除模板 2:批量删除   3.修改标题   4.引用  
             id:'',                      //单个删除
-            obj:{},                       //修改模板标题      
+            obj:{},                     //修改模板标题      
             title:'',                   //修改后的标题
-            okText:'确定',                  //确认按钮
+            okText:'确定',              //确认按钮
             okBorderColor:'red',
             oKBg:'',
             okColor:'red',
@@ -109,10 +110,11 @@ class PushContainer extends Component {
             })
         })
     }
-    keypress(e){
+    keypress(event){
+        let e = event?event:window.event;
         if(e.keyCode == 13) {
-            this.makeSure()
-            store.dispatch(changeVisible(false))
+            // this.makeSure()
+            // store.dispatch(changeVisible(false))
         }
     }
     changeTitle(){
@@ -191,7 +193,7 @@ class PushContainer extends Component {
         }else if(this.state.type == 3){
             if(this.state.title == this.state.obj.text){
                 store.dispatch(changeVisible(false))
-                Notify.info('标题修改成功');
+                Notify.success('标题修改成功');
                 return;
             }
             let tempObj = {
@@ -245,7 +247,8 @@ class PushContainer extends Component {
             >
                 {this.state.message}
             </ConfirmModal>
-        </div>
+            <CopyRightContainer />
+        </div>  
     }
 }
 

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

@@ -7,7 +7,7 @@ import tipsImg from "../../common/images/tips.png";
 import vigilantImg from "../../common/images/vigilant.png";
 import showImg from "../../common/images/show.png";
 import hideImg from "../../common/images/close.png";
-import CopyRightContainer from "@containers/CopyRightContainer";
+
 import PushDiag from "./PushDiag";
 import DiagnosticItem from "@containers/DiagnosticItem";
 import $ from "jquery";
@@ -95,7 +95,6 @@ class PushItems extends Component {
       showAdd,
       showTips
     } = this;
-
     let assayNum = 0;
     let assayHide = assay.map((item, index) => {
       assayNum = assayNum + item.name.length + 2;
@@ -355,8 +354,9 @@ class PushItems extends Component {
             </div>
           </div>
         </div>
-
-        <CopyRightContainer />
+        {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data[1].description}}></div>}
+        
+        
       </div>
     );
   }

+ 20 - 14
src/components/PushItems/index.less

@@ -1,12 +1,12 @@
 @import "~@less/variables.less";
 .push-content-wrapper{
   // padding-top: 50px;
-  padding: 0px 20px;
+  padding: 0px 15px;
   line-height: 20px; 
-  width: 460px;
+  width: @push-width;
   overflow: hidden;
   .push-content {
-    width: 480px;
+    width: 467px;
     overflow-y: scroll;
   }
   .vigilant{
@@ -55,7 +55,7 @@
         }
       }
       div{
-        font-size: 12px;
+        font-size: 14px;
         padding:6px 15px;
         span{
           cursor: pointer;
@@ -66,7 +66,7 @@
   .show {
     float: right;
     color:  #58ACD7;;
-    font-size: 12px;
+    font-size: 14px;
     cursor: pointer;
     img {
       width: 12px;
@@ -77,7 +77,7 @@
     float: right;
     text-align: right;
     color: #58ACD7;
-    font-size: 12px;
+    font-size: 14px;
     cursor: pointer;
     clear: both;
     img {
@@ -120,7 +120,7 @@
       }
     }
     div{
-      font-size: 12px;
+      font-size: 14px;
       padding:6px 15px;
       ul{
         .firstLi{
@@ -142,14 +142,14 @@
             padding: 0px 0px 0px 0px;
             margin-top: -2px;
             span{
-              font-size: 12px;
-              line-height: 12px;
+              font-size: 14px;
+              line-height: 14px;
               display: inline-block;
               margin: 6px;
               input[type='checkbox']{
                 float: left;
-                width: 12px;
-                height: 12px;
+                width: 14px;
+                height: 14px;
                 margin-right: 2px;
                 background-color: #fff;
                 -webkit-appearance:none;
@@ -183,7 +183,7 @@
       }
     }
     .content{
-      font-size: 12px;
+      font-size: 14px;
       padding:6px 15px;
       .title {
         font-size: 14px;
@@ -191,7 +191,7 @@
         margin-bottom:10px;
         a{
           display: inline-block;
-          font-size: 12px;
+          font-size: 14px;
           color: #3B9ED0;
           width: 42px;
           /*height: 20px;
@@ -210,7 +210,7 @@
           border: 1px solid #3B9ED0;
           border-radius: 4px;
           text-align: center;
-          font-size: 12px;
+          font-size: 14px;
           color: #3B9ED0;
           line-height: 18px;
           margin: 0 10px -2px;
@@ -340,3 +340,9 @@
 .billing {
   color: #3B9ED0;
 }
+.disTips {
+  padding: 10px 20px 0;
+  font-size: 10px;
+  color: #979797;
+  text-align: center;
+}

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

@@ -16,10 +16,10 @@ class TemplateItems extends React.Component {
         this.genItems = this.genItems.bind(this);
     }  
     componentDidMount(){
-        const height = getWindowInnerHeight()-172;
+        const height = getWindowInnerHeight()-216;
         this.$cont.current.style.height = height+"px";
         windowEventHandler('resize', ()=>{
-            const height = getWindowInnerHeight()-172;
+            const height = getWindowInnerHeight()-216;
             this.$cont.current.style.height = height+"px";
         });
     }
@@ -68,7 +68,7 @@ class TemplateItems extends React.Component {
                             <span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
                     </div>) : null
                 }
-                <div style={{width:'460px',overflow:'hidden'}}>
+                <div style={{width:'450px',overflow:'hidden'}}>
                     <div className={style.tempLists} ref={this.$cont}>
                         {
                             this.genItems().length > 0?this.genItems():

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

@@ -7,7 +7,7 @@
     .tempLists {
         overflow-y: scroll;
         background-color: #fff;
-        width: 475px;
+        width: 466px;
         // &::-webkit-scrollbar {
         //     display: none;
         // }

+ 22 - 17
src/components/Treat/DrugTreat/index.jsx

@@ -28,9 +28,10 @@ class DrugTreat extends Component {
         setDrugInfo && setDrugInfo(item);
     }
     showTreatDesc() {
-        $('#treatWrapper').animate({'width': '940px'}, 500);
-        $('#treatDescBox').animate({'width': '260px'}, 500);
+        $('#treatDescBox').css({'display': 'block'});
         $('#treatWrapper').animate({'margin-left': '-470px'}, 300);
+        $('#treatDescBox').animate({'width': '260px'}, 500);
+        
     }
     
 
@@ -42,21 +43,25 @@ class DrugTreat extends Component {
                 <h3 className={style['drug-title']}><img className={style['drug-icon']} src={drugIcon}/> 常用药物治疗</h3>
                 {treatment.map((item, index) => {
                     return(<div className={style['drug-content']}>
-                        {index + 1 + '. ' }{item.drugsName}:&nbsp;
-                        {item.medicitionsList.map((it, ii) => {
-                            return ((it.isShow == 1 || it.selected) && <span style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)'} : ''}>
-                                    {ii === 0 ? '' : ', '}
-                                    <span className={style['drug-name']}  
-                                          onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}} 
-                                          onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} style={it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}>
-                                        {it.medicitionName}
-                                    </span>
-                                    {/* {it.showInfo && it.showInfo==='1'&& <img className={style['info-img']} src={info} onClick={() =>{this.setDrugInfo(it);showDrugInfo();}}/>} */}
-                                    {it.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: it.forbidden === '2' ? <span className={style['info-flag']} style={{border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 使用率{it.rate}
-                                    
-                                </span>)
-                        })}
-                        {<span className={style['drug-more']} onClick={() =>this.setOtherRecommend(item, index)} ><img className={style['info-img']} src={more} />更多同类药</span> }
+                        <div  className={style['drug-name-box']}>
+                            {index + 1 + '. ' }{item.drugsName}:&nbsp;
+                            {item.medicitionsList.map((it, ii) => {
+                                return ((it.isShow == 1 || it.selected) && <span style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)'} : ''}>
+                                        {ii === 0 ? '' : ', '}
+                                        <span className={style['drug-name']}  
+                                            onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}} 
+                                            onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} style={it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}>
+                                            {it.medicitionName}
+                                        </span>
+                                        {/* {it.showInfo && it.showInfo==='1'&& <img className={style['info-img']} src={info} onClick={() =>{this.setDrugInfo(it);showDrugInfo();}}/>} */}
+                                        {it.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: it.forbidden === '2' ? <span className={style['info-flag']} style={{border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 使用率{it.rate}
+                                        
+                                    </span>)
+                            })}
+
+                        </div>
+                        {<div className={style['drug-more']} onClick={() =>this.setOtherRecommend(item, index)} ><img className={style['info-img']} src={more} />更多同类药</div> }
+                        
                     </div>)
                 })}
             </div>

+ 9 - 2
src/components/Treat/DrugTreat/index.less

@@ -9,6 +9,7 @@
     margin: 10px;
 }
 .drug-content {
+    position: relative;
     line-height: 36px;
     border-bottom: 1px dashed #D2D2D2;
 }
@@ -31,10 +32,16 @@
     text-align: center;
 }
 .drug-more {
-    display: inline-block;
     cursor: pointer;
-    float: right;
     color: #3B9ED0;
+    position: absolute;
+    right: 0;
+    top: 50%;
+    margin-top: -18px;
+}
+.drug-name-box {
+    float: left;
+    width: 530px;
 }
 .drug-content:after{display:block;clear:both;content:"";visibility:hidden;height:0}
 .drug-content{zoom:1}

+ 3 - 2
src/components/Treat/GeneralTreat/index.jsx

@@ -7,10 +7,11 @@ class GeneralTreat extends Component {
     }
 
     render() {
-        const { icon, titleBg, filter, title, generalTreat } = this.props
+        const { icon, titleStyle,titleBg, filter, title, generalTreat } = this.props
         return(
             generalTreat && generalTreat.length > 0 && <div className={style['general-wrapper']}>
-                <div className={style['general-title']} style={{background: titleBg,filter:filter}}><img className={style['general-icon']} src={icon}/>{title}</div>
+                <div className={style['general-title-box']} style={titleStyle}></div>
+                <div className={style['general-title']} ><img className={style['general-icon']} src={icon}/>{title}</div>
                 <div className={style['general-item']} dangerouslySetInnerHTML={{__html: generalTreat}}>
                 </div>
 

+ 12 - 0
src/components/Treat/GeneralTreat/index.less

@@ -1,7 +1,19 @@
 .general-wrapper {
+    position: relative;
     padding: 10px 0 0 0;
 }
+.general-title-box {
+    height: 36px;
+    line-height: 36px;
+    background: rgb(47,199,156);
+    opacity: 0.1;
+    filter:alpha(opacity=10);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=10);";
+}
 .general-title {
+    position: absolute;
+    width: 100%;
+    top: 10px;
     height: 36px;
     line-height: 36px;
 }

+ 18 - 15
src/components/Treat/index.jsx

@@ -7,8 +7,8 @@ import DrugInfo from '@components/TreatDesc/DrugInfo';
 import Notify from '@commonComp/Notify'
 import close from './img/close.png';
 import generalIcon from './img/general.png';
-
 import surgicalIcon from './img/surgical.png';
+import $ from "jquery";
 
 class Treat extends Component {
     constructor(props){
@@ -38,29 +38,28 @@ class Treat extends Component {
     }
 
     render(){
-        const { generalTreat, treatment, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title} = this.props;
+        const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title} = this.props;
         return(
-        <div className={style['treat-mask']}>
-            <div  id='treatWrapper' className={style['treat-wrapper']}>
-                
-                <div className={style['treat-box']}>
-                    <p className={style['treat-title']}>治疗方案 <img onClick={this.hideTreat} src={close}/></p>
+            <div   className={style['treat-wrapper']}>
+                <div className={style['treat-mask']}>
+                </div>
+                <div id='treatWrapper' className={style['treat-box']}>
+                    <div className={style['treat-title']}>治疗方案 ({treatItem.name})<img onClick={this.hideTreat} src={close}/></div>
+
                     <div className={style['treat-inner-box']}>
-                        <GeneralTreat icon={generalIcon} title='一般治疗' titleBg='rgba(47,199,156,0.1)' filter='progid:DXImageTransform.Microsoft.gradient(startColorstr=#192FC79C,endColorstr=#192FC79C)' generalTreat={generalTreat}></GeneralTreat>
+                        <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
                         <DrugTreat treatment={ treatment } 
                                 selectDrug={selectDrug} 
                                 setOtherRecommend={ setOtherRecommend } 
                                 showDrugInfo = {showDrugInfo}
                                 setDrugInfo={ setDrugInfo }>
-                        </DrugTreat>
-                        <GeneralTreat icon={surgicalIcon} title='手术治疗' titleBg='#FAEAEA' generalTreat={surgeryTreat}></GeneralTreat>
+                        </DrugTreat> 
+                        <GeneralTreat icon={surgicalIcon} title='手术治疗' titleStyle={{background:'#FAEAEA',opacity:'1', filter:'alpha(opacity=100);',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=100);'}} titleBg='#FAEAEA' generalTreat={surgeryTreat}></GeneralTreat>
                     </div>
                     <div className={style['bottom']}>
                         <span className={style['prescription-btn']} onClick={this.handlePrescription}>开处方</span> <span className={style['determine-btn']} onClick={this.handleDetermine}>确定</span>
                     </div>
-                    
-                </div>
-                {treatDesc && <TreatDesc 
+                    {treatDesc && <TreatDesc 
                     treatment={treatment} 
                     treatDesc={treatDesc} 
                     selectDrug={selectDrug} 
@@ -68,11 +67,15 @@ class Treat extends Component {
                     showDrugInfo = {showDrugInfo}
                     showDrug = {showDrug}
                     >
-                </TreatDesc>}
+                    </TreatDesc>}
+                </div>
+                
+                
                 {showDrug && drugInfo && <DrugInfo drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
             </div>
+                
             
-        </div>
+        
         )
     }
 }

+ 37 - 18
src/components/Treat/index.less

@@ -1,31 +1,48 @@
 @import "~@less/mixin.less";
 .treat-wrapper{
     position: fixed;
-    background: #fff;
-    z-index: 102;
-    left: 50%;
-    top: 50%;
-    width: 680px;
-    height: 680px;
-    margin-left: -340px;
-    margin-top: -340px;
+    width: 100%;
+    height: 100%;
+    left: 0;
+    top: 0;
+    // background: #fff;
+    // left: 50%;
+    // top: 25%;
+    // width: 680px;
+    // margin-left: -340px;
+    // margin-top: -340px;
+    // z-index: 301;
+    z-index: 300;
 }
 .treat-mask {
     position: fixed;
-    background: rgba(0, 0, 0, 0.5);
     width: 100%;
     height: 100%;
     top: 0;
     left: 0;
-    z-index: 9999;
+    z-index: 300;
+    background: #000;
+    opacity: 0.6;
+    filter:alpha(opacity=60);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
 }
 .treat-box {
+    position: fixed;
+    background: #fff;
     width: 680px;
-    float: left;
-    border-right: 1px solid #e0e2e4;
-    padding-bottom: 100px;
+    left: 50%;
+    top: 20%;
+    height: 60%;
+    margin-left: -340px;
+    z-index: 301;
+    padding-top: 40px;
+    padding-bottom: 80px;
 }
 .treat-title {
+    width: 100%;
+    position: absolute;
+    top: 0px;
+    background: #fff;
     height: 40px;
     line-height: 40px;
     border-bottom: 1px solid #e0e2e4;
@@ -39,18 +56,19 @@
     }
 }
 .treat-inner-box {
-    width: 680px;
-    height: 540px;
+    width: 100%;
+    height: 100%;
     padding: 10px 20px 0 20px;
-    overflow: hidden;
+
     overflow-y: auto;
 }
 
 .bottom {
     position: absolute;
-    bottom: 20px;
-    height: 40px;
+    width: 100%;
+    height: 80px;
     line-height: 40px;
+    background: #fff;
 }
 .prescription-btn,.determine-btn {
     position: absolute;
@@ -61,6 +79,7 @@
     border-radius: 4px;
     text-align: center;
     cursor: pointer;
+    top: 20px;
 }
 
 .prescription-btn {

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

@@ -7,7 +7,7 @@
     margin-left: -425px;
     margin-top: -340px;
     background: #fff;
-    z-index: 103;
+    z-index: 303;
     
 }
 .drug-desc-wrapper {

+ 7 - 6
src/components/TreatDesc/index.jsx

@@ -17,17 +17,17 @@ class TreatDesc extends Component {
         selectDrug && selectDrug(index,ii);
     }
     hideTreatDesc() {
-        $('#treatWrapper').animate({'width': '680px'}, 500);
-        $('#treatDescBox').animate({'width': '0px'}, 500);
+        $('#treatDescBox').css({'display': 'none'});
+        $('#treatDescBox').animate({'display': 'none'}, 500);
         $('#treatWrapper').animate({'margin-left': '-340px'}, 500);
     }
 
     render(){
         const  { treatment, treatDesc, setDrugInfo, showDrugInfo} = this.props
         const { title, basic, otherDrugIndex, drugDesc} = treatDesc
-        return (treatment && treatment.length >0 && <div id='treatDescBox' className={style['treat-desc-box']}>
-            <h3 className={style['drug-desc-title']}>同类药物  <img src={close} onClick={this.hideTreatDesc} className={style['close-drug-desc']} /></h3>
-            {title && title === '药品推荐' ? <div>
+        return (treatment && treatment.length >0 && <div  className={style['treat-desc-box']}>
+            
+            {title && title === '药品推荐' ? <div className={style['similar-drug-box']} id='treatDescBox'>
                 {/* { basic && basic.length > 0 && <div> //推荐依据不需要展示
                     <h3 className={style['recommend-title']}>推荐依据</h3>
                     {basic.map((item, index) =>{
@@ -36,7 +36,8 @@ class TreatDesc extends Component {
                     })}
                     
                 </div> } */}
-                { otherDrugIndex > -1 && <div className={style['similar-drug']}>
+                { otherDrugIndex > -1 && <div  className={style['similar-drug']}>
+                    <h3 className={style['drug-desc-title']}>同类药物  <img src={close} onClick={this.hideTreatDesc} className={style['close-drug-desc']} /></h3>
                     {treatment[otherDrugIndex].medicitionsList.map((item, index) =>{
                         return (<span style={item.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)'} : ''}>
                         {index === 0 ? '' : ', '}                   

+ 19 - 5
src/components/TreatDesc/index.less

@@ -4,8 +4,8 @@
     overflow: hidden;
 }
 .drug-desc-wrapper {
-    max-height: 650px;
-    overflow-y: scroll;
+  height: 100%;
+  overflow-y: auto
 }
 .drug-desc-title {
     height: 40px;
@@ -13,7 +13,10 @@
     border-bottom: 1px solid #e0e2e4;
     padding-left: 20px;
     width: 260px;
-    position: relative;
+    position: absolute;
+    background: #fff;
+    top: 0px;
+    margin-left: -20px;
 }
 .recommend-title, .drug-title {
     padding: 30px 0 15px 20px;
@@ -29,8 +32,19 @@
     position: absolute;
     right: 0px;
 }
+.similar-drug-box {
+    display: none;
+}
 .similar-drug {
-    padding: 20px;
+    position: absolute;
+    padding-top: 40px;
+    overflow-y: auto;
+    width: 260px;
+    left: 680px;
+    height: 100%;
+    top: 0;
+    background: #fff;
+    padding: 60px 20px 80px;
 }
 
 .drug-name {
@@ -48,4 +62,4 @@
     line-height: 16px;
     border-radius: 4px;
     text-align: center;
-}
+}

+ 2 - 0
src/config/index.js

@@ -19,6 +19,7 @@ export default {
     },
     textId:'text',        //自由文本标签的id,
     textLabel:'{"tagType":"8","id":"","name":""}',
+    _textLabel:'{"tagType":"8","id":"","name":","}',//查体每个标签后面加逗号(1-29)
     tagType:"8",
     tongYId:7,      //主诉通用特征描述id
     addSId:8,      //主诉添加症状id
@@ -37,6 +38,7 @@ export default {
       week:"周",
       month:"月",
       year:"年",
+      age:"岁",
     },
     Params
 };

+ 1 - 1
src/containers/CurrentIll.js

@@ -12,7 +12,7 @@ import {getModule} from '@store/async-actions/fetchModules.js';
 import {didPushParamChange} from '@utils/tools.js';
 
 
-function mapStateToProps(state) {//console.log(11,state);
+function mapStateToProps(state) {
   const {homePage} = state;
     return {
         data:state.currentIll.data,//主诉模板

+ 2 - 2
src/containers/EditableSpan.js

@@ -213,10 +213,10 @@ function mapDispatchToProps(dispatch,state) {
       if(obj.i==null){return}
       switch (+obj.boxMark){
         case 1:
-          dispatch({type:DEL_MAIN,delIndex:obj.i});
+          dispatch({type:DEL_MAIN,delIndex:obj.i,text:obj.text});
           break;
         case 2:
-          dispatch({type:DEL_CURRENT,delIndex:obj.i});
+          dispatch({type:DEL_CURRENT,delIndex:obj.i,text:obj.text});
           break;
         case 3:
           dispatch({type:DEL_OTHERHIS,delIndex:obj.i});

+ 12 - 8
src/containers/NumberDrop.js

@@ -1,12 +1,12 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import NumberDrop from "@components/NumberDrop";
-import {SETNUMBER,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
-import {SETNUMBER4,CHANGECHECKTEXTLABEL} from '@types/checkBody.js';
+import {SETNUMBER,CHANGEOTHERTEXTLABEL,CHANGEOTHERTEXTLABEL_NUMBER} from '@types/otherHistory';
+import {SETNUMBER4,CHANGECHECKTEXTLABEL,CHANGECHECKTEXTLABEL_NUMBER} from '@types/checkBody.js';
 import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP} from '@types/homePage.js';
-import {NUMBER_SELECT,CHANGE_LABELVAL} from '@store/types/mainSuit.js';
+import {NUMBER_SELECT,CHANGE_LABELVAL,CHANGE_LABELVAL_NUMBER} from '@store/types/mainSuit.js';
 import {getLabelIndex} from '@common/js/func.js';
-import {CURRENT_NUMBER,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
+import {CURRENT_NUMBER,CURRENT_TEXT_LABEL,CURRENT_TEXT_LABEL_NUMBER} from '@store/types/currentIll.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {Notify} from '@commonComp';
 import {filterArr,didPushParamChange} from '@utils/tools.js';
@@ -77,7 +77,8 @@ function mainSuitLabel(dispatch,params){
   let ikey = getLabelIndex(index);
   const {changeVal,totalVal} = params;
   dispatch({
-    type:CHANGE_LABELVAL,
+    // type:CHANGE_LABELVAL,
+    type:CHANGE_LABELVAL_NUMBER,
     data:{changeVal:changeVal,ikey:ikey,totalVal}
   })
 }
@@ -86,7 +87,8 @@ function currentLabel(dispatch,params){
   const index = params.ikey;
   let ikey = getLabelIndex(index);
   dispatch({
-    type:CURRENT_TEXT_LABEL,
+    // type:CURRENT_TEXT_LABEL,
+    type:CURRENT_TEXT_LABEL_NUMBER,
     data:{changeVal:params.changeVal,ikey:ikey}
   })
 }
@@ -97,7 +99,8 @@ function otherHisLabelEdit(dispatch,params){
   const {changeVal,totalVal} = params;
   let ikey = getLabelIndex(index);
   dispatch({
-    type:CHANGEOTHERTEXTLABEL,
+    // type:CHANGEOTHERTEXTLABEL,
+    type:CHANGEOTHERTEXTLABEL_NUMBER,
     data:{changeVal:changeVal,ikey:ikey,totalVal}
   })
 }
@@ -108,7 +111,8 @@ function checkBodyLabelEdit(dispatch,params){
   let ikey = getLabelIndex(index);
   const {changeVal,totalVal} = params;
   dispatch({
-    type:CHANGECHECKTEXTLABEL,
+    // type:CHANGECHECKTEXTLABEL,
+    type:CHANGECHECKTEXTLABEL_NUMBER,
     data:{changeVal:changeVal,ikey:ikey,totalVal}
   })
 }

+ 10 - 1
src/containers/NumberUnitDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import NumberUnitDrop from "@components/NumberUnitDrop";
 import {SETNUMBER,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
 import {SETNUMBER4,CHANGECHECKTEXTLABEL} from '@types/checkBody.js';
-import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP} from '@types/homePage.js';
+import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage.js';
 import {NUMBER_SELECT,CHANGE_LABELVAL} from '@store/types/mainSuit.js';
 import {getLabelIndex} from '@common/js/func.js';
 import {CURRENT_NUMBER,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
@@ -124,6 +124,12 @@ function mapDispatchToProps(dispatch,store){
           clearTimeout(timer);
         }
       },config.delayPushTime);
+      if(!params.text.trim()){
+        dispatch({
+          type:ISREAD
+        })
+      }
+      
     },
     handleDbclick(obj){
       dispatch({
@@ -170,6 +176,9 @@ function mapDispatchToProps(dispatch,store){
           break;
         default:
       }
+      dispatch({
+        type: ISREAD
+      });
     }
   }
 }

+ 10 - 5
src/containers/OperationContainer.js

@@ -5,15 +5,14 @@ import {
     SHOW_PRINT_PREVIEW,
     CLOSE_PRINT_PREVIEW,
     SHOW_PREVIEW,
-    CLOSE_PREVIEW
+    CLOSE_PREVIEW,
+    DIAG_SHOW
 } from "../store/types/print";
 import {saveMessage,clearMessages} from "../store/async-actions/print";
 import {saveTemplateDetail} from '@store/async-actions/tabTemplate';
 import {saveClickNum} from '@store/async-actions/homePage';
 
-function mapStateToProps({
-    print
-}) {
+function mapStateToProps({print}) {
     return ({
         print
     });
@@ -49,8 +48,14 @@ function mapDispatchToProps(dispatch) {
             clearMessages()
         },
         saveDataAll(val){
-            dispatch(saveTemplateDetail(val))
+          dispatch(saveTemplateDetail(val))
         },
+        diagShowTmp(bool){
+          dispatch({
+            type: DIAG_SHOW,
+            data:bool
+          });
+        }
     };
 }
 

+ 5 - 1
src/containers/RadioDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import RadioDrop from "@components/RadioDrop";
 import {SETRADIO,CLEARSELECTED,CONFIRMSELECTED,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
 import {SETSELECTED4,CHANGECHECKTEXTLABEL} from '@types/checkBody';
-import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT} from '@types/homePage.js';
+import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT,ISREAD} from '@types/homePage.js';
 import {RADIO_SELECT,CHANGE_LABELVAL} from '@store/types/mainSuit.js';
 import {CURRENT_RADIO,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
 import {Notify} from '@commonComp';
@@ -127,6 +127,10 @@ function mapDispatchToProps(dispatch,store){
         type:dbEditActions[+type],
         data:{changeVal:params.changeVal,ikey:ikey}
       });
+      dispatch(billing);
+      dispatch({
+        type:ISREAD
+      })
     },
     handleShow(obj) {
       dispatch({

+ 9 - 3
src/containers/SpreadDrop.js

@@ -77,10 +77,12 @@ function currentIll(dispatch,store,params){
   // const ikey = params.ikey.substr(1,1);
   const index = params.ikey;
   let ikey = getLabelIndex(index);
-  let existsId = getIds(exists);
-  let withsId = getIds(withs);
+  // let existsId = getIds(exists);
+  // let withsId = getIds(withs);
+  let existsId = exists && exists.length>0?getIds(exists):[];
+  let withsId = withs && withs.length>0?getIds(withs):[];
   // const ids = existsId.join(",")+withsId.join(",");
-  const ids = (existsId.concat(withsId)).join(",");
+  const ids = (existsId.concat(withsId)).join(",");console.log("点击的下标是:",index,"选中的id是:",ids)
   let has = [],wes=[];
   //获取选中项目模板
   fetchModules(ids).then((res)=>{
@@ -330,6 +332,10 @@ function handleLabel(dispatch,params){
       break;
     default:
   }
+  dispatch(billing);
+  dispatch({
+    type:ISREAD
+  })
 }
 
 function mapDispatchToProps(dispatch,store){

+ 2 - 1
src/containers/Treat.js

@@ -15,7 +15,8 @@ function mapStateToProps(state){
         surgeryTreat: treat.surgeryTreat,
         treatDesc: treat.treatDesc,
         drugInfo: treat.drugInfo,
-        showDrug: treat.showDrugInfo
+        showDrug: treat.showDrugInfo,
+        treatItem: treat.treatItem,
     }
 }
  

+ 3 - 1
src/containers/eleType.js

@@ -122,7 +122,9 @@ export default function(params){
     case 6:
       return multCheckLabels(params,data.tagType);
     case 8:
-      return <EditableSpan {...params} value={data.value||data.name} update={Math.random()}/>;
+      // return <EditableSpan {...params} value={data.value||data.name} update={Math.random()}/>;
+      // 删除后value为空,应展示空而不是name
+      return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} update={Math.random()}/>;
     case 11://推送类型
       return multCheckLabels(params,data.tagType);
     default:

+ 1 - 1
src/main.js

@@ -27,7 +27,7 @@ const render = (Component) => {
         }
       })
     })
-  };
+  };          
     ReactDOM.render(
         <AppContainer>
             <Provider store={store}>

+ 26 - 2
src/store/actions/checkBody.js

@@ -5,6 +5,7 @@ export function set(state,action){
   let res = Object.assign({},state);
   const {data} = action;
   res.data = [...data];
+  res.saveText = fullfillText(res.data).saveText;//存逗号
   res.update = Math.random();
   return res;
 }
@@ -30,12 +31,13 @@ export function setNumberValue(state,action){
     });
     res.saveText[labelInx] = hasValue?sub.join(''):'';
   }
+  // res.saveText = fullfillText(res.data).saveText;
   res.update = Math.random();
   return res;
 }
 
 //查体单选下拉选中
-export function setRadioValue(state,action){console.log(221)
+export function setRadioValue(state,action){
   let res = Object.assign({},state);
   const {ikey,id,text} = action;
   let labelInx = getLabelIndex(ikey);
@@ -75,6 +77,7 @@ export function setRadioValue(state,action){console.log(221)
     });
     res.saveText[labelInx] = hasValue?sub.join(''):'';
   }
+  // res.saveText = fullfillText(res.data).saveText;
   res.update = Math.random();
   return res;
 }
@@ -117,6 +120,7 @@ export function setCheckBoxValue(state,action) {
   res.data[labelInx].value = showText;
   res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
+  res.saveText = fullfillText(res.data).saveText;
   res.update = Math.random();
   return res;
 }
@@ -163,10 +167,30 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   const newVal = action.data.changeVal;     //下拉修改的内容
   const totalVal = action.data.totalVal;    //包含前后缀修改的内容
   let item = res.data[index];
+  if(newVal.trim()){
+    if(item){
+      item.value = newVal;
+      res.saveText[index] = totalVal;
+    }
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
+  } 
+  
+  res.update = Math.random();
+  return res;
+}
+
+// 数字键盘较特殊,有直接输入
+export const changeNumLabelVal = (state,action)=>{
+  const res = Object.assign({},state);
+  const index = action.data.ikey;
+  const newVal = action.data.changeVal;
+  let item = res.data[index];
   if(item){
     item.value = newVal;
   }
-  res.saveText[index] = totalVal;
+  res.saveText[index] = newVal;
   res.update = Math.random();
   return res;
 }

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

@@ -38,7 +38,7 @@ export const setModule = (state,action)=>{
 //插入病程变化
 export const insertProcess = (state,action)=>{
   const res = Object.assign({},state);
-  const processModule = res.processModule;
+  const processModule = JSON.parse(JSON.stringify(res.processModule));
   let data = res.data;
   res.data = insertPro(data,processModule);
   res.saveText = fullfillText(res.data).saveText;
@@ -85,6 +85,7 @@ export const setData = (state,action) =>{
     let tongYong = "";
     let main = [];//主症状
     let withs = [];//伴随
+    let firstT = 0;
     for(let i=0; i<mainData.length; i++){
         if(mainData[i].id==config.tongYId && !mainData[i].pos){//第一个通用特征描述
           if(mainData[i].value){
@@ -98,7 +99,8 @@ export const setData = (state,action) =>{
         // 处理时间和主诉通用症状--现病史模板无“主诉通用症状” 1-7
         for(let j=0; j<current.length; j++){
           if(mainData[i].id==current[j].id && mainData[i].controlType==5){//处理时间,避免手动输入的值
-            if(mainData[i].value){
+            firstT++
+            if(mainData[i].value && firstT==1){
               current[j] = {id:mainData[i].id,name:mainData[i].value,value:mainData[i].value,tagType:config.tagType}
             }
           }  
@@ -205,32 +207,34 @@ function getLabel(lid,lname){
 // 多选展开确定事件--主、伴、无
 export const confirm = (state,action) =>{
   let res = Object.assign({},state);
-  let length1 = res.data.length;
+  let length1 = res.data.length;console.log(123,action);
   let arr = JSON.parse(JSON.stringify(res.data));
   const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
-  let existsId = getIds(exists);
-  let withsId = getIds(withs);
+  let existsId = exists && exists.length>0?getIds(exists):[];
+  let withsId = withs && withs.length>0?getIds(withs):[];
   res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
   // 伴 标签
   const banText = JSON.stringify(ban)=='{}'?'':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
-  
+
   // 处理主症状标签及尾巴展开symptomType=1
-  if(exists.length>0){
-    for(let i in exists){
-      arr.splice(ikey,0,getLabel(exists[i].id,exists[i].questionMapping.length==0?exists[i].name+',':exists[i].name),...(exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
+  if(exists && exists.length>0){
+    // for(let i in exists){//ie8不支持for in循环
+     for(let i=0;i<exists.length; i++){
+      arr.splice(ikey,0,getLabel(exists[i].id,exists[i].questionMapping && exists[i].questionMapping.length==0?exists[i].name+',':exists[i].name),...(exists[i].questionMapping && exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
     }
   }
 
   let length = arr.length - length1;
   let withsArr = JSON.parse(JSON.stringify(arr));
   // 伴 伴随症状标签及尾巴展开symptomType=2
-  if(withs.length>0){
-    for(let i in withs){
+  if(withs && withs.length>0){
+    // for(let i in withs){
+    for(let i=0;i<withs.length; i++){
       // withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].name),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
-      withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
     }
   }
-  
+
   // 无 不用展开
   let lengthN = withsArr.length - length1;
   let noneArr = JSON.parse(JSON.stringify(withsArr));  
@@ -245,7 +249,7 @@ export const confirm = (state,action) =>{
   // res.data = resData;
   res.data = fullfillText(resData).newArr;
   res.saveText = fullfillText(resData).saveText;
-  res.update=Math.random(); 
+  res.update=Math.random();
   return res;
 };
 
@@ -277,20 +281,27 @@ export function setNumberValue(state,action){
   let labelInx = getLabelIndex(index);
   const subInx = index.substr(index.length-1);
   let item = res.data[labelInx];
-  if(+item.tagType===1){
-    item.value = param.text;
-    res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
-  }else{
-    item.questionMapping[subInx].value = param.text;
-    let hasValue = false;
-    const sub = item.questionMapping.map((it)=>{
-      if(it.value){     //至少有一个子值才黑显
-        hasValue = true;
-      }
-      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
-    });
-    res.saveText[labelInx] = hasValue?sub.join(''):'';
-  }
+  // if(param.text.trim()){
+    if(+item.tagType===1){
+      item.value = param.text;
+      res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
+    }else{
+      item.questionMapping[subInx].value = param.text;
+      let hasValue = false;
+      const sub = item.questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      // res.saveText[labelInx] = sub.join(',');
+      res.saveText[labelInx] = hasValue?sub.join(''):'';
+      item.value = sub.join('');
+    }
+  /*}else{//删除完标签内容则删除该标签
+    res.data.splice(labelInx,1);
+    res.saveText = fullfillText(res.data).saveText;
+  }*/
   res.update = Math.random();
   return res;
 }
@@ -348,6 +359,25 @@ export function setRadioValue(state,action){
 
 //双击标签输入改变值
 export const changeLabelVal = (state,action)=>{
+  const res = Object.assign({},state);
+  const index = action.data.ikey;
+  const newVal = action.data.changeVal;
+  let item = res.data[index];
+  if(newVal.trim()){
+    if(item){
+      item.value = newVal;
+      res.saveText[index] = newVal;
+    }
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
+  } 
+  res.update = Math.random();
+  return res;
+}
+
+// 数字键盘较特殊,有直接输入
+export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
   const index = action.data.ikey;
   const newVal = action.data.changeVal;
@@ -509,10 +539,11 @@ export function setInputLabel(state,action){
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);
-  const {delIndex} = action;
+  const {delIndex,text} = action;
   const data = res.data;
   if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // 前一个是文本标签或者子模板 不做处理
+    // 前一个是文本标签或者子模板,只改变值
+    // data[delIndex].value = text;
   }else{
     data.splice(delIndex-1,2);
   }

+ 49 - 19
src/store/actions/mainSuit.js

@@ -127,12 +127,18 @@ export const confirm = (state,action) =>{
   let arr = res.data;
   let saveText = JSON.parse(JSON.stringify(res.saveText));
   const {exists,withs,ikey,withsName,existsName,ban} = action.data;
-  let existsId = getIds(exists);
-  let withsId = getIds(withs);
+  // let existsId = getIds(exists);
+  // let withsId = getIds(withs);
   let banText = JSON.stringify(ban) == "{}" ? '':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
-  res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
+  // res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
   let length = exists.length;
   let labelIndx = parseInt(ikey);//当前点击标签的index
+  // 取第一个添加症状的主症状和伴随
+  if(!arr[labelIndx].pos){
+    let existsId = getIds(exists);
+    let withsId = getIds(withs);
+    res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
+  }
 
   let text = saveText.slice(0,labelIndx);
   let index = text.indexOf('伴');
@@ -280,22 +286,27 @@ export function setNumberValue(state,action){
   let labelInx = getLabelIndex(index);
   const subInx = index.substr(index.length-1);
   let item = res.data[labelInx];
-  if(+item.tagType===1){
-    item.value = param.text;
-    res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
-  }else{
-    item.questionMapping[subInx].value = param.text;
-    let hasValue = false;
-    const sub = item.questionMapping.map((it)=>{
-      if(it.value){     //至少有一个子值才黑显
-        hasValue = true;
-      }
-      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
-    });
-    // res.saveText[labelInx] = sub.join(',');
-    res.saveText[labelInx] = hasValue?sub.join(''):'';
-    item.value = sub.join('');
-  }
+  // if(param.text.trim()){
+    if(+item.tagType===1){
+      item.value = param.text;
+      res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
+    }else{
+      item.questionMapping[subInx].value = param.text;
+      let hasValue = false;
+      const sub = item.questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      // res.saveText[labelInx] = sub.join(',');
+      res.saveText[labelInx] = hasValue?sub.join(''):'';
+      item.value = sub.join('');
+    }
+  /*}else{//删除完标签内容则删除该标签
+    res.data.splice(labelInx,1);
+    res.saveText = fullfillText(res.data).saveText;
+  }*/
   res.update = Math.random();
   return res;
 }
@@ -350,6 +361,25 @@ export function setRadioValue(state,action){
 
 //双击标签输入改变值
 export const changeLabelVal = (state,action)=>{
+  const res = Object.assign({},state);
+  const index = action.data.ikey;
+  const newVal = action.data.changeVal;
+  let item = res.data[index];
+  if(newVal.trim()){
+    if(item){
+      item.value = newVal;
+      res.saveText[index] = newVal;
+    }
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
+  }  
+  res.update = Math.random();//console.log(44,action,res);
+  return res;
+}
+
+// 数字键盘较特殊,有直接输入
+export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
   const index = action.data.ikey;
   const newVal = action.data.changeVal;

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

@@ -47,7 +47,8 @@ export const confirm = (state,action) =>{
     }
     arr.splice(ikey,0,...exists,...withs);
     //arr[ikey-1].value = text;
-    res.saveText[ikey+items.length] = text;
+    //res.saveText[ikey+items.length] = text;
+    res.saveText = fullfillText(arr).saveText;
     res.update=Math.random();         //用于触发组件更新(data变化了因在对象中无法被组件检测到)
     return res;
 };
@@ -200,6 +201,25 @@ export function insertLabelData(state,action){
 }
 
 export function changeTextLabel(state,action) {
+  const res = Object.assign({},state);
+  const index = action.data.ikey;
+  const newVal = action.data.changeVal;
+  let item = res.data[index];
+  if(newVal.trim()){
+    if(item){
+      item.value = newVal;
+      res.saveText[index] = newVal;
+    }
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
+  }
+  res.update = Math.random();
+  return res;
+}
+
+// 数字键盘较特殊,有直接输入
+export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
   const index = action.data.ikey;
   const newVal = action.data.changeVal;

+ 6 - 0
src/store/actions/print.js

@@ -27,3 +27,9 @@ export const saveMessage=(state,action)=>{
   res.saveMessage = action.data
   return res;
 };
+
+export const diagShow=(state,action)=>{
+  const res=Object.assign({},state);
+  res.diagShow = action.data
+  return res;
+};

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

@@ -190,7 +190,7 @@ export const addBilling = (state, action) => {
 		}
 	}
 	if(res.advice.assay  && res.advice.check !== '') {
-			if(res.advice.assay.substring(res.advice.assay.length-2,res.advice.assay.length-1) !== ', ') {
+			if(res.advice.assay.substring(res.advice.assay.length-2,res.advice.assay.length-1) !== ',') {
 				res.advice.assay = res.advice.assay + ', '
 			} 
 	}

+ 1 - 1
src/store/actions/tabTemplate.js

@@ -9,7 +9,7 @@ import {
     CHANGE_VISIBLE,
     SHOW_MESSAGE,
     KEEP_PUSH_DATA,
-    ALL_CHECKED_SHOW
+    ALL_CHECKED_SHOW,
 } from '@store/types/tabTemplate';
 
 export const delItems = (id) => ({ //删除模板

+ 6 - 0
src/store/actions/treat.js

@@ -79,3 +79,9 @@ export const hideDrugInfo = (state, action) => {
     return res;
 }
 
+export const setTreatInfo = (state, action) => {
+    const res = Object.assign({}, state);
+    res.treatItem = action.treatItem;
+    return res;
+}
+

+ 0 - 1
src/store/async-actions/assistCheck.js

@@ -18,7 +18,6 @@ export const getSearchList = (val) => {
             sexType: sex == '男'?'1' : sex == '女'?'2':'3'
         })
         .then((res)=>{
-            console.log(res.data.data)
             const data = res.data.data;
             dispatch(searchList(data));
         })

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

@@ -5,11 +5,15 @@ export const isAddMainSuit = () =>{
     return (dispatch, getState) => {
         const state = getState();
         if(state.diagnosticList.diagnosticList.length === 1 && state.diagnosticList.diagnosticList[0].type === 2) {
-            
-            if(state.mainSuit.data && state.mainSuit.data.length === 0 && state.mainSuit.saveText && (state.mainSuit.saveText.length === 0 || state.mainSuit.saveText.length === 1 &&  state.mainSuit.saveText[0] === '')) {
-              dispatch({
-                type:ISREAD
-              });
+            const isAddMainSuitFlag = state.mainSuit.data && state.mainSuit.data.length === 0 && state.mainSuit.saveText    //判断主诉和化验查体是否为空
+                                      && (state.mainSuit.saveText.length === 0 || state.mainSuit.saveText.length === 1 
+                                      &&  state.mainSuit.saveText[0] === '') && state.assistCheck && state.assistCheck.dataString.length === 0
+                                      && state.inspect.labelList && state.inspect.labelList.length === 0 && state.inspect.inspectStrPlus && state.inspect.inspectStrPlus.length === 0
+                                    
+            if(isAddMainSuitFlag) {
+                dispatch({
+                    type:ISREAD
+                });
                 dispatch({
                     type: SET_DIAG_TO_MAINSUIT,
                     data: state.diagnosticList.diagnosticStr

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

@@ -1,6 +1,6 @@
 import {json} from '@utils/ajax.js';
 import {SET} from '@types/checkBody.js';
-import {fullfillText} from '@common/js/func';
+import {fullfillText,_fullfillText} from '@common/js/func';
 import {SETDATA} from '@store/types/otherHistory';
 import store from '@store';
 import {getEMRParams} from '@utils/tools.js';
@@ -103,7 +103,7 @@ export function getInitData(){
       if(+res.data.code === 0){
         const data = res.data.data&&res.data.data.vital;
         const str = JSON.stringify(data);
-        const arr = fullfillText(JSON.parse(str)).newArr;
+        const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
         dispatch({
           type:SET,
           data:[...arr]

+ 4 - 0
src/store/async-actions/homePage.js

@@ -7,6 +7,7 @@ import store from '@store';
 import {fullfillText} from '@common/js/func';
 import {getOtherHisRecord,getInitData} from '@store/async-actions/fetchModules.js';
 import {initHistoryDetails} from '@store/async-actions/patInfo';
+import { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
   getModules:'/api/icss/moduleInfo/getAll',
@@ -57,6 +58,9 @@ export const getInitModules= (dispatch,getStore)=>{
           saveEmpty:initSaveText.currentEmpty,
         });
         dispatch(getOtherHisRecord());          //获取其他史最近记录
+        if(state.tabTemplate.items.length == 0){
+          dispatch(initItemList());         //模板列表没有就获取模板列表
+        }
         initHis(dispatch)
       }else{
         initHis(dispatch)

+ 18 - 2
src/store/async-actions/tabTemplate.js

@@ -4,8 +4,9 @@ import {
   delItems,
   batchDelItems,
   changeTitle,
-  keepPushData
+  keepPushData,
 } from '@store/actions/tabTemplate';
+import {DIAG_SHOW} from "@store/types/print";
 import Notify from '@commonComp/Notify';
 import store from '@store';
 import {
@@ -34,7 +35,7 @@ export const initItemList = (type) => { //初始化数据
   }
 };
 
-export const saveTemplateDetail = (val) => { //保存为模板(先判断是否引入模板,是的话需要判断是否改变了值)
+export const saveTemplateDetail = (val) => { //保存为模板
   let baseList = store.getState();
   let jsonData = getAllDataList(baseList);
   let jsonStr = getAllDataStringList(baseList);
@@ -69,7 +70,22 @@ export const saveTemplateDetail = (val) => { //保存为模板(先判断是否
         Notify.success('模板保存成功');
         dispatch(initItemList());
         dispatch(keepPushData(getdata(1),'part'));
+        dispatch({
+          type: DIAG_SHOW,
+          data:false
+        });
       } else {
+        if(data.msg == '该模板名存在'){         //存在不关闭弹窗
+          dispatch({
+            type: DIAG_SHOW,
+            data:true
+          });
+        }else{
+          dispatch({
+            type: DIAG_SHOW,
+            data:false
+          });
+        }
         Notify.error(data.msg);
       }
     })

+ 6 - 3
src/store/async-actions/treat.js

@@ -1,7 +1,7 @@
 import { json } from "@utils/ajax";
 import { SET_TREAT } from '@store/types/diagnosticList';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR} from '@store/types/diagnosticList';
-import { SET_DRUG_INFO, SET_TREATMENT, SET_RECOMMEND_BASIC } from '@store/types/treat';
+import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC } from '@store/types/treat';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
@@ -76,6 +76,10 @@ export const addDiagnostic = (item) => {
 
 export const getTreatResult = (item) =>{
     return (dispatch, getState) => {
+        dispatch({
+            type: SET_TREAT_INFO,
+            treatItem: item
+        })
         const state = getState();
         let url = api.push;
         if(+state.typeConfig.confirmType===1){
@@ -126,7 +130,7 @@ export const getTreatResult = (item) =>{
                      treat = data.data.data.treat || {}
                 }
                 if(treat) {
-                    return dispatch({
+                   dispatch({
                         type: SET_TREATMENT,
                         treatment: treat.treatment,
                         generalTreat: treat.commonTreatment,
@@ -134,7 +138,6 @@ export const getTreatResult = (item) =>{
                     })
                 }
                 
-            return
         }).catch((e) =>{
             console.log(e)
         })

+ 10 - 10
src/store/reducers/assistCheck.js

@@ -26,7 +26,7 @@ export default (state = initSearchList, action) => {
         newState.list = action.list
         return newState;
     }
-    if (action.type == GET_ASSIST_LABEL) {
+    if (action.type == GET_ASSIST_LABEL) {             //默认
         const newState = Object.assign({}, state);
         const tempArr = newState.list;
         const tempArrs = newState.assistLabel;
@@ -37,14 +37,14 @@ export default (state = initSearchList, action) => {
                 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:'')+';')
-            }
+        }
+        for (let j = 0; j < tempArrs.length; j++) {
+            tmpString += (tempArrs[j].name+(tempArrs[j].value?(':'+tempArrs[j].value):'')+(tempArrs[j].time?',报告日期:'+tempArrs[j].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
     }
-    if (action.type == DEL_ASSIST_LABEL) {
+    if (action.type == DEL_ASSIST_LABEL) {        //删除
         const newState = Object.assign({}, state);
         const tempArr = newState.assistLabel;
         let tmpString = '';
@@ -54,13 +54,13 @@ 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:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?',报告日期:'+tempArr[i].time:'')+';')
         }
         newState.assistLabel = [...tempArr]
         newState.dataString = tmpString
         return newState;
     }
-    if (action.type == CHANGE_ASSIST_VAL) {
+    if (action.type == CHANGE_ASSIST_VAL) {           //改变输入值
         const newState = Object.assign({}, state);
         const tempArr = newState.assistLabel;
         let tmpString = '';
@@ -69,12 +69,12 @@ 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:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?',报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
     }
-    if (action.type == CHANGE_DATE) {
+    if (action.type == CHANGE_DATE) {             //新增
         const newState = Object.assign({}, state);
         const tempArr = newState.assistLabel;
         let tmpString = '';
@@ -83,7 +83,7 @@ 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:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?',报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;

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

@@ -1,6 +1,6 @@
 import {SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEARCHDATA,
-  SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,SETCHECKINPUT,DEL_CHECKBODY} from '../types/checkBody.js';
-import {set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText} from '../actions/checkBody.js';
+  SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,SETCHECKINPUT,DEL_CHECKBODY,CHANGECHECKTEXTLABEL_NUMBER} from '../types/checkBody.js';
+import {set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText,changeNumLabelVal} from '../actions/checkBody.js';
 import config from '@config/index.js';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});
@@ -33,6 +33,8 @@ export default function(state=initState,action){
       return clearCheckBody(state,action);
     case CHANGECHECKTEXTLABEL://改变标签值
       return changeLabelVal(state,action);
+    case CHANGECHECKTEXTLABEL_NUMBER://数字键盘
+      return changeNumLabelVal(state,action);
     case CHECK_FOCUS_INDEX:
       res.focusIndex = action.index;
       res.span = action.$span;

+ 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} from '../types/currentIll';
+  SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER} from '../types/currentIll';
 import {confirm,insertProcess,setData,setCheckBox,setRadioValue,setNumberValue,changeLabelVal,clearCurrentIll,
-  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText} from '../actions/currentIll';
+  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal} from '../actions/currentIll';
 
 const initState = {
   moduleData:[],
@@ -42,6 +42,8 @@ export default function(state=initState,action){
       return setNumberValue(state,action);
     case CURRENT_TEXT_LABEL://标签双击编辑
       return changeLabelVal(state,action);
+    case CURRENT_TEXT_LABEL_NUMBER://数字键盘
+      return changeNumLabelVal(state,action);
     case CURRENT_GET_BIGDATAPUSH://标签双击编辑
       return bigDataSymptom(state,action);
     case SET_CURRENT_SEARCH://搜索结果

+ 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} from '../types/mainSuit'
+  INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER} from '../types/mainSuit'
 import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
-  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText} from '../actions/mainSuit'
+  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal} from '../actions/mainSuit'
 
 
 const initState = {
@@ -62,6 +62,8 @@ export default function(state=initState,action){
       return setRadioValue(state,action);
     case CHANGE_LABELVAL://改变标签值
       return changeLabelVal(state,action);
+    case CHANGE_LABELVAL_NUMBER://数字标签输入值
+      return changeNumLabelVal(state,action);
     case SAVE_FREE://自由输入
       return saveFreeVal(state,action);
     case MAIN_FOCUS_INDEX:

+ 4 - 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} from '../types/otherHistory';
-import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText} from '../actions/otherHistory';
+  SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,CHANGEOTHERTEXTLABEL_NUMBER} from '../types/otherHistory';
+import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal} from '../actions/otherHistory';
 
 const initState = {data:[],saveText:[],selecteds:[],focusIndex:'',editClear:true};/*mockData.OtherHis.moduleDetailDTOList;[
     mockData.radioData,
@@ -35,6 +35,8 @@ export default function(state=initState,action){//console.log(state)
       return clearOtherHistory(state,action);
     case CHANGEOTHERTEXTLABEL:
       return changeTextLabel(state,action);
+    case CHANGEOTHERTEXTLABEL_NUMBER:
+      return changeNumLabelVal(state,action);
     case SETOTHERINPUT:
       return setOtherInput(state,action);
     case SETTEXTMODEVALUE:

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

@@ -1,10 +1,11 @@
-import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,CLEAR_MESSAGE } from "../types/print";
-import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview } from "../actions/print";
+import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,CLEAR_MESSAGE,DIAG_SHOW } from "../types/print";
+import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow } from "../actions/print";
 
 const initState = {
   visible: false,
   preVisible: false,
-  saveMessage: {}
+  saveMessage: {},
+  diagShow:false
 };
 export default function(state = initState, action) {
   switch (action.type) {
@@ -20,6 +21,8 @@ export default function(state = initState, action) {
       return saveMessage(state, action);
     case CLEAR_MESSAGE:
       return clearMessage(state, action);
+    case DIAG_SHOW:
+      return diagShow(state, action);
     default:
       return state;
   }

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

@@ -9,7 +9,7 @@ import {
   CHANGE_VISIBLE,
   SHOW_MESSAGE,
   KEEP_PUSH_DATA,
-  ALL_CHECKED_SHOW
+  ALL_CHECKED_SHOW,
 } from '../types/tabTemplate';
 
 

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

@@ -1,5 +1,5 @@
-import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC } from '../types/treat'
-import { selectDrug, setOtherDrug, setDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic } from '../actions/treat'
+import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC } from '../types/treat'
+import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic } from '../actions/treat'
 const initState = {
     show: false, //治疗方案显示隐藏
     showDrugInfo: false, //药品信息显示隐藏
@@ -191,6 +191,8 @@ export default function(state=initState, action){
             return showDrugInfo(state, action);
         case HIDE_DRUG_INFO:
             return hideDrugInfo(state, action);
+        case SET_TREAT_INFO:
+            return setTreatInfo(state, action);
         default:
             return state
     }

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

@@ -12,4 +12,5 @@ export const CLEARCHECKBODY = 'clear_check_body';
 export const CHECK_FOCUS_INDEX = 'check_focus_text_index';
 export const CHECKBODY_CLEAR = 'clear_search_check_body';
 export const SETCHECKINPUT = 'set_check_body_input_label';
-export const DEL_CHECKBODY = 'DEL_CHECKBODY';//backspace
+export const DEL_CHECKBODY = 'DEL_CHECKBODY';//backspace
+export const CHANGECHECKTEXTLABEL_NUMBER = 'CHANGECHECKTEXTLABEL_NUMBER';//数字键盘

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

@@ -21,4 +21,5 @@ export const CLEAR_CURRENT_EDIT = 'CLEAR_CURRENT_EDIT' ;
 export const CURRENTADDLABELITEM = 'current_add_label_item';    //带加号的标签复制
 export const SETCURRENTINPUT = 'SET_CURRENT_ILL_INPUT_LABEL';     //文本输入标签存值
 export const DEL_CURRENT = 'DEL_CURRENT';     //backspace删除
+export const CURRENT_TEXT_LABEL_NUMBER = 'CURRENT_TEXT_LABEL_NUMBER';     //数字键盘输入
 

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

@@ -21,4 +21,5 @@ export const SETTEXTMODEVALUE = 'SET_TEXT_MODE_VALUE';  //文本模式下输入
 export const SETMAINTEXT = 'SETMAINTEXT';  //模板下输入值
 export const MAINADDLABELITEM = 'MAIN_ADD_LABEL_ITEM';      //带加号的标签复制
 export const SETMAININPUT = 'SET_MAIN_INPUT_LABEL';     //文本输入标签存值
-export const DEL_MAIN = 'DEL_MAIN';     //文本输入标签存值
+export const DEL_MAIN = 'DEL_MAIN';     //删除标签
+export const CHANGE_LABELVAL_NUMBER = 'CHANGE_LABELVAL_NUMBER';     //数字键盘输入存值

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

@@ -16,4 +16,5 @@ export const OTHER_FOCUS_INDEX = 'other_focus_text_index';
 export const OTHERHIS_CLEAR = 'OTHERHIS_CLEAR';  //清空搜索值
 export const OTHERADDLABELITEM = 'other_add_label_item';    //带加号的标签复制
 export const OTHEREDICLEAR = 'OTHEREDICLEAR';    //文本框是否可以编辑
-export const DEL_OTHERHIS = 'DEL_OTHERHIS';    //backspace
+export const DEL_OTHERHIS = 'DEL_OTHERHIS';    //backspace
+export const CHANGEOTHERTEXTLABEL_NUMBER = 'CHANGEOTHERTEXTLABEL_NUMBER';    //数字键盘

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

@@ -3,4 +3,5 @@ export const CLOSE_PRINT_PREVIEW = 'CLOSE_PRINT_PREVIEW'
 export const SAVE_MESSAGE = 'SAVE_MESSAGE'
 export const CLEAR_MESSAGE = 'CLEAR_MESSAGE'
 export const SHOW_PREVIEW = 'SHOW_PREVIEW'
-export const CLOSE_PREVIEW = 'CLOSE_PREVIEW'
+export const CLOSE_PREVIEW = 'CLOSE_PREVIEW'
+export const DIAG_SHOW = 'DIAG_SHOW'

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

@@ -10,3 +10,4 @@ export const SET_GENERAL_TREAT = 'SET_GENERAL_TREAT'; //设置一般治疗
 export const SET_SURGERY_TREAT = 'SET_SURGERY_TREAT'; //设置手术治疗
 export const SET_TREATMENT = 'SET_TREATMENT' //设置治疗方案
 export const SET_RECOMMEND_BASIC = 'SET_RECOMMEND_BASIC'//设置其他推荐推荐依据
+export const SET_TREAT_INFO = 'SET_TREAT_INFO' //设置治疗方案信息(name,id等)

+ 24 - 9
src/utils/tools.js

@@ -474,24 +474,39 @@ function filterArr(arr){
     return tmpArr.join("").replace(/\s/g,'');
 }
 
-function filterDataArr(arr){   //数据处理
+function filterDataArr(arrTmp){   //数据处理
     let tmpArr = [];
+    let arr = arrTmp.join('').split('');
     for(let i = 0;i < arr.length;i++){
         if(arr[i] && arr[i].indexOf('undefined') == -1){
-            if(tmpArr[tmpArr.length-1] != ',' && tmpArr[tmpArr.length-1] != ',' ){
+            if(tmpArr[tmpArr.length-1] != ',' && tmpArr[tmpArr.length-1] != ',' && 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{
-                tmpArr.push(arr[i]);
+            }else {
+              if(tmpArr[tmpArr.length-1] == '。' && arr[i] != ',' && arr[i] != ',' && arr[i] != '、' && arr[i] != '。'){
+                  tmpArr.push(arr[i]);
+              }else if(tmpArr[tmpArr.length-1] != '。'){
+                if(arr[i] == '。'){
+                  tmpArr.pop();
+                  tmpArr.push(arr[i]);
+                }else if(arr[i] != '。' && tmpArr[tmpArr.length-1] == '、'){    //前面逗号后面顿号 [',','、']
+                  if(arr[i] != ',' && arr[i] != ',' && arr[i] != '、'){
+                    tmpArr.push(arr[i]);
+                  }else{
+                    tmpArr.pop();
+                    tmpArr.push(arr[i]);
+                  }
+                }else if(arr[i] != '。' && tmpArr[tmpArr.length-1] != '、'){
+                  if(arr[i] != ',' && arr[i] != ',' && arr[i] != '、'){
+                    tmpArr.push(arr[i]);
+                  }
+                }
               }
             }
         }
     }
-    return (tmpArr.join('')).replace(/,^|,^|,$|,$/gi,"");
+    return (tmpArr.join('')).replace(/^,+/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/、+$/,"");
 }
+filterDataArr(['sds','、',',','sds'])
 // 取消默认行为
 function preventDefault(event) {
     if (event.preventDefault) {