zhouna 4 роки тому
батько
коміт
40ffa20026

+ 9 - 26
src/components/DiagnosticList/index.jsx

@@ -30,7 +30,6 @@ class DiagnosticList extends Component {
     constructor(props) {
         super(props);
         this.state = {
-            editStatus:[],      //是否被编辑过
             visible: false,
             delItem: {},
             treatTitle: '',
@@ -96,21 +95,10 @@ class DiagnosticList extends Component {
     }
     handleBlur(e,delItem,idxNum){
       const { delDiagnostic,isTcm } = this.props;
-      let name = e.target.value;
-      if(isTcm){
-          if(!delItem.tcmDiag.trim()&&!delItem.tcmSyndrome){
-              const arr = [...this.state.editStatus];
-              arr.splice(idxNum,1);
-              this.setState({editStatus:arr})
-              delDiagnostic && delDiagnostic(delItem,idxNum,isTcm);
-          }
-          return;
-      }else{
-          if(name.trim() == ''){
-              delDiagnostic && delDiagnostic(delItem,idxNum,isTcm);
-          }
+      let name = e.target.value
+      if(name.trim() == ''){
+        delDiagnostic && delDiagnostic(delItem,idxNum,isTcm);
       }
-
     }
     handleTcmShowSearch(e) {
         this.props.showTcm ? this.hideTcmSearch() : this.showTcmSearch()
@@ -343,11 +331,6 @@ class DiagnosticList extends Component {
       const {editDiagName,getBilling} = this.props;
       let name = (e.target.value).trim()
       editDiagName(index,name,isTcm)
-      if(isTcm){
-          const arr = [...this.state.editStatus];
-          arr[index] = true;
-          this.setState({editStatus:arr})
-      }
       //右侧推送--延时推送
       const stimer = this.state.timer;
       clearTimeout(stimer);
@@ -360,7 +343,7 @@ class DiagnosticList extends Component {
     render(){
         const { list,tcmList, treatment,pushMessage, loading,refreshScroller,windowHeight,setHighter,isTcm} = this.props;
         const {showTipsDetails,tipsDetails,showAllName}=pushMessage;
-        const {visible, treatTitle,  hasOndel, hasOnIndex,delItem,editStatus} = this.state;
+        const {visible, treatTitle,  hasOndel, hasOnIndex,delItem} = this.state;
         const diagList = isTcm?tcmList:list;
         if(isTcm){      //中医,添加中医诊断后才显示中医症候添加按钮
             return(
@@ -372,15 +355,15 @@ class DiagnosticList extends Component {
                             {diagList.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}
                             <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '1' : index+1}</span>
 
-                                {editStatus[index]||tcmDiag?<span className={style['diag-name']}>
+                                {tcmDiag?<span className={style['diag-name']}>
                                       <span title={tcmDiag} className={style['diag-name-box']} style={{'max-width': '300px'}}>
-                                        <input type="text" value={tcmDiag}  onFocus={(e)=>{this.handleFocus(true)}} onBlur={(e)=>{this.handleBlur(e,item,index,'tcmDiag')}} onInput={(e)=>this.handleInput(e,index,'tcmDiag')}/>
+                                        <input type="text" value={tcmDiag} disabled={true}/>
                                       </span>
 
                                     </span>:<Add showText="添加中医诊断结果" isTcm={isTcm} handleClick={this.handleTcmShowSearch} id="addTcmDiag" height="50px" />}
-                            {editStatus[index]||tcmSyndrome?<span className={style['diag-name']}>
+                            {tcmSyndrome?<span className={style['diag-name']}>
                                       <span title={tcmSyndrome} className={style['diag-name-box']} style={{'max-width': '300px'}}>
-                                        <input type="text" value={tcmSyndrome}  onFocus={(e)=>{this.handleFocus(true)}} onBlur={(e)=>{this.handleBlur(e,item,index,'tcmSyndrome')}} onInput={(e)=>this.handleInput(e,index,'tcmSyndrome')}/>
+                                        <input type="text" value={tcmSyndrome} disabled={true}/>
                                       </span>
 
                                     </span>:(tcmDiag?<Add showText="添加中医证候" isTcm={isTcm} handleClick={this.handleSymShowSearch} id="addSymDiag" height="50px" />:'')}
@@ -392,7 +375,7 @@ class DiagnosticList extends Component {
                                         isTcm={isTcm}
                                         height={150}>
                                     </DiagResultSearch>}
-                                {editStatus[index]||(tcmDiag&&tcmSyndrome)?<span className={style['treat']}
+                                {tcmDiag&&tcmSyndrome?<span className={style['treat']}
                                   onClick={() =>{this.showTreat(item, index)}}>
                                           <img src={item.hasTreat?singleB:singleL} alt=""/>
                                           治疗方案

+ 0 - 8
src/store/actions/diagnosticList.js

@@ -1,13 +1,5 @@
 export const editDiagMsg = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    const {name,isTcm,idx}  = action;
-    if(isTcm){
-        res.tcmList[idx][isTcm]=name;
-        if(res.otherIndex&&res.tcmList[idx].hasTreat){
-            res.otherIndex[isTcm]=name;
-        }
-        return res;
-    }
     let tmpLis = res.diagnosticList
     for(let i = 0;i < tmpLis.length;i++){
         if(action.idx == i){