Browse Source

Merge branch 'dev5.4.1' of http://192.168.2.236:10080/zhouna/newICSS into dev5.4.1

luolei 5 years ago
parent
commit
7032ef79dc

+ 3 - 1
src/components/CheckBody/index.jsx

@@ -7,6 +7,7 @@ import {getPageCoordinate,windowEventHandler,isIE,filterDataArr} from '@utils/to
 import $ from "jquery";
 import showImg from "../../common/images/show.png";
 import hideImg from "../../common/images/close.png";
+import rePushIcon from '../../common/images/possible.png';
 import config from '@config/index';
 
 class CheckBody extends Component{
@@ -110,9 +111,10 @@ class CheckBody extends Component{
     });
   }
   render(){
-    const {searchData,totalHide,data,saveText} = this.props;
+    const {searchData,totalHide,data,saveText,rePush} = this.props;
     const {boxLeft,boxTop} = this.state;
     return <ItemBox title='查体' handleClick={this.handleClick}>
+        <img src={rePushIcon} onClick={rePush}/>
         {this.getLabels()}
         {/*{showMoreBtn?more:''}*/}
         {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}

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

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

+ 9 - 10
src/components/PatInfo/index.jsx

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

+ 3 - 3
src/components/PatInfo/index.less

@@ -13,14 +13,14 @@
   }
   .tdBorderB {
     border-bottom: 1px solid @person-table-color;
-    max-width: 180px;
+    max-width: 110px;
     overflow: hidden;
     white-space: nowrap;
     text-overflow: ellipsis;
   }
   .tdBorderR {
     border-right: 1px solid @person-table-color;
-    max-width: 180px;
+    max-width: 110px;
     overflow: hidden;
     white-space: nowrap;
     text-overflow: ellipsis;
@@ -32,6 +32,6 @@
     font-size: 13px;
     white-space: nowrap;
     text-overflow: ellipsis;
-    max-width: 180px;
+    max-width: 110px;
   }
 }

+ 5 - 2
src/containers/CheckBody.js

@@ -1,8 +1,8 @@
 import {connect} from 'react-redux';
 import CheckBody from '@components/CheckBody';
-import {getModule,getInitData} from '@store/async-actions/fetchModules.js';
+import {getModule,getInitData,pregetCheckbodyData} from '@store/async-actions/fetchModules.js';
 import {HIDE,RESET,SETDROPSHOW,ISREAD,MODI_LOADING} from '@store/types/homePage.js';
-import {SELECTSEARCHDATA} from "@store/types/checkBody";
+import {SELECTSEARCHDATA,REPUSH_CHECK_LABELS} from "@store/types/checkBody";
 import {billing} from '@store/async-actions/pushMessage';
 import {didPushParamChange,filterDataArr} from '@utils/tools.js';
 
@@ -56,6 +56,9 @@ function mapDispatchToProps(dispatch){
         }
       });
     },
+    rePush(){console.log(222)
+      dispatch(pregetCheckbodyData(false,true));
+    }
   }
 }
 

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

@@ -1,6 +1,5 @@
 import config from '@config/index.js';
