ソースを参照

医嘱添加修改删除改为索引取值

luolei 4 年 前
コミット
599b3f3818

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

@@ -1,5 +1,4 @@
 import React, { Component } from "react";
-import styles from "./index.less";
 import $ from 'jquery';
 
 class SlideIpt extends Component {
@@ -40,7 +39,7 @@ class SlideIpt extends Component {
     $(e.target).removeAttr('disabled').focus()
   }
   render() {
-    const {item} = this.props;
+    const {item,idx} = this.props;
     return (
       <input disabled="disabled" type="text" 
           class="canEdit" 
@@ -50,7 +49,7 @@ class SlideIpt extends Component {
           autoComplete="off"
           value={this.state.value}
           onInput={(e)=>{this.handleInputTime(e)}}
-          onBlur={(e)=>{this.handleBlur(e,item,1);}}
+          onBlur={(e)=>{this.handleBlur(e,item,1,idx)}}
           />
     );
   }

+ 0 - 269
src/components/AddNewInspect/SlideIpt/index.less

@@ -1,269 +0,0 @@
-@import "~@less/variables.less";
-.slideLi {
-    // cursor: pointer;
-    // color: #767676;
-    position: relative;
-    padding: 10px 0px 10px 0;
-    border-bottom:1px dashed #989DA3;
-    margin-top: 5px;
-    span {
-        display: inline-block;
-        padding: 0 5px;
-        box-sizing: border-box;
-    }
-    i {
-        font-style: normal;
-        display: inline-block;
-        vertical-align: top;
-        padding-top: 3px;
-        // &:before {
-        //     content: '\300C';
-        // }
-        // &:after {
-        //     content: '\300D';
-        // }
-    }  
-    &>p {
-        cursor: pointer;
-        color: #767676;
-        display: inline-block;
-        position: relative;
-        vertical-align: top;
-    } 
-    .partDel {
-        width: 15px;
-        height: 15px;
-        margin-bottom: 11px;
-        cursor: pointer;
-        display: inline-block;
-        position: absolute;
-        right: -4px;
-        top: 0px;
-        background: @closeIcon;
-        background-color: #fff;
-        background-size: 100% 100%;
-    }
-    .bigname {
-        width: 35%;
-        font-weight: bold;
-    }
-    .smallname {
-        width: 15%;
-    }
-    .edit {
-        width: 25%;
-        input {
-            width: 100%;
-        }
-        i {
-            
-        }
-    }
-    .maxmin {
-        width: 15%;
-    }
-    .pass {
-        text-align: right;
-        padding-left: 15px;
-        box-sizing: border-box;
-    }
-    .imgCheck {
-        position: relative;
-        top: 2px;
-        margin: 0 3px 0 5px;
-        cursor: pointer;
-    }
-}
-.slideLi:hover{
-    background:#F2F2F2;
-    border-radius: 4px;
-       .partDel{
-        background: @closeHor;
-        background-color: #fff;
-        background-size: 100% 100%;
-      } 
-}
-.staticTagActive {
-    cursor: pointer;
-    color: #333;
-    // display: inline-block;
-    position: relative;
-    vertical-align: top;
-    padding: 2px 10px 10px 10px;
-    box-sizing: border-box;
-    width: 100%;
-    float: left;
-    span {
-        border-bottom: 1px solid #666666 ;
-    }
-}
-
-.staticTag {
-    cursor: pointer;
-    // color: #767676;
-    color: @blue;
-    padding-top: 10px;
-    display: inline-block;
-    position: relative;
-    /* &:before {
-        content: '\300C';
-    }
-    &:after {
-        content: '\300D';
-    } */
-}
-.table {
-    color: #000;
-    width: 100%;
-    tr {
-        line-height: 18px;
-        height: 18px;
-        width: 100%;
-        font-size: unset;
-        td {
-          cursor: default;
-          padding-top: 3px;
-          font-size: unset;
-          span {
-              font-size: unset;
-          }
-        }
-    }
-    tr > td {
-        padding: 0 10px;
-        box-sizing: border-box;
-    }
-}
-
-.searchResult {
-    .searchResultT {
-        img {
-            float: right;
-        }
-    }
-}
-
-.excelDataLists {
-    position: relative;
-    background-color: #f1f1f1;
-    border: 1px solid #ccc;
-    .close {
-        width: 13px;
-        height: 13px;
-        position: absolute;
-        top: -5px;
-        right: -5px;
-        z-index: 30;
-        background-color: #fff;
-        border-radius: 50%;
-    }
-    .excelDataLis {
-        padding: 2px 0px;
-        border-bottom: 1px dashed #989DA3;
-        .excelDataTitle {
-            display: inline-block;
-            width: 20%;
-            vertical-align: top;
-            padding-left: 10px;
-            float: left;
-        }
-        table {
-            width: 80%;
-            tr {
-                height: 16px;
-                line-height: 16px;
-                width: 100%;
-            }
-            td {
-                text-align: left;
-                padding-top: 6px;
-                cursor: default;
-            }
-            .excelUnit {
-                width: auto;
-                margin-left: 5px;
-            }
-        }
-    }
-}
-.center {
-    text-align: center;
-    font-size: 16px;
-    padding-top: 10px;
-    padding-bottom: 50px;
-}
-.slides {
-  background-color: #EDEDED;
-  text-align: center;
-  height: 28px;
-  line-height: 28px;
-  margin: 10px 0 8px 0;
-  cursor: pointer;
-  span {
-    color:#7d7d7d;
-  }
-  img{
-    vertical-align: middle;
-  }
-  .num {
-    color: @blue;
-  }
-}
-.imgInfo {
-  position: relative;
-}
-.imgInfo, .imgInfo1 {
-  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;
-  cursor: pointer;
-}
-.imgInfo1 {
-    top: -13px;
-  }
-  .imgInfo:hover, .imgInfo1:hover {
-    background: url('../img/info3.png') no-repeat center center;
-    background-size: 100% auto; 
-  }
-.tagSpan {
-  display: inline-block;
-  position: relative;
-}
-.tagSpanS {
-    font-weight: bold;
-    color: #000;
-}
-.selectTagSpan {
-  color: #000;
-  font-weight: bold;
-}
-.tagSpan:hover {
-    .imgInfo, .imgInfo1 {
-        display: block;
-      }
-}
-.iptValue {
-    width: 60px;
-    color: #3B9ED0;
-    font-size: 12px;
-}
-.iptValueBtn {
-    color: #3B9ED0;
-    width: 60px;
-    height: 22px;
-    line-height: 22px;
-    background-color: #EDF8FF;
-    text-align: center;
-    display: inline-block;
-    font-size: 12px;
-    border-radius: 4px;
-    border-bottom: 0 !important;
-    margin-left: 10px;
-}

+ 9 - 9
src/components/AddNewInspect/SlidePic/index.jsx

@@ -48,9 +48,9 @@ class SlidePic extends Component {
       activeName:''
     })
   }
