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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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>

View File

@ -14,10 +14,18 @@
<el-collapse-item <el-collapse-item
v-for="plan in data" v-for="plan in data"
:key="plan.id" :key="plan.id"
:title="plan.label"
:name="plan.id" :name="plan.id"
:class="plan.id === hitPlanId ? 'collapse_item_hit' : ''" :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 <div
v-for="menu in plan.menus" v-for="menu in plan.menus"
:class="`item ${menu.id === curMenuId ? 'sel_item' : ''}`" :class="`item ${menu.id === curMenuId ? 'sel_item' : ''}`"
@ -32,9 +40,12 @@
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
</div> </div>
<plan-time-dialog ref="planRef" @onConfirm="handleOnTimeConfirm" />
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
import PlanTimeDialog from "./PlanTimeDialog";
export default { export default {
name: "planDrawer", name: "planDrawer",
data() { data() {
@ -45,6 +56,9 @@ export default {
hitPlanId: 0, hitPlanId: 0,
}; };
}, },
components: {
PlanTimeDialog,
},
props: ["data", "planId", "menuId"], props: ["data", "planId", "menuId"],
methods: { methods: {
showDrawer() { showDrawer() {
@ -59,9 +73,16 @@ export default {
this.$emit("plan-change", menu); this.$emit("plan-change", menu);
}, },
handleOnShoppingPlanClick(e, data) {
e.stopPropagation();
this.$refs.planRef.showDialog(data.id);
this.visible = false;
}, },
computed: { handleOnTimeConfirm(val) {
console.log(val);
}, },
},
computed: {},
watch: { watch: {
planId(val) { planId(val) {
this.curPlanId = val; this.curPlanId = val;
@ -106,6 +127,19 @@ export default {
background: #409eff; background: #409eff;
color: white; 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> </style>