zhouna 4 anni fa
parent
commit
4eeffda05b

+ 2 - 2
src/components/Diagnosis/index.jsx

@@ -99,8 +99,8 @@ class Diagnosis extends Component {
         const {isTcm,tcmList} = this.props;
         if (isTcm) {    //添加中医诊断后才显示中医症候添加按钮
             const len = tcmList.length>0?tcmList.length-1:0;
-            const showNext = tcmList.length===0||(tcmList.length>0&&tcmList[len].tcmDiag&&tcmList[len].tcmSyndrome);
-            const showZh = tcmList.length>0&&tcmList[len].tcmDiag&&!tcmList[len].tcmSyndrome;
+            const notAll = tcmList.find((it)=>!it.tcmSyndrome);     //是否有未填写的症候
+            const showNext = tcmList.length===0||!notAll;
             return (<div id="diagnosisTcmResult">
                 <ItemBox id="tcmDiagnosis" title="中医诊断" boxHeight='auto' hideAllDrop={this.props.hideAllDrop}
                          titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>

+ 1 - 1
src/components/DiagnosticItem/index.jsx

@@ -51,7 +51,7 @@ class DiagnosticItem extends Component{
             const lastTcmDiag = tcmList[tcmList.length-1].tcmDiag;
             for (let i = 0; i < tcmList.length-1; i++) {
                 if(tcmList[i].tcmDiag+tcmList[i].tcmSyndrome=== lastTcmDiag+item.name) {
-                    Notify.info('该中医诊断+中医候已存在');
+                    Notify.info('该中医诊断+中医候已存在');
                     return
                 }
             }

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

@@ -366,7 +366,7 @@ class DiagnosticList extends Component {
                                         <input type="text" value={tcmSyndrome} disabled={true}/>
                                       </span>
 
-                                    </span>:(tcmDiag?<Add showText="添加中医候" isTcm={isTcm} handleClick={this.handleSymShowSearch} id="addSymDiag" height="50px" />:'')}
+                                    </span>:(tcmDiag?<Add showText="添加中医候" isTcm={isTcm} handleClick={this.handleSymShowSearch} id="addSymDiag" height="50px" />:'')}
                                 {tcmDiag&&tcmSyndrome?'':<DiagResultSearch
                                         refreshScroller={refreshScroller}
                                         setHighter={setHighter}

+ 3 - 2
src/store/actions/diagnosticList.js

@@ -45,7 +45,7 @@ export const addTcmDiagnostic = (state, action) => {
     //console.log('addTcmDiagnostic',action)
     const { isSym } = action;
     let obj=null;
-    //如果上一个诊断和症候不全,则不添加新行
+    //如果前面有一个诊断和症候不全,则不添加新行(不一定是上一个,但肯定只有一个不全)
     const len = res.tcmList.length;
     if(len===0){    //len==0,只可能是添加中医诊断
         obj = {
@@ -56,7 +56,8 @@ export const addTcmDiagnostic = (state, action) => {
         res.tcmList.push(obj);
     }else{
         if(isSym){      //上一个症候没填,不用新增
-            res.tcmList[len-1].tcmSyndrome=action.item.name;
+            const noAllInx = res.tcmList.findIndex((it)=>!it.tcmSyndrome);
+            res.tcmList[noAllInx].tcmSyndrome=action.item.name;
             if(len===1){
                 res.otherIndex = {
                     "tcmDiag":res.tcmList[0].tcmDiag, //中医诊断