Kaynağa Gözat

Merge branch 'ChronicMag' into Chronic-ll

Luolei 6 yıl önce
ebeveyn
işleme
c947e05141

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

@@ -151,6 +151,7 @@ class DiagnosticList extends Component {
                 <div className={style['diaglist-wrap']}>
                     {list && (list.length > 0) && list.map((item, index) => {
                         const hasTreat = item.treat && (item.treat.commonTreatment.content || item.treat.surgeryTreatment.content || item.treat.treatment.length>0)
+                        // const hasTreat= true;
                         return (<div draggable={true} className={style['diag-box'] + ' clearfix'}  key={item.id} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
                                     {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}

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

@@ -99,8 +99,8 @@ class MultSpread extends Component{
                             id={it.id}
                             ikey={inx} hideTag={true}></InlineTag>;
         case +it.controlType===7:
-          const min = data.minValue!=null&&data.minValue!=undefined?data.minValue-1:undefined;
-          const max = data.maxValue!=null&&data.maxValue!=undefined?+data.maxValue+1:undefined;
+          const min = it.minValue!=null&&it.minValue!=undefined?it.minValue-1:undefined;
+          const max = it.maxValue!=null&&it.maxValue!=undefined?+it.maxValue+1:undefined;
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
                              placeholder={it.name}

+ 8 - 0
src/components/PushItems/index.jsx

@@ -7,6 +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 DetailsModal from './DetailsModal';
 import PushDiag from "./PushDiag";
 import DiagnosticItem from "@containers/DiagnosticItem";
 import store from "@store";
@@ -143,6 +144,8 @@ class PushItems extends Component {
       assay,
       check,
       tips,
+      showTipsDetails,
+      tipsDetails,
       tmpFlg,
     } = this.props.pushMessage;
     const { tipsDiscalimer,chronicPushItems,wholeIndexs} = this.props;
@@ -458,6 +461,11 @@ class PushItems extends Component {
             </div>
           </div>
         </div>
+        {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data[1]&&tipsDiscalimer.data.data[1].description}}></div>}
+        {showTipsDetails && <DetailsModal  
+            showTipsDetails = {showTipsDetails}
+            hideTips = {this.hideTips}
+            tipsDetails = {tipsDetails}/>}
       </div>
     );
   }

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

@@ -156,7 +156,7 @@ class SpreadDrop extends Component{
 
   }
   setStateInit(){
-    const {nones,noneOn,noneIds,withOn,exists,nowOn,withs,exclusion,excluName} = deepClone(this.props.selecteds||[]);
+    const {nones,noneOn,noneIds,withOn,exists,nowOn,withs,exclusion,excluName,ban} = deepClone(this.props.selecteds||[]);
     this.setState({
       nones:nones||'',
       exists:exists||[],
@@ -167,7 +167,7 @@ class SpreadDrop extends Component{
       withOn:withOn||false,
       nowOn:nowOn||'',
       exclusion:exclusion||'',
-      ban:{},
+      ban:ban||{},
     });
   }
   clearState(){
@@ -224,7 +224,7 @@ class SpreadDrop extends Component{
       return;
     }
     //操作单选项
-    if(!noneOn&&selected){
+    if(selected){
       const tIndex= exists.findIndex((it)=>it.questionId===item.questionId);
       const bIndex= withs.findIndex((it)=>it.questionId===item.questionId);
       if(tIndex!=-1){

+ 4 - 4
src/components/Treat/AdverseReactions/index.jsx

@@ -52,10 +52,10 @@ class AdverseReactions extends Component {
                 <div className={style['last-treat-title']} ><img className={style['last-treat-icon']} src={icon}/>{title}</div>
                 {adversReactionList.map((item, index) => {
                     return (<div key={item.id}><span>{item.tagName}:</span>
-                        {item.details.map((item, index) => {
-                            return <span key={item.name}>
-                                <input type="checkbox" checked={item.checked} id={item.name} onChange={()=>{console.log('change')}}/>
-                                <label for={item.name}> {item.name} </label>
+                        {item.details.map((it, index) => {
+                            return <span key={item.id + it.name}>
+                                <input type="checkbox" checked={item.checked} id={item.id + it.name} onChange={()=>{console.log('change')}}/>
+                                <label for={item.id + it.name}> {it.name} </label>
                             </span>
                         })}
                     </div>)

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

@@ -65,8 +65,8 @@ class Treat extends Component {
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
-                        {/* <LastTreat icon={generalIcon} title='上次用药情况' lastTreat={lastTreat}  showDrugInfo = {showDrugInfo} setDrugInfo={ setDrugInfo }></LastTreat>
-                        <AdverseReactions icon={generalIcon} title='不良反应' adversReactionList = {adversReactionList}></AdverseReactions> */}
+                        <LastTreat icon={generalIcon} title='上次用药情况' lastTreat={lastTreat}  showDrugInfo = {showDrugInfo} setDrugInfo={ setDrugInfo }></LastTreat>
+                        <AdverseReactions icon={generalIcon} title='不良反应' adversReactionList = {adversReactionList}></AdverseReactions>
                         <DrugTreat treatment={ treatment } 
                                 selectDrug={selectDrug} 
                                 setOtherRecommend={ setOtherRecommend } 

+ 18 - 5
src/containers/MainSuit.js

@@ -6,13 +6,14 @@ import {RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION,MODI_LOADING} from '@store/
 import {getCommSymptoms,getCommSymptomPush} from '@store/async-actions/mainSuit.js'
 import {SET_MAIN_SUIT} from '@store/types/fillInfo';
 import {CLEAR_DIAGNOSE} from '@store/types/diagnosticList';
-import {getSearch,getFeature} from '@store/async-actions/fetchModules';
+import {getSearch,getFeature,setOtherHisModule} from '@store/async-actions/fetchModules';
 import {billing} from '@store/async-actions/pushMessage';
-import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
+import {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'
+import {CURRENT_CHRONIC} from '@store/types/currentIll';
+import {SET} from '@types/checkBody';
 
 function mapStateToProps(state) {//console.log(11,state);
   return {
@@ -212,8 +213,20 @@ function mapDispatchToProps(dispatch) {
       getBilling: () => {
         dispatch(billing())
       },
-      autoFillMoudles(){//自动填充模板
-        dispatch({type:CURRENT_CHRONIC})//现病史
+      autoFillMoudles() {//自动填充模板
+        dispatch({type: CURRENT_CHRONIC})//现病史
+        //其他史模板填充-先去历史,无历史用模板
+        dispatch(setOtherHisModule());
+        //查体模板填充
+        dispatch((dispatch, getStore) => {
+          const state = getStore();
+          const initData = state.homePage.initData;
+          dispatch({
+            type: SET,
+            data: [...initData.checkbody],
+            isEmpty:false
+          });
+        });
       }
     }
 }

+ 2 - 24
src/containers/OtherHistory.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import OtherHistory from "../components/OtherHistory";
 import {SETSELECTED,CLEARSELECTED,CONFIRMSELECTED,SELECTOTHERSEARCHDATA,SETDATA,SETTEXTMODEVALUE,OTHEREDICLEAR} from '@types/otherHistory';
 import {HIDE,RESET,ISREAD,SEARCH_DROP_LOCATION} from '@store/types/homePage.js';
-import {getModule} from '@store/async-actions/fetchModules.js';
+import {getModule,setOtherHisModule} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {fullfillText} from '@common/js/func';
 import {didPushParamChange,filterDataArr} from '@utils/tools.js';
@@ -37,29 +37,7 @@ function mapDispatchToProps(dispatch,store){
   return {
     setInitData(){
       //先获取最近记录,没有的话显示模板
-      dispatch((dispatch,getStore)=>{
-        const state = getStore();
-        const initData = state.homePage.initData;
-        const mode = state.typeConfig.typeConfig;
-        const model = JSON.parse(JSON.stringify(initData.otherHisModel));     //查体模板
-        const arr = JSON.parse(JSON.stringify(initData.otherHis||null));        //最近其他史数据
-        const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave||null));    //最近其他史saveText
-        const selects = JSON.parse(JSON.stringify(initData.otherSelecteds||null));  //其他史杂音类选中项
-        const isHis = initData.otherIsHis;     //是否是历史数据
-        const onlyOneText = arr&&arr.length==1&&arr[0].tagType==8&&!(arr[0].name||arr[0].value);    //是否只有一个自由文本标签
-        const listObj = isHis&&(mode==1||(!onlyOneText&&mode==0))?{newArr:arr,saveText:arrSave||[]}:fullfillText(model);
-        dispatch({
-          type:SETDATA,
-          data:listObj.newArr,
-          selecteds:selects,
-          period:initData.period,
-          save:listObj.saveText,
-          isEmpty:false
-        });
-        dispatch({
-          type:ISREAD
-        })
-      });
+      dispatch(setOtherHisModule());
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送

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

@@ -3,9 +3,10 @@ import {SET} from '@types/checkBody.js';
 import {fullfillText,_fullfillText} from '@common/js/func';
 import {SETDATA} from '@store/types/otherHistory';
 import store from '@store';
-import {getEMRParams} from '@utils/tools.js';
+import {getEMRParams,didPushParamChange} from '@utils/tools.js';
 import {Notify} from '@commonComp';
-import {SETOTHERHISTORY} from "../types/homePage";
+import {billing} from '@store/async-actions/pushMessage';
+import {SETOTHERHISTORY,ISREAD} from "../types/homePage";
 import config from "@config/index";
 
 const api={
@@ -169,6 +170,43 @@ export function getInitData(){
   }
 }
 
+//其他史模板填充-先取最近记录,无则用模板
+export function setOtherHisModule(){
+  return (dispatch, getStore) => {
+    const state = getStore();
+    const initData = state.homePage.initData;
+    const mode = state.typeConfig.typeConfig;
+    const model = JSON.parse(JSON.stringify(initData.otherHisModel));     //查体模板
+    const arr = JSON.parse(JSON.stringify(initData.otherHis || null));        //最近其他史数据
+    const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave || null));    //最近其他史saveText
+    const selects = JSON.parse(JSON.stringify(initData.otherSelecteds || null));  //其他史杂音类选中项
+    const isHis = initData.otherIsHis;     //是否是历史数据
+    const onlyOneText = arr && arr.length == 1 && arr[0].tagType == 8 && !(arr[0].name || arr[0].value);    //是否只有一个自由文本标签
+    const listObj = isHis && (mode == 1 || (!onlyOneText && mode == 0)) ? {
+      newArr: arr,
+      saveText: arrSave || []
+    } : fullfillText(model);
+    dispatch({
+      type: SETDATA,
+      data: listObj.newArr,
+      selecteds: selects,
+      period: initData.period,
+      save: listObj.saveText,
+      isEmpty: false
+    });
+    dispatch({
+      type: ISREAD
+    });
+
+    //右侧推送
+    setTimeout(function () {      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
+      if (didPushParamChange()) {     //操作后内容有变化才推送
+        dispatch(billing());
+      }
+    }, 500);
+  }
+}
+
 //保存切换模式
 export function saveMode(mode){
   return (dispatch,getStore)=>{

+ 31 - 7
src/store/reducers/treat.js

@@ -99,7 +99,23 @@ const initState = {
             controlType: 2,
             details: [
                 {
-                    name: "无",
+                    name: "否",
+                    value: 0
+                },
+                {
+                    name: "是",
+                    value: 0
+                },
+                {
+                    name: "轻度",
+                    value: 0
+                },
+                {
+                    name: "中度",
+                    value: 0
+                },
+                {
+                    name: "重度",
                     value: 0
                 },
                 {
@@ -107,7 +123,7 @@ const initState = {
                     value: 0
                 },
                 {
-                    name: "频",
+                    name: "频",
                     value: 0
                 }
             ]
@@ -121,23 +137,31 @@ const initState = {
             controlType: 2,
             details: [
                 {
-                    name: "腹胀 ",
+                    name: "否",
+                    value: 0
+                },
+                {
+                    name: "是",
                     value: 0
                 },
                 {
-                    name: "厌食",
+                    name: "轻度",
                     value: 0
                 },
                 {
-                    name: "嗳气",
+                    name: "中度",
                     value: 0
                 },
                 {
-                    name: "恶心",
+                    name: "重度",
+                    value: 0
+                },
+                {
+                    name: "偶尔",
                     value: 0
                 },
                 {
-                    name: "呕吐",
+                    name: "频繁",
                     value: 0
                 }
             ]