From f02235936c4d412cf0c20124b67d087cc95f530b Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Mon, 15 Mar 2021 20:53:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=BF=8C=E5=8F=A3?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stdiet-ui/src/store/modules/recipes.js | 31 +++- stdiet-ui/src/utils/healthyData.js | 5 + stdiet-ui/src/views/custom/dishes/index.vue | 82 +++++---- .../AddDishesDrawer/ConfigDishes.vue | 2 +- .../AddDishesDrawer/SelectDishes.vue | 166 ++++++++++-------- .../RecipesCom/EditableText/index.vue | 9 +- .../RecipesView/RecipesCom/index.vue | 16 +- .../custom/recipesBuild/VerifyView/index.vue | 69 ++++++-- 8 files changed, 253 insertions(+), 127 deletions(-) diff --git a/stdiet-ui/src/store/modules/recipes.js b/stdiet-ui/src/store/modules/recipes.js index e03bd6c20..03fd59638 100644 --- a/stdiet-ui/src/store/modules/recipes.js +++ b/stdiet-ui/src/store/modules/recipes.js @@ -36,7 +36,10 @@ const oriState = { fontSize: parseInt(localStorage.getItem("fontSize")) || 12, dishBigClassOptions: [], dishSmallClassOptions: [], - leftShow: false + // + leftShow: false, + notRecIgds: [], + igdTypeOptions: [] }; const mutations = { @@ -64,7 +67,7 @@ const mutations = { payload.cusWeight && (tarIgd.cusWeight = payload.cusWeight); payload.cusUnit && (tarIgd.cusUnit = payload.cusUnit); } - console.log(JSON.parse(JSON.stringify(state.recipesData))); + // console.log(JSON.parse(JSON.stringify(state.recipesData))); } else if (actionType === "delIgd") { tarDishes.igdList = tarDishes.igdList.filter( igd => igd.id !== payload.igdId @@ -103,6 +106,9 @@ const mutations = { toggleLeftShow(state, payload) { state.leftShow = !state.leftShow; }, + setNotRecIgds(state, payload) { + state.notRecIgds = payload.data; + }, setDate(state, payload) { state.startDate = payload.startDate; state.endDate = payload.endDate; @@ -152,6 +158,9 @@ const actions = { getDicts("dish_class_small").then(response => { commit("updateStateData", { dishSmallClassOptions: response.data }); }); + getDicts("cus_ing_type").then(response => { + commit("updateStateData", { igdTypeOptions: response.data }); + }); return new Promise((res, rej) => { // 健康数据 @@ -559,6 +568,19 @@ const getters = { }); return arr; }, []), + igdTypeDetial: state => + state.recipesData.reduce((obj, cur) => { + cur.dishes.forEach(dObj => { + dObj.igdList.forEach(iObj => { + if (!obj[iObj.type]) { + obj[iObj.type] = [{ name: iObj.name, id: iObj.id }]; + } else if (!obj[iObj.type].some(tObj => tObj.id === iObj.id)) { + obj[iObj.type].push({ name: iObj.name, id: iObj.id }); + } + }); + }); + return obj; + }, {}), cusUnitDict: state => state.cusUnitOptions.reduce((obj, cur) => { obj[cur.dictValue] = cur.dictLabel; @@ -583,6 +605,11 @@ const getters = { state.dishSmallClassOptions.reduce((obj, cur) => { obj[cur.dictValue] = cur.dictLabel; return obj; + }, {}), + igdTypeDict: state => + state.igdTypeOptions.reduce((obj, cur) => { + obj[cur.dictValue] = cur.dictLabel; + return obj; }, {}) }; diff --git a/stdiet-ui/src/utils/healthyData.js b/stdiet-ui/src/utils/healthyData.js index c788249c5..509d7ecbf 100644 --- a/stdiet-ui/src/utils/healthyData.js +++ b/stdiet-ui/src/utils/healthyData.js @@ -598,6 +598,11 @@ export function dealHealthy(customerHealthy) { ? `,${customerHealthy.otherMotionField}` : ""; } + if (customerHealthy.hasOwnProperty("otherOperationHistory")) { + customerHealthy.operationHistory += customerHealthy.otherOperationHistory + ? `,${customerHealthy.otherOperationHistory}` + : ""; + } if (customerHealthy.hasOwnProperty("defecationNum")) { customerHealthy.defecationNum += "次/天"; } diff --git a/stdiet-ui/src/views/custom/dishes/index.vue b/stdiet-ui/src/views/custom/dishes/index.vue index 481200bda..b01a02a5b 100644 --- a/stdiet-ui/src/views/custom/dishes/index.vue +++ b/stdiet-ui/src/views/custom/dishes/index.vue @@ -12,12 +12,13 @@ v-model="queryParams.name" placeholder="请输入菜品名称" clearable - size="small" + size="mini" @keyup.enter.native="handleQuery" /> - + @@ -199,7 +200,7 @@ :options="dishClassOptions" :props="{ expandTrigger: 'hover' }" placeholder="请选择菜品种类" - > + > @@ -464,8 +465,8 @@ export default { // cusWeightOptions: [], dishClassOptions: [], - dishClassBigOptions:[], - dishClassSmallOptions:[], + dishClassBigOptions: [], + dishClassSmallOptions: [], // 查询参数 queryParams: { pageNum: 1, @@ -473,14 +474,14 @@ export default { name: null, type: null, bigClass: null, - smallClass: null + smallClass: null, }, // 表单参数 form: {}, // 表单校验 rules: {}, //菜品种类查询种类 - dishClassQueryParam:[] + dishClassQueryParam: [], }; }, created() { @@ -512,9 +513,12 @@ export default { /** 查询菜品列表 */ getList() { this.loading = true; - if(this.dishClassQueryParam != null && this.dishClassQueryParam.length > 0){ + if ( + this.dishClassQueryParam != null && + this.dishClassQueryParam.length > 0 + ) { this.queryParams.smallClass = this.dishClassQueryParam[1]; - }else{ + } else { this.queryParams.smallClass = null; } listDishes(this.queryParams).then((response) => { @@ -549,23 +553,25 @@ export default { }); }, //处理菜品大类小类的关系 - dealDishClassBigAndSmall(){ + dealDishClassBigAndSmall() { this.dishClassBigOptions.forEach((item, index) => { - this.dishClassOptions.push({ - 'value': parseInt(item.dictValue), - 'label': item.dictLabel, - 'children': [] + this.dishClassOptions.push({ + value: parseInt(item.dictValue), + label: item.dictLabel, + children: [], + }); + if (index == this.dishClassBigOptions.length - 1) { + this.dishClassSmallOptions.forEach((smallClass, i) => { + if (smallClass.remark) { + this.dishClassOptions[ + parseInt(smallClass.remark - 1) + ].children.push({ + value: parseInt(smallClass.dictValue), + label: smallClass.dictLabel, + }); + } }); - if(index == this.dishClassBigOptions.length - 1){ - this.dishClassSmallOptions.forEach((smallClass, i) => { - if(smallClass.remark){ - this.dishClassOptions[parseInt(smallClass.remark-1)].children.push({ - 'value': parseInt(smallClass.dictValue), - 'label': smallClass.dictLabel - }); - } - }); - } + } }); }, // 菜品类型字典翻译 @@ -587,13 +593,19 @@ export default { return this.selectDictLabel(this.reviewStatusOptions, row.area); }, //菜品种类翻译 - dishClassFormat(row){ - if(row.bigClass > 0 && row.smallClass > 0){ - let bigClassName = this.selectDictLabel(this.dishClassBigOptions, row.bigClass); - let smallClassName = this.selectDictLabel(this.dishClassSmallOptions, row.smallClass); - return bigClassName+"/"+smallClassName; - } - return ""; + dishClassFormat(row) { + if (row.bigClass > 0 && row.smallClass > 0) { + let bigClassName = this.selectDictLabel( + this.dishClassBigOptions, + row.bigClass + ); + let smallClassName = this.selectDictLabel( + this.dishClassSmallOptions, + row.smallClass + ); + return bigClassName + "/" + smallClassName; + } + return ""; }, // 取消按钮 cancel() { @@ -606,7 +618,7 @@ export default { id: null, name: null, type: [], - dishClass:[], + dishClass: [], methods: null, createBy: null, createTime: null, @@ -834,7 +846,7 @@ export default { (arr, cur, idx) => { if (idx > 1) { if (idx === 6) { - arr[6] = arr[3] * 4 + arr[4] * 9 + arr[5] * 4 + ' kcal'; + arr[6] = arr[3] * 4 + arr[4] * 9 + arr[5] * 4 + " kcal"; } else { arr[idx] = data.reduce((acc, dAcc) => { if (idx === 2) { diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/AddDishesDrawer/ConfigDishes.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/AddDishesDrawer/ConfigDishes.vue index 8fa47026c..069c2516f 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/AddDishesDrawer/ConfigDishes.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/AddDishesDrawer/ConfigDishes.vue @@ -1,5 +1,5 @@ - + - + - + - +
- - - - - - - - - - - - - + + + + + + + + + + + + + - - - 选择所属客户 - - - - - - + + + + 选择所属客户 + + + + + +