Просмотр исходного кода

Merge branch 'pre-icss' into dev/new1

luolei 5 лет назад
Родитель
Сommit
29136f9e20

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

@@ -60,7 +60,7 @@ class EditableSpan extends Component{
   }
   onChange(e){
     e.stopPropagation();
-    const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds,handleClear} = this.props;
+    const {handleChange,boxMark,i,handleSearch,noSearch,mainSaveText,mainIds,handleClear} = this.props;
     const {labelVal,searchPre} = this.state;
     const text1 = e.target.innerText || e.target.innerHTML;
     // e.newValue IE浏览器DOMCharacterDataModified监听
@@ -88,7 +88,9 @@ class EditableSpan extends Component{
 
     const that = this;
     handleChange&&handleChange({text1,boxMark,i});
-
+    if(noSearch){
+      return;
+    }
     //延迟搜索
     clearTimeout(this.state.timer);
     const timer = setTimeout(function(){

+ 1 - 1
src/containers/eleType.js

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

+ 15 - 3
src/modules/HomePage/index.jsx

@@ -3,14 +3,16 @@ import { connect } from "react-redux";
 import BannerContainer from '@containers/TypeConfigContainer';
 //  引入组件
 import BodyContainer from "@components/BodyContainer";
+import {ConfirmModal} from '@commonComp';
 
-import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG} from '@store/types/homePage.js';
+import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE} from '@store/types/homePage.js';
 import {CLEAR_SEARCH} from '@types/mainSuit';
 import {CURRENT_CLEAR} from '@types/currentIll';
 import {OTHERHIS_CLEAR} from '@types/otherHistory';
 import {CHECKBODY_CLEAR} from '@types/checkBody';
 import style from './index.less';
 import {getInitModules,getChronic,getSystemConfig} from '@store/async-actions/homePage.js';
+import {getPreMsg} from '@store/async-actions/patInfo.js';
 import { getUrlArgObject,parseNameVal } from "@utils/tools";
 import $ from 'jquery';
 import loading from '@common/images/loading.gif';
@@ -65,12 +67,15 @@ class HomePage extends Component {
     }
   }
     render() {
-        const {flag} = this.props;
+        const {flag,showPre,noReferRecord,referRecord} = this.props;
         return <div className={style['home-page']}
                     onClick={this.hidePops} onmousedown={this.setElem.bind(this)}>
             <BannerContainer />
             {/* <InfoTitle /> */}
             <BodyContainer></BodyContainer>
+          <ConfirmModal visible={showPre} okText='是' cancelText='否' confirm={referRecord}  cancel={noReferRecord} close={noReferRecord}>
+              <div className={style['confirm-info']}>是否引用预问诊信息?</div>
+          </ConfirmModal>
           {flag?<div className={style['mask']}>
                 <img src={loading} className={style['load']}/>
             </div>:""}
@@ -80,11 +85,18 @@ class HomePage extends Component {
 
 const mapStateToProps = function (state) {
   return {
-    flag:state.homePage.loadingFlag
+    flag:state.homePage.loadingFlag,
+    showPre:state.homePage.showPre
   }
 };
 const mapDispatchToProps = function (dispatch) {
     return {
+      referRecord(){
+        getPreMsg(dispatch)
+      },
+      noReferRecord(){
+        dispatch({type:SETPRE,show:false});
+      },
       handleClear(){//清空搜索结果
            dispatch({type:CLEAR_SEARCH});
            dispatch({type:CURRENT_CLEAR});

+ 6 - 0
src/modules/HomePage/index.less

@@ -18,4 +18,10 @@
     left:50%;
     margin-top: -20px;
     margin-left: -20px;
+}
+.confirm-info {
+    text-align: center;
+    font-size: 16px;
+    padding-top: 10px;
+    padding-bottom: 50px;
 }

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

@@ -10,13 +10,22 @@ export function preSetCheckbody(state,action) {
 //设置查体数据
 export function set(state,action){
   let res = Object.assign({},state);
-  const {data} = action;
+  const {data,isText,isEmpty} = action;
+  if(isText){        //查体只显示文本时(引用预问诊)
+    const label = Object.assign(JSON.parse(config.textLabel),{value:data,noSearch:true});
+    res.data = [label];
+    res.saveText = [data];
+    res.showAll = true;
+    res.update = Math.random();
+    res.isEmpty = isEmpty;
+    return res;
+  }
   const obj = checkFullfillText(data);
   res.data = obj.newArr;
   res.saveText = obj.saveText;//存逗号
   res.showAll = obj.checkHiddenDefault;
   res.update = Math.random();
-  res.isEmpty = action.isEmpty;
+  res.isEmpty = isEmpty;
   return res;
 }
 //多选标签选中确定处理

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

@@ -5,16 +5,42 @@ import {getInfos} from '@store/actions/getInfoByUuid';
 import {getUrlArgObject,pushAllDataList} from '@utils/tools';
 import {getInitModules,getCommonList} from '@store/async-actions/homePage.js';
 import store from '@store'
-import {ISREAD,MODI_LOADING} from "../types/homePage";
+import {ISREAD,MODI_LOADING,SETPRE} from "../types/homePage";
 import { initItemList } from '@store/async-actions/tabTemplate';
 import config from '@config/index';
 
 const api = {
     getPatInfo: '/patientInfo/getTopPatientInfo',
     getPatBaseInfo: '/patientInfo/getPatientInfo',
-    getHospitalInfo:'/hospitalInfo/getHospitalInfo'
+    getHospitalInfo:'/hospitalInfo/getHospitalInfo',
+    getPreMsg:'/api/prec/inquiryInfo/getInquiryDetail'
 };
 
+//获取预问诊信息
+export const getPreMsg = (dispatch, getState) => {
+    // let baseList = getState();
+    // let state = baseList.patInfo.message;
+    json(api.getPreMsg, {
+        "hospitalCode": getUrlArgObject('hospitalId'),
+        "inquiryCode":getUrlArgObject("recordId"),
+        "patientCode": getUrlArgObject("patientNo")
+    },true).then((res) => {
+        const data = res.data;
+        if (data.code == 0) {
+            let result = data.data;
+            let preIcss = {
+              chief:result.chiefComplaint?new Array(result.chiefComplaint):[],
+              current:result.xbs?new Array(result.xbs):[],
+              other:result.qts?new Array(result.qts):[],
+              checkBody:result.supplement?result.supplement:''
+            }
+            pushAllDataList(1,'push',preIcss,'preIcss');
+            dispatch({type:SETPRE,show:false});
+        } else {
+            console.log(res)
+        }
+    })
+}
 //获取医院id
 export const initHospitalInfo = (dispatch, getState) => {
     let baseList = getState();
@@ -63,7 +89,12 @@ export const initHistoryDetails = (dispatch) => {
             const data = res.data;
             if (data.code == 0) {
                 const detail = data.data;
-                pushAllDataList(detail.sign,'push',detail,'history');
+                if(detail.dataJson){
+                  pushAllDataList(detail.sign,'push',detail,'history');
+                }else{
+                  let pre = baseList.homePage.sysConfig.connect_prec;
+                  (pre==1)&&dispatch({type:SETPRE,show:true});
+                }
                 dispatch({
                   type:ISREAD
                 });

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

@@ -1,5 +1,5 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES,SETSYSTEMCONFIG} from '../types/homePage.js';
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES,SETSYSTEMCONFIG,SETPRE} from '../types/homePage.js';
 import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList} from '../actions/homePage.js';
 
 const initState = {
@@ -17,6 +17,7 @@ const initState = {
   assistList:[],
   inspectList:[],
   sysConfig:{},
+  showPre:false
 };
 
 export default function (state=initState,action) {
@@ -72,6 +73,9 @@ export default function (state=initState,action) {
       return res;
     case SETSYSTEMCONFIG:
       res.sysConfig = action.data;
+      return res;
+    case SETPRE:
+      res.showPre = action.show;
     default:
       return res;
   }

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

@@ -16,3 +16,4 @@ export const GET_ASSIST_LIST = 'GET_ASSIST_LIST';    //辅检
 export const GET_INSPECT_LIST = 'GET_INSPECT_LIST';    //化验
 export const SETALLMODULES = 'SETALLMODULES';    //储存所有模板数据
 export const SETSYSTEMCONFIG = 'SETSYSTEMCONFIG';   //设置配置数据
+export const SETPRE = 'SETPRE';   //设置预问诊引用弹窗

+ 2 - 2
src/utils/ajax.js

@@ -64,11 +64,11 @@ const post=(url,data)=>{
 };
 
 //json传参
-const json=(url,data)=>{
+const json=(url,data,spec)=>{
   //兼容ie8,axios在ie8下content-type设置不成功且会把headers置为null
   return axios({
     method:'post',
-    url:url.indexOf('http:')!=-1?url:qhost+url,
+    url:url.indexOf('http:')!=-1?url:(spec?host+url:qhost+url),
     data
   });/*new Promise((resolve,reject)=>{
     $.ajax({

+ 1 - 1
src/utils/config.js

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

+ 26 - 2
src/utils/tools.js

@@ -2,7 +2,7 @@ import store from '@store';
 import {CLEAR_MAIN_SUIT} from '@store/types/mainSuit';
 import {CLEAR_CURRENT_ILL} from '@store/types/currentIll';
 import {CLEAROTHERHISTORY} from '@store/types/otherHistory';
-import {CLEARCHECKBODY} from '@store/types/checkBody';
+import {CLEARCHECKBODY,SET} from '@store/types/checkBody';
 import {clearAssistData,addAssistLabel} from '@store/actions/assistCheck';
 import {clearAllLabel,addLabel} from '@store/actions/inspect';
 import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
@@ -230,7 +230,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
 /**
  * 
  * @param {回读数据} reData 
- * @param {回读数据是历史病历'history',还是模板'template'} type 
+ * @param {回读数据是历史病历'history',还是模板'template',预问诊引用'preIcss'} type 
  * @param {什么操作,回读'push'还是清空'clear'} action 
  * @param {引用的话是保存时候的文本类型,编辑的时候是当前页面设置的文本类型} whichSign 
  */
@@ -289,6 +289,30 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         });
         storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
+    }else if(type == 'preIcss'){
+      store.dispatch({type: SET_READ_MODE, readMode: whichSign});
+      store.dispatch({     //主诉文本框
+          type: CLEAR_MAIN_SUIT,
+          data:[],
+          saveText:reData.chief
+      });
+      store.dispatch({
+          type: CLEAR_CURRENT_ILL,
+          data:[],
+          saveText:reData.current
+      });
+      store.dispatch({
+          type: CLEAROTHERHISTORY,
+          data:[],
+          isEmpty:false,
+          saveText:reData.other
+      });
+      store.dispatch({
+          type: SET,
+          isEmpty:false,
+          data:reData.checkBody,
+          isText:true,    //查体只显示文本
+      });
     }else{
         //回读/引用设置回读模式值(主诉-其他史使用)
         store.dispatch({type: SET_READ_MODE, readMode: whichSign});