浏览代码

Merge remote-tracking branch 'origin/TCM0513' into testNew

zhouna 4 年之前
父节点
当前提交
31988fa74e
共有 3 个文件被更改,包括 19 次插入9 次删除
  1. 7 7
      src/components/DiagnosticList/index.jsx
  2. 3 2
      src/containers/DiagnosticList.js
  3. 9 0
      src/store/actions/diagnosticList.js

+ 7 - 7
src/components/DiagnosticList/index.jsx

@@ -323,19 +323,19 @@ class DiagnosticList extends Component {
         hasEnterImg: false
       })
     }
-    handleFocus(){
+    handleFocus(flag){
       const {getBilling} = this.props;
-      getBilling&&getBilling({mode:10});
+      getBilling&&getBilling({isTcm:flag});
     }
-    handleInput(e,index){
+    handleInput(e,index,isTcm){
       const {editDiagName,getBilling} = this.props;
       let name = (e.target.value).trim()
-      editDiagName(index,name)
+      editDiagName(index,name,isTcm)
       //右侧推送--延时推送
       const stimer = this.state.timer;
       clearTimeout(stimer);
       let timer = setTimeout(function(){
-        getBilling&&getBilling({mode:10});
+        getBilling&&getBilling({isTcm:!!isTcm});
         clearTimeout(stimer);
       },config.delayPushTime);
       this.setState({timer})
@@ -357,13 +357,13 @@ class DiagnosticList extends Component {
 
                                 {tcmDiag?<span className={style['diag-name']}>
                                       <span title={tcmDiag} className={style['diag-name-box']} style={{'max-width': '300px'}}>
-                                        <input type="text" value={tcmDiag} disabled={true}/>
+                                        <input type="text" value={tcmDiag}  onFocus={(e)=>{this.handleFocus(true)}} onBlur={(e)=>{this.handleBlur(e,item,index)}} onInput={(e)=>this.handleInput(e,index,'tcmDiag')}/>
                                       </span>
 
                                     </span>:<Add showText="添加中医诊断结果" isTcm={isTcm} handleClick={this.handleTcmShowSearch} id="addTcmDiag" height="50px" />}
                             {tcmSyndrome?<span className={style['diag-name']}>
                                       <span title={tcmSyndrome} className={style['diag-name-box']} style={{'max-width': '300px'}}>
-                                        <input type="text" value={tcmSyndrome} disabled={true}/>
+                                        <input type="text" value={tcmSyndrome}  onFocus={(e)=>{this.handleFocus(true)}} onBlur={(e)=>{this.handleBlur(e,item,index)}} onInput={(e)=>this.handleInput(e,index,'tcmSyndrome')}/>
                                       </span>
 
                                     </span>:(tcmDiag?<Add showText="添加中医证候" isTcm={isTcm} handleClick={this.handleSymShowSearch} id="addSymDiag" height="50px" />:'')}

+ 3 - 2
src/containers/DiagnosticList.js

@@ -38,11 +38,12 @@ function mapStateToProps(state) {//console.log(state)
 
 function mapDispatchToProps(dispatch) {
     return {
-      editDiagName(idx,name){        //获取评估内容数据
+      editDiagName(idx,name,isTcm){        //获取评估内容数据
         dispatch({
           type:EDITDIAGMSG,
           idx:idx,
-          name:name
+          name:name,
+          isTcm
         });
         dispatch({
             type: GET_DIAGNOSTIC_STR

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

@@ -1,5 +1,14 @@
 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.tcmList[idx].hasTreat){
+            res.otherIndex[isTcm]=name;
+        }
+        return res;
+    }
+    console.log(action)
     let tmpLis = res.diagnosticList
     for(let i = 0;i < tmpLis.length;i++){
         if(action.idx == i){