-
-
+
+
-
{{ item.foodName }}
-
+ {{ item.dishName }}
+
当前余量
-
+
-
+
-
-
+
@@ -57,7 +51,7 @@
累计制作
+ {{ item.serveTypeName }}
-
-
-
- 低于预警值,请备菜
-
-
-
低于警告值,请补餐
+ 低于预警值,请补餐
无开餐数据
@@ -73,13 +67,13 @@
未制作
- {{ recipeFoodNotMadeList.length }}
+ {{ unmadeList.length }}
-
+
@@ -87,13 +81,13 @@
-
{{ item.foodName }}
- {{ item.foodWeight_kg }}kg
+ {{ item.dishName }}
+ {{ item.needQuantity }}kg
已制作
- {{ recipeFoodProducedList.length }}
+ {{ madeList.length }}
-
+
@@ -119,12 +113,12 @@ export default {
timer: null,
times: getCurrentTime(),
- dinnerType: "", // 餐次
- mealTime: "", // 餐次的时间
+ mealTypeName: "", // 餐次名称
+ mealTime: "", // 餐次的时间
- nutritionFoodList: [], // 菜品数据
- recipeFoodNotMadeList: [], // 食谱菜品未制作
- recipeFoodProducedList: [], // 食谱菜品已制作
+ nutritionList: [], // 营养秤实时数据
+ unmadeList: [], // 未制作列表
+ madeList: [], // 已制作列表
}
},
created() {
@@ -135,67 +129,50 @@ export default {
var params = {};
var _this = this;
- httpRequest("GET", "http://me.dm.yixiong-tech.com/terminal/neglect/large-screen/kitchen/info", params, {
+ httpRequest("GET", "https://dev.yixiong-tech.com:8081/nutrition/neglect/large-screen/kitchen", params, {
+ "X-DEVICE-CODE": "XIAOMI-00999",
"authorization": "57ee87183f2a4fa59683ec9ef41c8f5d"
}).then(function(res) {
- _this.dinnerType = "";
+ _this.mealTypeName = "";
_this.mealTime = "";
- _this.nutritionFoodList = [];
- _this.recipeFoodNotMadeList = [];
- _this.recipeFoodProducedList = [];
+ _this.nutritionList = [];
+ _this.unmadeList = [];
+ _this.madeList = [];
if (res && res.code === "00000" && res.data) {
- _this.dinnerType = res.data.dinnerType;
+ _this.mealTypeName = res.data.mealTypeName || "";
if (res.data.mealTimeStart && res.data.mealTimeEnd) {
_this.mealTime = res.data.mealTimeStart + ' - ' + res.data.mealTimeEnd;
}
- // 处理营养菜品列表
- if (res.data.nutritionFoodList && res.data.nutritionFoodList.length) {
- res.data.nutritionFoodList.map(function(item) {
- if (item.marginWeight >= item.warningWeight) {
- item.class = "normal";
- } else if (item.marginWeight >= item.dangerWeight) {
- item.class = "warning";
- } else {
- item.class = "danger";
- }
- item.foodWeight_kg = Math.round(item.foodWeight / 10) / 100;
- item.marginWeight_kg = Math.round(item.marginWeight / 10) / 100;
- item.progress = (1 - item.marginWeight / item.foodWeight) * 100 + '%';
+ // 营养秤实时数据
+ if (res.data.nutritionList && res.data.nutritionList.length) {
+ res.data.nutritionList.map(function(item) {
+ item.progress = item.madeWeightKg ? ((1 - item.remainWeightKg / item.madeWeightKg) * 100) + '%' : '0%';
return item;
});
- _this.nutritionFoodList = res.data.nutritionFoodList;
+ _this.nutritionList = res.data.nutritionList;
}
- // 处理已出菜品列表
- if (res.data.recipeFoodNotMadeList && res.data.recipeFoodNotMadeList.length) {
- res.data.recipeFoodNotMadeList.map(function(item) {
- item.foodWeight_kg = Math.round(item.foodWeight / 10) / 100;
- return item;
- });
- _this.recipeFoodNotMadeList = res.data.recipeFoodNotMadeList;
+ // 未制作列表
+ if (res.data.unmadeList && res.data.unmadeList.length) {
+ _this.unmadeList = res.data.unmadeList;
}
- if (res.data.recipeFoodProducedList && res.data.recipeFoodProducedList.length) {
- res.data.recipeFoodProducedList.map(function(item) {
- item.foodWeight_kg = Math.round(item.foodWeight / 10) / 100;
- return item;
- });
- _this.recipeFoodProducedList = res.data.recipeFoodProducedList;
+ // 已制作列表
+ if (res.data.madeList && res.data.madeList.length) {
+ _this.madeList = res.data.madeList;
}
}
- // 模拟 finally 效果:成功时触发下一次轮询
setTimeout(function() {
_this.getKitchenInfo();
}, 10000);
}).catch(function(err) {
console.error("H5 Log: 请求出错", err);
- // 模拟 finally 效果:失败时也触发下一次轮询,保证页面不卡死
setTimeout(function() {
_this.getKitchenInfo();
- }, 10000);
+ }, 5000);
});
}
},
@@ -423,54 +400,6 @@ export default {
}
}
- &.warning {
- background-color: #402200;
- border: 2px solid #5E4728;
-
- .content_l_list_name {
- > div:nth-of-type(1) {
- background-color: #F8A45A;
- }
-
- > div:nth-of-type(2) {
- color: #F6BD9E;
- }
-
- .content_l_list_name_warning {
- background-image: url("@/assets/images/mealSurplusInformation/warning_name_icon.png");
- }
- }
-
- .content_l_list_margin {
- color: #F6BD9E;
-
- span {
- color: #F8A45A;
- }
- }
-
- .content_l_list_status_ {
- width: 200px;
- background-color: #5A2F00;
-
- .content_l_list_status_icon {
- background-image: url("@/assets/images/mealSurplusInformation/warning_status_icon.png");
- }
-
- .content_l_list_status_text {
- color: #F6BD9E;
- }
- }
-
- .content_l_list_progress {
- background-color: rgba(248, 164, 90, .3);
-
- > div {
- background-color: #F8A45A;
- }
- }
- }
-
&.danger {
background-color: #220203;
border: 2px solid #FF3232;
-
{{ item.foodName }}
- {{ item.foodWeight_kg }}kg
+ {{ item.dishName }}
+ {{ item.madeQuantity }}kg