Browse Source

Merge remote-tracking branch 'origin/Chronic_test' into ChronicMag

# Conflicts:
#	src/components/ChronicInfo/index.jsx
#	src/containers/ChronicInfo.js
zhouna 6 years ago
parent
commit
79ff0cf898

+ 47 - 0
src/common/components/MiniToast/index.jsx

@@ -0,0 +1,47 @@
+import React from 'react';
+import style from './index.less';
+import close from "../../images/close-icon.png";
+/**
+*小弹窗,没有蒙层,例如计算公式结果
+*title:弹窗标题
+*icon:标题旁边的icon,不传不显示
+*children:弹窗内容
+*show:弹窗显示
+*footer:是否显示底部“确定”按钮,默认不显示
+*close:关闭弹窗事件
+*confirm:确定事件
+*使用时,父元素需要加相对定位position: relative;
+*/
+class MiniToast extends React.Component{
+  constructor(props){
+    super(props);
+  }
+
+  close(){
+    const {close} = this.props;
+    close&&close();
+  }
+
+  confirm(){
+    const {confirm} = this.props;
+    confirm&&confirm();
+  }
+
+
+  render(){
+    const {show,title,icon,children,footer} = this.props;
+    return <div className={style["infoBox"]} style={{display:show?'block':'none'}}>
+              <p className={style["infoTitle"]}>
+                {icon?<img src={icon} />:''}
+                {title}
+                <img src={close} onClick={this.close.bind(this)} className={style["closeIcon"]}/>
+              </p>
+              <div className={style["infoCon"]}>{children}</div>
+              <div className={style["infoFoot"]} style={{display:footer?'block':'none'}}>
+                <span onClick={this.confirm.bind(this)}>确定</span>
+              </div>
+            </div>
+  }
+}
+
+export default MiniToast;

+ 41 - 0
src/common/components/MiniToast/index.less

@@ -0,0 +1,41 @@
+.infoBox{
+  position: absolute;
+  top:27px;
+  width: 388px;
+  background: #fff;
+  z-index: 66;
+  border: 1px solid #EAEDF1;
+  box-shadow: 0 5px 10px 0 rgba(0,0,0,0.10);
+  .infoTitle{
+    height: 40px;
+    line-height: 40px;
+    padding-left: 18px;
+    // border-bottom: 1px solid #EAEDF1;
+    background: #DFEAFE;
+    img{
+      vertical-align: text-top;
+    }
+    .closeIcon{
+      // vertical-align: middle;
+      float: right;
+    }
+  }
+  .infoCon{
+    padding: 15px 26px 25px;
+  }
+  .infoFoot{
+    text-align: right;
+    // border-top: 1px solid #EAEDF1;
+    padding: 10px 20px 10px 0;
+    span{
+      color:#3B9ED0;
+      display: inline-block;
+      width: 66px;
+      height: 32px;
+      line-height: 32px;
+      text-align: center;
+      border: 1px solid #3B9ED0;
+      border-radius: 4px;
+    }
+  }
+}

+ 3 - 1
src/common/components/index.js

@@ -22,6 +22,7 @@ import Textarea from "./Textarea";
 import NumberUnitPan from "./NumberUnitPan";
 import Add from "./Add";
 import ComplexModal from "./ComplexModal";
+import MiniToast from "./MiniToast";
 
 module.exports = {
     Banner,
@@ -47,5 +48,6 @@ module.exports = {
     Textarea,
     NumberUnitPan,
     Add,
-    ComplexModal
+    ComplexModal,
+    MiniToast
 };

File diff suppressed because it is too large
+ 65 - 72
src/components/ChronicInfo/index.jsx


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

@@ -167,6 +167,24 @@
           }
         }
       }
+      .infoOption{
+        padding: 20px 0;
+      }
+      .infoConBtn{
+        text-align: right;
+        border-top: 1px solid #EAEDF1;
+        padding-top: 10px;
+        span{
+          color:#3B9ED0;
+          display: inline-block;
+          width: 66px;
+          height: 32px;
+          line-height: 32px;
+          text-align: center;
+          border: 1px solid #3B9ED0;
+          border-radius: 4px;
+        }
+      }
       .list:last-child{
         border-bottom:none;
       }

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

