Forráskód Böngészése

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

zhouna 6 éve
szülő
commit
950a1779ae

+ 1 - 0
src/components/AddAssistCheck/index.less

@@ -37,6 +37,7 @@
         padding: 10px;
         box-sizing: border-box;
         position: relative;
+        clear: both;
         .pointerFinger {
             width: 222px;
             position: absolute;

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

@@ -93,6 +93,7 @@ class Advice extends Component{
             {/* {advice.commontreatment && <div className={style['treat-input']}  onInput={this.handleComTreatInput}  contentEditable={true} style = {{outline: 'none'}}></div>} */}
             {<Textarea value={advice.commontreatment} isRead={isRead} handleChangeAssistValue={this.handleComTreatInput} ></Textarea>}
         </div>}
+        {console.log('followUp',followUp)}
         {!isFirstMainDiag && <FollowUp  noTitle="true"   setFollowUp={setFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
         {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={style['scheme']}>
           {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}

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

@@ -31,6 +31,7 @@ class Treat extends Component {
     
     hideTreat() {
         const { hideTreat,clearTreat, hideDrugInfo } = this.props;
+        
         clearTreat && clearTreat();
         hideTreat && hideTreat();
         hideDrugInfo && hideDrugInfo();

+ 2 - 1
src/containers/AdviceContainer.js

@@ -5,12 +5,13 @@ import { SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE
 import { SET_FOLLOW_UP } from '@store/types/treat.js';
 
 function mapStateToProps(state) {
+    console.log('state', state)
     return ({
         pushMessage: state.pushMessage,
         isRead:state.homePage.isRead,
         adviceInput: state.pushMessage.advice.adviceInput,
         isFirstMainDiag:  state.treat.isFirstMainDiag,
-        followUp: state.treat.followUp,
+        followUp: state.pushMessage.advice.followUp,
         hasFollowUp: state.treat.hasFollowUp
     })
 }

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

@@ -683,7 +683,6 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   if(action.symptomFeature !== undefined){//清除分词数据
     res.symptomFeature.featureData = action.symptomFeature;
   }
-  //console.log(res,action);
   return res;
 }
 

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

@@ -134,7 +134,9 @@ export const addScheme = (state, action) => {
      
   }
 	res.AdviceStr = getAdviceStr(res.advice)
-	res.drugList = getDrugList(res.advice.scheme)
+	if (res.advice.scheme) {
+		res.advice.drugList = getDrugList(res.advice.scheme)
+	}
   return res;
 }
 
@@ -269,4 +271,19 @@ export const setAdviceInput = (state, action) => {
 	res.advice.adviceInput = action.adviceInput;
 	res.AdviceStr = getAdviceStr(res.advice)
 	return res;
+}
+
+//保存回访时间
+export const saveFollowUp = (state, action) => {
+	const res = JSON.parse(JSON.stringify(state));
+	res.advice.followUp = action.followUp;
+	return res;
+}
+
+
+//删除回访时间
+export const delFollowUp = (state, action) => {
+	const res = JSON.parse(JSON.stringify(state));
+	res.advice.follow = '';
+	return res;
 }

+ 1 - 1
src/store/async-actions/historyTemplates.js

@@ -10,7 +10,7 @@ export const initItemList = (item) => {
     const param = {
       "hospitalId": state.hospitalId,
       "patientId": state.patientId,
-      "disName":item?item.name : 'bbb',
+      "disName":item?item.name : 'dis',
       "disType":item?1:0
     }
     return (dispatch) => {

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

@@ -68,6 +68,7 @@ export const saveMessage = (bool) => {
         "sign": whichSign, //类型0结构化 1文本
         "diagnose": (jsonData.diag.length > 0 ? jsonData.diag[0].name : ''), //诊断
         "inquiryCode": state.recordId, //就诊序列号
+        "drugList":baseList.pushMessage.advice.drugList || [],//药品列表
         // "regVisitedState": 0,      //就诊状态
         // "type": 0,
     }).then((res) => {

+ 6 - 0
src/store/async-actions/treat.js

@@ -5,6 +5,7 @@ import { SET_COMMONTREATMENT } from '@store/types/pushMessage'
 import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST, IS_FIRST_MAIN_DIAG, SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS, SET_FOLLOW_UP, DEL_FOLLOW_UP, SET_ALL_FOLLOW_UP } from '@store/types/treat';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
+import { SAVE_FOLLOW_UP } from "@store/types/pushMessage";
 
 const api={
     push:'/push/pushInner',
@@ -372,6 +373,11 @@ export const commonTreatAddToAdvice = () => {
                 type: SET_COMMONTREATMENT,
                 commontreatment: state.treat.treatItem.treat.commonTreatment.text
             })
+            console.log('state.treat.followUp', state.treat.followUp)
+            dispatch({
+                type: SAVE_FOLLOW_UP,
+                followUp: state.treat.followUp
+            })
         } else {
             return
         }

+ 12 - 2
src/store/reducers/pushMessage.js

@@ -1,5 +1,11 @@
-import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG, SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,HIDE_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,SAVE_TABLE_RESULT} from '../types/pushMessage';
-import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails, setCommontreatment, isFirstMainDiag, setAdviceInput } from '../actions/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, 
+        SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,
+        CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG, 
+        SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,HIDE_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,
+        SAVE_TABLE_RESULT, SAVE_FOLLOW_UP, DEL_FOLLOW_UP} from '../types/pushMessage';
+import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, 
+        setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails, 
+        setCommontreatment, isFirstMainDiag, setAdviceInput, saveFollowUp, delFollowUp } from '../actions/pushMessage';
 
 const initState = {
   vigilant: [],
@@ -57,6 +63,10 @@ export default function(state = initState, action) {
       return isFirstMainDiag(state, action);
     case SET_ADVICE_INPUT:
       return setAdviceInput(state, action);
+    case SAVE_FOLLOW_UP: 
+      return saveFollowUp(state, action);
+    case DEL_FOLLOW_UP: 
+      return delFollowUp(state, action);
     case SET_CHRONIC_TABLELIST://量表列表数据
       res.tableList = action.data;
       return res;

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

@@ -21,5 +21,7 @@ export const HIDE_TABLE_LIST = 'HIDE_TABLE_LIST' ; //隐藏量表列表
 export const SET_CHRONIC_PUSHS ='SET_CHRONIC_PUSHS'; //右侧慢病量表评估推送模块数据
 export const SET_SCALE_INFO = 'SET_SCALE_INFO' ; //量表明细
 export const SAVE_TABLE_RESULT = 'SAVE_TABLE_RESULT' ; //量表计算结果
+export const SAVE_FOLLOW_UP = 'SAVE_FOLLOW_UP'  //保存回访时间
+export const DEL_FOLLOW_UP = 'DEL_FOLLOW_UP'  //保存回访时间
 
 

+ 27 - 26
src/utils/tools.js

@@ -764,36 +764,48 @@ function getPageLength(event) {     //兼容ie8获取页面距离左和上的距
   return page;
 }
 function dragBox(domWrap,domDrag){
+  console.log(domWrap,domDrag,'拖拽')
   let drag = document.getElementById(domDrag);//拖拽区域
   let wrap = document.getElementById(domWrap);//被拖拽的元素
+  let wrapHeight = wrap.offsetHeight;//被拖拽的元素高度
+  let wrapWidth = wrap.offsetWidth;//被拖拽的元素高度
   let width = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;//屏幕宽度
   let height = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;//屏幕高度
   let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
-  windowEventHandler('mousedown',(event)=>{    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
-    let wrap = document.getElementById(domWrap);
+  windowEventHandler('mousedown',function(event){    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
     let page = getPageLength(event);
-    drag = document.getElementById(domDrag);
     mouseX = page.pageX - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
     mouseY = page.pageY - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
     isDrag = true
-    isMove = false
+    // isMove = false
   },drag)
   // windowEventHandler('mousemove',handleMove,document)
-  windowEventHandler('mousemove',(event)=>{      //移动的
+  windowEventHandler('mousemove',handleMove,document)
+  windowEventHandler('mouseup',()=>{
+    // if(isMove){ //有move就设置位置没有移动就不处理
+    //   console.log(dragX)
+    //   wrap.style.left = dragX + 'px'
+    //   wrap.style.top = dragY + 'px'
+    // }
+    isDrag = false
+    return false
+  },drag)
+
+  function handleMove(event){      //移动的
     let dragDes = document.getElementById('treatDescBox');//展開区域
     let page = getPageLength(event);
     let maxDragX = 0,dragDesWidth = 0;
-    let maxDragY = height - wrap.offsetHeight;//最大可拖拽y方向距离
-
+    let maxDragY = height - wrapHeight;//最大可拖拽y方向距离
+  
     if(domDrag == 'dragTreatTitle'){//最大可推拽x方向距离
       if(dragDes != null){
         dragDesWidth = dragDes.offsetWidth
       }else{
         dragDesWidth = 0
       }
-      maxDragX = width - wrap.offsetWidth - dragDesWidth
+      maxDragX = width - wrapWidth - dragDesWidth
     }else{
-      maxDragX = width - wrap.offsetWidth
+      maxDragX = width - wrapWidth
     }
     if(isDrag){
       dragX = page.pageX - mouseX          //鼠标可拖拽到左边的最大距离
@@ -805,36 +817,25 @@ function dragBox(domWrap,domDrag){
         dragY = 0
       }
       if(domDrag == 'dragTreatTitle'){
-        if(width-dragX-dragDesWidth < wrap.offsetWidth){    //不能超出右边界
+        if(width-dragX-dragDesWidth < wrapWidth){    //不能超出右边界
           dragX = maxDragX
         }
       }else{
-        if(width-dragX < wrap.offsetWidth){    //不能超出右边界
+        if(width-dragX < wrapWidth){    //不能超出右边界
           dragX = maxDragX
         }
       }
-      if(height-dragY < wrap.offsetHeight){     //不能超出下边界
+      if(height-dragY < wrapHeight){     //不能超出下边界
         dragY = maxDragY
       }
-      isMove = true
+      // isMove = true
       wrap.style.left = dragX + 'px'
       wrap.style.marginLeft = 0 + 'px'
       wrap.style.top = dragY + 'px'
     }
-  },document)
-  windowEventHandler('mouseup',()=>{
-    // if(isMove){ //有move就设置位置没有移动就不处理
-      // console.log(dragX)
-      // wrap.style.left = dragX + 'px'
-      // wrap.style.top = dragY + 'px'
-    // }
-    isDrag = false
-    return false
-  },document)
+  }
 }
-// function handleMove(event,mouseX){
-//     console.log(event)
-// }
+
 function getCurrentDate(){
   let myDate = new Date();
   let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)