diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysDishesMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysDishesMapper.xml index c8b9371bf..3b13adebe 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysDishesMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysDishesMapper.xml @@ -47,6 +47,8 @@ and name like concat('%', #{name}, '%') and FIND_IN_SET(#{type}, type) + and big_class = #{bigClass} + and small_class = #{smallClass} and review_status = #{reviewStatus} and is_main = #{isMain} diff --git a/stdiet-ui/src/store/modules/recipes.js b/stdiet-ui/src/store/modules/recipes.js index ed39f67f8..234858d8e 100644 --- a/stdiet-ui/src/store/modules/recipes.js +++ b/stdiet-ui/src/store/modules/recipes.js @@ -33,7 +33,9 @@ const oriState = { templateInfo: undefined, copyData: undefined, canCopyMenuTypes: [], - fontSize: parseInt(localStorage.getItem("fontSize")) || 12 + fontSize: parseInt(localStorage.getItem("fontSize")) || 12, + dishBigClassOptions:[], + dishSmallClassOptions:[], }; const mutations = { @@ -138,6 +140,12 @@ const actions = { getDicts("cus_dishes_type").then(response => { commit("updateStateData", { typeOptions: response.data }); }); + getDicts("dish_class_big").then((response) => { + commit("updateStateData", { dishBigClassOptions: response.data }); + }); + getDicts("dish_class_small").then((response) => { + commit("updateStateData", { dishSmallClassOptions: response.data }); + }); return new Promise((res, rej) => { // 健康数据 @@ -454,6 +462,27 @@ const actions = { }; const getters = { + dishClassOptions: state => { + const dishClass = []; + state.dishBigClassOptions.forEach((item, index) => { + dishClass.push({ + 'value': parseInt(item.dictValue), + 'label': item.dictLabel, + 'children': [] + }); + if(index == state.dishBigClassOptions.length - 1){ + state.dishSmallClassOptions.forEach((smallClass, i) => { + if(smallClass.remark){ + dishClass[parseInt(smallClass.remark-1)].children.push({ + 'value': parseInt(smallClass.dictValue), + 'label': smallClass.dictLabel + }); + } + }); + } + }); + return dishClass; + }, analyseData: state => { if (!state.recipesData.length) { return []; @@ -504,7 +533,18 @@ const getters = { state.typeOptions.reduce((obj, cur) => { obj[cur.dictValue] = cur.dictLabel; return obj; - }, {}) + }, {}), + dishBigClassDict: state => + state.dishBigClassOptions.reduce((obj, cur) => { + obj[cur.dictValue] = cur.dictLabel; + return obj; + }, {}), + dishSmallClassDict: state => + state.dishSmallClassOptions.reduce((obj, cur) => { + obj[cur.dictValue] = cur.dictLabel; + return obj; + }, {}), + }; export default { diff --git a/stdiet-ui/src/views/custom/dishes/index.vue b/stdiet-ui/src/views/custom/dishes/index.vue index 729ab5a80..481200bda 100644 --- a/stdiet-ui/src/views/custom/dishes/index.vue +++ b/stdiet-ui/src/views/custom/dishes/index.vue @@ -16,6 +16,17 @@ @keyup.enter.native="handleQuery" /> + + + @@ -453,15 +464,6 @@ export default { // cusWeightOptions: [], dishClassOptions: [], - /* - * { - value: 'zhinan', - label: '指南', - children: [{ - value: 'shejiyuanze', - label: '设计原则' - }] - }*/ dishClassBigOptions:[], dishClassSmallOptions:[], // 查询参数 @@ -470,11 +472,15 @@ export default { pageSize: 10, name: null, type: null, + bigClass: null, + smallClass: null }, // 表单参数 form: {}, // 表单校验 rules: {}, + //菜品种类查询种类 + dishClassQueryParam:[] }; }, created() { @@ -506,6 +512,11 @@ export default { /** 查询菜品列表 */ getList() { this.loading = true; + if(this.dishClassQueryParam != null && this.dishClassQueryParam.length > 0){ + this.queryParams.smallClass = this.dishClassQueryParam[1]; + }else{ + this.queryParams.smallClass = null; + } listDishes(this.queryParams).then((response) => { this.dishesList = response.rows.map((d) => { const recTags = [], @@ -621,6 +632,7 @@ export default { /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); + this.dishClassQueryParam = []; this.handleQuery(); }, // 多选框选中数据 diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/index.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/index.vue index 1e54da651..a027a0236 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/index.vue @@ -71,7 +71,7 @@ size="mini" type="primary" @click="handleOnSave" - >生成食谱生成食谱2 diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/AddDishesDrawer/SelectDishes.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/AddDishesDrawer/SelectDishes.vue index e23a38880..e2ae176a2 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/AddDishesDrawer/SelectDishes.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/AddDishesDrawer/SelectDishes.vue @@ -15,6 +15,17 @@ @keyup.enter.native="handleQuery" /> + + + + + +