@@ -57,7 +57,7 @@ class CurrentIll extends Component{
     }else {
       let num = moduleNum.num;//主诉使用了几个模板
       // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
-      if(data.length==0){
+      if(data.length==0 && !isChronic){
         // setData && setData({useEmpty,num,mainData,mainIds});
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回

+ 91 - 5
src/components/MainSuit/index.jsx

@@ -1,13 +1,19 @@
 import React,{Component} from 'react';
 import style from './index.less';
-import {Button,InlineTag,ItemBox,DropDown,DropList,Textarea,Notify} from '@commonComp';
+import {Button,InlineTag,ItemBox,DropDown,DropList,Textarea,Notify,ConfirmModal} from '@commonComp';
 import TailInlineTag from '@commonComp/TailInlineTag';
 import SearchDrop from '@components/SearchDrop';
 import CommonSymptom from '@components/CommonSymptom';
 import chooseType from '@containers/eleType.js';
 import config from "@config/index";
-import {isIE,getPageCoordinate,windowEventHandler,filterDataArr} from "@utils/tools.js"
+import {isIE,getPageCoordinate,windowEventHandler,filterDataArr,getAllDataList,getAllDataStringList,ifOtherClear} from "@utils/tools.js"
+import { initItemList } from '@store/async-actions/historyTemplates';
+import tableIcon from '@common/images/table.png';
+import iconRadioDefault from '@common/images/icon-radio-default.png'
+import iconRadioActive from '@common/images/icon-radio-active.png'
+import { pushAllDataList } from '@utils/tools';
 import $ from 'jquery';
+import store from '@store';
 
 class MainSuit extends Component{
   constructor(props){
@@ -29,6 +35,8 @@ class MainSuit extends Component{
       overFlag:false,
       tmpScroll:0,
       tmpTop:0,
+      activeHistory: -1,
+      showHistoryCase:false
     };
     this.toggleEditable = this.toggleEditable.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
@@ -37,6 +45,11 @@ class MainSuit extends Component{
     this.handleChange = this.handleChange.bind(this);
     this.handleClick = this.handleClick.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
+    this.referRecord = this.referRecord.bind(this);
+    this.noReferRecord = this.noReferRecord.bind(this);
+    this.referCase = this.referCase.bind(this);
+    this.closeHistoryCaseModal = this.closeHistoryCaseModal.bind(this);
+    this.handleQuoteClick = this.handleQuoteClick.bind(this);
   }
   componentWillReceiveProps(nextProps){
     this.setState({boxLeft:nextProps.boxLeft})
@@ -232,7 +245,7 @@ class MainSuit extends Component{
   }
 
   handleBlur(e){//隐藏常见症状下拉、存自由输入的值
-    const {freeText,saveText,datas,clearSearch,getSymptomFeature,currentData} = this.props;
+    const {freeText,saveText,datas,clearSearch,getSymptomFeature,currentData,saveChronic} = this.props;
     const that = this;
     let data = this.state.inpText;
     if(!isIE()){
@@ -241,6 +254,15 @@ class MainSuit extends Component{
       } 
       e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
       freeText && freeText(data.trim());
+      // 慢病模板获取:精确匹配"糖尿病复诊",储存慢病字段
+      // 页面有模板数据 就不在请求
+      let baseList = store.getState();
+      let jsonData = getAllDataList(baseList);
+      let jsonStr = getAllDataStringList(baseList);
+      let flg = ifOtherClear(jsonData,jsonStr,baseList);//除主诉外 其他是否为空
+      if(data.trim()=='糖尿病复诊' && !flg){
+        saveChronic && saveChronic({name:'糖尿病',id:21773});
+      }
     }else{
       if(datas.length==0){
         const ev = e || window.event;
@@ -259,10 +281,67 @@ class MainSuit extends Component{
       },config.delayTime-200); 
   }
 
+  // 慢病
+  referRecord() {//是否引用历史病例弹窗--是
+    const { chronicDesease,closeHisBox } = this.props
+    closeHisBox&&closeHisBox();//关闭
+    this.setState({
+      showHistoryCase:true
+    })
+    store.dispatch(initItemList(chronicDesease));
+  }
+  noReferRecord() {//否
+    const {closeHisBox,autoFillMoudles} = this.props;
+    closeHisBox&&closeHisBox();
+    // 不引用病例 -直接分发模板进行填充
+    autoFillMoudles && autoFillMoudles()
+  }
+  referCase() {
+        const { items } = this.props
+        this.setState({
+          showHistoryCase:false
+        })
+        if (this.state.activeHistory === -1) {
+            return
+        }
+        // let baseList = store.getState(); 
+        let baseObj = items[this.state.activeHistory];
+        pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
+        this.props.getBilling();
+        this.setState({
+            activeHistory: -1
+        })
+    }
+  closeHistoryCaseModal() {//关闭病例列表
+    const {autoFillMoudles} = this.props;
+      this.setState({
+        activeHistory: -1,
+        showHistoryCase:false
+      })
+     // 不引用病例直接分发模板进行填充 
+     autoFillMoudles&&autoFillMoudles();
+  }
+  handleQuoteClick(item, index) {
+      console.log('asadsd', item)
+      this.setState({
+          activeHistory: index
+      })
+  }
+  getHistoryCase() {
+        const { items } = this.props
+        return (<div className={style['history-info']}>
+            {items.map((item, index) => {
+                return<div onClick={this.handleQuoteClick.bind(this, item, index)} style={this.state.activeHistory === index ? {color: '#abcdef'} : ''}>
+                    <img src={this.state.activeHistory === index ? iconRadioActive : iconRadioDefault}/>{item.diagnose}
+                </div>
+            })}
+        </div>)
+    }
+
 
   render(){
-    const {type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,boxLeft,boxTop} = this.props;
-    const {showModule,show,symptom,search} = this.state;
+    const {type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,boxLeft,boxTop,showHisBox} = this.props;
+    const {showModule,show,symptom,search,showHistoryCase} = this.state;
     const symptomFlag = CommonSymptoms.length>0 ? true : false;
     const searchFlag = searchData.length>0 ? true : false;
     const boxTop1 = datas.length>0?boxTop:45;
@@ -286,6 +365,13 @@ class MainSuit extends Component{
       </ItemBox>
       {/*没有推送结果就不显示*/}
       {symptomFlag && !searchFlag ? <CommonSymptom data={CommonSymptoms} show={!totalHide&&symptom} onSelect={this.handleSelect} /> : ( searchFlag ? <SearchDrop data={searchData} show={!commSymHide} onSelect={this.handleSearchSelect} left={boxLeft1} top={boxTop1} mainEmpty={datas.length==0?true:false}/>:"")}
+      <ConfirmModal visible={showHisBox} okText='是' cancelText='否' confirm={this.referRecord}  cancel={this.noReferRecord} close={this.noReferRecord}>
+          <div className={style['confirm-info']}>是否引用往期病历</div> 
+      </ConfirmModal>
+      <ConfirmModal visible={showHistoryCase} noFooter='true' title='请选择历史病历' close={this.closeHistoryCaseModal} titleBg="#DFEAFE" icon={tableIcon} height={300}>
+        {this.getHistoryCase()}
+        <div className={style['confirm-history']}><span className={style['confirm-history-btn']} onClick={this.referCase}>确定</span></div>
+    </ConfirmModal>
     </div>
   }
 }

+ 33 - 0
src/components/MainSuit/index.less

@@ -22,4 +22,37 @@
             border: 1px solid red !important;
         }
     }
+}
+.confirm-info {
+    height: 70px;
+    font-size: 16px;
+    line-height: 16px;
+    text-align: center;
+    padding: 10px 30px;
+}
+.history-info {
+    height: 185px;
+    overflow-y: auto;
+    padding: 15px;
+    >div{
+        line-height: 26px;
+        img{
+            vertical-align: middle;
+            margin-right: 5px;
+        }
+    }
+}
+.confirm-history-btn {
+    position: absolute;
+    right: 15px;
+    // bottom: 10px;
+    display: inline-block;
+    width: 66px;
+    height: 32px;
+    line-height: 32px;
+    text-align: center;
+    color: #3B9ED0;
+    border: 1px solid #3B9ED0;
+    border-radius: 4px;
+    cursor: pointer;
 }

+ 14 - 28
src/components/ScaleTable/index.jsx

@@ -1,8 +1,12 @@
 import React from 'react';
 import style from './index.less';
 import mocks from '../../mock/chronicTable.js'
-
-// 量表 具体信息页面
+ 
+/**
+*量表 具体信息页面
+*title:量表标题
+*data:量表内容
+**/
 class ScaleTable extends React.Component{
   constructor(props){
     super(props);
@@ -14,14 +18,15 @@ class ScaleTable extends React.Component{
   }
 
   render(){
-    const {data} = this.props;
-    const content = data && data[1].content;
+    const {data,title} = this.props;
+    const content = data && data[1].content;//表格内容
+    const preContent = data && data[0].content;//表前文字
+    const footContent = data && data[2].content; //表后文字
     const datas = content && JSON.parse(content);
-    console.log(5555,datas);
 
     return <div className={style['tableBox']}>
-            <h1>密西根糖尿病神经筛查表(MDNS)</h1>
-            <p>MDNS可与MNSI联合应用以确定是否存在周围神经病变,在一段时间内对患者进行评分可以评估疾病的进展情况。</p>
+            <h1>{title}</h1>
+            <div dangerouslySetInnerHTML={{__html:preContent}} className={style['textlh']}></div>
             <table className={style['table']}>
               <thead>
                 <tr>
@@ -36,12 +41,10 @@ class ScaleTable extends React.Component{
                     <td>{v.name}</td>
                     <td>
                       {v.details.map((it,index)=>{
-                        /*return <td style={{display:'block'}}>{it.detailName}</td>*/
                         return <td className={style['block']}>
                           <label>
                             <input type="radio" name={v.name} value={it.score} onChange={this.handleChange}/>{it.detailName}
-                            {/*<span style={{display:+it.state==1?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>*/}
-                            <span style={{display:it.detailName=='正常'?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>
+                            <span style={{display:it.state==1?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>
                           </label>
                         </td>
                       })}
@@ -61,24 +64,7 @@ class ScaleTable extends React.Component{
                 </tr>
               </tfoot>
             </table>
-            <div>
-              <p>
-                1. 计算方法:<br/>
-              感觉损伤得分=左右两侧感觉检查项目的分数之和<br/>
-              肌力得分=左右两侧肌力检查项目的分数之和<br/>
-              反射得分=左右两侧反射检查项目的分数之和<br/>
-              体格检查得分=感觉损伤得分+肌力得分+反射得分
-              </p>
-              <p>
-                2. 临床体格检查部分:<br/>
-              最低得分0  最高得分46, 分数越高,周围神经病越重
-              </p>
-              {datas&&datas.calculate.range.map((v,i)=>{
-                return <p>
-                  <span>{v.min}~{v.max}</span>&nbsp;<span>{v.text}</span>
-                </p>
-              })}
-            </div>
+            <div dangerouslySetInnerHTML={{__html:footContent}} className={style['textlh']}></div>
           </div>
   }
 }

+ 17 - 5
src/components/ScaleTable/index.less

@@ -14,11 +14,6 @@
   margin: 10px 0 10px;
   border-top: 10px solid #D8D8D8;
   border-bottom: 10px solid #D8D8D8;
-  thead,tfoot{
-    tr{
-      height: 54px;
-    }
-  }
   tr{
     border-bottom: 1px solid #979797;
     td{
@@ -26,10 +21,27 @@
       padding: 7px 0;
     }
   }
+  thead,tfoot{
+    tr{
+      height: 54px;
+    }
+    td{
+      color:#000;
+      font-weight: bold;
+    }
+  }
   .sum{
     text-align: right;
   }
   .block{
     display: block;
   }
+}
+strong{
+  font-weight: bold;
+}
+.textlh{
+  p{
+    line-height: 22px;
+  }
 }

+ 1 - 0
src/containers/ChronicInfo.js

@@ -11,6 +11,7 @@ function mapStateToProps(state){
     tableList: state.pushMessage.tableList,
     showList: state.pushMessage.showList,
     scaleInfo: state.pushMessage.scaleInfo,//量表明细
+    chronicDesease:state.mainSuit.chronicDesease,//主诉存的慢病
     update:state.assessResult.update1
   }
 }

+ 2 - 1
src/containers/CurrentIll.js

@@ -42,7 +42,8 @@ function mapStateToProps(state) { //console.log(111,state);
         boxTop:state.homePage.boxTop,
         boxLeft:state.homePage.boxLeft,
         allModules:state.homePage.allModules,
-        isChronic:!!state.diagnosticList.chronicMagItem
+        // isChronic:!!state.diagnosticList.chronicMagItem,
+        isChronic:!!state.mainSuit.chronicDesease,
 
     }
 }

+ 34 - 2
src/containers/MainSuit.js

@@ -1,8 +1,8 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import MainSuit from '@components/MainSuit';
-import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE,SET_FEATURE} from '@store/types/mainSuit';
-import {RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION} from '@store/types/homePage.js';
+import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE,SET_FEATURE,SAVE_CHRONIC,SHOW_HISTORY_BOX,HIDE_HISTORY_BOX} from '@store/types/mainSuit';
+import {RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION,MODI_LOADING} from '@store/types/homePage.js';
 import {getCommSymptoms,getCommSymptomPush} from '@store/async-actions/mainSuit.js'
 import {SET_MAIN_SUIT} from '@store/types/fillInfo';
 import {CLEAR_DIAGNOSE} from '@store/types/diagnosticList';
@@ -11,6 +11,8 @@ import {billing} from '@store/async-actions/pushMessage';
 import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
 import config from '@config/index.js';
 import {Notify} from '@commonComp';
+import {getInitModules} from '@store/async-actions/homePage.js';
+import {CURRENT_CHRONIC} from '@store/types/currentIll'
 
 function mapStateToProps(state) {//console.log(11,state);
   return {
@@ -38,6 +40,9 @@ function mapStateToProps(state) {//console.log(11,state);
     boxLeft:state.homePage.boxLeft,
     currentData:state.currentIll.data,
     allModules:state.homePage.allModules,
+    chronicDesease:state.mainSuit.chronicDesease,
+    items:state.historyTemplates.items,
+    showHisBox:state.mainSuit.showHisBox,
   }
 }
 
@@ -182,6 +187,33 @@ function mapDispatchToProps(dispatch) {
             data:data
           })
         }
+      },
+      async saveChronic(item){//储存慢病信息
+        // 页面已有数据不再请求
+        
+        // loading
+        dispatch({type:MODI_LOADING,flag:true});
+        // 存慢病
+        dispatch({
+          type:SAVE_CHRONIC,
+          data:item
+        })
+        // 取模板
+        await dispatch(getInitModules);
+        // 模板回来关闭;loading
+        dispatch({type:MODI_LOADING,flag:false});
+        // 弹窗是否引用历史病例?
+        dispatch({type:SHOW_HISTORY_BOX});
+
+      },
+      closeHisBox(){
+        dispatch({type:HIDE_HISTORY_BOX})
+      },
+      getBilling: () => {
+        dispatch(billing())
+      },
+      autoFillMoudles(){//自动填充模板
+        dispatch({type:CURRENT_CHRONIC})//现病史
       }
     }
 }

+ 28 - 14
src/store/actions/currentIll.js

@@ -25,20 +25,25 @@ export const setModule = (state,action)=>{
   const originalSonData = action.processModule;
   let spreadLabels=[];
   let sonSpreadLabels=[];//子模板
-  for(let i=0; i<originalData.length;i++){
-    if(originalData[i].tagType==4){
-      spreadLabels.push(...originalData[i].questionMapping);
-    }else{
-      spreadLabels.push(originalData[i]);
+  if(originalData&&originalData.length>0){
+    for(let i=0; i<originalData.length;i++){
+      if(originalData[i].tagType==4){
+        spreadLabels.push(...originalData[i].questionMapping);
+      }else{
+        spreadLabels.push(originalData[i]);
+      }
     }
   }
-  for(let j=0; j<originalSonData.length;j++){
-    if(originalSonData[j].tagType==4){
-      sonSpreadLabels.push(...originalSonData[j].questionMapping);
-    }else{
-      sonSpreadLabels.push(originalSonData[j]);
+  if(originalSonData&&originalSonData.length>0){
+    for(let j=0; j<originalSonData.length;j++){
+      if(originalSonData[j].tagType==4){
+        sonSpreadLabels.push(...originalSonData[j].questionMapping);
+      }else{
+        sonSpreadLabels.push(originalSonData[j]);
+      }
     }
   }
+  
   // res.moduleData = action.data;
   // res.processModule = action.processModule;//病程变化模板
   res.moduleData = spreadLabels;
@@ -88,6 +93,16 @@ function addPos(data,num){
   return newData;
 }
 
+//慢病填充模板
+export const fillChronicModule = (state,action)=>{
+  let res = Object.assign({},state);
+  let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
+  res.data = fullfillText(moduleData).newArr;
+  res.saveText = fullfillText(res.data).saveText;
+  res.update=Math.random();
+  return res;
+}
+
 //聚焦时设置 现病史模板
 export const setData = (state,action) =>{
   let res = Object.assign({},state);
@@ -120,18 +135,17 @@ export const setData = (state,action) =>{
   
 
   // 是慢病,暂且使用现病史慢病模板,不区分空模板
-  if(isChronic){
+  /*if(isChronic){
     res.data = fullfillText(moduleData).newArr;
     res.saveText = fullfillText(res.data).saveText;
     res.update=Math.random();
     return res;
-  }
+  }*/
 
   /****************************************/
   // 是否使用空模板:num=0时判断mainIds,num>=1,截取第一病程遍历是否有症状exist
   if(num==0){
-    // useEmpty = mainIds.length>0 ? false:true;
-    useEmpty = mainIds.length==0 && !symptomFeature || symptomFeature.length==0? true:false;
+    useEmpty = mainIds.length>0 ? false:true;
     mainData = mainModleData;
   }else{
     // 模板也分词时得加上分词结果的判断

+ 2 - 0
src/store/actions/mainSuit.js

@@ -667,6 +667,7 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   // res.saveText = fullfillText(action.data).saveText;//解决删除data里的值保存,回读后页面上有内容saveText里没有的情况
   res.selecteds = action.selecteds?action.selecteds:[];
   res.mainIds = action.mainIds;
+  res.chronicDesease = action.chronicDesease;//慢病疾病字段
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -676,6 +677,7 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   if(action.symptomFeature !== undefined){//清除分词数据
     res.symptomFeature.featureData = action.symptomFeature;
   }
+  console.log(res,action);
   return res;
 }
 

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

@@ -222,6 +222,7 @@ export const clearAllPushMessage = (state, action) => {
 	res.determine = [];
 	res.assay = [];
 	res.check = [];
+  res.chronicPushItems = [];//量表
 	return res;
 }
 

+ 32 - 22
src/store/async-actions/homePage.js

@@ -31,7 +31,9 @@ function modulesParseJson(data){
 export const getInitModules= (dispatch,getStore)=>{
   const state = getStore();
   const {message} = state.patInfo;
-  const chronicMagItem = state.diagnosticList.chronicMagItem;
+  // const chronicMagItem = state.diagnosticList.chronicMagItem;
+  // const chronicId = chronicMagItem?chronicMagItem.id:'';//诊断为慢病复诊时储存慢病信息到store
+  const chronicMagItem = state.mainSuit.chronicDesease;
   const chronicId = chronicMagItem?chronicMagItem.id:'';//诊断为慢病复诊时储存慢病信息到store
   const param = {
     age:message.patientAge,
@@ -56,27 +58,35 @@ export const getInitModules= (dispatch,getStore)=>{
           type: SETINITDATA,
           data: initData
         });
-        dispatch({
-          type:SET_MAINSUIT,
-          // data:fullfillText(initData.mainSuit).newArr,
-          // addSymptom:fullfillText(initData.addSymptom).newArr,
-          data:initData.mainSuit,
-          addSymptom:initData.addSymptom,
-          addModuleName:initModuleName.addSymptom,//模板名称
-		      // save:initSaveText.mainSuit
-        });
-        dispatch({
-          type:SET_CURRENT,
-          data:formatContinueDots(initData.current),
-          save:initSaveText.current,
-          // processModule:formatContinueDots(initData.process),//病程变化
-          // processModuleName:initModuleName.process,//病程变化模板名称
-          processModule:[],//病程变化
-          processModuleName:'',//病程变化模板名称
-          saveProcess:initSaveText.process,
-          emptyData:formatContinueDots(initData.currentEmpty),//现病史空模板
-          saveEmpty:initSaveText.currentEmpty,
-        });
+        if(!chronicId){//普通病
+          dispatch({
+            type:SET_MAINSUIT,
+            data:fullfillText(initData.mainSuit).newArr,
+            addSymptom:fullfillText(initData.addSymptom).newArr,
+            // addModuleName:initModuleName.addSymptom,//模板名称
+            save:initSaveText.mainSuit
+          });
+          dispatch({
+            type:SET_CURRENT,
+            data:formatContinueDots(initData.current),
+            save:initSaveText.current,
+            processModule:formatContinueDots(initData.process),//病程变化
+            processModuleName:initModuleName.process,//病程变化模板名称
+            saveProcess:initSaveText.process,
+            emptyData:formatContinueDots(initData.currentEmpty),//现病史空模板
+            saveEmpty:initSaveText.currentEmpty,
+          });
+        }else{//慢病--没有主诉模板
+          dispatch({
+            type:SET_CURRENT,
+            data:formatContinueDots(initData.current),
+            save:initSaveText.current,
+            processModule:formatContinueDots(initData.process),//病程变化
+            processModuleName:initModuleName.process,//病程变化模板名称
+            // saveProcess:initSaveText.process,
+          });
+        }
+
         dispatch(getOtherHisRecord());          //获取其他史最近记录
       }
     })

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

@@ -60,9 +60,9 @@ export const initHistoryDetails = (dispatch) => {
                 }else{
                   dispatch(initItemList(baseList.typeConfig.typeConfig))
                 }
-                dispatch({type:MODI_LOADING});
+                dispatch({type:MODI_LOADING,flag:false});
             } else {
-                dispatch({type:MODI_LOADING});
+                dispatch({type:MODI_LOADING,flag:false});
                 console.log(res)
             }
         })

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

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

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

@@ -64,7 +64,8 @@ export default function (state=initState,action) {
       res.windowHeight = action.obj.height;
       return res;
     case MODI_LOADING:
-      res.loadingFlag = false;
+      // res.loadingFlag = false;
+      res.loadingFlag = action.flag;
       return res;
     case SEARCH_DROP_LOCATION:
       return searchDropLocation(state,action);

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

@@ -2,7 +2,7 @@ import {COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   SET_SEARCH,CLEAR_SEARCH,GET_BIGDATAPUSH,SET_MAINSUIT,MIX_CONFIRM,NUMBER_SELECT,
   RADIO_SELECT,COMM_CONFIRM,CHANGE_LABELVAL,SAVE_FREE,CLEAR_MAIN_SUIT,SET_DATA,
   INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,
-  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL} from '../types/mainSuit'
+  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC,SHOW_HISTORY_BOX,HIDE_HISTORY_BOX} from '../types/mainSuit'
 import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
   setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,
   addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,
@@ -99,6 +99,15 @@ export default function(state=initState,action){
       return getSymptomFeature(state,action);
     case SET_MS_RADIO_INPUT_VAL:
       return setRadioInputValue(state,action);
+    case SAVE_CHRONIC:
+      res.chronicDesease = action.data;
+      return res;
+    case SHOW_HISTORY_BOX://显示是否引用历史病例弹窗
+      res.showHisBox = true;
+      return res;
+    case HIDE_HISTORY_BOX://关闭
+      res.showHisBox = false;
+      return res;
     default:
       return state;
   }

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

@@ -26,4 +26,5 @@ export const REMOVE_CURR_ID = 'REMOVE_CURR_ID';     //删除后移除id
 export const CURRENT_MUL = 'CURRENT_MUL';     //单列多选
 export const DEL_CURRENT_LABLE = 'DEL_CURRENT_LABLE';     //
 export const SET_RADIO_INPUT_VALUE = 'SET_RADIO_INPUT_VALUE';
+export const CURRENT_CHRONIC = 'CURRENT_CHRONIC';//慢病填充模板
 

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

@@ -27,4 +27,7 @@ export const REMOVE_MAIN_ID = 'REMOVE_MAIN_ID';     //移除id
 export const MAINSUIT_MUL = 'MAINSUIT_MUL';     //单列多选
 export const DEL_MAIN_LABLE = 'DEL_MAIN_LABLE';     
 export const SET_FEATURE = 'SET_FEATURE';  //主诉分词
-export const SET_MS_RADIO_INPUT_VAL = 'SET_MS_RADIO_INPUT_VAL'
+export const SET_MS_RADIO_INPUT_VAL = 'SET_MS_RADIO_INPUT_VAL';
+export const SAVE_CHRONIC = 'SAVE_CHRONIC'; //储存慢病信息
+export const SHOW_HISTORY_BOX = 'SHOW_HISTORY_BOX'; //是否引用历史病例弹窗
+export const HIDE_HISTORY_BOX = 'HIDE_HISTORY_BOX'; //关闭是否引用历史病例弹窗

+ 2 - 1
src/utils/ajax.js

@@ -5,7 +5,8 @@ $.support.cors = true;
 const axios=require('axios');
 const qs=require('querystring');
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
-const qhost = isLocal?host+prefix:prefix;
+// const qhost = isLocal?host+prefix:prefix;
+const qhost = isLocal?host+prefix:host+prefix;
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 //axios.defaults.baseURL = host;       //默认地址
 // axios.defaults.timeout = 60000;       //请求超时

+ 1 - 1
src/utils/config.js

@@ -4,7 +4,7 @@
 const host='http://192.168.2.236:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
-// const host='http://192.168.3.117:8080'; //周铁刚
+// const host='http://192.168.3.117:5050'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://
 const imageUrlPrefix = 'http://192.168.2.241:82'
 module.exports={

+ 23 - 2
src/utils/tools.js

@@ -241,7 +241,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
 const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清空所有的数据
     if(action == 'clear'){     //清空
       const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
-      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],clearAction:true,symptomFeature:[]});
+      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],clearAction:true,symptomFeature:[],chronicDesease:{}});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
         store.dispatch({type: CLEAROTHERHISTORY,data:[block],isEmpty:true,saveText:[],selecteds:[],editClear:true,yjs_1:'',yjs_2:'',yjs_3:'',yjs_4:''});
         store.dispatch({type: CLEARCHECKBODY,data:[block],isEmpty:true,saveText:[],selecteds:[]});
@@ -694,6 +694,26 @@ function isAllClear(jsonData,jsonStr,baseList){
     return true;
   }
 }
+//判断除主诉外页面数据是否为空--慢病模板
+function ifOtherClear(jsonData,jsonStr,baseList){
+  if (      //结构化和文本数据都为空
+    JSON.stringify(jsonData.advice) == '{}' &&
+    jsonData.present.length < 1 &&
+    (jsonData.other.length > 0 ? baseList.otherHistory.isEmpty : true) &&
+    (jsonData.vital.length > 0 ? baseList.checkBody.isEmpty : true) &&
+    jsonData.diag.length < 1 &&
+    jsonData.pacs.length < 1 &&
+    jsonData.lis.labelList.length < 1 &&
+    jsonData.lis.getExcelDataList.length < 1 &&
+    filterDataArr(JSON.parse(jsonStr.present)) == '' &&
+    filterDataArr(JSON.parse(jsonStr.other)) == '' &&           //这里都是filterDataArr不是filterArr,要去符号的
+    filterDataArr(JSON.parse(jsonStr.vital)) == ''
+  ) {
+    return false;
+  }else{
+    return true;
+  }
+}
 function normalVal(min,max){
   if((min-0) && (max-0)){
       return `正常值: (${min}~${max})`
@@ -845,5 +865,6 @@ module.exports = {
     timestampToTime,
     getPageLength,
     dragBox,
-    formatContinueDots
+    formatContinueDots,
+    ifOtherClear
 };