Explorar o código

Merge branch 'version6.1' into testNew

luolei %!s(int64=4) %!d(string=hai) anos
pai
achega
48c536a197

BIN=BIN
src/common/images/bannerDown.png


+ 5 - 5
src/components/AddInspect/SlidePic/index.jsx

@@ -72,7 +72,7 @@ class SlideSelect extends Component {
     const {handleDelClick,item} = this.props;
     this.setState({
       activeInd:true,
-      activeName:item.uniqueName,
+      activeName:item.detailName,
     })
     handleDelClick&&handleDelClick(1,part,idx);
   }
@@ -161,11 +161,11 @@ class SlideSelect extends Component {
     const {item,idx,activeIdx,activeSign} = this.props;
     const {canEdit,activeInd,activeName,value,style} = this.state;
     return (
-      item.flg == 1?<li key={item.uniqueName+idx} className={`${styles.slideLi} clearfix`}> 
+      item.flg == 1?<li key={item.detailName+idx} className={`${styles.slideLi} clearfix`}> 
           <table>
             <tr>
               <img className={styles.imgCheck} src={item.check?checkOn:checkOff} onClick={()=>this.checkOnOff(item,idx)} alt=""/>
-              <span className={styles.bigname}>{item.uniqueName}</span>
+              <span className={styles.bigname}>{item.name}</span>
               <span className={styles.smallname}></span>
               <span className={styles.edit}></span>
               <span className={styles.maxmin}></span>
@@ -192,10 +192,10 @@ class SlideSelect extends Component {
                     top={'30px'}
                     cancel={this.handleCancel}
                     confirm={()=>{this.delConfirm(item,idx)}}/>
-      </li>:<li key={item.uniqueName+idx} className={`${styles.slideLi} clearfix`}> 
+      </li>:<li key={item.detailName+idx} className={`${styles.slideLi} clearfix`}> 
           <span style={{width:'22px'}}></span>
           <span className={styles.bigname}>{item.name}</span>
-          <span className={styles.smallname}>{item.uniqueName}</span>
+          <span className={styles.smallname}>{item.detailName}</span>
           <span className={styles.edit}>
             <input type="text" 
               class="canEdit"

+ 2 - 2
src/components/AddNewInspect/SlidePic/index.jsx

@@ -47,7 +47,7 @@ class SlidePic extends Component {
     const {handleDelClick,item} = this.props;
     this.setState({
       activeInd:true,
-      activeName:item.uniqueName,
+      activeName:item.detailName,
     })
     handleDelClick&&handleDelClick(1,time);
   }
@@ -120,7 +120,7 @@ class SlidePic extends Component {
     return (
       <li key={item.time} className={`${styles.slideLi} clearfix`}> 
           <img className={styles.imgCheck} src={item.check?checkOn:checkOff} onClick={()=>this.checkOnOff(item,idx)} alt=""/>
-          <span className={styles.bigname} title={item.uniqueName}>{item.uniqueName}</span>
+          <span className={styles.bigname} title={item.detailName}>{item.detailName}</span>
           <span className={styles.smallname}>{item.flg == 5?'药品':item.flg == 6?'手术/操作':'输血'}</span>
           <span className={styles.medType}>
             <a style={{display:item.flg == 5?'block':'none',color:item.form=='选择剂型'||!item.form?"#AAAAAA":"#333"}} id="selectJiTypeWrap" onClick={()=>this.handleSelectShow(idx)}>

+ 113 - 16
src/components/Banner/index.jsx

@@ -3,7 +3,7 @@ import { connect } from "react-redux";
 import style from "./index.less";
 import ReactDom from "react-dom";
 import logo from "../../common/images/logoa.png";
-import prec from "../../common/images/prec.png";
+import bannerDown from "../../common/images/bannerDown.png";
 import setup from "../../common/images/setup.png";
 import emergIcon from '../../common/images/emergency.png'
 import {Notify} from '@commonComp';
@@ -14,10 +14,14 @@ import {timestampToTime,getCurrentDate} from '@utils/tools.js';
 import {dragBox} from '@utils/drag';
 import {CLEAR_COMSYMPTOMS} from '@store/types/mainSuit';
 import { GET_PREC_LIST,SET_PREC_SHOW } from "@store/types/preIcss";
+import { CHANGEHOSPITAL } from "@store/types/homePage";
 import {getPreMsg} from '@store/async-actions/preIcss';
 import ModeChange from './ModeChange'
+import {ConfirmModal} from '@commonComp';
 import { embedPush} from '../../store/async-actions/pushMessage'
+import { clearMessages } from "../../store/async-actions/print";
 import {debounce} from '../../utils/tools'
+import $ from 'jquery';
 import store from '@store';
 class Banner extends Component {
   constructor(props){
@@ -29,15 +33,37 @@ class Banner extends Component {
       config2:conf[2],      //其他史默认
       config3:conf[3],    //字体大小
       config4:conf[4],       //字体颜色
-      emergencyBox:false
+      emergencyBox:false,
+      showHos:false,
+      showM:false,
+      hosName:"杭州朗通信息技术有限公司",
+      hosId:"-1",
+      hosNameTmp:"",
+      hosIdTmp:"-1",
     };
     this.showConfigModal = this.showConfigModal.bind(this);
     this.changeType = this.changeType.bind(this);
     this.confirmType = this.confirmType.bind(this);
     this.showHisModal = this.showHisModal.bind(this);
     this.handleHisClose = this.handleHisClose.bind(this);
+    this.showHospitalLis = this.showHospitalLis.bind(this);
     this.setInitConfig = this.setInitConfig.bind(this);
     this.handleEmbedPush = this.handleEmbedPush.bind(this);
+    this.deleteItem = this.deleteItem.bind(this);
+    this.cancel = this.cancel.bind(this);
+    this.close = this.close.bind(this);
+    this.showCheckModal  = this.showCheckModal.bind(this);
+  }
+
+  componentDidMount(){
+    $(document).click((e) => {
+      let showHospitalLis = document.getElementById("showHospitalLis");         // 公共填写单
+      if(!$.contains(showHospitalLis, e.target)){
+        this.setState({
+          showHos:false
+        })
+      }
+    })
   }
 
   showConfigModal(){
@@ -107,10 +133,8 @@ class Banner extends Component {
     this.setState({
       emergencyBox:false,
     });
-    dragBox('previewWrapper','previewStatic','del')    
+    dragBox('previewWrapper','previewStatic','del')
   }
-
-
   // 处理点击的默认推送
   handleEmbedPush(){
     store.dispatch(embedPush({
@@ -118,17 +142,57 @@ class Banner extends Component {
       mode: 1
     }))
   }
-
+  showHospitalLis(){
+    let tmpshow = this.state.showHos
+    this.setState({
+      showHos:!tmpshow
+    })
+  }
+  showCheckModal(id,name){
+    this.setState({
+      hosIdTmp:id,
+      hosNameTmp:name,
+      showM:true,
+    })
+  }
+  deleteItem() {
+      const {changeHospital,clearAll} = this.props
+      this.setState({
+          showM: false,
+          hosName:this.state.hosNameTmp,
+          hosId:this.state.hosIdTmp
+      })
+      changeHospital({
+        hosName:this.state.hosNameTmp,
+        hosId:this.state.hosIdTmp
+      })
+      clearAll()
+      store.dispatch(embedPush({
+        action: "patientia",
+        mode: 1
+      }))
+      Notify.success('切换成功')
+  }
+  cancel() {
+      this.setState({
+        showM: false
+      })
+  }
+  close() {
+      this.setState({
+        showM: false
+      })
+  }
   render() {
-    const {visible,pre,ifShow,deptName, closeConfigModal,hasMain,hasCurrent,hasOther,preShow,show} = this.props;
-    const {emergencyBox} = this.state;
-    const {showConfigModal, changeType, confirmType} = this;
+    const {visible,pre,ifShow,deptName, closeConfigModal,hasMain,hasCurrent,hasOther,preShow,show,hospitalMsg,curHos} = this.props;
+    const {emergencyBox,showHos,showM,hosName,hosNameTmp} = this.state;
+    const {showConfigModal, changeType, showHospitalLis,showCheckModal} = this;
     const domNode = document.getElementById('root');
     const disabled = !(hasMain||hasCurrent||hasOther);
     return (
-      <div className={style["logo"]} onClick={this.handleEmbedPush}>
-        <img src={logo} />
-        <span className={style["logo-name"]}>|&nbsp;&nbsp;智能辅助临床决策系统</span>
+      <div className={style["logo"]}>
+        <img src={logo} onClick={this.handleEmbedPush}/>
+        <span className={style["logo-name"]} onClick={this.handleEmbedPush}>|&nbsp;&nbsp;智能辅助临床决策系统</span>
         <div className={style["buon"]}>
           {ifShow==1&&deptName=='急诊科'?<div className={`${style["buon1"]} ${style["buon2"]}`} onClick={this.showHisModal}>
                       <img className={`${style["st"]} ${style["his"]}`} src={emergIcon} />
@@ -138,10 +202,20 @@ class Banner extends Component {
             <img className={style["st"]} src={prec} alt="预问诊"/>
             <i> 预问诊信息</i>
           </div>:null} */}
-          {/*<div className={style["buon1"]} onClick={showConfigModal}>
+          <div className={style["showHospitalLis"]} onClick={showHospitalLis} id="showHospitalLis">
+          <p className={`${style["selectedHos"]}`}><span className={style["ellipsis"]}>{curHos.hosName}</span><img src={bannerDown} /></p>
+            <ul className={`${style["hospitalLis"]}`} style={{"display":showHos?"block":"none"}}>
+              {
+                hospitalMsg&&hospitalMsg.map((item)=>{
+                  return <li className={style['ellipsis']} key={item.id} title={item.name} onClick={()=>showCheckModal(item.id,item.name)}>{item.name}</li>
+                })
+              }
+            </ul>
+          </div>
+          {/* <div className={style["buon1"]} onClick={showConfigModal}>
             <img className={style["st"]} src={setup} />
             <i> 设置</i>
-          </div>*/}
+          </div> */}
         </div>
         {/*{visible&& <ModeChange
           {...this.state}
@@ -159,19 +233,33 @@ class Banner extends Component {
           </React.Fragment>
           , domNode):''}
         {show?<PreInIcss></PreInIcss>:null}
+        <ConfirmModal visible={showM} 
+            okText='确定' 
+            cancelText='取消' 
+            confirm={this.deleteItem}  
+            cancel={this.cancel}
+            close={this.close}
+            okBorderColor={'#3B9ED0'}
+            okColor={'#fff'}
+            oKBg={'#3B9ED0'}
+            >
+            <div className={style['changeHos']}>确定要切换至{hosNameTmp}吗?医院切换后将清空当前页面。</div> 
+        </ConfirmModal>
       </div>
     );
   }
 }
 
 const mapStateToProps = function(state){
-  const {sysConfig} = state.homePage;
+  const {sysConfig,hospitalMsg,curHos} = state.homePage;
   const {message} = state.patInfo;
   return {
     ifShow:sysConfig.general_show,
     deptName:message.selfDeptName,
     show:state.preIcss.preShow,
-    pre:sysConfig.connect_prec
+    pre:sysConfig.connect_prec,
+    curHos:curHos,
+    hospitalMsg:hospitalMsg,
   }
 }
 
@@ -187,6 +275,15 @@ const mapDispatchToProps = function(dispatch){
     },
     preShow(show){
       show?dispatch({type:SET_PREC_SHOW}):getPreMsg()
+    },
+    clearAll(){
+      clearMessages()
+    },
+    changeHospital(obj){
+      dispatch({
+        type: CHANGEHOSPITAL,
+        data:obj
+      })
     }
   }
 }

+ 54 - 3
src/components/Banner/index.less

@@ -5,17 +5,14 @@
     background: linear-gradient(-90deg, #93CEE3 7%,#3B9ED0 98%);
     background-image: url("../../common/images/bar.png");
     height: 50px;
-
     border-bottom: 10px solid #e4e6e7;
     position: fixed;          //页面布局调整
     width: 1200px;
     top: 0;
-    // z-index: 202;
     img{
       vertical-align: middle;
       margin: 0 10px 2px 18px;
     }
-    // span{
     .logo-name{
         display: inline-block;
         line-height: 40px;
@@ -57,6 +54,50 @@
       width: 20px;
       height: 20px;
     }
+    .showHospitalLis {
+      float: right;
+      height: 22px;
+      line-height: 22px;
+      width: 120px;
+      margin-top: 7px;
+      cursor: pointer;
+      .selectedHos {
+        box-shadow: 0px 1px 3px 3px #45A3D2 inset;
+        background-color: #65B5D9;
+        padding-left: 10px;
+        span {
+          width: 90px;
+          top: 3px;
+          position: relative;
+          box-sizing: border-box;
+          display: inline-block;
+          font-size: 12px;
+        }
+        img {
+          position: absolute;
+          right: 10px;
+          top: 11px;
+        }
+      }
+      .hospitalLis {
+        background-color: #fff;
+        color: #1E1E1E;
+        border-radius: 5px;
+        overflow: hidden;
+        box-shadow: 0px 6px 16px 0px #ccc;
+        li {
+          cursor: pointer;
+          height: 30px;
+          line-height: 30px;
+          padding: 0 10px;
+          font-size: 12px;
+          &:hover {
+            background-color: #8DCBE2;
+            color: #fff;
+          }
+        }
+      }
+    }
 }
 .title{
   font-size: 16px;
@@ -66,6 +107,11 @@
     color: red;
   }
 }
+.ellipsis{
+  white-space: nowrap;/*强制在一行显示*/
+  text-overflow:ellipsis;/*设置超出内容显示...*/
+  overflow: hidden;/*一定不能少 超出的内容进行隐藏*/
+}
 .shade {
   .maskZIndex;
   position: fixed;
@@ -77,4 +123,9 @@
   opacity: 0.6;
   filter:alpha(opacity=60);
   -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
+}
+.changeHos {
+  height: 84px;
+  line-height: 20px;
+  padding: 10px 18px;
 }

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

@@ -16,7 +16,7 @@ const PreviewInspect = (props) => {
             // console.log(item, item,'=====');
               return (               
                   <tr className={style.assistTableTrSec}>
-                    <td className={style.assistTableTdFst}>{item.uniqueName}</td>
+                    <td className={style.assistTableTdFst}>{item.detailName}</td>
                     <td className={style.assistTableTdSec}>
                       {/* {getStatusImg(value.type, value.value, 1)}
                       {value.unit} */}
@@ -44,7 +44,7 @@ const PreviewInspect = (props) => {
             return (
               // <table style={style.assistTable}>
                 <tr className={style.assistTableTrSec}>
-                  <td className={style.assistTableTdFst}>{item.uniqueName}</td>  
+                  <td className={style.assistTableTdFst}>{item.name}</td>  
                   <td className={style.assistTableTdSec}></td>
                   <td className={style.assistTableTdTrd}></td>                                             
                   {/* <td className={style.assistTableTdFor}>{item.time == '' ? ('导入时间:' + dateTime) : '检验时间:' + toTime(item.time) */}

+ 2 - 1
src/modules/HomePage/index.jsx

@@ -13,7 +13,7 @@ import {CURRENT_CLEAR,DELETE_CURRENT_SELECTED_TAGS} from '@types/currentIll';
 import {OTHERHIS_CLEAR,DELETE_OTHER_SELECTED_TAGS} from '@types/otherHistory';
 import {CHECKBODY_CLEAR,DELETE_CHECK_SELECTED_TAGS} from '@types/checkBody';
 import style from './index.less';
-import {getInitModules,getChronic,getSystemConfig,getCommonData} from '@store/async-actions/homePage.js';
+import {getInitModules,getChronic,getSystemConfig,getCommonData,getHosData} from '@store/async-actions/homePage.js';
 import {getPreMsg} from '@store/async-actions/patInfo.js';
 import { getUrlArgObject,parseNameVal,pushAllDataList } from "@utils/tools";
 import $ from 'jquery';
@@ -167,6 +167,7 @@ const mapDispatchToProps = function (dispatch) {
         },
         getCommon(){
           dispatch(getCommonData())
+          dispatch(getHosData())
         },
       deleteLabels(){   //选中删除标签
         const state = store.getState();

+ 13 - 0
src/store/actions/homePage.js

@@ -146,3 +146,16 @@ export const getStaticData = (state,action)=>{
   return res;
 }
 
+export const setHospitalMsg = (state,action)=>{
+  let res = Object.assign({},state);
+  res.hospitalMsg = action.data;
+  return res;
+}
+
+
+export const changeHospital = (state,action)=>{
+  let res = Object.assign({},state);
+  res.curHos = action.data;
+  return res;
+}
+

+ 15 - 5
src/store/async-actions/historyTemplates.js

@@ -12,12 +12,15 @@ import Notify from '@commonComp/Notify';
 import store from '@store';
 
 export const initItemList = (item) => {
+    let baseList = store.getState();
+    const { homePage:{curHos}} = baseList
     let params = {
       sex: '',
       name: '',
       current: 1,
       size: 9999,
-      desc : ['gmt_create']
+      desc : ['gmt_create'],
+      hospitalId:curHos.hosId
     }; 
     if (item === 'up') {
       params.desc = ['gmt_create'];
@@ -60,12 +63,15 @@ export function setInitHistory(data){
 
 
 export const asyncUpdateByIdUsNames = (editId, templateName) => {
+  let baseList = store.getState();
+  const { homePage:{curHos}} = baseList
   return (dispatch) => {
     return new Promise((resolve, reject)=>{
       let param = {
         id: editId,
         modeName: templateName,
-        doctorId: ''
+        doctorId: '',
+        hospitalId:curHos.hosId
       }
       axios.json('/demo/templateInfo/updateByIdUsNames', param).then(res=>{
         if (res.data.code === '0'){
@@ -79,10 +85,13 @@ export const asyncUpdateByIdUsNames = (editId, templateName) => {
 }
 
 export const asyncCancelTemplateInfos = (delId) => {
+  let baseList = store.getState();
+  const { homePage:{curHos}} = baseList
   return (dispatch) => {
     return new Promise((resolve, reject) => {
       let param = {
-        ids: delId
+        ids: delId,
+        hospitalId:curHos.hosId
       }
       axios.json('/demo/templateInfo/cancelTemplateInfos', param).then(res => {
         if (res.data.code === '0') {
@@ -99,8 +108,9 @@ export const asyncCancelTemplateInfos = (delId) => {
 // 获取医院信息
 export const getHospitalInfo = () =>{
   return (dispatch) =>{
-    let hospitalId = getUrlArgObject('hospitalId');
-    axios.json('/tran/hospitalInfo/getHospitalInfoById', { id: hospitalId }).then(res => {
+    let baseList = store.getState();
+    const { homePage:{curHos}} = baseList
+    axios.json('/tran/hospitalInfo/getHospitalInfoById', { id: curHos.hosId }).then(res => {
       if (res.data.code === '0') {
         dispatch({
           type: HISTORY_GETHOSPITALINFO,

+ 17 - 1
src/store/async-actions/homePage.js

@@ -1,5 +1,5 @@
 import {post,json} from '@utils/ajax.js';
-import {SETINITDATA,MODI_LOADING,GET_ASSIST_LIST,GET_INSPECT_LIST,SETALLMODULES,GETSTATICDATA} from '@store/types/homePage.js';
+import {SETINITDATA,MODI_LOADING,GET_ASSIST_LIST,GET_INSPECT_LIST,SETALLMODULES,GETSTATICDATA,HOSPITALMSG} from '@store/types/homePage.js';
 import {SET_CURRENT} from '@store/types/currentIll';
 import {SET_MAINSUIT} from '@store/types/mainSuit';
 import config from '@config/index.js';
@@ -14,6 +14,7 @@ const api = {
   getQuestionUsual:'/questionUsual/getQuestionUsual', //检验常用标签
   getSystemConfig:'/sysSet/getSysSetInfoDatas',     //获取系统配置
   getStaticData:'/sys/dictionaryInfo/getList',     //获取字典信息
+  getAllEnableHospitalInfo:'/tran/hospitalInfo/getAllEnableHospitalInfo',     //获取医院列表
 };
 
 //获取系统配置
@@ -176,3 +177,18 @@ export const getCommonData = (dispatch) => {
       })
   }
 };
+
+// 医院列表
+export const getHosData = (dispatch) => {
+  return (dispatch) => {
+      json(api.getAllEnableHospitalInfo,{}).then((res)=>{
+          const data = res.data;
+          if(data.code == '0'){
+            dispatch({
+              type:HOSPITALMSG,
+              data:data.data
+            })
+          }
+      })
+  }
+};

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

@@ -33,6 +33,7 @@ export const getSearchList = (val) => {
                     for (var key in arr) {
                         let obj = {}
                         obj['uniqueName'] = arr[key];
+                        obj['detailName'] = arr[key];
                         obj['value'] = '';
                         obj['otherValue']='';
                         obj['name'] = arr[key];

+ 4 - 1
src/store/async-actions/newAdvice.js

@@ -13,8 +13,9 @@ export const getSearchList = (val) => {
     let type = baseList.newAdvice.shType;
     return (dispatch) => {
         axios.json('/demo/retrieval/index',{
-            "age": formatFormParmas('patientAge',baseList.patInfo.patInfoData),
             "inputStr": val,
+            "hospitalId": 2,
+            "age": formatFormParmas('patientAge',baseList.patInfo.patInfoData),
             "sex": formatFormParmas('patientSex',baseList.patInfo.patInfoData),
             "type": type
         })
@@ -28,9 +29,11 @@ export const getSearchList = (val) => {
                     if(type==8){
                         obj['uniqueName'] = arr[i];
                         obj['name'] = arr[i];
+                        obj['detailName'] = arr[i];
                         obj['flg'] = type;
                     }else{
                         obj['uniqueName'] = arr[i].name;
+                        obj['detailName'] = arr[i].name;
                         obj['name'] = arr[i].name;
                         obj['flg'] = type;
                     }

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

@@ -71,7 +71,7 @@ function formatFormParmas(val,arr){
 // 保存病历_lcq_new_重写
 export const saveMedicalData = () =>{
     let baseList = store.getState();
-    const { patInfo: { patInfoData } } = baseList
+    const { patInfo: { patInfoData },homePage:{curHos}} = baseList
     let inquiryDate = timestampToTime(new Date().getTime())  // 获取当前时间  
     let modeName = baseList.patInfo.medicalName   //病历名称
     let jsonData = getAllDataList(baseList);
@@ -168,6 +168,7 @@ export const saveMedicalData = () =>{
         "patName": formatFormParmas('patientName', patInfoData),
         "preview": JSON.stringify(preview),  // 左侧病历预览信息
         "sex": formatFormParmas('patientSex', patInfoData),
+        "hospitalId":curHos.hosId
     }
     return new Promise((resolve,reject) =>{
       json('/demo/templateInfo/saveTemplateInfo', params).then(res => {

+ 15 - 3
src/store/reducers/homePage.js

@@ -1,7 +1,7 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,SETPREDATA,
   HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,
-  SETALLMODULES,SETSYSTEMCONFIG,SETPRE,RESET_SELECT_TAG,SET_SELECTED_AREA,SETADMIN,SET_CURRENT_MODULE,TOGGLE_PUSH_DATA,GETSTATICDATA} from '../types/homePage.js';
-import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList,setSelectArea,resetSelectArea, setCurrentModule,getStaticData} from '../actions/homePage.js';
+  SETALLMODULES,SETSYSTEMCONFIG,SETPRE,RESET_SELECT_TAG,SET_SELECTED_AREA,SETADMIN,SET_CURRENT_MODULE,TOGGLE_PUSH_DATA,GETSTATICDATA,CHANGEHOSPITAL,HOSPITALMSG} from '../types/homePage.js';
+import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList,setSelectArea,resetSelectArea, changeHospital,getStaticData,setHospitalMsg} from '../actions/homePage.js';
 import {getMRAnalyse} from '@store/async-actions/pushMessage';
 
 const initState = {
@@ -33,7 +33,15 @@ const initState = {
     "3": "其他史",
     "4": "查体"
   },
-  staticData:{}
+  staticData:{},
+  hospitalMsg:[{
+    hospitalId:-1
+  }],
+  curHos:{
+    hosId:-1,
+    hosName:'杭州朗通信息技术有限公司'
+  }
+
 };
 
 export default function (state=initState,action) {
@@ -46,6 +54,10 @@ export default function (state=initState,action) {
       res.totalHide = false;
       res.commSymHide = false;
       return res;
+    case HOSPITALMSG:
+      return setHospitalMsg(state,action);
+    case CHANGEHOSPITAL:
+      return changeHospital(state,action);
     case SETDROPSHOW:
       return showDrop(state,action);
     case HIDEDROP:

+ 2 - 0
src/store/types/homePage.js

@@ -24,3 +24,5 @@ export const SET_SELECTED_AREA='SET_SELECTED_AREA';
 export const SET_CURRENT_MODULE = 'SET_CURRENT_MODULE'
 export const TOGGLE_PUSH_DATA = 'TOGGLE_PUSH_DATA' //切换推送框
 export const GETSTATICDATA = 'GETSTATICDATA' //字典信息
+export const HOSPITALMSG = 'HOSPITALMSG' //医院列表
+export const CHANGEHOSPITAL = 'CHANGEHOSPITAL' //更改医院

+ 80 - 16
src/utils/tools.js

@@ -905,9 +905,8 @@ function formatFormParmas(val,arr){
 //获取病例输入的内容
 function getEMRParams(){
   const state = store.getState();
-  const {id} =  state.historyTemplates && state.historyTemplates.HospitalInfo 
-  const {message} = state.patInfo;
-  const { patInfoData } = state.patInfo;
+  const { curHos } = state.homePage;
+  const {message,patInfoData} = state.patInfo;
   const {
     mainSuit,
     currentIll,
@@ -929,28 +928,94 @@ function getEMRParams(){
   }
   if(diagnosticList.diagnosticList.length>0)diagnosticList.diseaseName.uniqueName = ''
   let templis = (inspect.labelListSmall).concat(inspect.labelListBig)
-  templis = templis.filter((item)=>!item.check)
+  templis = templis.filter((item)=>{
+    if(!item.check){
+      if(curHos.hosId != -1){
+        item.uniqueName = ''
+      }
+      return item
+    }
+  })
+  let tempLisOrder = inspect.totalOrder
+  tempLisOrder = tempLisOrder.filter((item)=>{
+    if(curHos.hosId != -1){
+      item.uniqueName = ''
+    }
+    return item
+  })
   let temppacs = assistCheck.assistLabel
-  temppacs = temppacs.filter((item)=>!item.check)
+  temppacs = temppacs.filter((item)=>{
+    if(!item.check){
+      if(curHos.hosId != -1){
+        item.uniqueName = ''
+      }
+      return item
+    }
+  })
+  let tempPacOrder = assistCheck.totalOrder
+  tempPacOrder = tempPacOrder.filter((item)=>{
+    if(curHos.hosId != -1){
+      item.uniqueName = ''
+    }
+    return item
+  })
   let tempdrug = newAdvice.labelListBig
   tempdrug = tempdrug.filter((item)=>{
     if(!item.check){
-      item.name = (item.uniqueName+(item.form||''))
+      if(curHos.hosId != -1){
+        item.uniqueName = ''
+      }
+      item.name = (item.name+(item.form||''))
       return item
     }
   })
   let tempdrugorder = newAdvice.drugOrder
   tempdrugorder = tempdrugorder.filter((item)=>{
-      item.name = (item.uniqueName+(item.form||''))
+      if(curHos.hosId != -1){
+        item.uniqueName = ''
+      }
+      item.name = (item.name+(item.form||''))
       return item
   })
   let tempoperation = newAdvice.labelListSmall
-  tempoperation = tempoperation.filter((item)=>!item.check)
+  tempoperation = tempoperation.filter((item)=>{
+    if(!item.check){
+      if(curHos.hosId != -1){
+        item.uniqueName = ''
+      }
+      return item
+    }
+  })
+  let tempOperationOrder = newAdvice.operationOrder
+  tempOperationOrder = tempOperationOrder.filter((item)=>{
+    if(curHos.hosId != -1){
+      item.uniqueName = ''
+    }
+    return item
+  })
+  let tempOperationName = newAdvice.operationName
+  if(curHos.hosId != -1&&tempOperationName.name){
+    tempOperationName.uniqueName = ''
+  }
   let tempblood = newAdvice.labelListBlood||[]
-  tempblood = tempblood.filter((item)=>!item.check)
+  tempblood = tempblood.filter((item)=>{
+    if(!item.check){
+      if(curHos.hosId != -1){
+        item.uniqueName = ''
+      }
+      return item
+    }
+  })  
+  let tempTransfusionOrder = newAdvice.transfusionOrder||[]
+  tempTransfusionOrder = tempTransfusionOrder.filter((item)=>{
+    if(curHos.hosId != -1){
+      item.uniqueName = ''
+    }
+    return item
+  })
   let sex = formatFormParmas('patientSex', patInfoData);
   const obj = {
-    "hospitalId": id || '',
+    "hospitalId": curHos.hosId || '',
     "age": formatFormParmas('patientAge', patInfoData),
     "sex": sex,
     "deptName": formatFormParmas('hospitalDeptName', patInfoData),
@@ -965,7 +1030,7 @@ function getEMRParams(){
     "marital": marriageHistory.saveText[0]||'',  //婚育史
     "menstrual": menstruationHistory.saveText[0]||'',  //月经史
     "diseaseName":diagnosticList.diseaseName,
-    "operationName":newAdvice.operationName,
+    "operationName":tempOperationName,
     "infectious": "",
     "operation": tempoperation,
     "allergy": "",
@@ -978,17 +1043,16 @@ function getEMRParams(){
     "lis": templis,
     "pacs": temppacs||[],
     "diag": diag,
-    "lisOrder": inspect.totalOrder,
-    "pacsOrder": assistCheck.totalOrder,
+    "lisOrder": tempLisOrder,
+    "pacsOrder": tempPacOrder,
     "diagOrder": [],
     "drugOrder": tempdrugorder,
-    "operationOrder": newAdvice.operationOrder,
+    "operationOrder": tempOperationOrder,
     "otherOrder": [],
     "patientId": message.patientId,
     "drug": tempdrug,
-    "hospitalId": id || '',
     'transfusion':tempblood,//输血
-    'transfusionOrder':newAdvice.transfusionOrder
+    'transfusionOrder':tempTransfusionOrder
   }
   if(sex !== 2){
     // 不是女性时,去除月经史