From 0e571bde22b3bc1dc214cb8e57185069752dc098 Mon Sep 17 00:00:00 2001 From: "28353131@qq.com" <28353131@qq.com> Date: Thu, 3 Dec 2020 23:16:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=97=85=E6=82=A3=E9=85=8D=E9=A4=90=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E5=A2=9E=E5=8A=A0=E6=AD=A3=E9=A4=90=E8=8F=9C?= =?UTF-8?q?=E5=93=81=E5=90=8D=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/fantang/foodDemand/index.vue | 52 +++++++++++++++++-- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/ruoyi-ui/src/views/fantang/foodDemand/index.vue b/ruoyi-ui/src/views/fantang/foodDemand/index.vue index 728af870b..3c6b6619b 100644 --- a/ruoyi-ui/src/views/fantang/foodDemand/index.vue +++ b/ruoyi-ui/src/views/fantang/foodDemand/index.vue @@ -89,11 +89,11 @@ - - - - - + + + + + @@ -147,6 +147,7 @@ import { listFoodDemand, updateFoodDemand } from "@/api/fantang/foodDemand"; +import {listFood} from "../../../api/fantang/food"; export default { name: "FoodDemand", @@ -198,6 +199,7 @@ export default { } }; }, + created() { this.getList(); this.getDicts("ft_book_type").then(response => { @@ -207,7 +209,47 @@ export default { this.updateFromOptions = response.data; }); }, + + beforeCreate() { + listFood(this.queryParams).then(response => { + this.foodList = response.rows; + this.loading = false; + }); + }, methods: { + // 格式化菜单回显文字 + formatFoods(row) { + const _this = this; + let arr = row.foods.split(",").map(Number); + let ret = arr.map(item =>{ + let obj = _this.foodList.find((value => { + return value.foodId === item; + })); + return obj.name; + }); + return ret.toString(); + }, + formatVegetables(row){ + if (row.vegetables === null || row.vegetables === 0) + return "否"; + return "是"; + }, + formatMeat(row) { + if (row.meat === null || row.meat === 0) + return "否"; + return "是"; + }, + + formatRice(row) { + if (row.rice === null || row.rice === 0) + return "否"; + return "是"; + }, + formatEgg(row) { + if (row.egg === null || row.egg === 0) + return "否"; + return "是"; + }, /** 查询病人报餐列表 */ getList() { this.loading = true;