morphone1995 vor 4 Jahren
Ursprung
Commit
136beae673

+ 27 - 18
src/components/Operation/index.jsx

@@ -95,24 +95,33 @@ class Operation extends Component {
   }
 
   saveAll(type) {
-    let keepState = readyKeepHistory();
-    if(keepState == 1){
-        Notify.info('主诉不能为空');
-        return;
-    }else if(keepState == 2){
-        Notify.info('诊断不能为空');
-        return;
-    }else{
-      this.setState({
-        type: type,
-        okText: '保存',
-        borderColor: '#3B9ED0',
-        okColor: '#fff',
-        oKBg: '#3B9ED0',
-        msg: <p className={style['msg']}>是否保存该病历?</p>
-      })
-      this.props.diagShowTmp(true)
-    }
+    // let keepState = readyKeepHistory();
+    // if(keepState == 1){
+    //     Notify.info('主诉不能为空');
+    //     return;
+    // }else if(keepState == 2){
+    //     Notify.info('诊断不能为空');
+    //     return;
+    // }else{
+    //   this.setState({
+    //     type: type,
+    //     okText: '保存',
+    //     borderColor: '#3B9ED0',
+    //     okColor: '#fff',
+    //     oKBg: '#3B9ED0',
+    //     msg: <p className={style['msg']}>是否保存该病历?</p>
+    //   })
+    //   this.props.diagShowTmp(true)
+    // }
+    this.setState({
+      type: type,
+      okText: '保存',
+      borderColor: '#3B9ED0',
+      okColor: '#fff',
+      oKBg: '#3B9ED0',
+      msg: <p className={style['msg']}>是否保存该病历?</p>
+    })
+    this.props.diagShowTmp(true)
   }
   clearAll(type) {
     let baseList = store.getState();

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

@@ -9,49 +9,49 @@ class PatInfo extends Component {
         {
           label: 'patientIdNo',
           id: 'patientIdNo',
-          value: '',
+          value: '330127198912311234',
           title: '卡号'
         },
         {
           label: 'patientName',
           id: 'patientName',
-          value: '',
+          value: '王明明',
           title: '姓名'
         },
         {
           label: 'patientAge',
           id: 'patientAge',
-          value: '',
+          value: '56',
           title: '年龄'
         },
         {
           label: 'patientSex',
           id: 'patientSex',
-          value: '',
+          value: '',
           title: '性别'
         },
         {
           label: 'systemTime',
           id: 'systemTime',
-          value: '',
+          value: '2020-08-10',
           title: '就诊时间'
         },
         {
           label: 'hospitalDeptName',
           id: 'hospitalDeptName',
-          value: '',
+          value: '全科',
           title: '科室'
         },
         {
           label: 'doctorName',
           id: 'doctorName',
-          value: '',
+          value: '付医生',
           title: '医生'
         },
         {
           label: 'recordId',
           id: 'recordId',
-          value: '',
+          value: '4332',
           title: '门诊号'
         }
 
@@ -60,31 +60,38 @@ class PatInfo extends Component {
     this.handleChange = this.handleChange.bind(this)
   }
   componentWillMount() {
-    const { getMessage } = this.props;
+    const { getMessage, initPatInfoData } = this.props;
     getMessage && getMessage()
+    initPatInfoData && initPatInfoData(this.state.patientInfo)
   }
   componentWillReceiveProps(nextProps){
-    const {message} = nextProps.patInfo
-    let { patientInfo} = this.state
-    if (Object.keys(message).legnth !== 0){     
-      patientInfo.forEach(item =>{
-        item.value = message[item.label]
-      })
-      this.setState({
-        patientInfo
-      })
-    }
+    const { patInfoData } = nextProps.patInfo
+    this.setState({
+      patientInfo:patInfoData
+    })
+    // const {message} = nextProps.patInfo
+    // let { patientInfo} = this.state
+    // if (Object.keys(message).legnth !== 0){     
+    //   patientInfo.forEach(item =>{
+    //     item.value = message[item.label]
+    //   })
+    //   this.setState({
+    //     patientInfo
+    //   })
+    // }
   }
 
   handleChange(e){
+    const { initPatInfoData } = this.props;
     let { patientInfo } = this.state
     let patientItem = patientInfo.find(item =>{
       return item.id === e.target.id
     })
     patientItem.value = e.target.value;
-    this.setState({
-      patientInfo
-    })
+    initPatInfoData && initPatInfoData(this.state.patientInfo)
+    // this.setState({
+    //   patientInfo
+    // })
   }
 
   render(){

+ 1 - 1
src/containers/OperationContainer.js

@@ -85,7 +85,7 @@ function mapDispatchToProps(dispatch) {
     },
     save: () => {
       // 埋点事件,点击保存时调用
-      dispatch(saveClickNum);
+      // dispatch(saveClickNum);
       dispatch(() => saveMessage())
     },
     clear: (flag) => {

+ 7 - 0
src/containers/PatInfoContainer.js

@@ -2,6 +2,7 @@ import React from 'react';
 import {connect} from 'react-redux';
 import {initPersonInfo} from '../store/async-actions/patInfo';
 import PatInfo from '../components/PatInfo';
+import { SETINITPATINFO} from '../store/types/patInfo'
 
 function mapStateToProps({patInfo}) {
     return ({patInfo})
@@ -11,6 +12,12 @@ function mapDispatchToProps(dispatch) {
     return {
         getMessage: () => {
             dispatch(initPersonInfo)
+        },
+        initPatInfoData: (params) =>{
+            dispatch({
+                type: SETINITPATINFO,
+                params
+            })
         }
     }
 }

+ 8 - 1
src/store/actions/patInfo.js

@@ -49,4 +49,11 @@ export const updateHospitalMessage=(state,action)=>{
     }
     res.hospitalMsg = tmpObj || {};
     return res;
-};
+};
+
+// 获取设置病历信息
+export const setPatInfo = (state,action) => {
+  const res = Object.assign({}, state);
+  res.patInfoData = action.params
+  return res
+}

+ 5 - 0
src/store/async-actions/patInfo.js

@@ -249,3 +249,8 @@ export async function getPatientMessage(dispatch, getState){
   //dispatch(initHistoryDetails());      //历史病历回读
 }
 
+
+//  获取病历信息
+export async function getPatInfoData(dispatch,getState) {
+  
+}

+ 39 - 5
src/store/async-actions/print.js

@@ -10,7 +10,8 @@ import {
     getAllDataStringList,
     pushAllDataList,
     filterDataArr,
-    filterOtherDataArr
+    filterOtherDataArr,
+    timestampToTime
 } from '@utils/tools';
 export const getConceptDetails = (bool) => {
     let baseList = store.getState();
@@ -45,15 +46,48 @@ export const getConceptDetails = (bool) => {
 }
 export const saveMessage=(bool)=>{
     store.dispatch({type:MODI_LOADING,flag:true});
-    getConceptDetails(bool)
+    // getConceptDetails(bool)  //保存病历 老版本
+    saveMedicalData()
 }
 
+// 获取参数value
+function formatFormParmas(val,arr){
+    let item = arr.length!==0 && arr.find(item=>{
+       return item.id === val
+    })
+    return item.value
+}
+
+// 保存病历_lcq_new_重写
+export const saveMedicalData = () =>{
+    let baseList = store.getState();
+    console.log(baseList,'======baseList========');
+    let inquiryDate = timestampToTime(new Date().getTime())  // 获取当前时间
+    const { patInfo: { patInfoData} } = baseList
+    let params = {
+        "age": formatFormParmas('patientAge', patInfoData),
+        "cardNo": formatFormParmas('patientIdNo', patInfoData),
+        "dataJson": '',
+        "deptName": formatFormParmas('hospitalDeptName', patInfoData),
+        "doctorName": formatFormParmas('doctorName', patInfoData),
+        "inquiryCode": formatFormParmas('recordId', patInfoData),
+        "inquiryDate": inquiryDate,
+        "modeName": '',
+        "patName": formatFormParmas('patientName', patInfoData),
+        "preview": '',
+        "sex": 0
+    }
+       
+    json('/demo/templateInfo/saveTemplateInfo', params).then(res=>{
+        console.log(res,'返回的数据');
+    })
+
+}
+
+
 // 保存病历信息
 export const realSaveData = (bool,list) => {
-    console.log(bool,'==============');
-    console.log(list,'==============');
     let baseList = store.getState();
-    console.log(baseList,'baseList=========');
     const dConfig = baseList.typeConfig;
     const readMode = dConfig.readMode;          //回读模式
     let state = baseList.patInfo.message;

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

@@ -18,7 +18,8 @@ const api={
   getTableInfo:'/scale/getContent', //获取量表明细
   getConceptDetail:'/conceptDetail/getConceptDetail', //获取静态提示信息
   getMRAnalyse: '/mrqc/analyse', //病历质控
-  setMrInfo:'/api/data/mrv2/createMr',      //存页面信息,供页面推送模式调取
+  // setMrInfo:'/api/data/mrv2/createMr',      //存页面信息,供页面推送模式调取
+  setMrInfo:'/sys/mr/createMr',      //存页面信息,供页面推送模式调取
 };
 
 export const embedPush = (obj) => {      //内嵌页面推送时推送

+ 6 - 3
src/store/reducers/patInfo.js

@@ -1,9 +1,10 @@
-import {GET_PATIENT_MESSAGE,GET_HOSPITAL_MESSAGE} from '../types/patInfo';
-import {updatePatientMessage,updateHospitalMessage} from '../actions/patInfo';
+import { GET_PATIENT_MESSAGE, GET_HOSPITAL_MESSAGE, SETINITPATINFO} from '../types/patInfo';
+import { updatePatientMessage, updateHospitalMessage,setPatInfo} from '../actions/patInfo';
 
 const initState = {
     message: {},
-    hospitalMsg:{}
+    hospitalMsg:{},
+    patInfoData: []  // 病历基本信息
 };
 export default function(state = initState,action){
   switch(action.type){
@@ -11,6 +12,8 @@ export default function(state = initState,action){
       return updatePatientMessage(state,action);
     case GET_HOSPITAL_MESSAGE:
       return updateHospitalMessage(state,action);
+    case SETINITPATINFO:
+      return setPatInfo(state, action);
     default:
       return state;
   }

+ 2 - 1
src/store/types/patInfo.js

@@ -1,2 +1,3 @@
 export const GET_PATIENT_MESSAGE = 'GET_PATIENT_MESSAGE'
-export const GET_HOSPITAL_MESSAGE = 'GET_HOSPITAL_MESSAGE'
+export const GET_HOSPITAL_MESSAGE = 'GET_HOSPITAL_MESSAGE'
+export const SETINITPATINFO = 'SET_INITPAT_INFO'

+ 2 - 1
src/utils/ajax.js

@@ -6,7 +6,8 @@ const axios=require('axios');
 const qs=require('querystring');
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
 const orgin = window.location.origin;
-const qhost = isLocal?host+prefix:prefix;
+// const qhost = isLocal?host+prefix:prefix;
+const qhost = isLocal ? host  :'';
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 //axios.defaults.baseURL = host;       //默认地址
 // axios.defaults.timeout = 60000;       //请求超时