Переглянути джерело

化验提示信息显示到右侧

Luolei 6 роки тому
батько
коміт
7ac42a2a1e

+ 31 - 11
src/components/AddInspect/SlideSelect/index.jsx

@@ -6,6 +6,9 @@ import slideUp from "@common/images/slide-up.png";
 import slideDown from "@common/images/slide-down.png";
 import date1 from '../img/date1.png';
 import close from '../img/close.png';
+import info from '../img/info3.png';
+import info2 from '../img/info2.png';
+
 class SlideSelect extends Component {
   constructor(props) {
     super(props);
@@ -34,7 +37,7 @@ class SlideSelect extends Component {
     })
   }
   render() {
-    const {handleConfirm,changeActivePart,handleDelClick,getItemList,date,item,idx,handleFillShow,showDetails,handleLabelSub,showFill,changeShowFill,handlePush,dateTime,currentIdx,currentData,fillActive,handleShowDate,handleChangeDate} = this.props;
+    const {getInfomation,handleConfirm,changeActivePart,handleDelClick,getItemList,date,item,idx,handleFillShow,showDetails,handleLabelSub,showFill,changeShowFill,handlePush,dateTime,currentIdx,currentData,fillActive,handleShowDate,handleChangeDate} = this.props;
     const {show} = this.state;
     let numPlus = 0,numPlus1 = 0;
     return (
@@ -43,28 +46,39 @@ class SlideSelect extends Component {
             // 标签,血常规。。
             item.show ?
             <p className={styles.staticTagActive}>
-                <span data-flg="current" style={{color:"#000"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); handleFillShow(e,idx) }}>{item.name}</span>
+                <span className={styles.tagSpan} data-flg="current" style={{color:"#000"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); handleFillShow(e,idx) }}>
+                  {item.name}
+                  <span className={styles.imgInfo} onClick={()=>getInfomation(item.questionId)}></span>
+                </span>
             </p>:
-            <p>
-                <i data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); handleFillShow(e,idx) }}>{item.name}</i>
+            <p >
+                <i className={styles.tagSpan} data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); handleFillShow(e,idx) }}>
+                  {item.name}
+                  <span className={styles.imgInfo} onClick={()=>getInfomation(item.questionId)}></span>
+                </i>
             </p>
         }
         
         {
           item.details && item.details.map((val)=>{
             if(val.value && val.value != ''){
-                numPlus = ++numPlus
-              }
-            })
-          }
+              numPlus = ++numPlus
+            }
+          })
+        }
         {
-            item.show ? 
+            item.show ?
                 <table className={styles.table}>
                     {
                         show?(item.details.map((val)=>{
                             if(val.value && val.value != ''){
                                 return <tr>
-                                    <td style={{width:'30%'}}>{val.name}</td>
+                                    <td style={{width:'30%'}}>
+                                      <span className={styles.tagSpan}>
+                                        {val.name}
+                                        <span className={styles.imgInfo} onClick={()=>getInfomation(val.id)}></span>                                        
+                                      </span>
+                                    </td>
                                     {showDetails(val)}
                                     <td style={{width:'25%'}}>
                                         {normalVal(val.minValue,val.maxValue)}
@@ -73,11 +87,17 @@ class SlideSelect extends Component {
                                 </tr>
                             }
                         })):(item.details.map((val,num)=>{
+                          console.log(item,788787)
                           if(val.value && val.value != '' ){
                               ++numPlus1;
                               if(numPlus1 < 5){
                                 return <tr>
-                                    <td style={{width:'30%'}}>{val.name}</td>
+                                    <td style={{width:'30%'}}>
+                                      <span className={styles.tagSpan}>
+                                        {val.name}
+                                        <span className={styles.imgInfo} onClick={()=>getInfomation(val.id)}></span>
+                                      </span>
+                                    </td>
                                     {showDetails(val)}
                                     <td style={{width:'25%'}}>
                                         {normalVal(val.minValue,val.maxValue)}

+ 27 - 0
src/components/AddInspect/SlideSelect/index.less

@@ -151,4 +151,31 @@
   .num {
     color: @blue;
   }
+}
+.imgInfo {
+  position: relative;
+}
+.imgInfo {
+  width: 15px;
+  height: 17px;
+  border-bottom: 0 none !important;
+  background: url('../img/info2.png') no-repeat center center;
+  background-size: 100% auto; 
+  position: absolute;
+  top: -10px;
+  left: 50%;
+  margin-left: -8px;
+  display: none;
+}
+.imgInfo:hover {
+  background: url('../img/info3.png') no-repeat center center;
+  background-size: 100% auto; 
+}
+.tagSpan {
+  position: relative;
+}
+.tagSpan:hover {
+  .imgInfo {
+    display: block;
+  }
 }

BIN
src/components/AddInspect/img/info2.png


BIN
src/components/AddInspect/img/info3.png


+ 2 - 1
src/components/AddInspect/index.jsx

@@ -284,7 +284,7 @@ class Inspect extends React.Component {
     }
   }
   render() {
-    const { handleChangeValue, list, labelList, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
+    const { getInfomation,handleChangeValue, list, labelList, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
     const { toastText, visible, tmpId, tmpIdx } = this.state;
     return (
       <div className={styles.wrapper}>
@@ -333,6 +333,7 @@ class Inspect extends React.Component {
                   changeActivePart={this.changeActivePart}
                   handleDelClick={this.handleDelClick}
                   handleConfirm={handleConfirm}
+                  getInfomation={getInfomation}
                 ></SlideSelect>
               })
             }

+ 2 - 1
src/components/Inspect/index.jsx

@@ -141,7 +141,7 @@ class Inspect extends React.Component {
         </ul>
     }
     render() {
-        const {fetchPushInfos, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList,delPartItem,inspectList } = this.props;
+        const {fetchPushInfos,getInfomation, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList,delPartItem,inspectList } = this.props;
         const {ieVersion,isIE} = this.state;
         return (
             <div className={styles.wrapper} >
@@ -178,6 +178,7 @@ class Inspect extends React.Component {
                             labelListActive={labelListActive}
                             delPartItem={delPartItem}
                             inspectList={inspectList}
+                            getInfomation={getInfomation}
                         >
                         </AddInspect>
                     </div>

+ 3 - 1
src/components/PushItems/index.jsx

@@ -151,7 +151,8 @@ class PushItems extends Component {
       check,
       tips,
       showTipsDetails,
-      tipsDetails
+      tipsDetails,
+      tmpFlg,
     } = this.props.pushMessage;
     const { tipsDiscalimer } = this.props;
     const { moreAssay, moreCheck } = this.state;
@@ -429,6 +430,7 @@ class PushItems extends Component {
                       <span
                         className={style["tips-details"]}
                         onClick={() => showTips(tips)}
+                        style={{display:tmpFlg?'none':'inline-block'}}
                       >
                         详情
                       </span>

+ 4 - 1
src/containers/Inspect.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import Inspect from '@components/Inspect';
-import {getSearchList,getSublableList} from '@store/async-actions/inspect';
+import {getSearchList,getSublableList,getInstroduce } from '@store/async-actions/inspect';
 import {setLabel,fillActived,fillActiveDetail,checkValueIsChange,delExcelLis,clearLabel,delPartItem} from '@store/actions/inspect';
 import {billing} from '@store/async-actions/pushMessage';
 function mapStateToProps(state) {
@@ -20,6 +20,9 @@ function mapDispatchToProps(dispatch, store) {
         handleChangeValue(val){
             dispatch(getSearchList(val))
         },
+        getInfomation(id){
+            dispatch(getInstroduce(id))
+        },
         handleSign(id,idx,type){
             dispatch(setLabel(idx,type))
             dispatch(getSublableList(id))

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

@@ -138,6 +138,7 @@ export const addScheme = (state, action) => {
 export const setTips = (state, action) => {
   const res = Object.assign({}, state)
   res.tips = action.tips;
+  res.tmpFlg = action.tmpFlg
   return res;
 }
 

+ 20 - 1
src/store/async-actions/inspect.js

@@ -2,7 +2,7 @@ import axios from '@utils/ajax';
 import store from '@store';
 
 import { searchList,resetLabel } from '../actions/inspect';
-
+import { BILLING_ADVICE, SET_TIPS, SET_TIPS_DETAILS } from '../types/pushMessage';
 
 export const getSearchList = (val) => {
     if(val.trim() == ''){
@@ -49,3 +49,22 @@ export const getSublableList = (id,idx) => {
         })
     }
 };
+
+export const getInstroduce = (id)=>{    //获取化验的提示信息
+  return (dispatch, getState) =>{
+      axios.json('/api/icss/introduceInfo/getByQuestionId', {
+        questionId: id,
+        type: 5,
+        position: 1
+    })
+    .then((data)=>{
+        dispatch({
+          type: SET_TIPS,
+          tips: data.data.data,
+          tmpFlg:'midPart'
+      })          
+    }).catch((e) => {
+        console.log(e)
+    })
+  }
+}

+ 2 - 1
src/store/reducers/pushMessage.js

@@ -16,7 +16,8 @@ const initState = {
     // scheme: [],
     // adviceStr: '' 
   },
-  AdviceStr: ''
+  AdviceStr: '',
+  tmpFlg:''
 };
 export default function(state = initState, action) {
   switch (action.type) {