食谱制作状态
This commit is contained in:
parent
0f201eb2fd
commit
51be6ba97a
@ -54,8 +54,8 @@ public class SysRecipesServiceImpl implements ISysRecipesService {
|
|||||||
// 更新食谱计划
|
// 更新食谱计划
|
||||||
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
|
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
|
||||||
sysRecipesPlan.setId(sysRecipes.getPlanId());
|
sysRecipesPlan.setId(sysRecipes.getPlanId());
|
||||||
|
sysRecipesPlan.setReviewStatus(3);// 设置制作中
|
||||||
sysRecipesPlan.setRecipesId(sysRecipes.getId());
|
sysRecipesPlan.setRecipesId(sysRecipes.getId());
|
||||||
sysRecipesPlan.setReviewStatus(1);
|
|
||||||
sysRecipesPlanMapper.updateSysRecipesPlan(sysRecipesPlan);
|
sysRecipesPlanMapper.updateSysRecipesPlan(sysRecipesPlan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,8 +104,9 @@ export default {
|
|||||||
[{ title: "方便沟通时间", value: "connectTime" }],
|
[{ title: "方便沟通时间", value: "connectTime" }],
|
||||||
];
|
];
|
||||||
if (this.dev) {
|
if (this.dev) {
|
||||||
basicInfo.splice(3, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
|
basicInfo.splice(3, 0, [{ title: "蛋白范围", value: "recProtein" }]);
|
||||||
basicInfo.splice(4, 0, [
|
basicInfo.splice(4, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
|
||||||
|
basicInfo.splice(5, 0, [
|
||||||
{ title: "不运动总热量", value: "notSportHeat" },
|
{ title: "不运动总热量", value: "notSportHeat" },
|
||||||
]);
|
]);
|
||||||
basicInfo.splice(basicInfo.length, 0, [
|
basicInfo.splice(basicInfo.length, 0, [
|
||||||
|
@ -90,11 +90,12 @@ export default {
|
|||||||
[{ title: "地域", value: "position" }],
|
[{ title: "地域", value: "position" }],
|
||||||
];
|
];
|
||||||
if (this.dev) {
|
if (this.dev) {
|
||||||
basicInfo.splice(3, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
|
basicInfo.splice(3, 0, [{ title: "推荐蛋白范围", value: "recProtein" }]);
|
||||||
basicInfo.splice(4, 0, [
|
basicInfo.splice(4, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
|
||||||
|
basicInfo.splice(5, 0, [
|
||||||
{ title: "不运动总热量", value: "notSportHeat" },
|
{ title: "不运动总热量", value: "notSportHeat" },
|
||||||
]);
|
]);
|
||||||
basicInfo.splice(6, 0, [{ title: "备注", value: "remark" }]);
|
basicInfo.splice(basicInfo.length, 0, [{ title: "备注", value: "remark" }]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -60,24 +60,9 @@
|
|||||||
<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
|
<el-tag :type="getReviewType(scope.row.reviewStatus)">
|
||||||
:type="
|
{{ getReviewStatusName(scope.row.reviewStatus) }}
|
||||||
scope.row.reviewStatus === 0
|
</el-tag>
|
||||||
? '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">
|
||||||
@ -226,6 +211,32 @@ export default {
|
|||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
getReviewStatusName(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 1:
|
||||||
|
return "未审核";
|
||||||
|
case 2:
|
||||||
|
return "已审核";
|
||||||
|
case 3:
|
||||||
|
return "制作中";
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return "未制作";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getReviewType(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 1:
|
||||||
|
return "danger";
|
||||||
|
case 2:
|
||||||
|
return "success";
|
||||||
|
case 3:
|
||||||
|
return "";
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return "info";
|
||||||
|
}
|
||||||
|
},
|
||||||
handleOnClosed() {
|
handleOnClosed() {
|
||||||
this.data = undefined;
|
this.data = undefined;
|
||||||
this.cusOutId = "";
|
this.cusOutId = "";
|
||||||
|
@ -302,7 +302,7 @@ const actions = {
|
|||||||
const recipesId = result.data;
|
const recipesId = result.data;
|
||||||
if (!payload.planId) {
|
if (!payload.planId) {
|
||||||
// 非保存模板
|
// 非保存模板
|
||||||
commit("updateStateData", { recipesId });
|
commit("updateStateData", { recipesId, reviewStatus: 3 });
|
||||||
dispatch("getRecipesInfo", { recipesId });
|
dispatch("getRecipesInfo", { recipesId });
|
||||||
}
|
}
|
||||||
payload.callback &&
|
payload.callback &&
|
||||||
|
@ -482,6 +482,8 @@ export function dealHealthy(customerHealthy) {
|
|||||||
customerHealthy.notSportHeat = (customerHealthy.basicBMR * 1.3).toFixed(1);
|
customerHealthy.notSportHeat = (customerHealthy.basicBMR * 1.3).toFixed(1);
|
||||||
customerHealthy.basicBMR += "千卡";
|
customerHealthy.basicBMR += "千卡";
|
||||||
customerHealthy.notSportHeat += "千卡";
|
customerHealthy.notSportHeat += "千卡";
|
||||||
|
const lowRecProtein = customerHealthy.tall - 105;
|
||||||
|
customerHealthy.recProtein = `${lowRecProtein * 0.8} - ${lowRecProtein * 1.5}`;
|
||||||
|
|
||||||
needAttrName.forEach(name => {
|
needAttrName.forEach(name => {
|
||||||
if (customerHealthy.hasOwnProperty(name)) {
|
if (customerHealthy.hasOwnProperty(name)) {
|
||||||
|
@ -37,37 +37,43 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</span>
|
</span>
|
||||||
<el-button size="mini" v-if="!recipesId" @click="handleOnBack"
|
<el-button size="mini" v-if="!recipesId" @click="handleOnBack">
|
||||||
>返回</el-button
|
返回
|
||||||
>
|
</el-button>
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
title="修改审核状态"
|
title="修改食谱状态"
|
||||||
style="margin-right: 12px"
|
style="margin-right: 12px"
|
||||||
v-hasPermi="['recipes:plan:review']"
|
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="success"
|
type="success"
|
||||||
|
v-hasPermi="['recipes:plan:review']"
|
||||||
@click="hanldeOnReveiwChange(2)"
|
@click="hanldeOnReveiwChange(2)"
|
||||||
>审核通过</el-button
|
>已审核</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="hanldeOnReveiwChange(1)"
|
@click="hanldeOnReveiwChange(1)"
|
||||||
>未审核通过</el-button
|
>未审核</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
@click="hanldeOnReveiwChange(3)"
|
||||||
|
>制作中</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
<el-button
|
||||||
slot="reference"
|
slot="reference"
|
||||||
size="mini"
|
size="mini"
|
||||||
v-if="reviewStatus"
|
v-if="!!recipesId"
|
||||||
:type="reviewStatus === 1 ? 'danger' : 'success'"
|
:type="getReviewType(reviewStatus)"
|
||||||
>
|
>
|
||||||
{{ reviewStatus === 1 ? "未审核" : "已审核" }}
|
{{ getReviewStatusName(reviewStatus) }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<el-button
|
<el-button
|
||||||
@ -157,6 +163,32 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getReviewStatusName(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 1:
|
||||||
|
return "未审核";
|
||||||
|
case 2:
|
||||||
|
return "已审核";
|
||||||
|
case 3:
|
||||||
|
return "制作中";
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return "未制作";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getReviewType(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 1:
|
||||||
|
return "danger";
|
||||||
|
case 2:
|
||||||
|
return "success";
|
||||||
|
case 3:
|
||||||
|
return "primary";
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return "info";
|
||||||
|
}
|
||||||
|
},
|
||||||
...mapActions(["saveRecipes", "updateReviewStatus"]),
|
...mapActions(["saveRecipes", "updateReviewStatus"]),
|
||||||
...mapMutations(["updateStateData", "updateFontSize", "toggleLeftShow"]),
|
...mapMutations(["updateStateData", "updateFontSize", "toggleLeftShow"]),
|
||||||
},
|
},
|
||||||
|
@ -3,10 +3,12 @@
|
|||||||
<div>忌口</div>
|
<div>忌口</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<span
|
<span
|
||||||
class="item"
|
:class="`item ${
|
||||||
|
selectedNotRec.includes(item.name) ? 'selected_item' : ''
|
||||||
|
} `"
|
||||||
v-for="item in verifyNotRecData"
|
v-for="item in verifyNotRecData"
|
||||||
:key="item.name"
|
:key="item.name"
|
||||||
@click="handleOnClick(item.data)"
|
@click="handleOnClick(item)"
|
||||||
>{{ item.name }}</span
|
>{{ item.name }}</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@ -18,14 +20,38 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers("recipes");
|
|||||||
export default {
|
export default {
|
||||||
name: "VerifyView",
|
name: "VerifyView",
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
selectedNotRec: [],
|
||||||
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(["verifyNotRecData"]),
|
...mapGetters(["verifyNotRecData"]),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleOnClick(data) {
|
handleOnClick(data) {
|
||||||
console.log({ data, verifyNotRecData: this.verifyNotRecData });
|
if (this.selectedNotRec.some((str) => data.name === str)) {
|
||||||
|
this.selectedNotRec = this.selectedNotRec.filter(
|
||||||
|
(str) => str !== data.name
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.selectedNotRec.push(data.name);
|
||||||
|
this.selectedNotRec = JSON.parse(JSON.stringify(this.selectedNotRec));
|
||||||
|
}
|
||||||
|
|
||||||
|
const notRecIgds = this.selectedNotRec.reduce((arr, cur) => {
|
||||||
|
this.verifyNotRecData[cur].data.forEach((obj) => {
|
||||||
|
if (!arr.includes(obj.igdId)) {
|
||||||
|
arr.push(obj.igdId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return arr;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
console.log({
|
||||||
|
data,
|
||||||
|
notRecIgds,
|
||||||
|
verifyNotRecData: this.verifyNotRecData,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -44,12 +70,21 @@ export default {
|
|||||||
border: 1px solid #8c8c8c;
|
border: 1px solid #8c8c8c;
|
||||||
padding: 3px 8px;
|
padding: 3px 8px;
|
||||||
word-break: normal;
|
word-break: normal;
|
||||||
|
transition: all 0.3s;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #d96969;
|
color: white;
|
||||||
|
background: #d96969;
|
||||||
border-color: #d96969;
|
border-color: #d96969;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.selected_item {
|
||||||
|
color: white;
|
||||||
|
background: #d96969;
|
||||||
|
border-color: #d96969;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -108,24 +108,9 @@
|
|||||||
<el-table v-loading="loading" :data="recipesPlanList">
|
<el-table v-loading="loading" :data="recipesPlanList">
|
||||||
<el-table-column label="审核状态" align="center" width="100">
|
<el-table-column label="审核状态" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag
|
<el-tag :type="getReviewType(scope.row.reviewStatus)">
|
||||||
:type="
|
{{ getReviewStatusName(scope.row.reviewStatus) }}
|
||||||
!scope.row.reviewStatus
|
</el-tag>
|
||||||
? 'info'
|
|
||||||
: scope.row.reviewStatus === 1
|
|
||||||
? 'danger'
|
|
||||||
: 'success'
|
|
||||||
"
|
|
||||||
>{{
|
|
||||||
`${
|
|
||||||
!scope.row.reviewStatus
|
|
||||||
? "未制作"
|
|
||||||
: scope.row.reviewStatus == 1
|
|
||||||
? "未审核"
|
|
||||||
: "已审核"
|
|
||||||
}`
|
|
||||||
}}</el-tag
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="客户姓名" align="center" prop="customer" />
|
<el-table-column label="客户姓名" align="center" prop="customer" />
|
||||||
@ -338,6 +323,32 @@ export default {
|
|||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
getReviewStatusName(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 1:
|
||||||
|
return "未审核";
|
||||||
|
case 2:
|
||||||
|
return "已审核";
|
||||||
|
case 3:
|
||||||
|
return "制作中";
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return "未制作";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getReviewType(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 1:
|
||||||
|
return "danger";
|
||||||
|
case 2:
|
||||||
|
return "success";
|
||||||
|
case 3:
|
||||||
|
return "";
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return "info";
|
||||||
|
}
|
||||||
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
|
@ -87,24 +87,9 @@
|
|||||||
<el-table v-loading="loading" :data="recipesTemplateList">
|
<el-table v-loading="loading" :data="recipesTemplateList">
|
||||||
<el-table-column label="审核状态" align="center" width="120">
|
<el-table-column label="审核状态" align="center" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag
|
<el-tag :type="getReviewType(scope.row.reviewStatus)">
|
||||||
:type="
|
{{ getReviewStatusName(scope.row.reviewStatus) }}
|
||||||
!scope.row.reviewStatus
|
</el-tag>
|
||||||
? 'info'
|
|
||||||
: scope.row.reviewStatus === 1
|
|
||||||
? 'danger'
|
|
||||||
: 'success'
|
|
||||||
"
|
|
||||||
>{{
|
|
||||||
`${
|
|
||||||
!scope.row.reviewStatus
|
|
||||||
? "未制作"
|
|
||||||
: scope.row.reviewStatus == 1
|
|
||||||
? "未审核"
|
|
||||||
: "已审核"
|
|
||||||
}`
|
|
||||||
}}</el-tag
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@ -299,6 +284,32 @@ export default {
|
|||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
getReviewStatusName(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 1:
|
||||||
|
return "未审核";
|
||||||
|
case 2:
|
||||||
|
return "已审核";
|
||||||
|
case 3:
|
||||||
|
return "制作中";
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return "未制作";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getReviewType(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 1:
|
||||||
|
return "danger";
|
||||||
|
case 2:
|
||||||
|
return "success";
|
||||||
|
case 3:
|
||||||
|
return "";
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return "info";
|
||||||
|
}
|
||||||
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user