morphone1995 преди 4 години
родител
ревизия
32882251e1

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

@@ -79,26 +79,24 @@ class PatInfo extends Component {
   }
 
   handleChange(e){
-    const { initPatInfoData } = this.props;
-    
+    const { initPatInfoData } = this.props;    
     let { patientInfo } = this.state;
     let newInfo = Object.assign([], patientInfo);
-    // console.log(newInfo,'newInfo');
     let patientItem = newInfo.find(item =>{
       return item.id === e.target.id
-    })  
+    })      
     // 处理性别
     if (patientItem.id === 'patientSex'){     
-      if (e.target.value === '') {
+      if (e.target.value === '1') {
         patientItem.value = 1
-      } else if (e.target.value === ''){
+      } else if (e.target.value === '0'){
         patientItem.value = 0
       } else {
         patientItem.value = 0  // 默认为女
       }
+    }else{
+      patientItem.value = e.target.value;
     }
-    patientItem.value = e.target.value;
-    // console.log(e.target.value, '性别', patientItem)
     this.setState({
       patientInfo: newInfo
     },()=>{
@@ -116,7 +114,13 @@ class PatInfo extends Component {
               return (
                 <div className={style["infoItem"]} key={item.id}>
                   <label for={item.label}>{item.title}:</label>
-                  {item.id === 'patientSex' && (<input id={item.id} type="text" autocomplete="off" value={item.value == 1 ? '男' : '女'} onChange={this.handleChange} />)}
+                  {item.id === 'patientSex' && (
+                    <select id={item.id} value={item.value} onChange={this.handleChange}>
+                      <option value='1'>男</option>
+                      <option value='0'>女</option>
+                    </select>
+                  )}
+                  {/* {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 !== 'patientSex' && item.id !== 'systemTime' &&  (<input id={item.id} type="text" autocomplete="off" value={item.value} onChange={this.handleChange} />) }                  
                 </div>

+ 12 - 0
src/components/PatInfo/index.less

@@ -27,6 +27,18 @@
       text-overflow: ellipsis;
       overflow: hidden;
     }
+    select {
+
+      height: 28px;
+      flex:1;
+      border: none;
+      outline: none;
+    }
+    option{
+      display: inline-block;
+      height: 40px;
+      // width: 77%;
+    }
   }
   .infoItem:nth-child(-n+4){
     border-bottom: 1px solid @person-table-color;

+ 11 - 5
src/store/async-actions/historyTemplates.js

@@ -1,5 +1,10 @@
 import axios from '@utils/ajax';
-import { pushAllDataList, didPushParamChange, pushHistoryDataList } from '@utils/tools';
+import {
+  pushAllDataList,
+  didPushParamChange,
+  pushHistoryDataList,
+  getUrlArgObject,
+} from '@utils/tools';
 import { initHistory } from '@store/actions/historyTemplates';
 import { HISTORY_GETHOSPITALINFO } from '@store/types/historyTemplates';
 import Notify from '@commonComp/Notify';
@@ -92,14 +97,15 @@ export const asyncCancelTemplateInfos = (delId) => {
 // 获取医院信息
 export const getHospitalInfo = () =>{
   return (dispatch) =>{
-    axios.json('/tran/hospitalInfo/getHospitalInfoById', { id: 1 }).then(res => {
+    let hospitalId = getUrlArgObject('hospitalId');
+    axios.json('/tran/hospitalInfo/getHospitalInfoById', { id: hospitalId }).then(res => {
       if (res.data.code === '0') {
         dispatch({
           type: HISTORY_GETHOSPITALINFO,
-          data: res.data.data
-        })
+          data: res.data.data,
+        });
       }
-    })
+    });
   }
   
 }

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

@@ -144,7 +144,7 @@ export const saveMedicalData = () =>{
         type: 12,
       },
     ];
-    let sex = formatFormParmas('patientSex', patInfoData) === '男' ? 1 : 0
+    // let sex = formatFormParmas('patientSex', patInfoData) === '男' ? 1 : 0
     let params = {
         "age": formatFormParmas('patientAge', patInfoData),
         "cardNo": formatFormParmas('patientIdNo', patInfoData),
@@ -156,7 +156,7 @@ export const saveMedicalData = () =>{
         "modeName": modeName,
         "patName": formatFormParmas('patientName', patInfoData),
         "preview": JSON.stringify(preview),  // 左侧病历预览信息
-        "sex": sex,
+        "sex": formatFormParmas('patientSex', patInfoData),
     }
     json('/demo/templateInfo/saveTemplateInfo', params).then(res=>{
         let data = res.data

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

@@ -24,7 +24,7 @@ const api={
 
 export const embedPush = (obj) => {      //内嵌页面推送时推送
   return (dispatch, getState) =>{
-    console.log(obj,'推送的obj');
+    // console.log(obj,'推送的obj');
     const param = getEMRParams();   // 获取推送参数
     param.mode=obj?obj.mode:-1;    // 模式  >100 输入中    < 100  获取
     json(api.setMrInfo,param,true).then((res)=>{