Parcourir la source

检索数据获取

Luolei il y a 6 ans
Parent
commit
49dc1205c0

+ 1 - 0
src/common/components/Calendar/index.less

@@ -62,6 +62,7 @@
     border: 1px solid #b1d2ec;
     background-color: #deecf8;
     text-align: center;
+    cursor: pointer;
     &:hover{
       background-color: #ECF4FB;
     }

+ 10 - 0
src/common/less/variables.less

@@ -207,6 +207,16 @@
   -ms-user-select: none;
   user-select: none;
 }
+:global(.clearfix) {
+  zoom: 1;
+}
+:global(.clearfix:after) {
+  content: "";
+  display: block;
+  height: 0;
+  clear: both;
+  visibility: hidden;
+}
 // 加入病历
 .add-record{
   float: right;

+ 20 - 12
src/components/Inspect/index.jsx

@@ -44,7 +44,7 @@ class Inspect extends React.Component {
       isIE: isIE(),
       ieVersion: null,
       height: '-1',
-      hide: false
+      hide: true
     }
     this.handleImportExcel = this.handleImportExcel.bind(this)
     this.cancel = this.cancel.bind(this)
@@ -163,7 +163,7 @@ class Inspect extends React.Component {
     dragBox('previewWrapper','previewStatic','del')
   }
   render() {
-    const { fetchPushInfos, getInfomation, inspectVal,handleSearch, windowHeight, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList, delPartItem, inspectList } = this.props;
+    const { fetchPushInfos, hospitalInspect,handleGetSonList,getInfomation,hospitalMsg, inspectVal,handleSearch, windowHeight, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList, delPartItem, inspectList } = this.props;
     const { ieVersion, isIE, hide } = this.state;
     const { checkSystemIpt,onClose } = this;
     return (
@@ -172,21 +172,29 @@ class Inspect extends React.Component {
         <div className={styles.top}>
           <span id="inspectResultData">化验结果数据</span>
           {/* <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}> */}
-          <div className={this.getStyle()}>
+          <div className={this.getStyle()} style={{display:hospitalMsg.importWay == 0?'none':'block'}}>
             {/* <button disabled={ieVersion&&ieVersion>9?true:false}>导入化验结果</button>*/}
-            <div className={styles.pushButton}>导入化验结果
-            <ul className={styles.importSelect}>
-              <li className={styles.excelIpt}>
-                <div onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>本地导入</div>
+            {/* {0没有,1本地,2医院,3本地和医院} */}
+            {
+              hospitalMsg.importWay == 1?<div className={styles.pushButton} disabled={ieVersion&&ieVersion>9?true:false} onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>
+                导入化验结果
                 <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
-              </li>
-              <li className={`${styles.excelIpt} ${styles.systemIpt}`} onClick={checkSystemIpt}>检查系统导入</li>
-            </ul>
+              </div>:hospitalMsg.importWay == 48888?<div className={styles.pushButton} disabled={ieVersion&&ieVersion>9?true:false} onClick={checkSystemIpt}>
+                检查系统导入
+              </div>:hospitalMsg.importWay == 2?<div className={styles.pushButton}>导入化验结果
+                <ul className={styles.importSelect}>
+                  <li className={styles.excelIpt}>
+                    <div onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>本地导入</div>
+                    <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
+                  </li>
+                  <li className={`${styles.excelIpt} ${styles.systemIpt}`} onClick={checkSystemIpt}>检查系统导入</li>
+                </ul>
+              </div>:null
+            }
             
-            </div>
             {
               hide ? <WrapModalContainer title={'导入化验数据'} width={1000} onClose={onClose}>
-                <WrapModalBody handleSearch={handleSearch}></WrapModalBody>
+                <WrapModalBody hospitalInspect={hospitalInspect} handleGetSonList={handleGetSonList} handleSearch={handleSearch}></WrapModalBody>
               </WrapModalContainer> : null
             }
             {/* <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} /> */}

+ 18 - 0
src/components/WrapModalBody/WrapModalRight/index.jsx

@@ -0,0 +1,18 @@
+import React from "react";
+import style from "../index.less";
+
+class WrapModalRight extends React.Component {
+  constructor(props) {
+    super(props)
+  }
+  render() {
+    return <div className={style['modalRight']}>
+      <div className={`${style.modalRightT} clearfix`}>
+        <span className={style.tip}>已选化验项</span>
+        <span className={style.btnS}>确认选择</span>
+      </div>
+    </div>
+  }
+}
+
+export default WrapModalRight;

+ 31 - 2
src/components/WrapModalBody/WrapModalTable/index.jsx

@@ -6,9 +6,38 @@ class WrapModalTable extends React.Component {
     super(props)
   }
   render() {
-    const { list,message } = this.props;
+    const { hospitalInspect,getSonDetailList,handleGetSonList } = this.props;
+    console.log(hospitalInspect)
     return <div className={style['modalTable']}>
-      table
+      <div className={style.parentTable}>
+        <table>
+          <tr className={style.head}>
+            <td className={`${style.fst} ellipsOver`}>编号</td>
+            <td className={`${style.sec} ellipsOver`}>标本类型</td>
+            <td className={`${style.trd} ellipsOver`}>组名称</td>
+            <td className={`${style.four} ellipsOver`}>送检医生</td>
+            <td className={`${style.fif} ellipsOver`}>送检时间</td>
+            <td className={`${style.six} ellipsOver`}>报告时间</td>
+          </tr>
+          {
+            hospitalInspect.map((item,idx)=>{
+              return <tr>
+                <td title={idx} className={`${style.fst} ellipsOver`}>{idx}</td>
+                <td title={item.specimenType} className={`${style.sec} ellipsOver`}>{item.specimenType}</td>
+                <td title={item.groupName} className={`${style.trd} ellipsOver`} onClick={()=>handleGetSonList(item.groupName)}>{item.groupName}</td>
+                <td title={item.inspectDoctor} className={`${style.four} ellipsOver`}>{item.inspectDoctor}</td>
+                <td title={item.inspectTime} className={`${style.fif} ellipsOver`}>{item.inspectTime}</td>
+                <td title={item.reportTime} className={`${style.six} ellipsOver`}>{item.reportTime}</td>
+              </tr>
+            })
+          }
+        </table>
+      </div>
+      <div className={style.parentTable}>
+          <div className={style.sonTitle}>
+            <span>组名称 : </span><span className={style.btn}>选中异常值数据</span>
+          </div>
+      </div>
     </div>
   }
 }

+ 1 - 1
src/components/WrapModalBody/WrapModalTitle/index.jsx

@@ -7,7 +7,7 @@ class WrapModalTitle extends React.Component {
     super(props)
   }
   render() {
-    const {handleSearch} = this.props
+    const { handleSearch } = this.props
     return <div className={style['modalTop']}>
       <Item handleSearch={handleSearch}></Item>
     </div>

+ 4 - 3
src/components/WrapModalBody/index.jsx

@@ -2,20 +2,21 @@ import React from "react";
 import style from "./index.less";
 import WrapModalTitle from "./WrapModalTitle";
 import WrapModalTable from "./WrapModalTable";
+import WrapModalRight from "./WrapModalRight";
 
 class WrapModalBody extends React.Component {
   constructor(props) {
     super(props)
   }
   render() {
-    const { handleSearch } = this.props;
+    const { handleSearch,hospitalInspect,handleGetSonList } = this.props;
     return <div className={style['container']}>
       <div className={`${style.left}`}>
         <WrapModalTitle handleSearch={handleSearch}></WrapModalTitle>
-        <WrapModalTable></WrapModalTable>
+        <WrapModalTable hospitalInspect={hospitalInspect} handleGetSonList={handleGetSonList}></WrapModalTable>
       </div>
       <div className={`${style.right}`}>
-        sdsd
+        <WrapModalRight></WrapModalRight>
       </div>
     </div>
   }

+ 100 - 2
src/components/WrapModalBody/index.less

@@ -2,13 +2,13 @@
 
 .container {
   height: 100%;
-  background-color: @ipt-wrap-color;
+  // background-color: @ipt-wrap-color;
   position: relative;
   .left {
     position: absolute;
     top: 0;
     left: 0;
-    width: 761px;
+    width: 762px;
     height: 100%;
     border-right: 1px solid #D8D8D8;
   }
@@ -55,6 +55,7 @@
         line-height: 26px;
         padding: 0 3px;
         box-sizing: border-box;
+        cursor: pointer;
       }
     }
     .code{
@@ -89,5 +90,102 @@
         text-align: center;
       }
     }
+  }    
+  .modalRightT{
+    height: 46px;
+    line-height: 46px;
+    background-color: #F0F0F0;
+    padding: 0 20px;
+    position: absolute;
+    width: 100%;
+    span.tip {
+      font-size: 12px;
+      float: left;
+    }
+    span.btnS {
+      font-size: 12px;
+      float: right;
+      width: 64px;
+      height: 26px;
+      line-height: 26px;
+      margin-top: 10px;
+      color: #fff;
+      text-align: center;
+      border-radius: 4px;
+      background-color: @blue;
+      cursor: pointer;
+    }
+  }
+  .modalTable {
+    .parentTable {
+      height: 330px;
+      overflow: auto;
+    }
+    .sonTitle {
+      height: 46px;
+      line-height: 46px;
+      background-color: #F0F0F0;
+      padding: 0 20px;
+      .btn {
+        font-size: 12px;
+        float: right;
+        height: 26px;
+        line-height: 24px;
+        border: 1px solid #9C9C9C;
+        border-radius: 4px;
+        padding: 0 11px;
+        margin-top: 10px;
+        cursor: pointer;
+        &:hover {
+          background-color: @blue;
+          border: 1px solid @blue;
+          color: #fff;
+        }
+      }
+      
+    }
+    table {
+      border-collapse: collapse;
+      tr {
+        height: 40px;
+        line-height: 40px;
+        text-align: center;
+        td {
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+          border: 1px solid #E7EAEB;
+          padding: 0 5px;
+          box-sizing: border-box;
+        }
+        td.fst {
+          width: 48px;
+          max-width: 48px;
+        }
+        td.sec {
+          width: 116px;
+          max-width: 116px;
+        }
+        td.trd {
+          width: 215px;
+          max-width: 215px;
+          cursor: pointer;
+        }
+        td.four {
+          // width: 255px;
+        }
+        td.fif {
+          width: 150px;
+          max-width: 150px;
+        }
+        td.six {
+          width: 150px;
+          max-width: 150px;
+        }
+      }
+      .head {
+        background-color: #EAF7FA;
+      }
+    }
   }
 }

+ 12 - 3
src/containers/Inspect.js

@@ -5,7 +5,9 @@ import {
 import Inspect from '@components/Inspect';
 import {
   getSearchList,
-  getSublableList
+  getSublableList,
+  getImportList,
+  getSonDetailList
 } from '@store/async-actions/inspect';
 import {
   setLabel,
@@ -21,7 +23,7 @@ import {
   getConceptDetail
 } from '@store/async-actions/pushMessage';
 
-function mapStateToProps(state) { //console.log(state)
+function mapStateToProps(state) {console.log(state)
   return {
     list: state.inspect.list,
     labelList: state.inspect.labelList,
@@ -30,7 +32,9 @@ function mapStateToProps(state) { //console.log(state)
     labelListActive: state.inspect.labelListActive,
     inspectList: state.homePage.inspectList,
     windowHeight: state.homePage.windowHeight,
-    inspectVal: state.inspect.inspectVal
+    inspectVal: state.inspect.inspectVal,
+    hospitalMsg: state.patInfo.hospitalMsg,
+    hospitalInspect: state.inspect.hospitalInspect,
   }
 }
 
@@ -38,6 +42,11 @@ function mapDispatchToProps(dispatch, store) {
   return {
     handleSearch(data) {
       console.log(data)
+      dispatch(getImportList(data))
+    },
+    handleGetSonList(name) {
+      console.log(name)
+      dispatch(getSonDetailList(name))
     },
     handleChangeValue(val) {
       dispatch(getSearchList(val))

+ 9 - 1
src/store/actions/inspect.js

@@ -1,10 +1,18 @@
-import {ADD_LABEL,SEARCH_LIST,SET_LABEL,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL,CLEAR_ALL_LABEL,DEL_PART_ITEM,DEL_EXCEL_LIST} from '../types/inspect';
+import {ADD_LABEL,SEARCH_HOSPITAL_INSPECT_SON,SEARCH_HOSPITAL_INSPECT,SEARCH_LIST,SET_LABEL,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL,CLEAR_ALL_LABEL,DEL_PART_ITEM,DEL_EXCEL_LIST} from '../types/inspect';
 
 export const searchList = (list,val) => ({         //初始化数据
     type:SEARCH_LIST,
     list,
     val
 })
+export const getHospitalInspectList = (list) => ({         //检索医院化验项
+    type:SEARCH_HOSPITAL_INSPECT,
+    list
+})
+export const getHospitalInspectDetailList = (list) => ({         //检索医院化验项
+    type:SEARCH_HOSPITAL_INSPECT_SON,
+    list
+})
 
 export const setLabel = (idx,sign) => ({          //搜索后点击选中的结果
     type:SET_LABEL,

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

@@ -30,4 +30,9 @@ export const updatePatientMessage=(state,action)=>{
         res.message = {};
     }*/
     return res;
+};
+export const updateHospitalMessage=(state,action)=>{
+    const res=Object.assign({},state);
+    res.hospitalMsg = action.data || {};
+    return res;
 };

+ 13 - 2
src/store/async-actions/inspect.js

@@ -1,7 +1,7 @@
 import axios from '@utils/ajax';
 import store from '@store';
 
-import { searchList,resetLabel } from '../actions/inspect';
+import { searchList,resetLabel,getHospitalInspectList,getHospitalInspectDetailList } from '../actions/inspect';
 import { SET_TIPS } from '../types/pushMessage';
 import { Notify} from '@commonComp';
 
@@ -64,7 +64,18 @@ export const getImportList = (data) => {
         axios.json('/dockingImport/lisDockingImports',param)
         .then((res)=>{
             const data = res.data.data;
-            console.log(res)
+            console.log(data.lisRetrieveData)
+            dispatch(getHospitalInspectList(data.lisRetrieveData))
+        })
+    }
+};
+export const getSonDetailList = (name) => {
+    return (dispatch) => {
+        axios.json('/dockingImport/getByGroupNameLisData',{groupName:name})
+        .then((res)=>{
+            const data = res.data.data;
+            console.log(data)
+            dispatch(getHospitalInspectDetailList(data))
         })
     }
 };

+ 23 - 2
src/store/async-actions/patInfo.js

@@ -1,5 +1,5 @@
 import {get, post, json} from "../../utils/ajax";
-import {GET_PATIENT_MESSAGE} from "../types/patInfo";
+import {GET_PATIENT_MESSAGE,GET_HOSPITAL_MESSAGE} from "../types/patInfo";
 import {CONFIRM_TYPE} from "../types/typeConfig";
 import {getInfos} from '@store/actions/getInfoByUuid';
 import {getUrlArgObject,pushAllDataList} from '@utils/tools';
@@ -10,9 +10,29 @@ import { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
     getPatInfo: '/patientInfo/getTopPatientInfo',
-    getPatBaseInfo: '/patientInfo/getPatientInfo'
+    getPatBaseInfo: '/patientInfo/getPatientInfo',
+    getHospitalInfo:'/hospitalInfo/getHospitalInfo'
 };
 
+//获取医院id
+export const initHospitalInfo = (dispatch, getState) => {
+    let baseList = getState();
+    let state = baseList.patInfo.message;
+    json(api.getHospitalInfo, {
+        "code": getUrlArgObject('hospitalId'),
+        "id":state.hospitalId
+    }).then((res) => {
+        const data = res.data;
+        if (data.code == 0) {
+            dispatch({
+              type: GET_HOSPITAL_MESSAGE,
+              data:data.data[0]
+            });
+        } else {
+            console.log(res)
+        }
+    })
+}
 //参数转换
 export const initPersonInfo = (dispatch, getState) => {
     json('/tranFieldInfo/getInfoByUuid', {
@@ -104,6 +124,7 @@ export async function getPatientMessage(dispatch, getState){
   dispatch(getCommonList(5));     //获取常用化验标签列表
   dispatch(getCommonList(6));     //获取常用辅检标签列表if(allModules.length == 0){//模板为空才回读
   dispatch(initHistoryDetails());      //历史病历回读
+  initHospitalInfo(dispatch, getState)
 }
 
 /*

+ 19 - 2
src/store/reducers/inspect.js

@@ -9,7 +9,9 @@ import {
     CLEAR_ALL_LABEL,
     DEL_PART_ITEM,
     DEL_EXCEL_LIST,
-    ADD_LABEL
+    ADD_LABEL,
+    SEARCH_HOSPITAL_INSPECT,
+    SEARCH_HOSPITAL_INSPECT_SON
 } from '../types/inspect';
 import store from '@store';
 import {dateParser} from '@utils/tools.js';
@@ -26,7 +28,12 @@ const initSearchList = {
     getExcelDataList: [], //导入的数据
     pushItem:[],    //推送的数据
     pushItems:[],    //右侧模板预览的数据
-    inspectVal:''
+    inspectVal:'',
+
+    hospitalInspect:[],//医院检索到的
+    hospitalInspectObj:{},//组对应的明细(单选多选全选)
+    selectGroupList:[],//选的组的明细可能有多个组
+    allCheck:false,//全选反选
 }
 
 export default (state = initSearchList, action) => {
@@ -36,6 +43,16 @@ export default (state = initSearchList, action) => {
         newState.inspectVal = action.val
         return newState;
     }
+    if (action.type == SEARCH_HOSPITAL_INSPECT) {
+        const newState = Object.assign({}, state);
+        newState.hospitalInspect = action.list
+        return newState;
+    }
+    if (action.type == SEARCH_HOSPITAL_INSPECT_SON) {
+        const newState = Object.assign({}, state);
+        newState.hospitalInspectObj = action.list
+        return newState;
+    }
     if (action.type == SET_LABEL) {             //选中的结果    
         const newState = Object.assign({}, state);
         let tempArr = [];

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

@@ -1,13 +1,16 @@
-import {GET_PATIENT_MESSAGE} from '../types/patInfo';
-import {updatePatientMessage} from '../actions/patInfo';
+import {GET_PATIENT_MESSAGE,GET_HOSPITAL_MESSAGE} from '../types/patInfo';
+import {updatePatientMessage,updateHospitalMessage} from '../actions/patInfo';
 
 const initState = {
-    message: {}
+    message: {},
+    hospitalMsg:{}
 };
 export default function(state = initState,action){
   switch(action.type){
     case GET_PATIENT_MESSAGE:
       return updatePatientMessage(state,action);
+    case GET_HOSPITAL_MESSAGE:
+      return updateHospitalMessage(state,action);
     default:
       return state;
   }

+ 2 - 2
src/store/types/inspect.js

@@ -11,5 +11,5 @@ export const CLEAR_ALL_LABEL = 'CLEAR_ALL_LABEL';
 export const DEL_PART_ITEM = 'DEL_PART_ITEM';
 export const DEL_EXCEL_LIST = 'DEL_EXCEL_LIST';
 export const ADD_LABEL = 'ADD_LABEL';
-export const GET_IMPORT_LIST = 'GET_IMPORT_LIST';
-export const GET_IMPORT_LIST_SON = 'GET_IMPORT_LIST_SON';
+export const SEARCH_HOSPITAL_INSPECT = 'SEARCH_HOSPITAL_INSPECT';
+export const SEARCH_HOSPITAL_INSPECT_SON = 'SEARCH_HOSPITAL_INSPECT_SON';

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

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