morphone1995 4 年 前
コミット
ee9ef242fc

+ 14 - 4
src/components/PatInfo/index.jsx

@@ -1,7 +1,7 @@
 import React, { Component } from "react";
 import style from "./index.less";
 import Select from './Select/index'
-import {timesYMDTime} from '@utils/tools';
+import { timesYMDTime, timestampToTime} from '@utils/tools';
 import config from '@config/index';
 import Notify from '@commonComp/Notify';
 import { getHospitalInfo } from '@store/async-actions/historyTemplates';
@@ -43,7 +43,8 @@ class PatInfo extends Component {
         {
           label: 'systemTime',
           id: 'systemTime',
-          value: timesYMDTime(new Date().getTime()),
+          // value: timesYMDTime(new Date().getTime()),
+          value: timestampToTime(new Date().getTime()),
           title: '就诊时间',
           maxlength: 100
         },
@@ -101,7 +102,16 @@ class PatInfo extends Component {
       return item.id === e.target.id
     })      
     if (patientItem.id === 'patientAge'){
-      patientItem.value = e.target.value.replace(/[^\d]+/, '')
+      let temp = Math.round(e.target.value.replace(/[^\d\.]+/, ''))
+      if (isNaN(temp)){
+        patientItem.value = 50
+        Notify.info('请输入正确的年龄')
+        return 
+      }else {
+        patientItem.value = temp
+      }
+      
+      // patientItem.value = e.target.value.replace(/[^\d\.]+/, '')   //小数四舍五入_楼超强2020914
     } else {
       patientItem.value = e.target.value;
     }
@@ -168,7 +178,7 @@ class PatInfo extends Component {
                     ></Select>
                   )}
                   {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 === 'systemTime' && (<input id={item.id} type="text" autocomplete="off" disabled value={item.value.split(' ')[0]} 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 - 1
src/store/actions/patInfo.js

@@ -80,7 +80,7 @@ export const reInitPatInfo = (state, action) => {
   res.patInfoData[1].value = action.params && action.params.patName;
   res.patInfoData[2].value = action.params && action.params.age;
   res.patInfoData[3].value = action.params && action.params.sex;
-  res.patInfoData[4].value = action.params && action.params.inquiryDate;
+  res.patInfoData[4].value = action.params && action.params.inquiryDate;   //2020/9/14
   res.patInfoData[5].value = action.params && action.params.deptName;
   res.patInfoData[6].value = action.params && action.params.doctorName;
   res.patInfoData[7].value = action.params && action.params.inquiryCode;

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

@@ -159,8 +159,9 @@ export const saveMedicalData = () =>{
         "dataJson": JSON.stringify(Object.assign({}, jsonData)),
         "deptName": formatFormParmas('hospitalDeptName', patInfoData),
         "doctorName": formatFormParmas('doctorName', patInfoData),
-        "inquiryCode": formatFormParmas('recordId', patInfoData),
-        "inquiryDate": inquiryDate,
+        "inquiryCode": formatFormParmas('recordId', patInfoData), 
+        "inquiryDate": formatFormParmas('systemTime', patInfoData),   // 2020/9/14 编辑状态保存原有时间 _lcq
+        // "inquiryDate": inquiryDate,
         "modeName": modeName,
         "patName": formatFormParmas('patientName', patInfoData),
         "preview": JSON.stringify(preview),  // 左侧病历预览信息