Explorar el Código

一般治疗和医嘱自由输入合为医嘱字符串

zhangxc hace 6 años
padre
commit
f9bf4d5e02
Se han modificado 1 ficheros con 11 adiciones y 4 borrados
  1. 11 4
      src/store/actions/pushMessage.js

+ 11 - 4
src/store/actions/pushMessage.js

@@ -35,9 +35,11 @@ export const setAdvice=(state,action)=>{
 
 //获取医嘱信息字符串
 function getAdviceStr(advice) {
+	const commontreatment = advice.commontreatment
 	const scheme = advice.scheme || '';
-	const assay = advice.assay || '';
-	const check = advice.check || '';
+	const adviceInput = advice.adviceInput || '';
+	// const assay = advice.assay || '';
+	// const check = advice.check || '';
 	let AdviceStr = advice.AdviceStr || '';
 	for (let i = 0; i < scheme.length; i++) {
 		for (let j = 0; j < scheme[i].treatment.length; j++) {
@@ -49,8 +51,11 @@ function getAdviceStr(advice) {
 			
 		}
 	}
-	if(assay || check)  { 
-		AdviceStr = assay + check +'; ' + AdviceStr;
+	if(commontreatment)  { 
+		AdviceStr = commontreatment +'; ' + AdviceStr;
+	}	
+	if(adviceInput)  { 
+		AdviceStr = AdviceStr +'; ' + adviceInput;
 	}	
 	return AdviceStr;
 }
@@ -235,11 +240,13 @@ export const hideTipsDetails = (state, action) => {
 export const setCommontreatment = (state, action) => {
 	const res = JSON.parse(JSON.stringify(state));
 	res.advice.commontreatment = action.commontreatment;
+	res.AdviceStr = getAdviceStr(res.advice)
 	return res;
 }
 
 export const setAdviceInput = (state, action) => {
 	const res = JSON.parse(JSON.stringify(state));
 	res.advice.adviceInput = action.adviceInput;
+	res.AdviceStr = getAdviceStr(res.advice)
 	return res;
 }