-  delConfirm(item){
+  delConfirm(item,idx){
     const {handleDelConfirm,handlePush} = this.props;
-    handleDelConfirm&&handleDelConfirm(item);
+    handleDelConfirm&&handleDelConfirm(item,idx);
     Notify.success("删除成功");
     handlePush && handlePush({mode:8});       //右侧推送
     this.setState({
@@ -68,9 +68,9 @@ class SlidePic extends Component {
     $('.canEdit').attr('disabled','disabled')
     handlePush && handlePush({mode:8});       //右侧推送
   }
-  checkOnOff(item){
+  checkOnOff(item,idx){
     const {checkOnOff,handlePush} = this.props
-    checkOnOff(item)
+    checkOnOff(item,idx)
     handlePush && handlePush({mode:8});       //右侧推送
   }
   setEdit(e){
@@ -78,11 +78,11 @@ class SlidePic extends Component {
     $(e.target).removeAttr('disabled').focus()
   }
   render() {
-    const {item,time,setTipValue} = this.props;
+    const {item,time,setTipValue,idx} = this.props;
     const {canEdit,activeInd,activeName,value,style} = this.state;
     return (
       <li key={item.time} className={`${styles.slideLi} clearfix`}> 
-          <img className={styles.imgCheck} src={item.check?checkOn:checkOff} onClick={()=>this.checkOnOff(item)} alt=""/>
+          <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.smallname}>{item.flg == 5?'药品':item.flg == 6?'手术/操作':'输血'}</span>
           <span className={styles.edit}>
@@ -95,13 +95,13 @@ class SlidePic extends Component {
                 placeholder={item.flg == 5?'(填写用法计量)':'(填写用量)'}
                 autoComplete="off"
                 value={item.value}
-                onInput={(e)=>{this.handleInput(e,item,2)}}
+                onInput={(e)=>{this.handleInput(e,item,2,idx)}}
                 onBlur={()=>{this.handleBlur()}}
                 />:null
             }
           </span>
           <span className={styles.pass}>
-            <SlideIpt item={item} setTipValue={setTipValue}/> 
+            <SlideIpt item={item} setTipValue={setTipValue} idx={idx}/> 
           </span>
           <span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item.time)}}></span>
           <DelToast show={time==item.time&&activeInd?true:false}
@@ -109,7 +109,7 @@ class SlidePic extends Component {
                     right={'-34px'}
                     top={'30px'}
                     cancel={this.handleCancel}
-                    confirm={()=>{this.delConfirm(item)}}/>
+                    confirm={()=>{this.delConfirm(item,idx)}}/>
       </li>
     );
   }

+ 5 - 2
src/components/AddNewInspect/index.jsx

@@ -67,10 +67,10 @@ class AddNewInspect extends React.Component {
     });
   }
   handleDelConfirm() {//弹窗确定
-    const { delPartItem, handleCloseExcel, handlePush } = this.props;
+    const { delPartItem, handleCloseExcel, handlePush,idx } = this.props;
     const { type, id, impId } = this.state;
     if (type == 1) {
-      delPartItem(id)
+      delPartItem(id,idx)
     } else if (type == 2) {
       handleCloseExcel(impId)
     }
@@ -141,6 +141,7 @@ class AddNewInspect extends React.Component {
                 return <SlidePic
                   item={item}
                   checkOnOff={checkOnOff}
+                  idx={idx}
                   time={time}
                   handlePush={handlePush}
                   handleDelClick={this.handleDelClick}
@@ -155,6 +156,7 @@ class AddNewInspect extends React.Component {
                   item={item}
                   checkOnOff={checkOnOff}
                   time={time}
+                  idx={idx}
                   handlePush={handlePush}
                   handleDelClick={this.handleDelClick}
                   setTipValue={setTipValue}
@@ -168,6 +170,7 @@ class AddNewInspect extends React.Component {
                   item={item}
                   checkOnOff={checkOnOff}
                   time={time}
+                  idx={idx}
                   handlePush={handlePush}
                   handleDelClick={this.handleDelClick}
                   setTipValue={setTipValue}

+ 6 - 6
src/containers/NewAdvice.js

@@ -53,8 +53,8 @@ function mapStateToProps(state) {//console.log(state.newAdvice)
 
 function mapDispatchToProps(dispatch) {
   return {
-    checkOnOff(item){
-      dispatch(checkOffOn(item))
+    checkOnOff(item,idx){
+      dispatch(checkOffOn(item,idx))
     },
     detailClick(val){
       dispatch(searchTypeNew(val))
@@ -62,8 +62,8 @@ function mapDispatchToProps(dispatch) {
     setContext(obj){
       dispatch(setContext(obj))
     },
-    handleDelConfirm(obj){
-      dispatch(delOnePic(obj))
+    handleDelConfirm(obj,idx){
+      dispatch(delOnePic(obj,idx))
     },
     handleChangeValue(val) {
       dispatch(getSearchList(val))
@@ -100,8 +100,8 @@ function mapDispatchToProps(dispatch) {
       dispatch(delPartItem(idx))
       dispatch(getMRAnalyse())
     },
-    setTipValue(item,value,sign) {
-      dispatch(setTipAdvice(item,value,sign))
+    setTipValue(item,value,sign,tip) {
+      dispatch(setTipAdvice(item,value,sign,tip))
     },
     //右侧推送
     fetchPushInfos(obj) {

+ 6 - 6
src/store/actions/newAdvice.js

@@ -63,22 +63,22 @@ export const setContext = (obj) => ({
     type:SET_CONTEXT,
     obj
 })
-export const setTipAdvice = (item,value,sign) => ({
+export const setTipAdvice = (item,value,sign,tip) => ({
     type:SET_TIP_ADVICE,
     item,
     value,
-    sign
+    sign,tip
 })
 export const searchTypeNew = (value) => ({
     type:SEARCH_TYPE_NEW,
     value
 })
 
-export const delOnePic = (item) => ({
+export const delOnePic = (item,tip) => ({
     type:DEL_ONE_PIC,
-    item
+    item,tip
 })
-export const checkOffOn = (item) => ({
+export const checkOffOn = (item,tip) => ({
     type:CHECK_OFF_ON_NEW,
-    item
+    item,tip
 })

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

@@ -57,11 +57,6 @@ export const saveMessage = (bool) =>{
            });
        });
     }
-    // store.dispatch({type:MODI_LOADING,flag:true});
-    // store.dispatch({ type: CLEARMEDICALNAME});
-    // getConceptDetails(bool)  //保存病历 老版本
-   
-    
 }
 
 // 获取参数value

+ 22 - 9
src/store/reducers/newAdvice.js

@@ -53,7 +53,7 @@ export default (state = initSearchList, action) => {
         let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempBloodOrder=[],tempTotalOrder=[];
         if(tmpLis&&tmpLis.flg == 5){//药品
             for(let i = 0;i < tempArr.length;i++){
-                if(tempArr[i].time == tmpLis.time){
+                if(action.tip == i){
                     let flg = tempArr[i].check;
                     tempArr[i].check = !flg
                 }
@@ -61,7 +61,7 @@ export default (state = initSearchList, action) => {
             newState.labelListBig = [...tempArr]
         }else if(tmpLis&&tmpLis.flg == 6){//手术、操作
             for(let i = 0;i < tempArrs.length;i++){
-                if(tempArrs[i].time == tmpLis.time){
+                if(action.tip == i){
                     let flg = tempArrs[i].check;
                     tempArrs[i].check = !flg
                 }
@@ -69,7 +69,7 @@ export default (state = initSearchList, action) => {
             newState.labelListSmall = [...tempArrs]
         }else if(tmpLis&&tmpLis.flg == 8){//输血
             for(let i = 0;i < tmpArr.length;i++){
-                if(tmpArr[i].time == tmpLis.time){
+                if(action.tip == i){
                     let flg = tmpArr[i].check;
                     tmpArr[i].check = !flg
                 }
@@ -91,13 +91,26 @@ export default (state = initSearchList, action) => {
         let tmpArr = newState.labelListBlood;
         let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempBloodOrder=[],tempTotalOrder=[];
         if(tmpLis&&tmpLis.flg == 5){
-            tempArr = tempArr.filter((item)=>item.time != tmpLis.time)
+            console.log(action.tip)
+            tempArr = tempArr.filter((item,idx)=>{
+                if(action.tip != idx){
+                    return item
+                }
+            })
             newState.labelListBig = [...tempArr]
         }else if(tmpLis&&tmpLis.flg == 6){
-            tempArrs = tempArrs.filter((item)=> item.time != tmpLis.time )
+            tempArrs = tempArrs.filter((item,idx)=> {
+                if(action.tip != idx){
+                    return item
+                }
+            } )
             newState.labelListSmall = [...tempArrs]
         }else if(tmpLis&&tmpLis.flg == 8){
-            tmpArr = tmpArr.filter((item)=> item.time != tmpLis.time )
+            tmpArr = tmpArr.filter((item,idx)=> {
+                if(action.tip != idx){
+                    return item
+                }
+            } )
             newState.labelListBlood = [...tmpArr]
         }
         tempBigOrder = tempArr.filter((item)=>item.check)
@@ -119,7 +132,7 @@ export default (state = initSearchList, action) => {
         // console.log(action,1111111)
         if(tmpLis.flg == 5){//药品
             for(let i= 0;i < tempArr.length;i++){
-                if(tmpLis.time == tempArr[i].time){
+                if(action.tip == i){
                     if(action.sign == 1){//时间
                         tempArr[i].time = action.value
                         tempArr[i].dateValue = action.value
@@ -131,7 +144,7 @@ export default (state = initSearchList, action) => {
             newState.labelListBig = [...tempArr]
         }else if(tmpLis.flg == 6){//手术
             for(let i= 0;i < tempArrs.length;i++){
-                if(tmpLis.time == tempArrs[i].time){
+                if(action.tip == i){
                     tempArrs[i].time = action.value
                     tempArrs[i].dateValue = action.value
                 }
@@ -139,7 +152,7 @@ export default (state = initSearchList, action) => {
             newState.labelListSmall = [...tempArrs]
         }if(tmpLis.flg == 8){//输血
             for(let i= 0;i < tmpArr.length;i++){
-                if(tmpLis.time == tmpArr[i].time){
+                if(action.tip == i){
                     if(action.sign == 1){
                         tmpArr[i].time = action.value
                         tmpArr[i].dateValue = action.value