浏览代码

Merge branch 'optimize' into dev/new1

zhouna 6 年之前
父节点
当前提交
e993f7e922

+ 15 - 3
src/components/AddInspect/SlideSelect/index.jsx

@@ -10,10 +10,19 @@ import close from '../img/close.png';
 class SlideSelect extends Component {
   constructor(props) {
     super(props);
+    const date = new Date();
     this.state = {
       show:false,
       activeInd:false,
-      activeName:''
+      activeName:'',
+      timeLis: {
+        year: date.getFullYear(),
+        month: date.getMonth() + 1,
+        day: date.getDate(),
+        hour: '00',
+        minute: '00',
+        second: '00'
+      },
     };
     this.toTime = this.toTime.bind(this)
     this.handleSlide = this.handleSlide.bind(this)
@@ -61,9 +70,12 @@ class SlideSelect extends Component {
       activeName:''
     })
   }
+  timeSure(date){
+    console.log(date)
+  }
   render() {
     const {getInfomation,handleConfirm,changeActivePart,handleDelClick,getItemList,date,item,idx,handleFillShow,showDetails,handleLabelSub,showFill,changeShowFill,handlePush,dateTime,currentIdx,currentData,fillActive,handleShowDate,handleChangeDate,showToast} = this.props;
-    const {show,activeInd,activeName} = this.state;
+    const {show,activeInd,activeName,timeLis} = this.state;
     let numPlus = 0,numPlus1 = 0;
     return (
       <li key={item.questionId} className={styles.slideLi}> 
@@ -171,7 +183,7 @@ class SlideSelect extends Component {
                             </p>
                             <div style={{display:date?"block":"none",position:"relative"}}>
                                 {/* 日期组件 */}
-                                <Calendar isShow={true} handleChange={handleChangeDate}></Calendar>
+                                <Calendar timeLis={timeLis} isShow={true} timeSure={this.timeSure} needTime={true} sure={true} handleChange={handleChangeDate}></Calendar>
                             </div>
                         </div>
                             {/* 填写单内容显示 */}

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

@@ -30,7 +30,6 @@ class Inspect extends React.Component {
     }
     this.handleChangeDate = this.handleChangeDate.bind(this)
     this.handleShowDate = this.handleShowDate.bind(this)
-    this.getCurrentDate = this.getCurrentDate.bind(this)
     this.getItemList = this.getItemList.bind(this)
     this.getSearchList = this.getSearchList.bind(this)
     this.getCommonList = this.getCommonList.bind(this)
@@ -124,7 +123,7 @@ class Inspect extends React.Component {
   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')+' '+h.toString().padStart(2,'0')+m.toString().padStart(2,'0')+s.toString().padStart(2,'0');
-    this.setState({ dateTime: date, date: false })
+    // this.setState({ dateTime: date, date: false })
   }
   handleSearchShow(e) {
     let tmpShow = this.state.show;
@@ -147,15 +146,6 @@ class Inspect extends React.Component {
       date: !this.state.date
     })
   }
-  getCurrentDate() {
-    let myDate = new Date();
-    let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
-    let mon = myDate.getMonth() - 0 + 1;       //获取当前月份(0-11,0代表1月)
-    let day = myDate.getDate();            //获取当前日(1-31)
-    let date = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day);
-    this.setState({ dateTime: date })
-    return date;
-  }
   changeActivePart(idx, val, clear) {
     let nums = this.state.num;
     let fillActive;

+ 4 - 3
src/components/Advice/Textarea/index.jsx

@@ -18,7 +18,7 @@ class Textarea extends Component {
   handleInput(e){
     e.stopPropagation();
     const {handleChangeAssistValue,idx,handlePush} = this.props;
-    const text = e.target.innerText || e.target.innerHTML;
+    const text =  e.target.innerHTML;
     const stimer = this.state.timer;
     handleChangeAssistValue&&handleChangeAssistValue(text);
    
@@ -36,7 +36,7 @@ class Textarea extends Component {
     //   // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     // }
     if(next.isRead != isRead && next.value || next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
-      next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = '' 
+      next.value ? this.$dom.current.innerHTML = next.value :  this.$dom.current.innerHTML = '' 
       // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     }
     if(next.typeConfig != typeConfig) {
@@ -46,7 +46,7 @@ class Textarea extends Component {
   componentDidMount(){
     const {value} = this.props;
     if(value && value.trim()){
-      this.$dom.current.innerText = value
+      this.$dom.current.innerHTML = value
       // this.$dom.current.focus()
       // this.$dom.current.innerText ? (this.$dom.current.innerText = value) : (this.$dom.current.innerHTML = value)
     //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
@@ -62,6 +62,7 @@ class Textarea extends Component {
             ref={this.$dom}
             onInput={this.handleInput}
             onKeyUp={this.handleInput}
+            onkeydown={(e) => {e.stopPropagation()}}
         ></div>
       </div>
     );

+ 3 - 2
src/components/AssessResult/AssessHis/index.jsx

@@ -7,9 +7,9 @@ import loadingIcon from '@common/images/loading.gif';
 import ChooseItem from "../ChooseItem";
 import ScaleItem from "../ScaleItem";
 import ChartItem from "../ChartItem";
-import printIcon from '@common/images/team.png';
 import tableIcon from '@common/images/table.png';
 import ScaleTableHis from '@components/ScaleTableHis';
+import { dragBox } from '@utils/drag';
 import $ from "jquery";
 
 class AssessResultHis extends Component {
@@ -99,10 +99,11 @@ class AssessResultHis extends Component {
   showScaleFn(item){
     const { list,inquiryId } = this.props;
     const obj = list&&list[inquiryId];
+    dragBox('dragModalWrap','dragModalTitle','del')
     if(item){
       this.setState({
         tableName:item.name,
-        tableId:item.id,
+        tableId:item.conceptId,
         showScale:!this.state.showScale
       });
     }else{

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

@@ -389,7 +389,7 @@ class ChronicInfo extends React.Component{
                             </span>
                             {formulaId&&formulaId==v.conceptId&&<MiniToast title={it.content.name}
                                 icon={allTableIcon}
-                                confirmText={chronicMagItem?'加入病记录':'确定'}
+                                confirmText={chronicMagItem?'加入病记录':'确定'}
                                 show={formulaId&&formulaId==v.conceptId?true:false}
                                 close={this.closeFormula.bind(this,it)}
                                 confirm={this.addFormula.bind(this,it,v,i,j)}
@@ -453,7 +453,7 @@ class ChronicInfo extends React.Component{
                             </span>
                             <MiniToast title='结果选择'
                                 icon={checkIcon}
-                                confirmText={chronicMagItem?'加入病记录':'确定'}
+                                confirmText={chronicMagItem?'加入病记录':'确定'}
                                 show={optionId&&optionId==v.conceptId?true:false}
                                 close={this.closeOption}
                                 confirm={this.confirmOption.bind(this,v,i,j)}
@@ -499,9 +499,8 @@ class ChronicInfo extends React.Component{
   render(){
     const {comfirnFlag,flag,ff} = this.state;
     const {chronicMagItem,chronicDesease,data,showHide,slideUp} = this.props;
-    console.log(showHide)
     const scaleFooter = <Footer print={true}
-                                footText={showHide.isPop||!chronicMagItem?"确定":"加入病记录"}
+                                footText={showHide.isPop||!chronicMagItem?"确定":"加入病记录"}
                                 handlePrint={this.onPrint}
                                 handleConfirm={this.comfirnTable}/>;
     if(data&&data.length>0){

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

@@ -52,7 +52,6 @@ class CurrentIll extends Component{
       })
     }else if(!text) {//现病史框里没有内容时才设置模板
       let num = moduleNum.num;//主诉使用了几个模板
-      //console.log(999,isChronic)
       if(data.length==0 && !isChronic){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回

+ 2 - 1
src/components/Emergency/index.jsx

@@ -181,7 +181,8 @@ class EmergencyHis extends Component{
                              }}
                             onPropertyChange={(e) => {  // 兼容ie
                                 this.handleInput(e)
-                            }}/>
+                            }}
+                            disabled={data.length==0?true:false}/>
                       <span className={this.getBtnStyle()} onClick={!valChange?this.handleAdd:''}>确认添加</span>
                     </div>
                     <p className={style['add-tip']}>说明:二次诊断只会对导出数据有影响(只为AI建模使用)并不会对真实病历产生任何影响!</p>

+ 1 - 0
src/components/EmergencyProcedure/EmergencyModal/index.less

@@ -45,6 +45,7 @@
     left: 10px;
     padding: 10px;
     box-sizing: border-box;
+    z-index: 20;
     background-color: #fff;
     box-shadow: 0 10px 20px 0 #989DA3;
     border: 1px solid #dedede;

+ 2 - 2
src/components/EmergencyProcedure/EmergencyPart/PartSec/index.jsx

@@ -133,7 +133,7 @@ class PartSec extends React.Component{
         </React.Fragment>
       }else{
         return <React.Fragment>
-        <div className={`${styles.nextWar} ${styles.next}`}>
+        <div className={`${styles.nextCom} ${styles.next}`}>
           <span>非心包积液</span> 
           <img onClick={()=>{this.backSec()}} src={back} alt=""/>
         </div>
@@ -159,7 +159,7 @@ class PartSec extends React.Component{
         </React.Fragment>
       }else{
         return <React.Fragment>
-        <div className={`${styles.nextWar} ${styles.next}`}>
+        <div className={`${styles.nextCom} ${styles.next}`}>
           <span>非气胸患者</span> 
           <img onClick={()=>{this.backSec()}} src={back} alt=""/>
         </div>

+ 5 - 5
src/components/EmergencyProcedure/EmergencyPart/index.jsx

@@ -26,11 +26,11 @@ class EmergencyProcedure extends React.Component {
       });
     }
   }
-  componentWillReceiveProps(nextState){
-    if(nextState.idx != this.props.idx){
-      this.setState({trdShow:false})
-    }
-  }
+  // componentWillReceiveProps(nextState){
+  //   if(nextState.idx != this.props.idx){
+  //     this.setState({trdShow:false})
+  //   }
+  // }
   makeSureWar(num){
     this.setState({
       trdNum:num

+ 5 - 0
src/components/PreviewBody/index.jsx

@@ -78,6 +78,7 @@ class PreviewBody extends Component {
     const { show, preInfo, dataJson, dataStr, baseObj, flg ,showAssessBtn,showHistoryCases} = this.props;
     const other_yjs = dataStr.other?filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other):'';
     const noData = JSON.stringify(preInfo) == '{}';
+    const isChronic = (dataJson.diagChronicMagItem&&dataJson.diagChronicMagItem.name)||(dataJson.mainChronicDesease&&dataJson.mainChronicDesease.name);
     return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>
       <div className={style['contents']} id="content" style={{ margin: "0 auto", maxWidth: "620px" }}>
         <Information baseObj={baseObj} preInfo={preInfo}></Information>
@@ -117,6 +118,10 @@ class PreviewBody extends Component {
           </tr>
         </table>
         <p className={style.docName}>医生签名:<span>{baseObj ? baseObj.doctorName : (noData ? '' : preInfo.doctorName)}</span></p>
+        {showAssessBtn&&isChronic?<AssessResultHis showHistoryCases={showHistoryCases} inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
+        <div onClick={() => { this.surePrint(dataStr) }} className={style.printBtn} style={{
+          display: show ? 'inline-block' : 'none',
+        }}>打印</div>
       </div>
     </div>
   }

+ 1 - 2
src/modules/HomePage/index.jsx

@@ -55,8 +55,7 @@ class HomePage extends Component {
     }
     render() {
         const {flag,setPushEmergencyIdx,sysConfig} = this.props;
-        return <div className={style['home-page']}>
-        {/* return <div className={style['home-page']} onClick={this.props.hideAllDrop}> */}
+        return <div className={style['home-page']} onClick={this.props.hideAllDrop}>
             <BannerContainer />
             {/* <InfoTitle /> */}
             <BodyContainer></BodyContainer>

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

@@ -73,7 +73,8 @@ function getAdviceStr(advice) {
 	if(adviceInput)  { 
 		AdviceStr = AdviceStr +'; ' + adviceInput;
 	}	
-	
+	let reg=/<[^>]+>/gim;
+	AdviceStr = AdviceStr.replace(reg,"");
 	return AdviceStr;
 }
 

+ 4 - 2
src/store/async-actions/print.js

@@ -79,9 +79,11 @@ export const saveMessage = (bool) => {
                 Notify.success('历史病历保存成功');
             }
         } else {
-            console.log(res)
+          Notify.info(data.msg);
         }
-    })
+    }).catch(function(){
+        Notify.info('保存失败,请稍后再试!');
+    });
     if(bool){
         json('/printRecord/savePrintRecords', {
             "dataJson": JSON.stringify(getAllDataList(baseList)),

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

@@ -136,7 +136,7 @@ export const getConceptDetail = (item) => {
         }
 
         json(api.getConceptDetail, params).then((res) => {
-            if(res.data.code == '0') {
+            if(res.data.code == '0'&& res.data.data.details && res.data.data.details.length > 0) {
                 if(item.position == '1') {  //右侧提示信息
                     dispatch({
                         type: SET_CLICK_DIAG,

+ 0 - 1
src/store/reducers/homePage.js

@@ -1,7 +1,6 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
   HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,SEARCH_DROP_LOCATION,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES,SETSYSTEMCONFIG} from '../types/homePage.js';
 import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,searchDropLocation,getInspectList,getAssistList} from '../actions/homePage.js';
-import SearchDrop from '../../components/SearchDrop/index.jsx';
 
 const initState = {
   totalHide:false,

+ 0 - 1
src/store/reducers/inspect.js

@@ -51,7 +51,6 @@ export default (state = initSearchList, action) => {
           lisExcelRes:[],
           messages:[]
         }
-
         for(let i = 0;i < tmpGroup.length;i++){
           let tmpObj = {//excelDataLis.lisExcelRes[0]
             menus:'',

+ 2 - 1
src/utils/tools.js

@@ -879,8 +879,9 @@ function dateParser(timestamp,link = '-'){
   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 result = year+link+month+link+date;
-  let result = year+link+(month<10?"0"+month:month)+link+(date<10?"0"+date:date)+' '+hour+':'+minute;
+  let result = year+link+(month<10?"0"+month:month)+link+(date<10?"0"+date:date)+' '+hour+':'+minute+':'+second;
   return result;
 }