-import {formatContinueDots,getLabelIndex,handleLocalDelTag,checkFullfillText} from '@utils/tools.js';
-import {shiftLocalDelTag} from "../../utils/tools";
+import {formatContinueDots,getLabelIndex,handleLocalDelTag,checkFullfillText,shiftLocalDelTag,getValuedLabels,removeRepeat} from '@utils/tools.js';
 
 export function preSetCheckbody(state,action) {
   let res = Object.assign({},state);
@@ -330,4 +329,15 @@ export function recoveTag(state,action) {
   shiftLocalDelTag();
   res.update = Math.random();
   return res;
+}
+
+export function reflashLabels(state,action) {
+  let res = Object.assign({},state);
+  const valuedLabels = getValuedLabels(res.data);
+  const newLabels = removeRepeat(valuedLabels,action.data);
+  const addTextsArr = checkFullfillText(newLabels);
+  res.data = addTextsArr.newArr;
+  res.saveText = addTextsArr.saveText;
+  res.update = Math.random();
+  return res;
 }

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

@@ -10,7 +10,7 @@ import config from "@config/index";
 import {CURRENT_CHRONIC} from '@store/types/currentIll';
 import {MODI_LOADING} from '@store/types/homePage';
 import {GET_ALL_HIS,FILTER_ALL_HIS} from '@store/types/emergencyHis';
-import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
+import {SET_IMPORT_CHECKBODY_LABEL,REPUSH_CHECK_LABELS} from "../types/checkBody";
 import {getBigPush} from '@utils/utils';
 
 const api={
@@ -135,7 +135,7 @@ export const getOtherHisRecord = ()=>{
 };
 
 //预取查体模板数据-现病史触发推送时获取
-export function pregetCheckbodyData(flag){     //flag=true获取到数据后立即显示
+export function pregetCheckbodyData(flag,addValued){     //flag=true获取到数据后立即显示,addValued=true在已选的标签后叠加
   return (dispatch)=>{
     if(flag){
       dispatch({type:MODI_LOADING,flag:true});
@@ -155,6 +155,12 @@ export function pregetCheckbodyData(flag){     //flag=true获取到数据后立
           type:PRESET,
           data:data
         });
+        if(addValued){
+          dispatch({
+            type:REPUSH_CHECK_LABELS,
+            data:data
+          })
+        }
         if(flag){
           const arr = checkFullfillText(data).newArr;
           const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签

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

@@ -1,10 +1,10 @@
 import {RECOVER_TAG_CHECK,SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEARCHDATA,
   SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,
   SETCHECKINPUT,DEL_CHECKBODY,CHECKCONFIRMSELECTED,
-  CHECKBODY_MUL,DEL_CHECKBODY_LABLE,SET_CK_RADIO_INPUT_VAL,SET_IMPORT_CHECKBODY_LABEL,PRESET} from '../types/checkBody.js';
+  CHECKBODY_MUL,DEL_CHECKBODY_LABLE,SET_CK_RADIO_INPUT_VAL,SET_IMPORT_CHECKBODY_LABEL,PRESET,REPUSH_CHECK_LABELS} from '../types/checkBody.js';
 import {recoveTag,set,setCheckBoxValue,
   setSearchData,insertLabelData,changeLabelVal,clearCheckBody,backspaceText
-  ,confirm,multipleComfirn,delSingleLable,setImportCheckbodyLabel,preSetCheckbody} from '../actions/checkBody.js';
+  ,confirm,multipleComfirn,delSingleLable,setImportCheckbodyLabel,preSetCheckbody,reflashLabels} from '../actions/checkBody.js';
 import {setRadioInputValue,setRadioValue,setNumberValue,setCheckText,addLabelItem,setInputLabel} from '@utils/utils';
 import config from '@config/index.js';
 
@@ -67,6 +67,8 @@ export default function(state=initState,action){
       return setImportCheckbodyLabel(state,action);
     case RECOVER_TAG_CHECK:
       return recoveTag(state,action);
+    case REPUSH_CHECK_LABELS:
+      return reflashLabels(state,action);
     default:
       return res;
   }

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

@@ -19,4 +19,5 @@ export const DEL_CHECKBODY_LABLE = 'DEL_CHECKBODY_LABLE';
 export const SET_CK_RADIO_INPUT_VAL = 'SET_CK_RADIO_INPUT_VAL';
 export const SET_IMPORT_CHECKBODY_LABEL='SET_IMPORT_CHECKBODY_LABEL';
 export const PRESET = 'PRESET_CHECKBODY_DATA';
-export const RECOVER_TAG_CHECK = 'RECOVER_TAG_CHECK';     //恢复已删除标签
+export const RECOVER_TAG_CHECK = 'RECOVER_TAG_CHECK';     //恢复已删除标签
+export const REPUSH_CHECK_LABELS = 'REPUSH_CHECK_LABELS';   //重新获取查体

+ 25 - 1
src/utils/tools.js

@@ -1443,6 +1443,27 @@ const setFontColorSize = (flg,pacs) => {
     return classStr;
   // }, 0);
 }
+
+//获取查体体征和已选中的标签
+function getValuedLabels(arr){
+  const newArr = arr.filter((it)=>{
+    return it.value||+it.specFlag===4;
+  });
+  return newArr;
+}
+
+//对象数组去重
+function removeRepeat(arr1,arr2){     //arr1被完全保留的数组
+  const arr = arr2.reduce(function(newArr,item){
+    const it = newArr.findIndex((i)=>i.id===item.id);
+    if(it===-1){
+      newArr.push(item);
+    }
+    return newArr;
+  },[...arr1]);
+  return arr;
+}
+
 module.exports = {
     getIds,
     getWindowInnerWidth,
@@ -1494,5 +1515,8 @@ module.exports = {
     isAllPartClear,
     getDomUpDown,
     setFontColorSize,
-    moveEnd
+    moveEnd,
+    setFontColorSize,
+    getValuedLabels,
+    removeRepeat
 };