소스 검색

Merge branch 'dev5.3.2' of http://192.168.2.236:10080/zhouna/newICSS into dev5.3.2

zhangxc 5 년 전
부모
커밋
e61ab49c40

+ 2 - 3
src/components/AddInspect/index.jsx

@@ -2,7 +2,7 @@ import React from 'react';
 import { SearchOption, InspectCommon, Calendar, Notify, ConfirmModal, Add, DelToast } from '@commonComp';
 import SlideExcel from './SlideExcel';
 import SlideSelect from './SlideSelect';
-import { deepClone, getPageCoordinate, getStatusImg ,getCurrentDate,setPosition} from '@utils/tools';
+import { deepClone, getPageCoordinate, getStatusImg ,getCurrentDate,setPosition,getCalendarDate} from '@utils/tools';
 import styles from './index.less';
 import ScrollArea from 'react-scrollbar';
 import store from '@store';
@@ -135,8 +135,7 @@ class Inspect extends React.Component {
     this.props.setHighter(48)
   }
   handleChangeDate(info) {
-    // let date = info.year+'-'+info.month.toString().padStart(2,'0')+'-'+info.day.toString().padStart(2,'0')
-    let date = info.year+'-'+info.month.toString().padStart(2,'0')+'-'+info.day.toString().padStart(2,'0')+' '+info.hour.toString().padStart(2,'0')+':'+info.minute.toString().padStart(2,'0')+':'+info.second.toString().padStart(2,'0');
+    let date = getCalendarDate(info);
     this.setState({ dateTime: date, date: false })
   }
   handleSearchShow(e) {

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

@@ -163,6 +163,7 @@ class MainSuit extends Component{
       }
       ev.target.blur();
       ev.target.innerText?(ev.target.innerText = data.substr(0,config.limited)):(ev.target.innerHTML = data.substr(0,config.limited));  //输入法内输入多个字再按enter的情况
+      console.log(333,data,ev)
       // ev.target.blur();
       this.setState({
         inpText:data.substr(0,config.limited),

+ 4 - 3
src/components/MedicalInfo/index.jsx

@@ -8,7 +8,7 @@ class MedicalInfo extends Component {
         super(props);
         this.$inp = React.createRef();
         this.$cont = React.createRef();
-      this.$ul = React.createRef();
+        this.$ul = React.createRef();
         this.state={
           val:'',
           hasSearch: false,
@@ -62,6 +62,7 @@ class MedicalInfo extends Component {
         hasSearch: false,
         msg: '',
       });
+      
       clearResult && clearResult();
     }
   }
@@ -78,6 +79,7 @@ class MedicalInfo extends Component {
         hasSearch: false,
         msg:''
       });
+      this.$inp.current.focus();
       clearResult&&clearResult();
   }
   componentDidMount(){
@@ -105,9 +107,8 @@ class MedicalInfo extends Component {
         return (
             <div className={style['search-cont']} ref={this.$cont}>
               <div className={style['search-box']}>
-                <p className={style['title']}>医学知识搜索</p>
                 <p className={style['cont']}>
-                  <input type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
+                  <input placeholder="医学知识搜索" type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
                   {val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
                   <button onClick={this.search}>搜索</button>
                 </p>

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

@@ -56,7 +56,7 @@
         border: none;
     }
     .result{
-        margin-top:78px;
+        margin-top:46px;
         padding: 0 5px 0 0;
         height: 100%;
         box-sizing: border-box;

+ 0 - 52
src/components/Operation/index.jsx

@@ -160,8 +160,6 @@ class Operation extends Component {
     // console.log(tmpLis,'接口返回的')
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
-      // let dataJson = tmpLis[i].dataJson;
-      // console.log(jsonStr.diag , JSON.parse(dataStr).diag)
       if(
         filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) && 
         filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) && 
@@ -175,56 +173,6 @@ class Operation extends Component {
         Notify.info('该模板已保存');
         return false;
       }
-      // if(whichSign == 0){
-      //   // console.log(filterDataArr(JSON.parse(jsonStr.present)) , filterDataArr(JSON.parse(JSON.parse(dataStr).present)))
-      //   if(
-      //     filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) && 
-      //     filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) && 
-      //     filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) && 
-      //     filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
-      //     jsonStr.lis == JSON.parse(dataStr).lis &&
-      //     jsonStr.pacs == JSON.parse(dataStr).pacs &&
-      //     jsonStr.diag == JSON.parse(dataStr).diag &&
-      //     jsonStr.advice == JSON.parse(dataStr).advice
-      //     // JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
-      //     // JSON.stringify(jsonData.checkedListImport) == JSON.stringify(JSON.parse(dataJson).checkedListImport) &&    
-      //     // JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
-      //     // JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&
-      //     // JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
-      //     // JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
-      //     // JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
-      //     // JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
-      //     // JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
-      //     // JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
-      //     // JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
-      //     // JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
-      //     // JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
-      //     // JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
-      //   ){
-      //     Notify.info('该模板已保存');
-      //     return false;
-      //   }
-      // }else if(whichSign == 1){
-      //   if(
-      //     jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
-      //     jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
-      //     jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
-      //     jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')')) &&
-      //     jsonStr.lis == JSON.parse(dataStr).lis &&
-      //     jsonStr.pacs == JSON.parse(dataStr).pacs &&
-      //     jsonStr.diag == JSON.parse(dataStr).diag &&
-      //     jsonStr.advice == JSON.parse(dataStr).advice
-      //     // JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
-      //     // JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
-      //     // JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
-      //     // JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
-      //     // JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&        
-      //     // JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
-      //   ){
-      //     Notify.info('该模板已保存');
-      //     return false;
-      //   }
-      // }
     }
     return true;
   }

+ 3 - 1
src/components/RadioInpDrop/index.jsx

@@ -196,11 +196,12 @@ class RadioInpDrop extends Component{
     if(!show&&tmpDom){
       $(tmpDom).parent().parent().prev().attr({"contentEditable":true})
     }
+    // 移除双击编辑 onDoubleClick={hideTag?null:this.handledbClick}
     return <div className={style['container']} ref = {this.$cont}>
       <div className={this.getClass()}
            onBlur={this.handleEditLabel}
            contentEditable={this.state.editable}
-           onDoubleClick={hideTag?null:this.handledbClick}
+           
            onClick={(e)=>this.handleShow(e,true)}
            onKeyDown={handleEnter}>
         {vals?this.parseInputDom():<span>{placeholder}</span>}
@@ -231,6 +232,7 @@ class InputComp extends Component{
       const inp = this.$inp.current;
       const value = this.props.value;
       setTimeout(function(){
+        inp.innerText?(inp.innerText = ''):(inp.innerHTML = '');
         inp.innerText?(inp.innerText = value):(inp.innerHTML = value);
       })
     }

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

@@ -93,6 +93,7 @@ class ScaleSearch extends Component {
       hasSearch: false,
       msg:''
     });
+    this.$inp.current.focus();
     clearResult&&clearResult();
   }
   componentDidMount(){
@@ -120,9 +121,8 @@ class ScaleSearch extends Component {
     return (
         <div className={style['search-cont']} ref={this.$cont}>
           <div className={style['search-box']}>
-            <p className={style['title']}>量表搜索</p>
             <p className={style['cont']}>
-              <input type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
+              <input type="text" placeholder="量表搜索" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
               {val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
               <button onClick={this.search}>搜索</button>
             </p>

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

@@ -52,7 +52,7 @@
     border: none;
   }
   .result{
-    margin-top:78px;
+    margin-top:46px;
     padding: 0 5px 0 0;
     height: 100%;
     overflow: auto;

+ 29 - 30
src/components/ScaleTable/index.jsx

@@ -74,42 +74,41 @@ class ScaleTable extends React.Component{
     }
     if(rows){
       for(let j=0; j<rows.length; j++){
-        let row = rows[j].row;
-        let required = rows[j].required;
         let rowsId = rows[j].indexId;
-        let metux = rows[j].metux; //互斥
-        
-        // 必填项处理
-        if(required==1&&rowsId==indexId){
-          for(let k=0;k < row.length; k++){
-            row[k].isSelect = true;
-            if(metux == 1){//互斥,把其他的清空
-              let detList = row[k].details;
-              for(let f=0; f<detList.length; f++){
-                detList[f].select = 0;
+        if(rowsId==indexId){
+          let row = rows[j].row;
+          let required = rows[j].required; //必填
+          let metux = rows[j].metux; //互斥
+          if(required==1){ // 必填项处理
+            for(let k=0;k < row.length; k++){
+              row[k].isSelect = true;
+              if(metux == 1){//互斥,把其他的清空
+                let detList = row[k].details;
+                for(let f=0; f<detList.length; f++){
+                  detList[f].select = 0;
+                }
               }
-            }
-            if(row[k].name==name){
-              details = row[k].details;
-              // break;
-            }
-          }
-        }else{
-          for(let k=0;k < row.length; k++){
-            if(metux == 1){//互斥,把其他的清空
-              let detList = row[k].details;
-              for(let f=0; f<detList.length; f++){
-                detList[f].select = 0;
+              if(row[k].name==name){
+                details = row[k].details;
+                // break;
               }
             }
-            if(row[k].name==name){
-              details = row[k].details;
-              row[k].isSelect = true;
-              break;
+          }else{
+            for(let k=0;k < row.length; k++){
+              if(metux == 1){//互斥,把其他的清空
+                let detList = row[k].details;
+                for(let f=0; f<detList.length; f++){
+                  detList[f].select = 0;
+                }
+              }
+              if(row[k].name==name){
+                details = row[k].details;
+                row[k].isSelect = true;
+                break;
+              }
             }
           }
-        }
-        
+        }   
       }
     }
     if(details){

+ 1 - 1
src/components/TemplateItems/TemplateItem/index.less

@@ -33,7 +33,7 @@
     position: relative;
     height: 45px;
     line-height: 45px;
-    padding: 0 20px;
+    padding: 0 15px;
     cursor: pointer;
     img {
         display: inline-block;

+ 55 - 13
src/components/TemplateItems/index.jsx

@@ -3,6 +3,7 @@ import React from "react"
 import style from "./index.less"
 import TemplateItem from './TemplateItem'
 import check_circle from './TemplateItem/img/check-circle.png';
+import delIcon from '@common/images/del_nor.png';
 import check_right from './TemplateItem/img/check-right.png';
 import Empty from '@components/Empty';
 import {windowEventHandler,getWindowInnerHeight} from '@utils/tools'
@@ -11,17 +12,24 @@ import {windowEventHandler,getWindowInnerHeight} from '@utils/tools'
 class TemplateItems extends React.Component {
     constructor(props) {
         super(props);
+        this.state = {
+            msg:'还没有保存模板',
+            val:''
+        }
         this.$cont = React.createRef();
         this.$search = React.createRef();
         this.genItems = this.genItems.bind(this);
         this.templateSearch = this.templateSearch.bind(this);
+        this.handleEnter = this.handleEnter.bind(this);
+        this.handleChange = this.handleChange.bind(this);
+        this.clear = this.clear.bind(this);
     }  
     componentDidMount(){
-        const height = getWindowInnerHeight()-226;
+        const height = getWindowInnerHeight()-216;
         this.$cont.current.style.height = height+"px";
         windowEventHandler('resize', ()=>{
             if(this.$cont.current){
-                const height = getWindowInnerHeight()-226;
+                const height = getWindowInnerHeight()-216;
                 this.$cont.current.style.height = height+"px";
             }
         });
@@ -54,7 +62,48 @@ class TemplateItems extends React.Component {
     templateSearch(){
         const {templateSearch} = this.props
         templateSearch(this.$search.current.value)
+        if(this.$search.current.value.trim()){
+            this.setState({
+                msg:'暂无模板信息'
+            })
+        }else{
+            this.setState({
+                msg:'还没有保存模板'
+            })
+        }
+    }
+    
+    handleEnter(e){
+        if(e.keyCode==13){
+            this.templateSearch();
+        }
     }
+    
+    handleChange(){
+        const value = (this.$search.current.value).substring(0,30);
+        // this.$search.current.value = value
+        setTimeout(() => {
+            
+            this.setState({
+                val: value
+            });
+        }, 30);
+        // if (value === '') {
+        //     this.setState({
+        //         val: ''
+        //     });
+        // }
+    }
+
+    clear(){
+        this.$search.current.value = '';
+        this.setState({
+            val:''
+        })
+        
+        this.$search.current.focus();
+    }
+
     render() {
         const { allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
         // console.log(allCheckShow,7877877)
@@ -75,25 +124,18 @@ class TemplateItems extends React.Component {
                         </div> :
                         <div className={style.wrapperTop}>
                             <div className={style.templateSearch}>
-                                <input ref={this.$search} type="text" />
-                                <div className={style.search} onClick={this.templateSearch}>检索</div>
+                                <input placeholder="模板搜索" maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
+                                {this.state.val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
+                                <div className={style.search} onClick={this.templateSearch}>搜索</div>
                             </div>
                             {
                                 items.length > 0&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
                             }
                     </div>) : <div style={{height:'36px'}}></div>
-                    // <div className={style.emptyWrap}>
-                    //     <div className={`${style.templateSearch}`}>
-                    //         <input ref={this.$search} type="text" />
-                    //         <div className={style.search} onClick={this.templateSearch}>检索</div>
-                            
-                    //     </div>
-                    //     <span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
-                    // </div>
                 }
                 <div className={style.tempLists} ref={this.$cont}>
                     {
-                        this.genItems().length > 0?this.genItems(): <Empty message={'还没有保存模板'}></Empty>
+                        this.genItems().length > 0?this.genItems(): <Empty message={this.state.msg}></Empty>
                     }
                     {/* {//注释掉的暂时没有分也功能
                       hasMore?<p onClick={()=>handleClickGetMore(current)} className={style.loadMore}>点击查看更多</p>:null

+ 23 - 11
src/components/TemplateItems/index.less

@@ -9,7 +9,7 @@
     .tempLists {
         overflow-y: auto;
         background-color: #fff;
-        margin-top: 15px;
+        // margin-top: 15px;
     }
     .emptyWrap {
         padding: 0 20px;
@@ -23,9 +23,9 @@
         }
     }
     .wrapperTop {
-        height: 36px;
-        padding: 0 20px;
-        margin-top: 15px;
+        height: 46px;
+        padding: 0 15px;
+        margin-top: 10px;
         // background-color: #EAEDF1;
         cursor: pointer;
         .check-box {
@@ -33,21 +33,19 @@
             // width: 18px;
             margin-top: 10px;
             padding-right: 10px;
-            
             box-sizing: content-box;
             float: left;
         }
         .check-wrap{
             height: 36px;
             padding-right: 10px;
-            display: inline-block;
             float: left;
         }
         span {
-            display: inline-block;
             height: 36px;
             line-height: 36px;
             float: left;
+            // margin-top: 20px;
         }
         .fr-element {
             float: right;
@@ -75,13 +73,20 @@
     }
     .templateSearch {
         display: inline-block;
+        p {
+            font-size: 12px;
+            color: #979797;
+            margin-bottom: 10px;
+        }
         input {
-            height: 35px;
-            line-height: 35px;
-            border: 1px solid #CECECE;
             box-sizing: border-box;
             width: 270px;
-            padding: 0 10px;
+            display: inline-block;
+            line-height: 34px;
+            height: 34px;
+            padding: 5px 25px 5px 5px;
+            border: 1px #CECECE solid;
+            vertical-align: top;
         }
         .search {
             display: inline-block;
@@ -92,6 +97,13 @@
             height: 35px;
             line-height: 35px;
         }
+        img {
+            position: absolute;
+            width: 15px;
+            left: 264px;
+            top: 10px;
+            cursor: pointer;
+        }
     }
 }
 

+ 12 - 9
src/components/TimeInterval/index.jsx

@@ -59,11 +59,13 @@ class TimeInterval extends React.Component {
   timeSure(date) {
     const { getStartTime, getEndTime } = this.props;
     if (this.state.flg == 1) {
-      let time = getCalendarDate(date, true);
-      let dateBegin = (new Date(time)).getTime()
-      let dateEnd = (new Date(this.state.endTime)).getTime()
+      let time = getCalendarDate(date);
+      let tmpTime = time.replace(/ |:/g, '-').split('-');
+      let arr = this.state.endTime.replace(/ |:/g, '-').split('-');
+      let dateBegin = (new Date(Date.UTC(tmpTime[0],tmpTime[1],tmpTime[2],tmpTime[3],tmpTime[4]))).getTime();
+      let dateEnd = (new Date(Date.UTC(arr[0], arr[1], arr[2], arr[3],arr[4]))).getTime();
       let dateDes = (dateEnd - dateBegin)/(24 * 3600 * 1000)
-      if(dateEnd < dateBegin){
+      if(dateEnd - dateBegin < 0){
         Notify.info("终止时间不能早于起始时间");
         return
       }else if(dateDes>90){
@@ -76,13 +78,14 @@ class TimeInterval extends React.Component {
         timeLisStart: date//事件组件的日期
       })
       getStartTime(time)
-
     } else if (this.state.flg == 2) {
-      let time = getCalendarDate(date, true);
-      let dateBegin = (new Date(this.state.startTime)).getTime()
-      let dateEnd = (new Date(time)).getTime()
+      let time = getCalendarDate(date);
+      let tmpTime = time.replace(/ |:/g, '-').split('-');
+      let arr = this.state.endTime.replace(/ |:/g, '-').split('-');
+      let dateBegin = (new Date(Date.UTC(arr[0], arr[1], arr[2], arr[3],arr[4]))).getTime();
+      let dateEnd = (new Date(Date.UTC(tmpTime[0],tmpTime[1],tmpTime[2],tmpTime[3],tmpTime[4]))).getTime();
       let dateDes = (dateEnd - dateBegin)/(24 * 3600 * 1000)
-      if(dateEnd < dateBegin){
+      if(dateEnd - dateBegin < 0){
         Notify.info("终止时间不能早于起始时间");
         return
       }else if(dateDes>90){

+ 2 - 1
src/containers/AssistCheck.js

@@ -7,6 +7,7 @@ import { assistLable,delAssistLabel,changeAssistVal,changeDate,allCheckImports,s
 import { getSearchList,getInstroduce ,getImportLists,getSonDetailList} from '@store/async-actions/assistCheck';
 import {ISREAD} from '@store/types/homePage.js';
 import {billing, getConceptDetail} from '@store/async-actions/pushMessage';
+import { getCalendarDate} from '@utils/tools';
 
 function mapStateToProps(state) {//console.log(state)
     return {
@@ -67,7 +68,7 @@ function mapDispatchToProps(dispatch, store) {
             dispatch(changeAssistVal(val,idx))
         },
         handleChangeDate(info,idx){
-            let date = info.year+'-'+info.month.toString().padStart(2,'0')+'-'+info.day.toString().padStart(2,'0')+' '+info.hour.toString().padStart(2,'0')+':'+info.minute.toString().padStart(2,'0')+':'+info.second.toString().padStart(2,'0');
+            let date = getCalendarDate(info);
             dispatch(changeDate(date,idx))
         },
         //右侧推送

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

@@ -21,6 +21,7 @@ export const billing = (mdata,boxMark) => {
   const state = getState();
   let url = api.push;
    const checkBody = state.checkBody.data;
+   let diagMain = state.diagnosticList.diagnosticList.length>0&&state.diagnosticList.diagnosticList[0]
    let getCheck = boxMark==2&&!(checkBody&&checkBody.length>0&&!checkBody[0].full);
   const emrData = getEMRParams();
   const params = {
@@ -56,7 +57,16 @@ export const billing = (mdata,boxMark) => {
             vigilant = dis&&dis['警惕'];
             determine = dis&&dis['确诊']; //确诊
             likely = dis&&dis['鉴别诊断'];
-        if(dis&&dis['急诊']&&dis['急诊'].length>0){
+        //急诊显示规则,主诊断有急诊优先显示,没有则显示推送的,推送也没有就不显示
+        if(dis&&dis['页面急诊']&&(dis['页面急诊'].length>0)&&(diagMain&&dis['页面急诊'][0].conceptId == diagMain.conceptId)){
+          setPushEmergency=dis['页面急诊'][0]
+          let name = dis['页面急诊'][0].name || ''
+          for(let i = 0;i < dataLis.length;i++){
+            if(name == dataLis[i].emergencyillname){
+              setPushEmergencyIdx=i
+            }
+          }
+        }else if(dis&&dis['急诊']&&dis['急诊'].length>0){
           setPushEmergency=dis['急诊'][0]
           let name = dis['急诊'][0].name || ''
           for(let i = 0;i < dataLis.length;i++){

+ 10 - 16
src/utils/tools.js

@@ -284,7 +284,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
           likely:[],
           lab: [],
           pacs:[],
-          setPushEmergency:[],
+          setPushEmergency:{},
           setPushEmergencyIdx:''
         });
         storageLocal.remove('emrParam');
@@ -818,9 +818,9 @@ function getCurrentDate(flg,con){
     var h = myDate.getHours();
     var m = myDate.getMinutes();
     var s = myDate.getSeconds();
-    date = year+link+mon.toString().padStart(2,'0')+link+day.toString().padStart(2,'0')+' '+h.toString().padStart(2,'0')+':'+m.toString().padStart(2,'0')+':'+s.toString().padStart(2,'0');
+    date = year+link+(mon<10?"0"+mon:mon)+link+(day<10?"0"+day:day)+' '+(h<10?"0"+h:h)+':'+(m<10?"0"+m:m)+':'+(s<10?"0"+s:s);
   }else{
-    date = year+link+mon.toString().padStart(2,'0')+link+day.toString().padStart(2,'0');
+    date = year+link+(mon<10?"0"+mon:mon)+link+(day<10?"0"+day:day);
   }
   return date;
 }
@@ -926,11 +926,11 @@ function dateParser(timestamp,link = '-'){
   let year = time.getFullYear();
   let month = time.getMonth()+1;
   let date = time.getDate();
-  let hour = time.getHours().toString().padStart(2,'0');
-  let minute = time.getMinutes().toString().padStart(2,'0');
-  let second = time.getSeconds().toString().padStart(2,'0');
+  let hour = time.getHours();
+  let minute = time.getMinutes();
+  let second = time.getSeconds();
   // let result = year+link+month+link+date;
-  let result = year+link+(month<10?"0"+month:month)+link+(date<10?"0"+date:date)+' '+hour+':'+minute+':'+second;
+  let result = year+link+(month<10?"0"+month:month)+link+(date<10?"0"+date:date)+' '+(hour<10?"0"+hour:hour)+':'+(minute<10?"0"+minute:minute)+':'+(second<10?"0"+second:second);
   return result;
 }
 
@@ -1176,15 +1176,9 @@ function getIds(data){
  * @param {时间是否包含时分秒} flg 
  * @param {连接符} con 
  */
-function getCalendarDate(info,flg,con) {
-  let date = '';
-  let time = flg?flg:false;
-  let conect = con?con:'-';
-  if(time){
-    date = info.year + conect + (info.month).toString().padStart(2,'0') + conect + (info.day).toString().padStart(2,'0') + ' '+(info.hour).toString().padStart(2,'0')+':'+(info.minute).toString().padStart(2,'0')+':'+(info.second).toString().padStart(2,'0');
-  }else{
-    date = info.year + conect + (info.month < 10 ? '0' + info.month : info.month) + conect + (info.day < 10 ? '0' + info.day : info.day);
-  }
+function getCalendarDate(info) {
+  let conect = '-';
+  let date = info.year + conect + (info.month < 10 ? '0' + info.month : info.month) + conect + (info.day < 10 ? '0' + info.day : info.day) + ' '+ (info.hour < 10 ? '0' + info.hour : info.hour)+':'+ (info.minute < 10 ? '0' + info.minute : info.minute)+':'+ (info.second < 10 ? '0' + info.second : info.second);
   return date;
 }