|
@@ -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, //中医诊断
|