瀏覽代碼

Merge branch 'masterCdss' into referMasterCdss

luolei 4 年之前
父節點
當前提交
2ceff8128b

+ 31 - 8
src/components/DiagnosticList/index.jsx

@@ -21,6 +21,7 @@ import {getAssessData} from '@store/async-actions/fetchModules';
 import DetailsModal from '@components/PushItems/DetailsModal';
 import tableIcon from '@common/images/table.png';
 import { CONFIRM_TYPE } from "@store/types/typeConfig";
+import config from '@config/index';
 import $ from "jquery";
 import {getMRAnalyse} from '@store/async-actions/pushMessage';
 
@@ -41,7 +42,8 @@ class DiagnosticList extends Component {
             hasOnIndex: -1,
             activeItem:{},
             hasEnterItem: -1,
-            hasEnterImg: false
+            hasEnterImg: false,
+            timer:null
         }
         this.deleteItem = this.deleteItem.bind(this);
         this.cancel = this.cancel.bind(this);
@@ -75,9 +77,9 @@ class DiagnosticList extends Component {
         downDiagnostic && downDiagnostic(index)
     }
     deleteItem() {
-        const { delItem } = this.state;
+        const { delItem,idxNum } = this.state;
         const { delDiagnostic, delReact,delFollowUp } = this.props;
-        delDiagnostic && delDiagnostic(delItem);
+        delDiagnostic && delDiagnostic(delItem,idxNum);
         delReact && delReact(delItem);
         delFollowUp && delFollowUp(delItem);
         this.setState({
@@ -85,6 +87,13 @@ class DiagnosticList extends Component {
         })
         Notify.success('删除成功')
     }
+    handleBlur(e,delItem,idxNum){
+      const { delDiagnostic } = this.props;
+      let name = e.target.value
+      if(name.trim() == ''){
+        delDiagnostic && delDiagnostic(delItem,idxNum);
+      }
+    }
     cancel() {
         this.setState({
             visible: false
@@ -95,10 +104,11 @@ class DiagnosticList extends Component {
             visible: false
         })
     }
-    handleDeleteItem(item) {
+    handleDeleteItem(item,idx) {
         this.setState({
             visible: true,
             delItem: item,
+            idxNum:idx
         })
     }
     showTreat(item, idx) {
@@ -242,7 +252,7 @@ class DiagnosticList extends Component {
     }
     componentWillReceiveProps(nextprops) {
       let flg = store.getState().print.mrInfo.mrId&&store.getState().print.mrInfo.mrId.indexOf('reStart')>-1
-      if (this.props.diagnosticStr != nextprops.diagnosticStr&&!flg) {
+      if (this.props.diagnosticStr.split(',').length != nextprops.diagnosticStr.split(',').length&&!flg) {
         this.props.getBilling({mode:10});
       }
     }
@@ -279,6 +289,19 @@ class DiagnosticList extends Component {
         hasEnterImg: false
       })
     }
+    handleInput(e,index){
+      const {editDiagName,getBilling} = this.props;
+      let name = (e.target.value).trim()
+      editDiagName(index,name)
+      //右侧推送--延时推送
+      const stimer = this.state.timer;
+      clearTimeout(stimer);
+      let timer = setTimeout(function(){
+        getBilling&&getBilling({mode:10});
+        clearTimeout(stimer);
+      },config.delayPushTime);
+      this.setState({timer})
+    }
     render(){
         const { list, treatment,pushMessage, showReferRecord, showHistoryCase ,chronicMagItem,loading,refreshScroller,windowWidth,hideChronic} = this.props;
       const {showTipsDetails,tipsDetails,showAllName}=pushMessage;
@@ -295,7 +318,7 @@ class DiagnosticList extends Component {
                         /*const hasTreat = item.treat && ((item.treat.commonTreatment&&item.treat.commonTreatment.content) || (item.treat.surgeryTreatment&&item.treat.surgeryTreatment.content) || item.treat.treatment.length>0 ||(item.adverseReactions&&item.adverseReactions.length > 0)
                            || (item.drugHistory && item.drugHistory['慢病用药内容'] &&  item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory &&item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow)
                         isChronic = !hideChronic&&chronicMagItem&&item.type==2&&chronicList&&chronicList.findIndex((it)=>it.conceptId==item.conceptId)!=-1;*/
-                        return (<div draggable={true} className={`${style['diag-box']} ${setFontColorSize(2,3)} clearfix`} id="diagListBox" key={item.conceptId} >
+                        return (<div draggable={false} className={`${style['diag-box']} ${setFontColorSize(2,3)} clearfix`} id="diagListBox" key={item.conceptId} >
                                     {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>}
                                     <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '1' : index+1}</span>
@@ -304,7 +327,7 @@ class DiagnosticList extends Component {
                                        onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
                                     >
                                       <span title={item.name} className={style['diag-name-box']} style={{'max-width': '300px'}}>
-                                        {item.name}
+                                        <input type="text" value={item.name} onBlur={(e)=>{this.handleBlur(e,item,index)}} onInput={(e)=>this.handleInput(e,index)}/>
                                       </span>
                                       {/* <img className={`${style['info-img']}`}
                                           title='点击i图标可查看详细说明'
@@ -326,7 +349,7 @@ class DiagnosticList extends Component {
                                           onClick={this.showAssessFn.bind(this,item)}>
                                         管理评估
                                     </span>:''}*/}
-                                    <img className={style['diag-del']} src={hasOnIndex == index ? hasOndel ? del_on : del_icon : del_icon} onMouseEnter={this.handleEnterDel.bind(this,index)} onMouseLeave={this.handleLeaveDel.bind(this)} onClick={()=>{this.handleDeleteItem(item)}}/>
+                                    <img className={style['diag-del']} src={hasOnIndex == index ? hasOndel ? del_on : del_icon : del_icon} onMouseEnter={this.handleEnterDel.bind(this,index)} onMouseLeave={this.handleLeaveDel.bind(this)} onClick={()=>{this.handleDeleteItem(item,index)}}/>
                         </div>)
                     })}
                      {treatment&&<Treat title={treatTitle} refreshScroller={refreshScroller}></Treat>}

+ 1 - 1
src/components/DiagnosticList/index.less

@@ -66,7 +66,7 @@
     .ellipsis;
     display: inline-block;
     line-height: 18px;
-    border-bottom: 1px solid #666;
+    // border-bottom: 1px solid #666;
     position: relative;
     top: 3px;
     // max-width: 220px;

+ 13 - 15
src/components/PatInfo/index.jsx

@@ -101,21 +101,19 @@ class PatInfo extends Component {
     let patientItem = newInfo.find(item =>{
       return item.id === e.target.id
     })      
-    if (patientItem.id === 'patientAge'){
-      let temp = Math.round(e.target.value.replace(/[^\d\.]+/, ''))
-      if (isNaN(temp)){
-        patientItem.value = 50
-        Notify.info('请输入正确的年龄')
-        return 
-      }else {
-        patientItem.value = temp
-      }
-      
-      // patientItem.value = e.target.value.replace(/[^\d\.]+/, '')   //小数四舍五入_楼超强2020914
-    } else {
-      patientItem.value = e.target.value;
-    }
-    // console.log(typeof patientItem.value, patientItem.value,'patientItem.value');
+    // if (patientItem.id === 'patientAge'){
+    //   let temp = Math.round(e.target.value.replace(/[^\d\.]+/, ''))
+    //   if (isNaN(temp)){
+    //     patientItem.value = 50
+    //     Notify.info('请输入正确的年龄')
+    //     return 
+    //   }else {
+    //     patientItem.value = temp
+    //   }
+    // } else {
+    //   patientItem.value = e.target.value;
+    // }
+    patientItem.value = e.target.value;  // 20201014 取消年龄格式限制 lcq
     if (patientItem.id === 'patientAge' && +patientItem.value > 200) {
       Notify.info('年龄不能超过200')
       // return false

+ 11 - 3
src/containers/DiagnosticList.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
-import { DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING,ADDDIAGMSG} from '@store/types/diagnosticList'; 
+import { DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING,ADDDIAGMSG,EDITDIAGMSG} from '@store/types/diagnosticList'; 
 import {SHOW_TIPS_DETAILS,HIDE_TIPS_DETAILS} from '@store/types/pushMessage';
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
@@ -36,6 +36,13 @@ function mapStateToProps(state) {//console.log(state)
 
 function mapDispatchToProps(dispatch) {
     return {
+      editDiagName(idx,name){        //获取评估内容数据
+        dispatch({
+          type:EDITDIAGMSG,
+          idx:idx,
+          name:name
+        });
+      },
       setAssess(data,disName){        //获取评估内容数据
         dispatch({
           type:SET_ASSESS_DATA,
@@ -43,10 +50,11 @@ function mapDispatchToProps(dispatch) {
           name:disName
         });
       },
-        delDiagnostic: (item) => {
+        delDiagnostic: (item,idx) => {
             dispatch({
                 type: DEL_DIAGNOSTIC,
-                item: item
+                item: item,
+                idx:idx
             });
             dispatch({
                 type: GET_DIAGNOSTIC_STR

+ 32 - 4
src/store/actions/diagnosticList.js

@@ -1,3 +1,24 @@
+export const editDiagMsg = (state, action) => {
+    const res = JSON.parse(JSON.stringify(state));
+    let tmpLis = res.diagnosticList
+    for(let i = 0;i < tmpLis.length;i++){
+        if(action.idx == i){
+            tmpLis[i].name = action.name
+            if(!!tmpLis[i].hasTreat){
+                let obj = {
+                    "dateValue": '',
+                    "name": action.name,
+                    "uniqueName": tmpLis[i].uniqueName
+                }
+                res.diseaseName = obj
+            }
+        }
+        res.diagnosticStr = tmpLis[i].name + ','
+    }
+    res.diagnosticList = [...tmpLis]
+    return res;
+}
+
 export const addDiagMsg = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
     let tmpLis = res.diagnosticList
@@ -11,7 +32,7 @@ export const addDiagMsg = (state, action) => {
     let obj = {
         "dateValue": '',
         "name": action.item.name,
-        "uniqueName": action.item.name
+        "uniqueName": action.item.uniqueName
     }
     res.diagnosticList = [...tmpLis]
     res.diseaseName = obj
@@ -23,6 +44,7 @@ export const addDiagnostic = (state, action) => {
     res.diagnosticList.push(action.item)
     let tmpLis = res.diagnosticList,num=0
     for(let i = 0;i < tmpLis.length;i++){
+        tmpLis[i].uniqueName = tmpLis[i].name
         if(!tmpLis[i].hasTreat){
             ++num
         }
@@ -32,7 +54,7 @@ export const addDiagnostic = (state, action) => {
         let obj = {
             "dateValue": '',
             "name": tmpLis[0].name,
-            "uniqueName": tmpLis[0].name
+            "uniqueName": tmpLis[0].uniqueName
         }
         res.diseaseName = obj
     }
@@ -42,7 +64,11 @@ export const addDiagnostic = (state, action) => {
 
 export const delDiagnostic = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    res.diagnosticList = res.diagnosticList.filter(item => (item.conceptId !== action.item.conceptId || item.name !== action.item.name));
+    res.diagnosticList = res.diagnosticList.filter((item,idx) =>{
+        if(idx != action.idx){
+            return item
+        }
+    });
     let tmpLis = res.diagnosticList,num=0
     for(let i = 0;i < tmpLis.length;i++){
         if(!tmpLis[i].hasTreat){
@@ -54,9 +80,11 @@ export const delDiagnostic = (state, action) => {
         let obj = {
             "dateValue": '',
             "name": tmpLis[0].name,
-            "uniqueName": tmpLis[0].name
+            "uniqueName": tmpLis[0].uniqueName
         }
         res.diseaseName = obj
+    }else{
+        res.diseaseName = {}
     }
     res.diagnosticList = [...tmpLis]
     return res;

+ 5 - 1
src/store/reducers/diagnosticList.js

@@ -20,6 +20,7 @@ import {
   REDIAGDATA,
   CLEARDIAGDATA,
   ADDDIAGMSG,
+  EDITDIAGMSG,
 } from '../types/diagnosticList';
 import {
   addDiagnostic,
@@ -39,7 +40,8 @@ import {
   hideHistoryCase,
   addTreat,
   reDiagData,
-  addDiagMsg
+  addDiagMsg,
+  editDiagMsg
 } from '../actions/diagnosticList';
 
 const initState = {
@@ -58,6 +60,8 @@ const initState = {
 export default function (state=initState, action) {
     const res = Object.assign({},state);
     switch (action.type) {
+      case EDITDIAGMSG:
+        return editDiagMsg(state, action);
       case ADDDIAGMSG:
         return addDiagMsg(state, action);
       case ADD_DIAGNOSTIC:

+ 6 - 2
src/store/reducers/newAdvice.js

@@ -150,10 +150,13 @@ export default (state = initSearchList, action) => {
             newState.labelListBig = [...tempArr]
         }else if(tmpLis&&tmpLis.flg == 6){
             tempArrs = tempArrs.filter((item,idx)=> {
+                if(item['hasTreat'] = 1){
+                    newState.operationName = {}
+                }
                 if(action.tip != idx){
                     return item
                 }
-            } )
+            })
             for(let i = 0;i < tempArrs.length;i++){
                 if(!tempArrs[i].hasTreat){
                     ++num
@@ -174,7 +177,7 @@ export default (state = initSearchList, action) => {
                 if(action.tip != idx){
                     return item
                 }
-            } )
+            })
             newState.labelListBlood = [...tmpArr]
         }
         tempBigOrder = tempArr.filter((item)=>item.check)
@@ -431,6 +434,7 @@ export default (state = initSearchList, action) => {
     newState.operationOrder = [];
     newState.labelListBlood = [];
     newState.transfusionOrder = [];
+    newState.operationName = {};
     return newState;
     }
     return state;

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

@@ -21,4 +21,5 @@ export const ADD_TREAT = Symbol('ADD_TREAT') ;   //设置治疗
 
 export const REDIAGDATA = 'REDIAGDATA';
 export const CLEARDIAGDATA = 'CLEARDIAGDATA';
-export const ADDDIAGMSG = 'ADDDIAGMSG';
+export const ADDDIAGMSG = 'ADDDIAGMSG';
+export const EDITDIAGMSG = 'EDITDIAGMSG';

+ 37 - 2
src/utils/config.js

@@ -1,6 +1,12 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
+
+const { func } = require("prop-types");
+
 // const host='http://192.168.2.121:5050';//后端接口访问地址
+
+
+
 const host='http://192.168.2.241:6060';//后端接口访问地址
 // const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
@@ -8,11 +14,40 @@ const host='http://192.168.2.241:6060';//后端接口访问地址
 // const host='http://192.168.3.117:5050'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://
 const imageUrlPrefix = 'http://192.168.2.241:82';
+function geturl(){
+    if(window.location.href.indexOf('localhost')>-1){
+        return {
+            gourl:'http://localhost:8080/cdss.html',
+            imgurl:host.replace('6060','22')
+        }
+    }else if(window.location.href.indexOf('192.168.2.236')>-1){
+        return {
+            gourl:'http://192.168.2.236:5654/cdss.html',
+            imgurl:'http://192.168.2.236:82'
+        }
+    }else if(window.location.href.indexOf('192.168.2.241')>-1){
+        return {
+            gourl:'http://192.168.2.241:5654/cdss.html',
+            imgurl:'http://192.168.2.241:82'
+        }
+    }else if(window.location.href.indexOf('192.168.2.121')>-1){
+        return {
+            gourl:'http://192.168.2.121:5654/cdss.html',
+            imgurl:'http://192.168.2.121:82'
+        }
+    }else{
+        return {
+            gourl:'http://192.168.2.122:5654/cdss.html',
+            imgurl:'http://192.168.2.122:82'
+        }
+    }
+}
+let urlSelect = geturl()
 module.exports={
     host,
     prefix:'',            //带权限验证的api
     pushPage:'http://192.168.2.241:5488/icssIndex.html',        //右侧推送页面的地址
-    imageUrlPrefix,
-    pushPage2:'http://192.168.2.121:5654/cdss.html',        //右侧推送页面的地址
+    imageUrlPrefix:urlSelect.imgurl,
+    pushPage2:urlSelect.gourl,        //右侧推送页面的地址
     // pushPage2:'http://localhost:8080/cdss.html',        //右侧推送页面的地址
 };

+ 2 - 1
src/utils/tools.js

@@ -924,8 +924,9 @@ function getEMRParams(){
   } = state;
   const diag = [];
   for(let i = 0; i < diagnosticList.diagnosticList.length; i++) {
-    diag.push({"dateValue": "","name": diagnosticList.diagnosticList[i].name,"uniqueName": diagnosticList.diagnosticList[i].name})
+    diag.push({"dateValue": "","name": diagnosticList.diagnosticList[i].name,"uniqueName": ""})
   }
+  if(diagnosticList.length>0)diagnosticList.diseaseName.uniqueName = ''
   let templis = (inspect.labelListSmall).concat(inspect.labelListBig)
   templis = templis.filter((item)=>!item.check)
   let temppacs = assistCheck.assistLabel