morphone1995 4 vuotta sitten
vanhempi
commit
af64677dae

+ 1 - 1
src/common/components/BlockInp/index.less

@@ -25,7 +25,7 @@
     border-bottom:1px @part-border-color dashed;
     // margin-right: 470px;
     word-break: break-all;
-    font-weight: bold;
+    // font-weight: bold;
     textarea{
       width: 100%;
     }

+ 3 - 1
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -337,6 +337,7 @@ class HistoryCaseContainer extends React.Component {
       };
       const barStyle = { background: '#777', width: '100%' };
         return (
+            <div style={{height: '80%'}}>
             <div className={styles.mainHistory} id="hisWrapMove">
                 <div className={`${styles.closeHis} drag-title`} id="closeHis"></div>
                 <img className={styles.close} src={close} alt="关闭历史病历" onClick={showHistoryBox}/>
@@ -357,7 +358,7 @@ class HistoryCaseContainer extends React.Component {
                   verticalContainerStyle={contStyle}
                   verticalScrollbarStyle={barStyle}
                   contentClassName="content"> */}
-                        <ul id="hislistLeft" style={{ maxHeight: '500px',overflow:'auto' }} >
+                        <ul id="hislistLeft" style={{ maxHeight: '722px',overflow:'auto' }} >
                             {(items && items.length > 0) ? items.map((val,idx)=>{
                                     // return <li key={val.id} className={val.id == activeHistory.id?styles.bgc:''} onClick={(e)=>{this.handleCaseClick(e,idx)}}>
                               return <li key={val.id} onClick={() => { this.handleCaseClick(idx, val) }} onMouseEnter={() => this.handleMouseEnterLi(idx)} onMouseLeave={() => this.handleMouseLeaveLi(idx)}>
@@ -452,6 +453,7 @@ class HistoryCaseContainer extends React.Component {
                     </div>
                 </ConfirmModal>
             </div>
+          </div>
         )
     }
 }

+ 8 - 8
src/components/HistoryCaseContainer/HistoryList/index.less

@@ -67,12 +67,10 @@
                     }
                 .itemLeft{
                     flex: 1;
-
                     display: flex;
                     // align-items: center;
                     justify-content: start;
                     flex-direction: column;
-
                     .historyTop{
                         display: flex;
                         height:34px;
@@ -115,21 +113,23 @@
                         height:20px;
                         line-height: 20px;
                         color: #777;
+                        margin-top: -8px;
                     }    
                     .timeActive {
-                        font-size:10px;
+                        font-size: 10px;
                         height:20px;
                         line-height: 20px;
                         color: #3B9ED0;
+                        margin-top: -8px;
                     }                
                 }
                 .itemRight{
-                    width: 88px;
+                    width: 98px;
                     display: flex;
                     align-items: center;
                     .del {
                         // background-color: red;
-                        margin-left: 8px;
+                        // margin-left: 8px;
                         width: 30px;
                         height:30px;
                         img{
@@ -154,9 +154,9 @@
                 background-color: #fff;
             }
             .quote {
-                width: 50px;
-                height: 22px;
-                line-height: 22px;
+                width: 60px;
+                height: 26px;
+                line-height: 26px;
                 border-radius: 15px;
                 border: 0 none;
                 color: #fff;

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

@@ -47,7 +47,7 @@ class InfoTitle extends Component {
                 Notify.info("暂无历史病历");
             }
         })
-        store.dispatch(getHospitalInfo())
+        // store.dispatch(getHospitalInfo())
     }
     componentWillReceiveProps(next){
         const that = this;

+ 11 - 5
src/components/Operation/index.jsx

@@ -15,7 +15,7 @@ import check_circle from './img/check-circle.png';
 import check_right from './img/check-right.png';
 import {getAllDataList,getAllDataStringList,isAllPartClear,isAllClear,filterDataArr,readyKeepHistory,checkDeptContent} from '@utils/tools';
 import pinyin from '@utils/Convert_Pinyin.js';
-
+import { saveMessage } from  '@store/async-actions/print'
 import {dragBox} from '@utils/drag';
 import store from '@store';
 import $ from 'jquery';
@@ -86,11 +86,17 @@ class Operation extends Component {
     // clearmedicalName && clearmedicalName()
     // diagShowTmp(false)
     // this.setState({ title: '' })
-    this.setState({
-      medicalName: '',
-      saveVisible: false,
+   
+    store.dispatch(saveMessage()).then(res => {
+      this.setState({
+        medicalName: '',
+        saveVisible: false,
+      })
+    }).catch(err => {
+      if (err === '00020001'){
+
+      }
     })
-    this.props.save();
   }
 
   // 取消编辑病历

+ 8 - 17
src/components/PatInfo/index.jsx

@@ -4,7 +4,9 @@ import Select from './Select/index'
 import {
   timesYMDTime
 } from '@utils/tools';
-
+import Notify from '@commonComp/Notify';
+import { getHospitalInfo } from '@store/async-actions/historyTemplates';
+import store from '@store';
 class PatInfo extends Component {
   constructor(props){
     super(props)
@@ -76,7 +78,7 @@ class PatInfo extends Component {
     const { getMessage, initPatInfoData } = this.props;
     getMessage && getMessage()
     initPatInfoData && initPatInfoData(this.state.patientInfo)
-
+    store.dispatch(getHospitalInfo())
     // console.log(timesYMDTime(new Date().getTime()),'电脑时间');
 
   }
@@ -96,19 +98,14 @@ class PatInfo extends Component {
       return item.id === e.target.id
     })      
     // 处理性别
-    if (patientItem.id === 'patientSex'){     
-      if (e.target.value === '1') {
-        patientItem.value = 1
-      } else if (e.target.value === '2'){
-        patientItem.value = 2
-      } else {
-        patientItem.value = 2 // 默认为女
-      }
-    } else if (patientItem.id === 'patientAge'){
+    if (patientItem.id === 'patientAge'){
       patientItem.value = e.target.value.replace(/[^\d]+/, '')
     } else {
       patientItem.value = e.target.value;
     }
+    if (patientItem.id === 'patientAge' && patientItem.value > 200) {
+      Notify.info('年龄不能超过200')
+    }
     this.setState({
       patientInfo: newInfo
     })
@@ -135,12 +132,6 @@ class PatInfo extends Component {
               return (
                 <div className={style["infoItem"]} key={item.id}>
                   <label for={item.label}>{item.title}:</label>
-                  {/* {item.id === 'patientSex' && (
-                    <select id={item.id} value={item.value} onChange={this.handleChange}>
-                      <option value='1'>男</option>
-                      <option value='2'>女</option>
-                    </select>
-                  )} */}
                   {item.id === 'patientSex' && (
                     <Select
                       default={this.state.patientInfo[3]}

+ 4 - 1
src/components/PreviewBody/index.less

@@ -3,12 +3,15 @@
   position: relative;
   overflow: auto;
   height: 100%;
-  top:0px;
+  top: 0px;
   width: 820px;
   box-sizing: border-box;
+  // background-color: red;
+
   .contents {
     position: relative;
     padding-bottom: 26px;
+    // padding-top: 40px;
   }
 }
 table{

+ 10 - 0
src/store/actions/print.js

@@ -49,4 +49,14 @@ export const setMrId=(state,action)=>{
   res.mrInfo.mrId = action.data.data;
   res.mrInfo.mode = action.data.action;
   return res;
+};
+
+export const clearMrId = (state, action) => {
+  const res = Object.assign({}, state);
+  res.mrInfo = {
+    update: 0,
+    mrId: '',
+    mode: '',
+  };
+  return res;
 };

+ 27 - 10
src/store/async-actions/print.js

@@ -47,11 +47,23 @@ export const getConceptDetails = (bool) => {
         console.log(err)
     })
 }
-export const saveMessage=(bool)=>{
-    store.dispatch({type:MODI_LOADING,flag:true});
+export const saveMessage = (bool) =>{
+    return (dispatch) =>{
+       return new Promise((resolve, reject) => {
+         saveMedicalData()
+           .then(res => {
+             resolve();
+           })
+           .catch(err => {
+            //  console.log(err, 'data.code');
+           });
+       });
+    }
+    // store.dispatch({type:MODI_LOADING,flag:true});
     // store.dispatch({ type: CLEARMEDICALNAME});
     // getConceptDetails(bool)  //保存病历 老版本
-    saveMedicalData()
+   
+    
 }
 
 // 获取参数value
@@ -160,16 +172,21 @@ export const saveMedicalData = () =>{
         "preview": JSON.stringify(preview),  // 左侧病历预览信息
         "sex": formatFormParmas('patientSex', patInfoData),
     }
-    json('/demo/templateInfo/saveTemplateInfo', params).then(res=>{
-        let data = res.data
-        if (data.code == 0) {       
-            store.dispatch({ type: CLEARMEDICALNAME });     // 清除病历名称 
-            Notify.success('病历保存成功');
+    return new Promise((resolve,reject) =>{
+      json('/demo/templateInfo/saveTemplateInfo', params).then(res => {
+        let data = res.data;
+        if (data.code == 0) {
+          store.dispatch({ type: CLEARMEDICALNAME }); // 清除病历名称
+          Notify.success('病历保存成功');
+          resolve('ok')
         } else {
-            Notify.info(data.msg);
+          reject(data.code);
+          Notify.info(data.msg);
         }
         store.dispatch({ type: MODI_LOADING, flag: false });
-    })
+      });
+    }) 
+   
 }
 
 

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

@@ -26,6 +26,7 @@ export const embedPush = (obj) => {      //内嵌页面推送时推送
   return (dispatch, getState) =>{
     // console.log(obj,'推送的obj');
     const param = getEMRParams();   // 获取推送参数
+    console.log(param,'=param');
     param.mode=obj?obj.mode:-1;    // 模式  >100 输入中    < 100  获取
     json(api.setMrInfo,param,true).then((res)=>{
       // console.log(res,'======推送的结果');

+ 6 - 4
src/store/reducers/print.js

@@ -1,7 +1,7 @@
 import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,
-  DIAG_SHOW,CLEAR_SEARCH_PARAM,SET_MR_INFO } from "../types/print";
+  DIAG_SHOW,CLEAR_SEARCH_PARAM,SET_MR_INFO ,CLEAR_MR_INFO} from "../types/print";
 import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow,
-  clearSearchParam,setMrId } from "../actions/print";
+  clearSearchParam,setMrId,clearMrId } from "../actions/print";
 
 const initState = {
   visible: false,
@@ -30,9 +30,11 @@ export default function(state = initState, action) {
     case DIAG_SHOW:
       return diagShow(state, action);
     case CLEAR_SEARCH_PARAM:
-      return clearSearchParam(state,action);
+      return clearSearchParam(state, action);
     case SET_MR_INFO:
-      return setMrId(state,action);
+      return setMrId(state, action);
+    case CLEAR_MR_INFO:
+      return clearMrId(state, action);
     default:
       return state;
   }

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

@@ -5,4 +5,5 @@ export const SHOW_PREVIEW = 'SHOW_PREVIEW';
 export const CLOSE_PREVIEW = 'CLOSE_PREVIEW';
 export const DIAG_SHOW = 'DIAG_SHOW';
 export const CLEAR_SEARCH_PARAM='CLEAR_SEARCH_PARAM';
-export const SET_MR_INFO='SET_MR_INFO';
+export const SET_MR_INFO='SET_MR_INFO';
+export const CLEAR_MR_INFO = 'CLEAR_MR_INFO';

+ 1 - 1
src/utils/config.js

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

+ 7 - 1
src/utils/tools.js

@@ -13,6 +13,7 @@ import {
   CLEARCURRENTDATA,
 } from '@store/types/currentIll';
 import { REPASTTEXTDATA, CLEARPASTTEXTDATA } from '@store/types/pastHistory';
+import { CLEAR_MR_INFO } from '@store/types/print';
 import { REPERSONTEXTDATA, CLEARPERSONTEXTDATA } from '@store/types/personalHistory';
 import { REFAMILYTEXTDATA, CLEARFAMILYTEXTDATA } from '@store/types/familyHistory';
 import { REMARRIAGETEXTDATA, CLEARMARRIAGETEXTDATA } from '@store/types/marriageHistory';
@@ -338,6 +339,9 @@ const delHistoryDataList = () =>{
   store.dispatch({
     type: CLEARNEWADVICEDATA,
   });
+  store.dispatch({
+    type: CLEAR_MR_INFO,
+  });
 
 
 
@@ -898,6 +902,7 @@ function handleEnter(event){
 // };
 function getEMRParams(){
   const state = store.getState();
+  const {id} =  state.historyTemplates && state.historyTemplates.HospitalInfo 
   const {message} = state.patInfo;
   const {mainSuit,currentIll,otherHistory,checkBody,inspect,assistCheck,diagnosticList} = state;
   const diag = [];
@@ -937,7 +942,8 @@ function getEMRParams(){
     "otherOrder": [],
     "patientId": message.patientId,
     "drug": [],
-    "marriage": ""
+    "marriage": "",
+    "hospitalId": id || ''
   }
   return obj;
 };