commit
9cdefdb81b
@ -239,7 +239,7 @@
|
||||
|
||||
<!-- 通过outId查询食谱计划简要-->
|
||||
<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>
|
||||
|
||||
<resultMap type="SysRecipesDaily" id="SysRecipesResult">
|
||||
@ -248,9 +248,10 @@
|
||||
</resultMap>
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
<!-- 批量修改食谱计划 -->
|
||||
<update id="updateMuchRecipesPlanDate" parameterType="SysRecipesPlan">
|
||||
<!--<foreach collection="list" item="item" separator=";" open="" close="">
|
||||
|
@ -19,7 +19,17 @@
|
||||
@click="handleOnRecipesLinkClick"
|
||||
>客户食谱链接
|
||||
</el-button>
|
||||
|
||||
<el-popover placement="top" trigger="click" v-if="cusOutId" style="margin: 0 12px">
|
||||
<VueQr :text="copyValue" :logoSrc="logo" />
|
||||
<el-button
|
||||
slot="reference"
|
||||
size="mini"
|
||||
icon="el-icon-picture-outline"
|
||||
type="primary"
|
||||
@click="handleCopy(scope.row.path)"
|
||||
>二维码</el-button
|
||||
>
|
||||
</el-popover>
|
||||
<el-button icon="el-icon-view" size="mini" @click="handleInnerOpen"
|
||||
>查看暂停记录
|
||||
</el-button>
|
||||
@ -68,13 +78,17 @@
|
||||
import Clipboard from "clipboard";
|
||||
import { listRecipesPlanByCusId } from "@/api/custom/recipesPlan";
|
||||
import PlanPauseDrawer from "./PlanPauseDrawer";
|
||||
import VueQr from "vue-qr";
|
||||
const logo = require("@/assets/logo/logo_b.png");
|
||||
export default {
|
||||
name: "RecipesPlanDrawer",
|
||||
components: {
|
||||
PlanPauseDrawer,
|
||||
VueQr,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
logo,
|
||||
visible: false,
|
||||
title: "",
|
||||
cusOutId: "",
|
||||
@ -90,6 +104,7 @@ export default {
|
||||
if (!this.data) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.visible = true;
|
||||
this.title = `「${this.data.name}」食谱计划`;
|
||||
this.planLoading = true;
|
||||
@ -101,6 +116,10 @@ export default {
|
||||
}
|
||||
return str;
|
||||
}, "");
|
||||
this.copyValue =
|
||||
window.location.origin.replace("manage", "sign") +
|
||||
"/recipes/detail/" +
|
||||
this.cusOutId;
|
||||
// console.log(this.planList);
|
||||
this.planLoading = false;
|
||||
});
|
||||
@ -115,10 +134,6 @@ export default {
|
||||
this.innerTitle = `「${this.data.name}」暂停记录`;
|
||||
},
|
||||
handleOnRecipesLinkClick() {
|
||||
this.copyValue =
|
||||
window.location.origin.replace("manage", "sign") +
|
||||
"/recipes/detail/" +
|
||||
this.cusOutId;
|
||||
new Clipboard(".copyBtn");
|
||||
this.$message({
|
||||
message: "拷贝成功",
|
||||
|
@ -56,6 +56,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
console.log({ val });
|
||||
if (!val || !val.length) {
|
||||
return;
|
||||
}
|
||||
|
@ -5,7 +5,10 @@
|
||||
<!-- 食谱详细 -->
|
||||
<el-card v-for="obj in menus" :key="obj.type" style="margin-top: 12px">
|
||||
<div slot="header">
|
||||
<span>{{ obj.typeName }}</span>
|
||||
<div class="header_style">
|
||||
<span>{{ obj.typeName }}</span>
|
||||
<span class="time">{{ menuTypeTimeDict[obj.type] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-for="mObj in obj.values" :key="mObj.id">
|
||||
<div class="dishes_item">
|
||||
@ -60,6 +63,10 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menuTypeTimeDict: {
|
||||
2: "10:00 - 10:30",
|
||||
4: "15:00 - 15:30",
|
||||
},
|
||||
menuTypeDict: {},
|
||||
curUnitDict: {},
|
||||
cusWeightDict: {},
|
||||
@ -107,6 +114,15 @@ export default {
|
||||
.menu_detail_wrapper {
|
||||
padding: 0 12px 12px 12px;
|
||||
|
||||
.header_style {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.time {
|
||||
color: #8c8c8c;
|
||||
}
|
||||
}
|
||||
|
||||
.dishes_item {
|
||||
height: 38px;
|
||||
padding: 0 8px;
|
||||
|
@ -15,8 +15,10 @@
|
||||
@click="handleUserInfoClick"
|
||||
/>
|
||||
</div>
|
||||
<div class="content" v-loading="loading">
|
||||
<MenuDetail :value="menuData" :date="curDate" />
|
||||
<div v-loading="loading">
|
||||
<div class="content">
|
||||
<MenuDetail :value="menuData" :date="curDate" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 食谱计划 -->
|
||||
@ -71,24 +73,29 @@ export default {
|
||||
if (response.code === 200) {
|
||||
let curPlanId, curMenuId, curDate;
|
||||
const toDay = dayjs().format("YYYY-MM-DD");
|
||||
this.planList = response.data.map((plan) => ({
|
||||
menus: plan.menus.map((menu, idx) => {
|
||||
const date = dayjs(plan.startDate)
|
||||
.add(idx, "day")
|
||||
.format("YYYY-MM-DD");
|
||||
if (toDay === date) {
|
||||
curPlanId = plan.id;
|
||||
curMenuId = menu.id;
|
||||
curDate = date;
|
||||
}
|
||||
return {
|
||||
date,
|
||||
id: menu.id,
|
||||
};
|
||||
}),
|
||||
label: `第${plan.startNumDay} 至 ${plan.endNumDay}天`,
|
||||
id: plan.id,
|
||||
}));
|
||||
this.planList = response.data.reduce((arr, plan) => {
|
||||
if (plan.menus) {
|
||||
arr.push({
|
||||
menus: plan.menus.map((menu, idx) => {
|
||||
const date = dayjs(plan.startDate)
|
||||
.add(idx, "day")
|
||||
.format("YYYY-MM-DD");
|
||||
if (toDay === date) {
|
||||
curPlanId = plan.id;
|
||||
curMenuId = menu.id;
|
||||
curDate = date;
|
||||
}
|
||||
return {
|
||||
date,
|
||||
id: menu.id,
|
||||
};
|
||||
}),
|
||||
label: `第${plan.startNumDay} 至 ${plan.endNumDay}天`,
|
||||
id: plan.id,
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
if (!curMenuId) {
|
||||
curMenuId = this.planList[0].menus[0].id;
|
||||
curPlanId = this.planList[0].id;
|
||||
@ -98,6 +105,10 @@ export default {
|
||||
this.curPlanId = curPlanId;
|
||||
this.curDate = curDate;
|
||||
|
||||
// console.log({
|
||||
// planList: this.planList,
|
||||
// });
|
||||
|
||||
this.fetchRecipesInfo(this.curMenuId);
|
||||
}
|
||||
});
|
||||
|
@ -17,21 +17,21 @@ export function getProcessMenuData(menuData) {
|
||||
igdList: cur.igdList.reduce((igdArr, igdData) => {
|
||||
if (igdData.id > 0) {
|
||||
const tarDetail = cur.detail.find(obj => obj.id === igdData.id);
|
||||
igdArr.push({
|
||||
id: igdData.id,
|
||||
name: igdData.name,
|
||||
carbonRatio: igdData.carbonRatio,
|
||||
fatRatio: igdData.fatRatio,
|
||||
proteinRatio: igdData.proteinRatio,
|
||||
cusUnit: tarDetail ? tarDetail.cus_unit : igdData.cusUnit,
|
||||
cusWeight: tarDetail
|
||||
? parseFloat(tarDetail.cus_weight)
|
||||
: igdData.cusWeight,
|
||||
weight: tarDetail ? parseFloat(tarDetail.weight) : igdData.weight,
|
||||
notRec: igdData.notRec,
|
||||
rec: igdData.rec,
|
||||
type: igdData.type
|
||||
});
|
||||
if (tarDetail) {
|
||||
igdArr.push({
|
||||
id: igdData.id,
|
||||
name: igdData.name,
|
||||
carbonRatio: igdData.carbonRatio,
|
||||
fatRatio: igdData.fatRatio,
|
||||
proteinRatio: igdData.proteinRatio,
|
||||
cusUnit: tarDetail.cus_unit,
|
||||
cusWeight: tarDetail.cus_weight,
|
||||
weight: parseFloat(tarDetail.weight),
|
||||
notRec: igdData.notRec,
|
||||
rec: igdData.rec,
|
||||
type: igdData.type
|
||||
});
|
||||
}
|
||||
}
|
||||
return igdArr;
|
||||
}, [])
|
||||
|
Loading…
x
Reference in New Issue
Block a user