Browse Source

Merge branch 'newVersion6.0' into lcq

morphone1995 4 years atrás
parent
commit
cca08c5a6f

+ 13 - 65
src/components/AddNewInspect/SlidePic/index.jsx

@@ -1,17 +1,9 @@
 import React, { Component } from "react";
 import styles from "./index.less";
-import { normalVal,getArrow,timestampToTime,getDomUpDown,getPageCoordinate,setPosition,setFontColorSize } from '@utils/tools';
-import { InspectCommon, Notify,DelToast} from '@commonComp';
-import slideUp from "@common/images/slide-up.png";
-import slideDown from "@common/images/slide-down.png";
+import {  Notify,DelToast} from '@commonComp';
 import $ from 'jquery';
 import checkOff from '@common/images/check_off.png';
 import checkOn from '@common/images/check_on.png';
-import ScrollArea from 'react-scrollbar';
-import InspectName from '../InspectName';
-
-import up from '@images/up.png';
-import down from '@images/down.png';
 
 class SlidePic extends Component {
   constructor(props) {
@@ -21,25 +13,17 @@ class SlidePic extends Component {
       activeInd:false,
       activeName:'',
       canEdit:true,
-      style:'',
+      style:''
     };
-    this.toTime = this.toTime.bind(this);
-    this.handleSlide = this.handleSlide.bind(this);
     this.handleDel = this.handleDel.bind(this);
     this.handleCancel = this.handleCancel.bind(this);
     this.delConfirm = this.delConfirm.bind(this);
-    this.timeSure = this.timeSure.bind(this);
     this.setEdit = this.setEdit.bind(this);
-    this.handleLabelSub = this.handleLabelSub.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
     this.checkOnOff = this.checkOnOff.bind(this);
   }
-  handleChangeDate(date) {
-    // console.log(date,'外')
-  }
   
   componentDidMount() {
-    const {item} = this.props;
     $(document).click((event) => {
       if($(event.target).attr("id")!='addClose'&&$(event.target).attr("id")!='delTit'){
         this.setState({
@@ -47,37 +31,14 @@ class SlidePic extends Component {
         })
       }
     });
-    let type = getArrow(item.minValue,item.maxValue,item.value||null)
-    this.setState({style:type,value:item.value,time:item.time})
-    const that = this;
-    document.addEventListener('mousedown',function(e){
-      //onMousedown的目标为滚动条时,标签填写单不关闭
-      if(e.target.className=='scrollbar'){
-        that.isBar = true;
-      }else{
-        that.isBar = false;
-      }
-    });
-    // this.setState({ dateTime: getCurrentDate(1) })
-  }
-  toTime(time){
-    let tmpTim = time.split(',').join('')-0
-    if(time && tmpTim.toString() != 'NaN'){
-      let date = new Date('1900-01-01');
-      let dateTim = date.getTime();
-      let times = (tmpTim-2)*24*60*60*1000;
-      let result = timestampToTime(dateTim+times).split(' ')[0]
-      return result;
-    }else{
-      return time;
-    }
-  }
-  handleSlide(){
-    let tmpShow = this.state.show
-    this.setState({
-      show:!tmpShow
-    })
   }
+  // shouldComponentUpdate(nextProps,nextState){
+  //   console.log(this.props.item.time , nextProps.item.time,nextState)
+  //   if(this.props.item.time == nextProps.item.time){
+  //     return false
+  //   }
+  //   return true
+  // }
   handleDel(time){
     const {handleDelClick,item} = this.props;
     this.setState({
@@ -102,22 +63,9 @@ class SlidePic extends Component {
       activeName:''
     })
   }
-  timeSure(date){
-    const {handleChangeDate} = this.props;
-    handleChangeDate&&handleChangeDate(date)
-  }
-  handleLabelSub(e,questionId,idx){
-    const {handleLabelSub,handleFillShow,setHighter,refreshScroller} = this.props;
-    handleLabelSub(e,questionId,idx);
-    handleFillShow(e,idx);
-    //弹窗高度超出屏幕,增加页面高度
-    setPosition(e,"#inspectFill",setHighter);
-    /*setTimeout(function(){//如果检验下面有很多数据,则会跳过头
-      refreshScroller()&&refreshScroller().scrollYTo(290);
-    })*/
-  }
   handleInput(e,item,sign){
     const {setTipValue} = this.props
+    console.log(item,e.target.value)
     setTipValue(item,e.target.value,sign)
   }
   handleBlur(){
@@ -148,7 +96,7 @@ class SlidePic extends Component {
               <input disabled='disabled' type="text" 
                 class="canEdit" 
                 onDoubleClick={(e)=>this.setEdit(e)}
-                style={{color:style==2||style==4?'red':style==1?'#D949FF':'#333'}}
+                style={{color:'#333'}}
                 placeholder={item.flg == 5?'(填写用法计量)':'(填写用量)'}
                 autoComplete="off"
                 value={item.value}
@@ -165,8 +113,8 @@ class SlidePic extends Component {
                 placeholder='时间'
                 autoComplete="off"
                 value={item.time}
-                onInput={(e)=>{this.handleInput(e,item,1)}}
-                onBlur={()=>{this.handleBlur()}}
+                onChange={(e)=>{this.handleInput(e,item,1)}}
+                onBlur={(e)=>{this.handleBlur();}}
                 />
           </span>
           <span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item.time)}}></span>

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

@@ -327,6 +327,7 @@ class AddNewInspect extends React.Component {
     }
   }
   render() {
+    console.log(99)
     const {labelListBlood,setHighter,refreshScroller,checkOnOff, getInfomation,setTipValue, handleChangeValue,labelListSmall,inspectList, inspectVal, list, labelListBig, windowHeight, windowWidth,detailClick, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush,handleDelConfirm } = this.props;
     const { tmpId, tmpIdx, time, pageTop, impId } = this.state;
     const contStyle={

+ 2 - 2
src/containers/NewAdvice.js

@@ -16,7 +16,7 @@ import {
   clearLabel,
   delPartItem,
   setContext,
-  setTip,
+  setTipAdvice,
   searchTypeNew,
   resetLabel,
   delOnePic,
@@ -101,7 +101,7 @@ function mapDispatchToProps(dispatch) {
       dispatch(getMRAnalyse())
     },
     setTipValue(item,value,sign) {
-      dispatch(setTip(item,value,sign))
+      dispatch(setTipAdvice(item,value,sign))
     },
     //右侧推送
     fetchPushInfos(obj) {

+ 3 - 3
src/store/actions/newAdvice.js

@@ -1,4 +1,4 @@
-import {SET_CONTEXT,CHECK_OFF_ON_NEW,DEL_ONE_PIC,ADD_LABEL,SEARCH_LIST,SET_LABEL,SET_TIP,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL_NEW,CLEAR_ALL_LABEL,DEL_PART_ITEM_NEW,DEL_EXCEL_LIST,SEARCH_TYPE_NEW} from '../types/newAdvice';
+import {SET_CONTEXT,CHECK_OFF_ON_NEW,DEL_ONE_PIC,ADD_LABEL,SEARCH_LIST,SET_LABEL,SET_TIP_ADVICE,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL_NEW,CLEAR_ALL_LABEL,DEL_PART_ITEM_NEW,DEL_EXCEL_LIST,SEARCH_TYPE_NEW} from '../types/newAdvice';
 
 export const setLabel = (idx,sign) => ({          //搜索后点击选中的结果
     type:SET_LABEL,
@@ -63,8 +63,8 @@ export const setContext = (obj) => ({
     type:SET_CONTEXT,
     obj
 })
-export const setTip = (item,value,sign) => ({
-    type:SET_TIP,
+export const setTipAdvice = (item,value,sign) => ({
+    type:SET_TIP_ADVICE,
     item,
     value,
     sign

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

@@ -10,7 +10,6 @@ import { HISTORY_GETHOSPITALINFO } from '@store/types/historyTemplates';
 import { embedPush } from '@store/async-actions/pushMessage';
 import Notify from '@commonComp/Notify';
 import store from '@store';
-import { billing, getMRAnalyse} from '@store/async-actions/pushMessage';
 
 export const initItemList = (item) => {
     let params = {

+ 8 - 3
src/store/reducers/newAdvice.js

@@ -11,7 +11,7 @@ import {
   DEL_EXCEL_LIST,
   ADD_LABEL,
   SET_CONTEXT,
-  SET_TIP,
+  SET_TIP_ADVICE,
   DEL_ONE_PIC,
   SEARCH_TYPE_NEW,
   CHECK_OFF_ON_NEW,
@@ -19,7 +19,7 @@ import {
   CLEARNEWADVICEDATA,
 } from '../types/newAdvice';
 import store from '@store';
-import { getStringPlus,  getPushLists,  getPushList,getCurrentDate} from '@utils/tools.js';
+import {getStringPlus,getPushLists,getPushList,getCurrentDate} from '@utils/tools.js';
 
 const initSearchList = {
     list: [], //搜索的结果
@@ -110,7 +110,7 @@ export default (state = initSearchList, action) => {
         return newState;
     }
 
-    if (action.type == SET_TIP) {    
+    if (action.type == SET_TIP_ADVICE) {    
         const newState = Object.assign({}, state);
         let tempArr = newState.labelListBig;
         let tempArrs = newState.labelListSmall;
@@ -162,6 +162,7 @@ export default (state = initSearchList, action) => {
         const tempArrs = newState.labelListSmall;
         const tmpArr = newState.labelListBlood;
         let tmpLis = action.list
+        console.log(action,555555)
         tmpLis['time'] = getCurrentDate(1)
         tmpLis['dateValue'] = getCurrentDate(1)
         if(tmpLis.flg == 5){
@@ -318,6 +319,8 @@ export default (state = initSearchList, action) => {
       newState.labelListSmall = action.params[11].content.labelListSmall;
       newState.drugOrder = action.params[11].content.labelListBig;
       newState.operationOrder = action.params[11].content.labelListSmall;
+      newState.labelListBlood = action.params[11].content.labelListBlood;
+      newState.transfusionOrder = action.params[11].content.transfusionOrder;;
       return newState;
     }
     if (action.type == CLEARNEWADVICEDATA) {
@@ -326,6 +329,8 @@ export default (state = initSearchList, action) => {
     newState.labelListSmall = [];
     newState.drugOrder = [];
     newState.operationOrder = [];
+    newState.labelListBlood = [];
+    newState.transfusionOrder = [];
     return newState;
     }
     return state;

+ 1 - 1
src/store/types/newAdvice.js

@@ -12,7 +12,7 @@ export const DEL_PART_ITEM_NEW = 'DEL_PART_ITEM_NEW';
 export const DEL_EXCEL_LIST = 'DEL_EXCEL_LIST';
 export const ADD_LABEL = 'ADD_LABEL';
 export const SET_CONTEXT = 'SET_CONTEXT';
-export const SET_TIP = 'SET_TIP';
+export const SET_TIP_ADVICE = 'SET_TIP';
 export const SEARCH_TYPE_NEW = 'SEARCH_TYPE_NEW';
 export const DEL_ONE_PIC = 'DEL_ONE_PIC';
 export const CHECK_OFF_ON_NEW = 'CHECK_OFF_ON_NEW';

+ 5 - 4
src/utils/tools.js

@@ -196,9 +196,11 @@ const formatTextInfo = (baseList) =>{
   let newAdviceLabelList = {
     labelListSmall: [],
     labelListBig: [],
+    labelListBlood: [],
   };
   newAdviceLabelList.labelListSmall = baseList.newAdvice.labelListSmall;
   newAdviceLabelList.labelListBig = baseList.newAdvice.labelListBig;
+  newAdviceLabelList.labelListBlood = baseList.newAdvice.labelListBlood;
 
   let assistLabelList = {
     dataString: baseList.assistCheck.dataString,
@@ -220,7 +222,7 @@ const formatTextInfo = (baseList) =>{
     marriageHistory: JSON.stringify(baseList.marriageHistory.saveText),
     menstruationHistory: JSON.stringify(baseList.menstruationHistory.saveText),
     vital: JSON.stringify(baseList.checkBody.saveText),
-    lis: labelList, // 化验
+    lis: labelList, //化验
     pacs: assistLabelList,
     diag: diagnosticList,
     advice: newAdviceLabelList,
@@ -229,7 +231,6 @@ const formatTextInfo = (baseList) =>{
 
 // 回读数据_lcq_2020.08.17
 const pushHistoryDataList = (reData) =>{
-  
  store.getState().inspect.context.scrollArea&&store.getState().inspect.context.scrollArea.scrollTop()
  let dataJson = JSON.parse(reData.preview)
   // 回显头部表单数据 
@@ -933,7 +934,7 @@ function getEMRParams(){
   tempdrug = tempdrug.filter((item)=>!item.check)
   let tempoperation = newAdvice.labelListSmall
   tempoperation = tempoperation.filter((item)=>!item.check)
-  let tempblood = newAdvice.labelListBlood
+  let tempblood = newAdvice.labelListBlood||[]
   tempblood = tempblood.filter((item)=>!item.check)
   let sex = formatFormParmas('patientSex', patInfoData);
   const obj = {
@@ -1169,7 +1170,7 @@ function getCurrentDate(flg,con){
     var h = myDate.getHours();
     var m = myDate.getMinutes();
     var s = myDate.getSeconds();
-    date = year+link+(mon<10?"0"+mon:mon)+link+(day<10?"0"+day:day)+' '+(h<10&&h!=0?"0"+h:h)+':'+(m<10&&m!=0?"0"+m:m)+':'+(s<10&&s!=0?"0"+s:s);
+    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<10?"0"+mon:mon)+link+(day<10?"0"+day:day);
   }