Merge branches 'master' and 'xzj' of https://gitee.com/darlk/ShengTangManage into xzj

This commit is contained in:
xiezhijun 2021-03-09 18:25:29 +08:00
commit 6cd13e3e92
8 changed files with 154 additions and 28 deletions
stdiet-ui/src
components
HeatStatisticsDrawer
OrderDrawer
RecipesPlanDrawer
views/custom
recipesBuild/RecipesView/RecipesCom
recipesShow
MenuDetail
DishesDetailDialog
NutriComputeCom
PlanDrawer
PlanTimeDialog
index.vue

@ -21,8 +21,8 @@
>外食计算器</el-button
>
</el-col>
<el-popover :placement="bottom" trigger="click">
<VueQr :text="copyValue" :logoSrc="logo" size="256"/>
<el-popover placement="bottom" trigger="click">
<VueQr :text="copyValue" :logoSrc="logo" size="256" />
<el-button slot="reference">二维码</el-button>
</el-popover>
</el-row>

@ -41,10 +41,7 @@
>
{{ scope.row.reviewStatus === "yes" ? "已审核" : "未审核" }}
</el-tag>
<el-tag
v-if="scope.row.type === 'virtual'"
disable-transitions
>
<el-tag v-if="scope.row.type === 'virtual'" disable-transitions>
分单
</el-tag>
</template>
@ -55,11 +52,13 @@
align="center"
width="160"
></el-table-column>
<el-table-column
label="成交时间"
prop="orderTime"
align="center"
></el-table-column>
<el-table-column label="成交时间" prop="orderTime" align="center"
><template slot-scope="scope">
<div v-for="time in scope.row.orderTime.split(' ')" :key="time">
{{ time }}
</div>
</template>
</el-table-column>
<el-table-column
label="成交金额"
prop="amount"
@ -128,7 +127,7 @@ export default {
components: {
"edit-order-dialog": OrderEdit,
"order-detail": OrderDetail,
"create-order-dialog": OrderAdd
"create-order-dialog": OrderAdd,
},
data() {
return {

@ -19,7 +19,12 @@
@click="handleOnRecipesLinkClick"
>食谱链接
</el-button>
<el-popover placement="top" trigger="click" v-if="cusOutId" style="margin: 0 12px">
<el-popover
placement="top"
trigger="click"
v-if="cusOutId"
style="margin: 0 12px"
>
<VueQr :text="copyValue" :logoSrc="logo" size="256" />
<el-button
slot="reference"
@ -39,9 +44,24 @@
<el-table :data="planList" v-loading="planLoading" height="80%">
<el-table-column label="审核状态" align="center" width="80">
<template slot-scope="scope">
<el-tag :type="scope.row.reviewStatus ? 'success' : 'danger'">{{
`${scope.row.reviewStatus ? "已审核" : "未审核"}`
}}</el-tag>
<el-tag
:type="
scope.row.reviewStatus === 0
? 'info'
: scope.row.reviewStatus === 2
? 'success'
: 'danger'
"
>{{
`${
scope.row.reviewStatus === 0
? "未制作"
: scope.row.reviewStatus === 2
? "已审核"
: "未审核"
}`
}}</el-tag
>
</template>
</el-table-column>
<el-table-column label="计划" align="center">
@ -111,7 +131,7 @@ export default {
listRecipesPlanByCusId(data.id).then((response) => {
this.planList = response.data;
this.cusOutId = response.data.reduce((str, cur) => {
if (!str && cur.recipesId) {
if (!str && cur.recipesId && cur.reviewStatus === 2) {
str = cur.outId;
}
return str;
@ -142,8 +162,8 @@ export default {
},
handleOnRecipesEditClick(data) {
// console.log(data);
const { id, name } = this.data;
window.open("/recipes/build/" + name + "/" + id, "_blank");
// const { id, name } = this.data;
window.open("/recipes/build/" + this.data.name + "/" + data.id, "_blank");
},
},
};

@ -112,8 +112,9 @@
<template slot-scope="scope">
<span
v-if="
scope.row.nameSpan.colspan === 1 &&
scope.row.nameSpan.rowspan === 1
(scope.row.nameSpan.colspan === 1 &&
scope.row.nameSpan.rowspan === 1) ||
(scope.row.igdType !== '15' && scope.row.igdType !== '14')
"
>
{{ scope.row.igdName }}
@ -357,7 +358,6 @@ export default {
}
// console.log(cur);
arr.push({
id: cur.id,
dishesId: cur.dishesId,
@ -368,6 +368,7 @@ export default {
methods: cur.methods,
remark: cur.remark,
igdId: igd.id,
igdType: igd.type,
igdName: igd.name,
proteinRatio: igd.proteinRatio,
fatRatio: igd.fatRatio,
@ -400,7 +401,7 @@ export default {
}
return arr;
}, []);
// console.log(mData);
console.log(mData);
return mData;
},
@ -548,7 +549,7 @@ export default {
this.$refs.remarkDialogRef.showDialog(data);
},
handleOnRemarkConfirm(data) {
console.log(data);
// console.log(data);
const { id, remark } = data;
this.updateDishes({
num: this.num,

@ -84,4 +84,9 @@ export default {
.el-dialog__body {
padding: 12px 18px;
}
.dishes_detail_dialog_wrapper {
.el-dialog:not(.is-fullscreen) {
margin-top: 20vh !important;
}
}
</style>

@ -56,7 +56,7 @@ export default {
},
watch: {
value(val) {
console.log({ val });
// console.log({ val });
if (!val || !val.length) {
return;
}

@ -0,0 +1,67 @@
<template>
<el-dialog
:visible.sync="visible"
width="80%"
center
title="选择时间段"
append-to-body
class="plan_time_wrapper"
>
<div class="full_day">
<el-button style="width: 100%" @click="handleOnTimeClick(7)">
7天计划
</el-button>
</div>
<div class="seperate_day">
<el-button @click="handleOnTimeClick(3)">前3天计划</el-button>
<el-button @click="handleOnTimeClick(4)">后四天计划</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: "PlanTimeDialog",
data() {
return {
visible: false,
recipesId: "",
};
},
methods: {
showDialog(recipesId) {
this.visible = true;
this.recipesId = recipesId;
},
handleOnTimeClick(num) {
this.visible = false;
this.$emit("onConfirm", {
num,
recipesId: this.recipesId,
});
},
},
};
</script>
<style lang="scss" scoped>
.plan_time_wrapper {
& > div {
margin-top: 30vh;
}
.seperate_day {
margin-top: 10px;
display: flex;
& > button {
flex: 1;
}
}
}
</style>
<style lang="scss">
.plan_time_wrapper {
.el-dialog:not(.is-fullscreen) {
margin-top: 20vh !important;
}
}
</style>

@ -14,10 +14,18 @@
<el-collapse-item
v-for="plan in data"
:key="plan.id"
:title="plan.label"
:name="plan.id"
:class="plan.id === hitPlanId ? 'collapse_item_hit' : ''"
>
<template slot="title">
<div class="title_style">
<span>{{ plan.label }}</span>
<em
class="el-icon-shopping-cart-full icon_style"
@click="(e) => handleOnShoppingPlanClick(e, plan)"
/>
</div>
</template>
<div
v-for="menu in plan.menus"
:class="`item ${menu.id === curMenuId ? 'sel_item' : ''}`"
@ -32,9 +40,12 @@
</el-collapse-item>
</el-collapse>
</div>
<plan-time-dialog ref="planRef" @onConfirm="handleOnTimeConfirm" />
</el-drawer>
</template>
<script>
import PlanTimeDialog from "./PlanTimeDialog";
export default {
name: "planDrawer",
data() {
@ -45,6 +56,9 @@ export default {
hitPlanId: 0,
};
},
components: {
PlanTimeDialog,
},
props: ["data", "planId", "menuId"],
methods: {
showDrawer() {
@ -59,9 +73,16 @@ export default {
this.$emit("plan-change", menu);
},
handleOnShoppingPlanClick(e, data) {
e.stopPropagation();
this.$refs.planRef.showDialog(data.id);
this.visible = false;
},
handleOnTimeConfirm(val) {
console.log(val);
},
},
computed: {
},
computed: {},
watch: {
planId(val) {
this.curPlanId = val;
@ -106,6 +127,19 @@ export default {
background: #409eff;
color: white;
}
.title_style {
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
.icon_style {
margin-right: 16px;
font-size: 16px;
padding: 4px 8px;
}
}
}
}
</style>