luolei 4 éve
szülő
commit
a09271980e

+ 3 - 12
src/components/AddNewInspect/SlideIpt/index.jsx

@@ -13,13 +13,8 @@ class SlideIpt extends Component {
       style:'',
       value:''
     };
-    this.setEdit = this.setEdit.bind(this);
   }
   
-  componentDidMount(){
-    const {item} = this.props
-    this.setState({value:item.time})
-  }
   handleInput(e,item,sign,idx){
     const {setTipValue,handlePush} = this.props;
     setTipValue(item,e.target.value,sign,idx)
@@ -36,19 +31,15 @@ class SlideIpt extends Component {
     const {handlePush} = this.props;
     handlePush&&handlePush({mode:8});
   }
-  setEdit(e){
-    $(e.target).removeAttr('disabled').focus()
-  }
   render() {
     const {item,idx} = this.props;
     return (
-      <input type="text" 
-          class="canEdit" 
-          // onDoubleClick={(e)=>this.setEdit(e)}
+      <input type="text"
+          class="canEdit"
           style={{color:'#333'}}
           placeholder='时间'
           autoComplete="off"
-          value={this.state.value}
+          value={item.time}
           onInput={(e)=>{this.handleInput(e,item,1,idx)}}
           onFocus={()=>{this.handleFocus()}}
           />

+ 31 - 5
src/components/AddNewInspect/SlidePic/index.jsx

@@ -14,6 +14,7 @@ class SlidePic extends Component {
     this.state = {
       show:false,
       activeInd:false,
+      selectShow:false,
       activeName:'',
       canEdit:true,
       style:''
@@ -33,6 +34,10 @@ class SlidePic extends Component {
           activeInd:false
         })
       }
+      if($(event.target).attr("id")!='selectJiType'&&$(event.target).attr("id")!='selectJiTypeWrap'){
+        const {handleSelectShow,idx} = this.props;
+        handleSelectShow(idx,0)
+      }
     });
   }
   handleDel(time){
@@ -90,26 +95,47 @@ class SlidePic extends Component {
     const {handlePush} = this.props;
     handlePush&&handlePush({mode:8});
   }
+  handleSelect(part,idx){
+    const {selectJiType,handleSelectShow} = this.props;
+    selectJiType(part,idx)
+    handleSelectShow(idx)
+  }
+  handleSelectShow (idx){
+    const {handleSelectShow} = this.props;
+    handleSelectShow(idx)
+  }
   render() {
-    const {item,time,setTipValue,idx,handlePush} = this.props;
-    const {canEdit,activeInd,activeName,value,style} = this.state;
+    const {item,time,setTipValue,idx,handlePush,staticData} = this.props;
+    const {selectShow,activeInd,activeName,value,style} = this.state;
+    // console.log(item)
     return (
       <li key={item.time} className={`${styles.slideLi} clearfix`}> 
           <img className={styles.imgCheck} src={item.check?checkOn:checkOff} onClick={()=>this.checkOnOff(item,idx)} alt=""/>
-          <span className={styles.bigname}>{item.name}</span>
+          <span className={styles.bigname} title={item.name}>{item.name}</span>
           <span className={styles.smallname}>{item.flg == 5?'药品':item.flg == 6?'手术/操作':'输血'}</span>
+          <span className={styles.medType}>
+            <a style={{display:item.flg == 5?'block':'none'}} id="selectJiTypeWrap" onClick={()=>this.handleSelectShow(idx)}>{item.selectName||'选择剂型'}</a>
+              {
+                item.flg == 5&&item.selectShow&&item.activeIdx==idx?<ul className={styles.selectLis} id="selectJiType">
+                  {
+                    staticData&&staticData.map((part)=>{
+                      return <li onClick={()=>this.handleSelect(part,idx)}>{part.name||'选择剂型'}</li>
+                    })
+                  }
+                </ul>:''
+              }
+          </span>
           <span className={styles.edit}>
             {
               item.flg == 5||item.flg == 8?
               <input type="text" 
                 class="canEdit" 
-                // onDoubleClick={(e)=>this.setEdit(e)}
                 style={{color:'#333'}}
                 placeholder={item.flg == 5?'(填写用法计量)':'(填写用量)'}
                 autoComplete="off"
                 value={item.value}
+                title={item.value}
                 onInput={(e)=>{this.handleInput(e,item,2,idx)}}
-                // onBlur={()=>{this.handleBlur()}}
                 onFocus={()=>{this.handleFocus()}}
                 />:null
             }

+ 41 - 9
src/components/AddNewInspect/SlidePic/index.less

@@ -10,6 +10,7 @@
         display: inline-block;
         padding: 0 5px;
         box-sizing: border-box;
+        vertical-align: middle;
     }
     i {
         font-style: normal;
@@ -44,28 +45,40 @@
         background-size: 100% 100%;
     }
     .bigname {
-        width: 35%;
+        .ellipsis;
+        width: 400px;
         font-weight: bold;
+        margin-right: 15px;
     }
     .smallname {
-        width: 15%;
+        width: 85px;
+        margin-right: 15px;
+    }
+    .medType {
+        width: 94px;
+        border: 1px solid #AAAAAA;
+        border-radius: 4px;
+        cursor: pointer;
+        margin-right: 30px;
+        position: relative;
+        a {
+            display: inline-block;
+            width: 100%;
+        }
     }
     .edit {
-        width: 25%;
+        width: 150px;
+        margin-right: 15px;
         input {
             width: 100%;
         }
-        i {
-            
-        }
-    }
-    .maxmin {
-        width: 15%;
     }
     .pass {
         text-align: right;
         padding-left: 15px;
         box-sizing: border-box;
+        width: 150px;
+        margin-right: 15px;
     }
     .imgCheck {
         position: relative;
@@ -73,6 +86,25 @@
         margin: 0 3px 0 5px;
         cursor: pointer;
     }
+    .selectLis {
+        position: absolute;
+        left: 0;
+        top: 23px;
+        width: 100%;
+        background-color: #fff;
+        box-shadow: 0 10px 20px 0 #989DA3;
+        max-height: 100px;
+        overflow: auto;
+        z-index: 100;
+        li {
+            height: 35px;
+            line-height: 35px;
+            padding:0 8px;
+            &:hover {
+                background-color: #E2F1F8;
+            }
+        }
+    }
 }
 .slideLi:hover{
     background:#F2F2F2;

+ 4 - 1
src/components/AddNewInspect/index.jsx

@@ -122,7 +122,7 @@ class AddNewInspect extends React.Component {
       </ul>;
   }
   render() {
-    const {labelListBlood,setHighter,refreshScroller,checkOnOff, getInfomation,setTipValue, handleChangeValue,labelListSmall,inspectList, inspectVal, list, labelListBig, windowHeight, windowWidth,detailClick, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush,handleDelConfirm } = this.props;
+    const {labelListBlood,handleSelectShow,selectJiType,setHighter,staticData,refreshScroller,checkOnOff, getInfomation,setTipValue, handleChangeValue,labelListSmall,inspectList, inspectVal, list, labelListBig, windowHeight, windowWidth,detailClick, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush,handleDelConfirm } = this.props;
     const { tmpId, tmpIdx, time, pageTop, impId } = this.state;
     const contStyle={
       opacity:'0.4',
@@ -140,7 +140,10 @@ class AddNewInspect extends React.Component {
               labelListBig && labelListBig.map((item, idx) => {
                 return <SlidePic
                   item={item}
+                  handleSelectShow={handleSelectShow}
+                  selectJiType={selectJiType}
                   checkOnOff={checkOnOff}
+                  staticData={staticData}
                   idx={idx}
                   time={time}
                   handlePush={handlePush}

+ 4 - 1
src/components/NewAdvice/index.jsx

@@ -52,7 +52,7 @@ class NewAdvice extends React.Component {
 
   }
   render() {
-    const {hideAllDrop,setHighter,labelListBig, fetchPushInfos,getInfomation,labelListSmall, hospitalMsg, inspectVal, windowHeight, windowWidth,setTipValue, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList, delPartItem, inspectList,detailClick,handleDelConfirm,checkOnOff ,labelListBlood} = this.props;
+    const {hideAllDrop,staticData,selectJiType,handleSelectShow,setHighter,labelListBig, fetchPushInfos,getInfomation,labelListSmall, hospitalMsg, inspectVal, windowHeight, windowWidth,setTipValue, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList, delPartItem, inspectList,detailClick,handleDelConfirm,checkOnOff ,labelListBlood} = this.props;
 
     return (
       <div className={styles.wrapper}>
@@ -70,7 +70,10 @@ class NewAdvice extends React.Component {
         >
           <div style={{ padding: '0px 10px 10px 10px', boxSizing: 'border-box',color:'#000' }} >
             <AddNewInspect
+              handleSelectShow={handleSelectShow}
+              selectJiType={selectJiType}
               checkOnOff={checkOnOff}
+              staticData={staticData}
               handleDelConfirm={handleDelConfirm}
               labelListBig={labelListBig}
               labelListSmall={labelListSmall}

+ 1 - 1
src/containers/DiagnosticList.js

@@ -12,7 +12,7 @@ import {autoFillModules} from '@store/async-actions/fetchModules';
 import {SET_ASSESS_DATA} from '@types/assessResult';
 import {didPushParamChange} from '@utils/tools';
 
-function mapStateToProps(state) {//console.log(state.diagnosticList)
+function mapStateToProps(state) {//console.log(state.homePage)
     const {diagnosticList,assessResult,pushMessage } = state;
     let diagnC = diagnosticList.chronicMagItem;
     return {

+ 13 - 4
src/containers/NewAdvice.js

@@ -16,11 +16,13 @@ import {
   clearLabel,
   delPartItem,
   setContext,
-  setTipAdvice,
+  setTipAdviceNew,
   searchTypeNew,
   resetLabel,
   delOnePic,
   checkOffOn,
+  selectJiType,
+  handleSelectShow,
 } from '@store/actions/newAdvice';
 import {
   billing,
@@ -30,7 +32,7 @@ import {
 } from '@store/async-actions/pushMessage';
 import {HIDEDROP} from '@types/homePage';
 
-function mapStateToProps(state) {//console.log(state.newAdvice)
+function mapStateToProps(state) {//console.log(state)
   return {
     list: state.newAdvice.list,
     labelList: state.newAdvice.labelList,
@@ -47,12 +49,19 @@ function mapStateToProps(state) {//console.log(state.newAdvice)
     labelListSmall: state.newAdvice.labelListSmall,
     labelListBlood: state.newAdvice.labelListBlood,
     hospitalMsg: state.homePage.sysConfig || {},
-    typeConfig: state.typeConfig
+    typeConfig: state.typeConfig,
+    staticData:state.homePage.staticData['9']
   }
 }
 
 function mapDispatchToProps(dispatch) {
   return {
+    handleSelectShow(idx,sign){
+      dispatch(handleSelectShow(idx,sign))
+    },
+    selectJiType(part,idx){
+      dispatch(selectJiType(part,idx))
+    },
     checkOnOff(item,idx){
       dispatch(checkOffOn(item,idx))
     },
@@ -101,7 +110,7 @@ function mapDispatchToProps(dispatch) {
       dispatch(getMRAnalyse())
     },
     setTipValue(item,value,sign,tip) {
-      dispatch(setTipAdvice(item,value,sign,tip))
+      dispatch(setTipAdviceNew(item,value,sign,tip))
     },
     //右侧推送
     fetchPushInfos(obj) {

+ 6 - 2
src/modules/HomePage/index.jsx

@@ -13,7 +13,7 @@ import {CURRENT_CLEAR,DELETE_CURRENT_SELECTED_TAGS} from '@types/currentIll';
 import {OTHERHIS_CLEAR,DELETE_OTHER_SELECTED_TAGS} from '@types/otherHistory';
 import {CHECKBODY_CLEAR,DELETE_CHECK_SELECTED_TAGS} from '@types/checkBody';
 import style from './index.less';
-import {getInitModules,getChronic,getSystemConfig} from '@store/async-actions/homePage.js';
+import {getInitModules,getChronic,getSystemConfig,getCommonData} from '@store/async-actions/homePage.js';
 import {getPreMsg} from '@store/async-actions/patInfo.js';
 import { getUrlArgObject,parseNameVal,pushAllDataList } from "@utils/tools";
 import $ from 'jquery';
@@ -28,11 +28,12 @@ class HomePage extends Component {
         this.hidePops = this.hidePops.bind(this);
     }
     componentDidMount(){
-        const {setWindow,getChronicList,getConfig,clearAddItems} = this.props;
+        const {setWindow,getChronicList,getConfig,getCommon,clearAddItems} = this.props;
         //清除已保存的血压标签数据
         clearAddItems();
         //获取配置
         // getConfig();
+        getCommon()
         //getChronicList&&getChronicList();//获取慢病列表
         // 获取并监听窗口宽度,用于有横向滚动条时患者信息和打印预览跟随滚动
         let width = $(window).width();
@@ -164,6 +165,9 @@ const mapDispatchToProps = function (dispatch) {
             }
           });
         },
+        getCommon(){
+          dispatch(getCommonData())
+        },
       deleteLabels(){   //选中删除标签
         const state = store.getState();
         const {homePage} = state;

+ 6 - 0
src/store/actions/homePage.js

@@ -140,3 +140,9 @@ export const resetSelectArea = (state,action)=>{
   return res;
 }
 
+export const getStaticData = (state,action)=>{
+  let res = Object.assign({},state);
+  res.staticData = action.data;
+  return res;
+}
+

+ 12 - 2
src/store/actions/newAdvice.js

@@ -1,4 +1,4 @@
-import {SET_CONTEXT,CHECK_OFF_ON_NEW,DEL_ONE_PIC,ADD_LABEL,SEARCH_LIST,SET_LABEL,SET_TIP_ADVICE,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL_NEW,CLEAR_ALL_LABEL,DEL_PART_ITEM_NEW,DEL_EXCEL_LIST,SEARCH_TYPE_NEW} from '../types/newAdvice';
+import {HANDLESELECTSHOW,SELECTJITYPE,SET_CONTEXT,CHECK_OFF_ON_NEW,DEL_ONE_PIC,ADD_LABEL,SEARCH_LIST,SET_LABEL,SET_TIP_ADVICE,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL_NEW,CLEAR_ALL_LABEL,DEL_PART_ITEM_NEW,DEL_EXCEL_LIST,SEARCH_TYPE_NEW} from '../types/newAdvice';
 
 export const setLabel = (idx,sign) => ({          //搜索后点击选中的结果
     type:SET_LABEL,
@@ -63,7 +63,7 @@ export const setContext = (obj) => ({
     type:SET_CONTEXT,
     obj
 })
-export const setTipAdvice = (item,value,sign,tip) => ({
+export const setTipAdviceNew = (item,value,sign,tip) => ({
     type:SET_TIP_ADVICE,
     item,
     value,
@@ -82,3 +82,13 @@ export const checkOffOn = (item,tip) => ({
     type:CHECK_OFF_ON_NEW,
     item,tip
 })
+
+export const selectJiType = (part,idx) => ({
+    type:SELECTJITYPE,
+    part,idx
+})
+
+export const handleSelectShow = (idx,sign) => ({
+    type:HANDLESELECTSHOW,
+    idx,sign
+})

+ 17 - 2
src/store/async-actions/homePage.js

@@ -1,5 +1,5 @@
 import {post,json} from '@utils/ajax.js';
-import {SETINITDATA,MODI_LOADING,GET_ASSIST_LIST,GET_INSPECT_LIST,SETALLMODULES} from '@store/types/homePage.js';
+import {SETINITDATA,MODI_LOADING,GET_ASSIST_LIST,GET_INSPECT_LIST,SETALLMODULES,GETSTATICDATA} from '@store/types/homePage.js';
 import {SET_CURRENT} from '@store/types/currentIll';
 import {SET_MAINSUIT} from '@store/types/mainSuit';
 import config from '@config/index.js';
@@ -13,6 +13,7 @@ const api = {
   getChronic:'/disType/getDisType', //慢病列表
   getQuestionUsual:'/questionUsual/getQuestionUsual', //检验常用标签
   getSystemConfig:'/sysSet/getSysSetInfoDatas',     //获取系统配置
+  getStaticData:'/sys/dictionaryInfo/getList',     //获取字典信息
 };
 
 //获取系统配置
@@ -160,4 +161,18 @@ export const getCommonList = (val)=>{
       }
     })
   }
-}
+}
+// 字典数据
+export const getCommonData = (dispatch) => {
+  return (dispatch) => {
+      json(api.getStaticData,{}).then((res)=>{
+          const data = res.data;
+          if(data.code == '0'){
+            dispatch({
+              type:GETSTATICDATA,
+              data:data.data
+            })
+          }
+      })
+  }
+};

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

@@ -1,7 +1,7 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,SETPREDATA,
   HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,
-  SETALLMODULES,SETSYSTEMCONFIG,SETPRE,RESET_SELECT_TAG,SET_SELECTED_AREA,SETADMIN,SET_CURRENT_MODULE,TOGGLE_PUSH_DATA} from '../types/homePage.js';
-import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList,setSelectArea,resetSelectArea, setCurrentModule} from '../actions/homePage.js';
+  SETALLMODULES,SETSYSTEMCONFIG,SETPRE,RESET_SELECT_TAG,SET_SELECTED_AREA,SETADMIN,SET_CURRENT_MODULE,TOGGLE_PUSH_DATA,GETSTATICDATA} from '../types/homePage.js';
+import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList,setSelectArea,resetSelectArea, setCurrentModule,getStaticData} from '../actions/homePage.js';
 import {getMRAnalyse} from '@store/async-actions/pushMessage';
 
 const initState = {
@@ -32,7 +32,8 @@ const initState = {
     "2": "现病史",
     "3": "其他史",
     "4": "查体"
-  }
+  },
+  staticData:{}
 };
 
 export default function (state=initState,action) {
@@ -108,6 +109,8 @@ export default function (state=initState,action) {
     case TOGGLE_PUSH_DATA:
       res.showPushData = ! res.showPushData
       return res;
+    case GETSTATICDATA:
+      return getStaticData(state,action);
     default:
       return res;
   }

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

@@ -119,8 +119,10 @@ export default (state = initSearchList, action) => {
                     }else{//小项该数值
                         if(isNumber(action.value-0)){
                             item.value = action.value
+                            item.otherValue = ''
                         }else{
                             item.otherValue = action.value
+                            item.value = ''
                         }
                     }
                 }

+ 36 - 4
src/store/reducers/newAdvice.js

@@ -17,6 +17,8 @@ import {
   CHECK_OFF_ON_NEW,
   RENEWADVICEDATA,
   CLEARNEWADVICEDATA,
+  SELECTJITYPE,
+  HANDLESELECTSHOW,
 } from '../types/newAdvice';
 import store from '@store';
 import {getStringPlus,getPushLists,getPushList,getCurrentDate} from '@utils/tools.js';
@@ -45,6 +47,37 @@ const initSearchList = {
 }
 
 export default (state = initSearchList, action) => {
+    if (action.type == HANDLESELECTSHOW) {
+        const newState = Object.assign({}, state);
+        let tempArr = newState.labelListBig;
+        for(let i = 0;i < tempArr.length;i++){
+            if(action.idx == i){
+                let flg = tempArr[i].selectShow;
+                tempArr[i].selectShow = action.sign==1?true:action.sign==0?false:!flg
+                tempArr[i].activeIdx = action.idx 
+                // if(action.sign==1||!flg){
+
+                // }else{
+
+                // }
+            }
+        }
+        newState.labelListBig = [...tempArr]
+        return newState;
+    }
+    if (action.type == SELECTJITYPE) {
+        const newState = Object.assign({}, state);
+        let tempArr = newState.labelListBig;
+        for(let i = 0;i < tempArr.length;i++){
+            if(action.idx == i){
+                tempArr[i].selectShow = false
+                tempArr[i].selectName = action.part.name
+                tempArr[i].selectVal = action.part.val
+            }
+        }
+        newState.labelListBig = [...tempArr]
+        return newState;
+    }
     if (action.type == CHECK_OFF_ON_NEW) {
         const newState = Object.assign({}, state);
         let tempArr = newState.labelListBig;
@@ -139,7 +172,7 @@ export default (state = initSearchList, action) => {
                     }
                 }
             }
-            newState.labelListBig = [...tempArr]
+            newState.labelListBig = tempArr
         }else if(tmpLis.flg == 6){//手术
             for(let i= 0;i < tempArrs.length;i++){
                 if(action.tip == i){
@@ -147,7 +180,7 @@ export default (state = initSearchList, action) => {
                     tempArrs[i].dateValue = action.value
                 }
             }
-            newState.labelListSmall = [...tempArrs]
+            newState.labelListSmall = tempArrs
         }if(tmpLis.flg == 8){//输血
             for(let i= 0;i < tmpArr.length;i++){
                 if(action.tip == i){
@@ -159,9 +192,8 @@ export default (state = initSearchList, action) => {
                     }
                 }
             }
-            newState.labelListBlood = [...tmpArr]
+            newState.labelListBlood = tmpArr
         }
-        // console.log(newState,'newState');
         return newState;
     }
     if (action.type == SEARCH_TYPE_NEW) {

+ 1 - 0
src/store/types/homePage.js

@@ -23,3 +23,4 @@ export const RESET_SELECT_TAG='RESET_SELECT_TAG';   //重置选中标签的各
 export const SET_SELECTED_AREA='SET_SELECTED_AREA'; 
 export const SET_CURRENT_MODULE = 'SET_CURRENT_MODULE'
 export const TOGGLE_PUSH_DATA = 'TOGGLE_PUSH_DATA' //切换推送框
+export const GETSTATICDATA = 'GETSTATICDATA' //字典信息

+ 2 - 0
src/store/types/newAdvice.js

@@ -20,3 +20,5 @@ export const CHECK_OFF_ON_NEW = 'CHECK_OFF_ON_NEW';
 
 export const RENEWADVICEDATA = 'RENEWADVICEDATA';
 export const CLEARNEWADVICEDATA = 'CLEARNEWADVICEDATA';
+export const SELECTJITYPE = 'SELECTJITYPE';
+export const HANDLESELECTSHOW = 'HANDLESELECTSHOW';