新增食谱制作时按病症筛选功能

This commit is contained in:
huangdeliang
2021-04-27 11:55:11 +08:00
parent a45060a87c
commit a24a9e8674
20 changed files with 275 additions and 174 deletions

View File

@ -14,6 +14,7 @@ import { getRecipesPlan, updateRecipesPlan } from "@/api/custom/recipesPlan";
import { getDicts } from "@/api/system/dict/data";
import { addShortCut } from "@/utils/shortCutUtils";
import { messageTypes } from "@/utils";
import { listPhysicalSigns } from "@/api/custom/physicalSigns";
const oriState = {
cusId: undefined,
@ -46,6 +47,7 @@ const oriState = {
notRecIgds: [],
avoidFoodIds: [],
igdTypeOptions: [],
physicalSignsOptions: [],
//
curShortCutObj: {}
};
@ -175,6 +177,31 @@ const actions = {
getDicts("cus_ing_type").then(response => {
commit("updateStateData", { igdTypeOptions: response.data });
});
listPhysicalSigns().then(response => {
commit("updateStateData", {
physicalSignsOptions: response.rows.reduce((arr, cur) => {
const tarTypeObj = arr.find(obj => obj.value === cur.typeId);
if (!tarTypeObj) {
arr.push({
value: cur.typeId,
label: cur.typeName,
children: [
{
value: cur.id,
label: cur.name
}
]
});
} else {
tarTypeObj.children.push({
value: cur.id,
label: cur.name
});
}
return arr;
}, [])
});
});
return new Promise((res, rej) => {
// 健康数据