Parcourir la source

Merge remote-tracking branch 'origin/dev/byll' into dev/new1

# Conflicts:
#	src/containers/OtherHistory.js
zhouna il y a 6 ans
Parent
commit
c90d43b677

+ 1 - 1
src/components/AddAssistCheck/Textarea/index.jsx

@@ -50,7 +50,7 @@ class Textarea extends Component {
       <div className={style.divTextarea}
           contenteditable={true}
           ref={this.$dom}
-          onInput={this.handleInput}
+          onChange={this.handleInput}
       ></div>
     );
   }

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

@@ -111,6 +111,7 @@ class AddAssistCheck extends React.Component {
                     return (<li key={item.id}> 
                         <span style={{float:"left"}}>{item.name}:</span>
                         <p style={{float:"none",overflow:"hidden",marginRight:"215px",paddingLeft:'8px'}}>
+                        {/* <p className={styles.textareaWrap}> */}
                             {/* <textarea
                                 className={styles.divTextarea}
                                 onChange={(e)=>{

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

@@ -114,6 +114,12 @@
             font-family: inherit;
         }
     }
+    .textareaWrap {
+      float: none;
+      overflow: hidden;
+      margin-right: 215px;
+      padding-left: 8px;
+    }
 }
 .center {
     text-align: center;

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

@@ -340,7 +340,7 @@ class Inspect extends React.Component {
                                                     handleClear={(e)=>{
                                                         handleClear(e,idx)
                                                         this.setState({
-                                                            showFill:false
+                                                          currentData:fillActive
                                                         })
                                                     }}
                                                     handleConfirm={(e)=>{

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

@@ -56,7 +56,7 @@ class HistoryCaseContainer extends React.Component {
                                         >引 用</button> */}
                                         <button 
                                             className={styles.quote} 
-                                            onClick={(e)=>{handleQuoteClick(e,val)}}
+                                            onClick={(e)=>{handleQuoteClick(e,val,idx)}}
                                         >引 用</button>
                                         <span className={styles.time}>{val.inquiryDate}</span>
                                     </li>

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

@@ -19,7 +19,7 @@
     .mainHistoryLeft {
         width: 300px;
         height: 100%;
-        background: #F1F1F1;
+        background: #d2d1d1;
         position: relative;
         .title {
             height: 80px;
@@ -29,7 +29,7 @@
             top: 0;
             left: 0;
             width: 100%;
-            background: #F1F1F1;
+            background: #d2d1d1;
         }
         .his {
             font-size: 18px;

+ 5 - 2
src/components/Inspect/index.jsx

@@ -40,7 +40,8 @@ class Inspect extends React.Component {
             visible:false,
             dom:[],
             isIE:isIE(),
-            ieVersion:null
+            ieVersion:null,
+            height:'-1'
         }
         this.handleImportExcel = this.handleImportExcel.bind(this)
         this.cancel = this.cancel.bind(this)
@@ -99,7 +100,8 @@ class Inspect extends React.Component {
                                 if (message.length != 0) {
                                     that.setState({
                                         visible:true,
-                                        dom:message
+                                        dom:message,
+                                        height:message.length
                                     })
                                 }
                                 $("#choose").val("");
@@ -183,6 +185,7 @@ class Inspect extends React.Component {
                     okText='删除' 
                     cancelText='确定' 
                     width="450"
+                    height={(this.state.height > 2 && this.state.height < 8)?((this.state.height * 30 + 120)+'px') : this.state.height > 8 ? '350px' : '200px'}
                     noFooter= {true}
                     close={this.cancel}>
                     <ul className={styles.excelList}>

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

@@ -65,5 +65,6 @@
     text-align: center;
     color: #fff;
     margin-bottom: 20px;
+    cursor: pointer;
 }
 

+ 22 - 9
src/components/Operation/index.jsx

@@ -15,7 +15,6 @@ class Operation extends Component {
     super(props)
     this.state = {
       title: '',
-      visible: false,
       okText: '',
       borderColor: '',
       okColor: '',
@@ -68,13 +67,14 @@ class Operation extends Component {
     if(flg){
       this.setState({
         type: type,
-        visible: true,
         okText: '保存',
         borderColor: '#3B9ED0',
         okColor: '#fff',
         oKBg: '#3B9ED0',
         msg: <p className={style['msg']}>是否保存该病历?</p>
       })
+      
+      this.props.diagShowTmp(true)
     }
   }
   keepHistory(){
@@ -98,13 +98,14 @@ class Operation extends Component {
     if(flg){
       this.setState({
         type: type,
-        visible: true,
         okText: '清除',
         borderColor: 'red',
         okColor: 'red',
         oKBg: '#fff',
         msg: <p className={style['msg']}>是否清空所有内容?</p>
       })
+      
+      this.props.diagShowTmp(true)
     }
   }
   isClear(){
@@ -248,10 +249,12 @@ class Operation extends Component {
     const { save, clear, saveDataAll,diagShowTmp } = this.props;
     const { type } = this.state;
     if (type == 1) {
-      this.setState({ visible: false, title: '' })
+      diagShowTmp(false)
+      this.setState({ title: '' })
       save();
     } else if (type == 2) {
-      this.setState({ visible: false, title: '' })
+      diagShowTmp(false)
+      this.setState({ title: '' })
       clear();
     } else if (type == 3) {
       if (this.state.title.trim() == '') {
@@ -262,10 +265,20 @@ class Operation extends Component {
       saveDataAll(this.state.title);
     }
   }
+  closeDiagBox(){
+    const { diagShowTmp } = this.props;
+    const { type } = this.state;
+    if (type == 3){
+      diagShowTmp(false)
+      this.setState({ title: '' })
+    }else{
+      diagShowTmp(false)
+      this.setState({ title: '' }) 
+    }
+  }
   render() {
     const { showPrint, closePrint, showPreview, closePreview } = this;
     const { visible, preVisible,diagShow } = this.props.print;
-    const { diagShowTmp } = this.props;
     const {zIndex} = this.state;
     return <div className={style['container']} style={{zIndex:zIndex}}>
       <button className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</button>
@@ -276,10 +289,10 @@ class Operation extends Component {
       <PrintPreviewContainer visible={visible} onClose={closePrint} />
       <PreviewContainer visible={preVisible} onClose={closePreview} />
       <ConfirmModal
-        visible={this.state.visible}
+        visible={diagShow}        //改为全局控制
         confirm={() => { this.makeSure() }}
-        close={() => {this.setState({ visible: false, title: '' }) }}
-        cancel={() => {this.setState({ visible: false, title: '' }) }}
+        close={() => { this.closeDiagBox()}}
+        cancel={() => {this.closeDiagBox()}}
         okText={this.state.okText}
         okBorderColor={this.state.borderColor}
         okColor={this.state.okColor}

+ 1 - 0
src/components/TemplateItems/TemplateItem/index.jsx

@@ -74,6 +74,7 @@ class TemplateItem extends React.Component {
                     isOpen: false
                 });
             });
+            console.log($(this.content).parent().siblings().find('.content'))
             return;
         }
         $(this.content).slideDown(() => {

+ 2 - 1
src/containers/HistoryCases.js

@@ -24,9 +24,10 @@ function mapDispatchToProps(dispatch) {
             e.stopPropagation();
             dispatch(activeHistory(val))
         },
-        handleQuoteClick(e,data){
+        handleQuoteClick(e,data,idx){
             e.stopPropagation();
             dispatch(keepPushData(data,'his'))      //历史病历引用
+            dispatch(activeHistory(idx))
             dispatch(visibleHistory(true))
         },
         handleSortClick(){

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

@@ -30,6 +30,7 @@ export const saveMessage=(state,action)=>{
 
 export const diagShow=(state,action)=>{
   const res=Object.assign({},state);
+  console.log(action)
   res.diagShow = action.data
   return res;
 };

+ 4 - 9
src/store/async-actions/homePage.js

@@ -7,7 +7,6 @@ import store from '@store';
 import {fullfillText} from '@common/js/func';
 import {getOtherHisRecord,getInitData} from '@store/async-actions/fetchModules.js';
 import {initHistoryDetails} from '@store/async-actions/patInfo';
-import { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
   getModules:'/api/icss/moduleInfo/getAll',
@@ -58,9 +57,6 @@ export const getInitModules= (dispatch,getStore)=>{
           saveEmpty:initSaveText.currentEmpty,
         });
         dispatch(getOtherHisRecord());          //获取其他史最近记录
-        if(state.tabTemplate.items.length == 0){
-          dispatch(initItemList());         //模板列表没有就获取模板列表
-        }
         initHis(dispatch)
       }else{
         initHis(dispatch)
@@ -72,11 +68,10 @@ export const getInitModules= (dispatch,getStore)=>{
 
 export const initHis = (dispatch)=> {
     let timer = setInterval(()=>{
-        let baseDate = store.getState().patInfo.message;
-        //console.log(baseDate)
-        if(JSON.stringify(baseDate) != '{}') {
-            dispatch(initHistoryDetails(baseDate));
-            clearInterval(timer)
+        let baseDate = store.getState();
+        if(JSON.stringify(baseDate.patInfo.message) != '{}') {
+          dispatch(initHistoryDetails(baseDate.patInfo.message));
+          clearInterval(timer)
         }
     },500)
 }

+ 10 - 7
src/store/async-actions/patInfo.js

@@ -6,6 +6,7 @@ import {getUrlArgObject,pushAllDataList} from '@utils/tools';
 import {getInitModules} from '@store/async-actions/homePage.js';
 import store from '@store'
 import {ISREAD} from "../types/homePage";
+import { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
     getPatInfo: '/api/icss/patientInfo/getTopPatientInfo',
@@ -20,6 +21,7 @@ export const initPersonInfo = (dispatch, getState) => {
         const data = res.data;
         if (data.code == 0) {
             dispatch(getInfos(data.data));
+            console.log(data.data)
             getPatientMessage(dispatch, getState);
         } else {
             console.log(res)
@@ -47,16 +49,14 @@ export const initHistoryDetails = (dispatch) => {
                   type:ISREAD
                 });
                 // 设置初始模式
-                if(detail.sign == 1){
+                if(detail.sign == 1 || detail.sign == 0){
                     dispatch({
                         type: CONFIRM_TYPE,
-                        confirmType: 1
-                    })
-                }else if(detail.sign == 0){
-                    dispatch({
-                        type: CONFIRM_TYPE,
-                        confirmType: 0
+                        confirmType: detail.sign
                     })
+                    if(baseList.tabTemplate.items.length == 0){
+                      dispatch(initItemList());        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+                    }
                 }
             } else {
                 console.log(res)
@@ -94,5 +94,8 @@ export const getPatientMessage = (dispatch, getState) => {
         type: CONFIRM_TYPE,
         confirmType:data1.modeValue
       });
+      if(state.tabTemplate.items.length == 0){
+        dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+      }
     })
 };

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

@@ -18,6 +18,7 @@ export const initItemList = (type) => { //初始化数据
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.typeConfig;
   let state = baseList.patInfo.message;
+
   return (dispatch) => {
     axios.json('/api/icss/templateInfo/getByDoctorIdTemplates', {
       "doctorId": state.doctorId,

+ 1 - 1
src/store/reducers/getInfoByUuid.js

@@ -17,4 +17,4 @@ export default (state = initPersonList, action) => {
         return newState;
     }
     return state;
-}
+}

+ 1 - 1
src/store/reducers/print.js

@@ -5,7 +5,7 @@ const initState = {
   visible: false,
   preVisible: false,
   saveMessage: {},
-  diagShow:false
+  diagShow: false
 };
 export default function(state = initState, action) {
   switch (action.type) {