修复食谱展示页面
This commit is contained in:
parent
d7e5ae3732
commit
d266eabe8b
@ -239,7 +239,7 @@
|
|||||||
|
|
||||||
<!-- 通过outId查询食谱计划简要-->
|
<!-- 通过outId查询食谱计划简要-->
|
||||||
<select id="selectRecipesPlanListInfo" resultMap="SysRecipesPlanListInfoResult">
|
<select id="selectRecipesPlanListInfo" resultMap="SysRecipesPlanListInfoResult">
|
||||||
select id, start_date, end_date, start_num_day, end_num_day, recipes_id from sys_recipes_plan where out_id=#{outId} and del_flag = 0
|
select id, start_date, end_date, start_num_day, end_num_day, recipes_id from sys_recipes_plan where out_id=#{outId} and del_flag = 0 and review_status = 2
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<resultMap type="SysRecipesDaily" id="SysRecipesResult">
|
<resultMap type="SysRecipesDaily" id="SysRecipesResult">
|
||||||
@ -248,9 +248,10 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectMenuIds" parameterType="Long" resultMap="SysRecipesResult">
|
<select id="selectMenuIds" parameterType="Long" resultMap="SysRecipesResult">
|
||||||
select id, num_day from sys_customer_daily_menu where recipes_id=#{recipes_id} and del_flag = 0 order by num_day asc
|
select id, num_day from sys_customer_daily_menu where recipes_id=#{recipes_id} order by num_day asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<!-- 批量修改食谱计划 -->
|
<!-- 批量修改食谱计划 -->
|
||||||
<update id="updateMuchRecipesPlanDate" parameterType="SysRecipesPlan">
|
<update id="updateMuchRecipesPlanDate" parameterType="SysRecipesPlan">
|
||||||
<!--<foreach collection="list" item="item" separator=";" open="" close="">
|
<!--<foreach collection="list" item="item" separator=";" open="" close="">
|
||||||
|
@ -56,6 +56,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(val) {
|
value(val) {
|
||||||
|
console.log({ val });
|
||||||
if (!val || !val.length) {
|
if (!val || !val.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@
|
|||||||
<!-- 食谱详细 -->
|
<!-- 食谱详细 -->
|
||||||
<el-card v-for="obj in menus" :key="obj.type" style="margin-top: 12px">
|
<el-card v-for="obj in menus" :key="obj.type" style="margin-top: 12px">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
|
<div class="header_style">
|
||||||
<span>{{ obj.typeName }}</span>
|
<span>{{ obj.typeName }}</span>
|
||||||
|
<span class="time">{{ menuTypeTimeDict[obj.type] }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="mObj in obj.values" :key="mObj.id">
|
<div v-for="mObj in obj.values" :key="mObj.id">
|
||||||
<div class="dishes_item">
|
<div class="dishes_item">
|
||||||
@ -60,6 +63,10 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
menuTypeTimeDict: {
|
||||||
|
2: "10:00 - 10:30",
|
||||||
|
4: "15:00 - 15:30",
|
||||||
|
},
|
||||||
menuTypeDict: {},
|
menuTypeDict: {},
|
||||||
curUnitDict: {},
|
curUnitDict: {},
|
||||||
cusWeightDict: {},
|
cusWeightDict: {},
|
||||||
@ -107,6 +114,15 @@ export default {
|
|||||||
.menu_detail_wrapper {
|
.menu_detail_wrapper {
|
||||||
padding: 0 12px 12px 12px;
|
padding: 0 12px 12px 12px;
|
||||||
|
|
||||||
|
.header_style {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.time {
|
||||||
|
color: #8c8c8c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.dishes_item {
|
.dishes_item {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
|
@ -15,9 +15,11 @@
|
|||||||
@click="handleUserInfoClick"
|
@click="handleUserInfoClick"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="content" v-loading="loading">
|
<div v-loading="loading">
|
||||||
|
<div class="content">
|
||||||
<MenuDetail :value="menuData" :date="curDate" />
|
<MenuDetail :value="menuData" :date="curDate" />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 食谱计划 -->
|
<!-- 食谱计划 -->
|
||||||
<PlanDrawer
|
<PlanDrawer
|
||||||
@ -71,7 +73,9 @@ export default {
|
|||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
let curPlanId, curMenuId, curDate;
|
let curPlanId, curMenuId, curDate;
|
||||||
const toDay = dayjs().format("YYYY-MM-DD");
|
const toDay = dayjs().format("YYYY-MM-DD");
|
||||||
this.planList = response.data.map((plan) => ({
|
this.planList = response.data.reduce((arr, plan) => {
|
||||||
|
if (plan.menus) {
|
||||||
|
arr.push({
|
||||||
menus: plan.menus.map((menu, idx) => {
|
menus: plan.menus.map((menu, idx) => {
|
||||||
const date = dayjs(plan.startDate)
|
const date = dayjs(plan.startDate)
|
||||||
.add(idx, "day")
|
.add(idx, "day")
|
||||||
@ -88,7 +92,10 @@ export default {
|
|||||||
}),
|
}),
|
||||||
label: `第${plan.startNumDay} 至 ${plan.endNumDay}天`,
|
label: `第${plan.startNumDay} 至 ${plan.endNumDay}天`,
|
||||||
id: plan.id,
|
id: plan.id,
|
||||||
}));
|
});
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
}, []);
|
||||||
if (!curMenuId) {
|
if (!curMenuId) {
|
||||||
curMenuId = this.planList[0].menus[0].id;
|
curMenuId = this.planList[0].menus[0].id;
|
||||||
curPlanId = this.planList[0].id;
|
curPlanId = this.planList[0].id;
|
||||||
@ -98,6 +105,10 @@ export default {
|
|||||||
this.curPlanId = curPlanId;
|
this.curPlanId = curPlanId;
|
||||||
this.curDate = curDate;
|
this.curDate = curDate;
|
||||||
|
|
||||||
|
// console.log({
|
||||||
|
// planList: this.planList,
|
||||||
|
// });
|
||||||
|
|
||||||
this.fetchRecipesInfo(this.curMenuId);
|
this.fetchRecipesInfo(this.curMenuId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -17,22 +17,22 @@ export function getProcessMenuData(menuData) {
|
|||||||
igdList: cur.igdList.reduce((igdArr, igdData) => {
|
igdList: cur.igdList.reduce((igdArr, igdData) => {
|
||||||
if (igdData.id > 0) {
|
if (igdData.id > 0) {
|
||||||
const tarDetail = cur.detail.find(obj => obj.id === igdData.id);
|
const tarDetail = cur.detail.find(obj => obj.id === igdData.id);
|
||||||
|
if (tarDetail) {
|
||||||
igdArr.push({
|
igdArr.push({
|
||||||
id: igdData.id,
|
id: igdData.id,
|
||||||
name: igdData.name,
|
name: igdData.name,
|
||||||
carbonRatio: igdData.carbonRatio,
|
carbonRatio: igdData.carbonRatio,
|
||||||
fatRatio: igdData.fatRatio,
|
fatRatio: igdData.fatRatio,
|
||||||
proteinRatio: igdData.proteinRatio,
|
proteinRatio: igdData.proteinRatio,
|
||||||
cusUnit: tarDetail ? tarDetail.cus_unit : igdData.cusUnit,
|
cusUnit: tarDetail.cus_unit,
|
||||||
cusWeight: tarDetail
|
cusWeight: tarDetail.cus_weight,
|
||||||
? parseFloat(tarDetail.cus_weight)
|
weight: parseFloat(tarDetail.weight),
|
||||||
: igdData.cusWeight,
|
|
||||||
weight: tarDetail ? parseFloat(tarDetail.weight) : igdData.weight,
|
|
||||||
notRec: igdData.notRec,
|
notRec: igdData.notRec,
|
||||||
rec: igdData.rec,
|
rec: igdData.rec,
|
||||||
type: igdData.type
|
type: igdData.type
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return igdArr;
|
return igdArr;
|
||||||
}, [])
|
}, [])
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user