Jelajahi Sumber

bug 默认推送

morphone1995 4 tahun lalu
induk
melakukan
60005a89fc

+ 22 - 5
src/components/PatInfo/index.jsx

@@ -7,6 +7,7 @@ import {
 import Notify from '@commonComp/Notify';
 import { getHospitalInfo } from '@store/async-actions/historyTemplates';
 import store from '@store';
+import { embedPush } from '../../store/async-actions/pushMessage'
 class PatInfo extends Component {
   constructor(props){
     super(props)
@@ -73,6 +74,7 @@ class PatInfo extends Component {
     }
     this.handleChange = this.handleChange.bind(this)
     this.handleSexChange = this.handleSexChange.bind(this)
+    this.inputOnFocus = this.inputOnFocus.bind(this)
   }
   componentWillMount() {
     const { getMessage, initPatInfoData } = this.props;
@@ -97,7 +99,6 @@ class PatInfo extends Component {
     let patientItem = newInfo.find(item =>{
       return item.id === e.target.id
     })      
-    // 处理性别
     if (patientItem.id === 'patientAge'){
       patientItem.value = e.target.value.replace(/[^\d]+/, '')
     } else {
@@ -105,11 +106,20 @@ class PatInfo extends Component {
     }
     if (patientItem.id === 'patientAge' && patientItem.value > 200) {
       Notify.info('年龄不能超过200')
+      return 
     }
     this.setState({
       patientInfo: newInfo
     })
     initPatInfoData && initPatInfoData(newInfo)
+    // 年龄/科室改变时,默认推送
+
+    if (patientItem.id === 'patientAge' || patientItem.id === 'hospitalDeptName') {
+      store.dispatch(embedPush({
+        action: "patientia",
+        mode: 1
+      }))
+    } 
   }
 
   handleSexChange (item){
@@ -123,6 +133,14 @@ class PatInfo extends Component {
     initPatInfoData && initPatInfoData(newInfo)
   }
 
+  // 获取焦点推送
+  inputOnFocus(){
+    store.dispatch(embedPush({
+      action: "patientia",
+      mode: 1
+    }))
+  }
+
   render(){
     const {message} = this.props.patInfo;
      return (
@@ -140,10 +158,9 @@ class PatInfo extends Component {
                       onChange={(item) => this.handleSexChange(item)}
                     ></Select>
                   )}
-                  {item.id === 'patientAge' && (<input id={item.id} type="text" autocomplete="off" maxlength={11}  value={item.value} onChange={this.handleChange} />)}
-                  {/* {item.id === 'patientSex' && (<input id={item.id} type="text" autocomplete="off" value={item.value == 1 ? '男' : '女'} onChange={this.handleChange} />)} */}
-                  {item.id === 'systemTime' && (<input id={item.id} type="text" autocomplete="off"  disabled value={item.value } onChange={this.handleChange} />)}
-                  {item.id !== 'patientAge' && item.id !== 'patientSex' && item.id !== 'systemTime' && (<input id={item.id} type="text" maxlength={item.maxlength} autocomplete="off" value={item.value} onChange={this.handleChange} />) }                  
+                  {item.id === 'patientAge' && (<input id={item.id} type="text" autocomplete="off" maxlength={11} value={item.value} onChange={this.handleChange} onFocus={this.inputOnFocus}/>)}
+                  {item.id === 'systemTime' && (<input id={item.id} type="text" autocomplete="off" disabled value={item.value} onChange={this.handleChange} onFocus={this.inputOnFocus}/>)}
+                  {item.id !== 'patientAge' && item.id !== 'patientSex' && item.id !== 'systemTime' && (<input id={item.id} type="text" maxlength={item.maxlength} autocomplete="off" value={item.value} onChange={this.handleChange} onFocus={this.inputOnFocus}/>) }                  
                 </div>
               )
             })

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

@@ -170,6 +170,7 @@ export default (state = initSearchList, action) => {
   if (action.type == REASSISTCHECKDATA) {
     const newState = Object.assign({}, state);
     newState.assistLabel = action.params[9].contentValue;
+    newState.totalOrder = action.params[9].contentValue;
     newState.dataArr = action.params[9].contentValue;
     newState.dataString = action.params[9].content;
     return newState;

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

@@ -277,7 +277,7 @@ export default (state = initSearchList, action) => {
       const newState = Object.assign({}, state);
         newState.labelListBig = action.params[8].content.labelListBig
         newState.labelListSmall = action.params[8].content.labelListSmall;       
-        newState.totalOrder = action.params[8].content.totalOrder;       
+        newState.totalOrder = action.params[8].content.labelListBig;       
       return newState;
 
     }

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

@@ -279,6 +279,8 @@ export default (state = initSearchList, action) => {
       const newState = Object.assign({}, state);
       newState.labelListBig = action.params[11].content.labelListBig;
       newState.labelListSmall = action.params[11].content.labelListSmall;
+      newState.drugOrder = action.params[11].content.labelListBig;
+      newState.operationOrder = action.params[11].content.labelListSmall;
       return newState;
     }
     if (action.type == CLEARNEWADVICEDATA) {

+ 3 - 1
src/utils/tools.js

@@ -229,6 +229,7 @@ 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)
   // 回显头部表单数据 
@@ -1144,7 +1145,8 @@ function timesYMDTime(timestamp) {
   var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
   var Y = date.getFullYear() + '-';
   var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
-  var D = date.getDate() ;
+  // var D = date.getDate() ;
+  var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); ;
   return Y + M + D 
 }