+
客户食谱链接
+
+
+ 查看暂停记录
-
-
-
-
- 查看暂停记录
-
-
-
-
-
+
+
+
+ {{
+ `${scope.row.reviewStatus ? "已审核" : "未审核"}`
+ }}
+
+
+
+
+ {{ `第${scope.row.startNumDay} 至 ${scope.row.endNumDay}天` }}
+
+
+
+
+ {{ `${scope.row.startDate} 至 ${scope.row.endDate}` }}
+
+
+
+
+
+ {{ `${scope.row.recipesId ? "编辑" : "制作"}` }}
+
+
+
+
+
+
+
@@ -78,4 +137,8 @@ export default {
/deep/ :focus {
outline: 0;
}
+
+.recipes_plan_drawer_wrapper {
+ height: calc(100vh - 77px);
+}
diff --git a/stdiet-ui/src/permission.js b/stdiet-ui/src/permission.js
index c1c9875bb..41a8e5ba6 100644
--- a/stdiet-ui/src/permission.js
+++ b/stdiet-ui/src/permission.js
@@ -1,43 +1,52 @@
-import router from './router'
-import store from './store'
-import {Message} from 'element-ui'
-import NProgress from 'nprogress'
-import 'nprogress/nprogress.css'
-import {getToken} from '@/utils/auth'
+import router from "./router";
+import store from "./store";
+import { Message } from "element-ui";
+import NProgress from "nprogress";
+import "nprogress/nprogress.css";
+import { getToken } from "@/utils/auth";
-NProgress.configure({showSpinner: false})
+NProgress.configure({ showSpinner: false });
-const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/question', '/subhealthyInvestigation']
+const whiteList = [
+ "/login",
+ "/auth-redirect",
+ "/bind",
+ "/register",
+ "/question",
+ "/subhealthyInvestigation"
+];
router.beforeEach((to, from, next) => {
- NProgress.start()
+ NProgress.start();
if (getToken()) {
/* has token*/
- if (to.path === '/login') {
- next({path: '/'})
- NProgress.done()
+ if (to.path === "/login") {
+ next({ path: "/" });
+ NProgress.done();
} else {
if (store.getters.roles.length === 0) {
// 判断当前用户是否已拉取完user_info信息
- store.dispatch('GetInfo').then(res => {
- // 拉取user_info
- const roles = res.roles
- store.dispatch('GenerateRoutes', {roles}).then(accessRoutes => {
- // 测试 默认静态页面
- // store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => {
- // 根据roles权限生成可访问的路由表
- router.addRoutes(accessRoutes) // 动态添加可访问路由表
- next({...to, replace: true}) // hack方法 确保addRoutes已完成
+ store
+ .dispatch("GetInfo")
+ .then(res => {
+ // 拉取user_info
+ const roles = res.roles;
+ store.dispatch("GenerateRoutes", { roles }).then(accessRoutes => {
+ // 测试 默认静态页面
+ // store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => {
+ // 根据roles权限生成可访问的路由表
+ router.addRoutes(accessRoutes); // 动态添加可访问路由表
+ next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
+ });
})
- })
.catch(err => {
- store.dispatch('FedLogOut').then(() => {
- Message.error(err)
- next({path: '/'})
- })
- })
+ store.dispatch("FedLogOut").then(() => {
+ Message.error(err);
+ next({ path: "/" });
+ });
+ });
} else {
- next()
+ next();
// 没有动态改变权限的需求可直接next() 删除下方权限判断 ↓
// if (hasPermission(store.getters.roles, to.meta.roles)) {
// next()
@@ -49,17 +58,22 @@ router.beforeEach((to, from, next) => {
}
} else {
// 没有token
- if (whiteList.indexOf(to.path) !== -1 || to.path.startsWith('/f/contract/') || to.path.startsWith('/subhealthyInvestigation/')
- || to.path.startsWith('/foodHeatCalculator/')) {
+ if (
+ whiteList.indexOf(to.path) !== -1 ||
+ to.path.startsWith("/f/contract/") ||
+ to.path.startsWith("/recipes/detail/") ||
+ to.path.startsWith("/subhealthyInvestigation/") ||
+ to.path.startsWith("/foodHeatCalculator/")
+ ) {
// 在免登录白名单,直接进入
- next()
+ next();
} else {
- next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
- NProgress.done()
+ next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
+ NProgress.done();
}
}
-})
+});
router.afterEach(() => {
- NProgress.done()
-})
+ NProgress.done();
+});
diff --git a/stdiet-ui/src/router/index.js b/stdiet-ui/src/router/index.js
index fea245cae..c406b278d 100644
--- a/stdiet-ui/src/router/index.js
+++ b/stdiet-ui/src/router/index.js
@@ -71,20 +71,6 @@ export const constantRoutes = [
}
]
},
- {
- path: "/order",
- component: Layout,
- hidden: true,
- children: [
- {
- path: "orderPause/:orderId",
- component: resolve =>
- require(["@/views/custom/order/orderPause"], resolve),
- name: "orderPause",
- meta: { title: "订单暂停记录" }
- }
- ]
- },
{
path: "/user",
component: Layout,
@@ -140,12 +126,20 @@ export const constantRoutes = [
]
},
{
- path: "/recipes/build",
+ path: "/recipes/build/:name/:planId",
component: resolve => require(["@/views/custom/recipesBuild"], resolve),
name: "RecipiesBuild",
+ props: true,
meta: { title: "食谱制作" },
hidden: true
},
+ {
+ path: "/recipes/detail/:id",
+ component: resolve => require(["@/views/custom/recipesShow"], resolve),
+ props: true,
+ meta: { title: "健康食谱" },
+ hidden: true
+ },
{
path: "/f/contract/:id(\\d+)",
hidden: true,
diff --git a/stdiet-ui/src/store/modules/recipes.js b/stdiet-ui/src/store/modules/recipes.js
index 4311492bd..f6a514d2e 100644
--- a/stdiet-ui/src/store/modules/recipes.js
+++ b/stdiet-ui/src/store/modules/recipes.js
@@ -7,11 +7,14 @@ import {
deleteDishesApi,
addRecipesApi
} from "@/api/custom/recipes";
+import { getRecipesTemplateDetail } from "@/api/custom/recipesTemplate";
+import { getRecipesPlan, updateRecipesPlan } from "@/api/custom/recipesPlan";
import { getDicts } from "@/api/system/dict/data";
const oriState = {
cusId: undefined,
planId: undefined,
+ temId: undefined,
recipesId: undefined,
healthyData: {},
healthDataLoading: false,
@@ -20,31 +23,56 @@ const oriState = {
recipesDataLoading: false,
cusUnitOptions: [],
cusWeightOptions: [],
- dishesTypeOptions: [],
typeOptions: [],
currentDay: -1,
startNum: 0,
- endNum: 0
+ endNum: 0,
+ reviewStatus: 0,
+ templateInfo: undefined,
+ copyData: undefined,
+ fontSize: 12
};
const mutations = {
updateRecipesDishesDetail(state, payload) {
const tarDishes = state.recipesData[payload.num].dishes.find(
- obj => obj.dishesId === payload.dishesId
+ obj => obj.id === payload.id
);
if (tarDishes) {
- const tarIgd = tarDishes.igdList.find(obj => obj.id === payload.igdId);
- if (tarIgd) {
- payload.weight && (tarIgd.weight = payload.weight);
- payload.cusWeight && (tarIgd.cusWeight = payload.cusWeight);
- payload.cusUnit && (tarIgd.cusUnit = payload.cusUnit);
+ if (
+ payload.dishesId !== tarDishes.dishesId ||
+ payload.type !== undefined
+ ) {
+ // 替换菜品
+ Object.keys(payload).forEach(key => {
+ if (key === "num") {
+ return;
+ }
+ tarDishes[key] = payload[key];
+ });
+ } else {
+ const tarIgd = tarDishes.igdList.find(obj => obj.id === payload.igdId);
+ if (tarIgd) {
+ payload.weight && (tarIgd.weight = payload.weight);
+ payload.cusWeight && (tarIgd.cusWeight = payload.cusWeight);
+ payload.cusUnit && (tarIgd.cusUnit = payload.cusUnit);
+ }
}
}
},
+ updateFontSize(state, payload) {
+ state.fontSize = payload.fontSize;
+ },
addRecipesDishes(state, payload) {
state.recipesData[payload.num].dishes.push(payload.data);
},
setCurrentDay(state, payload) {
+ if (state.currentDay !== payload.currentDay) {
+ state.currentDay = payload.currentDay;
+ }
+ },
+ resetCurrentDay(state, payload) {
+ // console.log(payload);
state.currentDay =
payload.currentDay === state.currentDay ? -1 : payload.currentDay;
},
@@ -73,35 +101,68 @@ const mutations = {
const actions = {
async init({ commit, dispatch }, payload) {
- return new Promise((res, rej) => {
- // console.log(payload);
- //
- commit("updateStateData", payload);
- //
- getDicts("cus_cus_unit").then(response => {
- commit("updateStateData", { cusUnitOptions: response.data });
- });
- getDicts("cus_cus_weight").then(response => {
- commit("updateStateData", { cusWeightOptions: response.data });
- });
- getDicts("cus_dishes_type").then(response => {
- commit("updateStateData", { typeOptions: response.data });
- });
- getDicts("cus_dishes_type").then(response => {
- commit("updateStateData", { dishesTypeOptions: response.data });
- });
+ // console.log(payload);
+ const planResponse = await getRecipesPlan(payload.planId);
+ const {
+ startNumDay,
+ endNumDay,
+ recipesId,
+ cusId,
+ reviewStatus
+ } = planResponse.data;
+ commit("updateStateData", {
+ cusId,
+ recipesId,
+ reviewStatus,
+ temId: payload.temId,
+ planId: payload.planId,
+ startNum: startNumDay,
+ endNum: endNumDay
+ });
+ getDicts("cus_cus_unit").then(response => {
+ commit("updateStateData", { cusUnitOptions: response.data });
+ });
+ getDicts("cus_cus_weight").then(response => {
+ commit("updateStateData", { cusWeightOptions: response.data });
+ });
+ getDicts("cus_dishes_type").then(response => {
+ commit("updateStateData", { typeOptions: response.data });
+ });
+ return new Promise((res, rej) => {
// 健康数据
- if (payload.cusId) {
- dispatch("getHealthyData", payload).catch(err => rej(err));
+ if (cusId) {
+ dispatch("getHealthyData", { cusId }).catch(err => rej(err));
+ }
+
+ // 模板信息
+ if (payload.temId) {
+ dispatch("getRecipesTemplate", payload).catch(err => rej(err));
}
// 食谱数据
- if (payload.recipesId) {
- dispatch("getRecipesInfo", payload).catch(err => rej(err));
+ if (recipesId) {
+ dispatch("getRecipesInfo", { recipesId }).catch(err => rej(err));
}
});
},
+ async getRecipesTemplate({ commit, state }, { temId }) {
+ const response = await getRecipesTemplateDetail(temId);
+ if (response.code === 200) {
+ commit("updateStateData", {
+ templateInfo: response.data
+ });
+ }
+ },
+ async updateReviewStatus({ commit, state }, payload) {
+ const response = await updateRecipesPlan({
+ id: state.planId,
+ reviewStatus: payload.reviewStatus
+ });
+ if (response.code === 200) {
+ commit("updateStateData", payload);
+ }
+ },
async getHealthyData({ commit }, payload) {
commit("updateStateData", { healthDataLoading: true });
const healthyDataResult = await getCustomerPhysicalSignsByCusId(
@@ -131,16 +192,14 @@ const actions = {
const recipesDataResult = await getRecipesApi(payload.recipesId);
let recipesData = [];
if (recipesDataResult.code === 200) {
- const { endNum, startNum } = state;
- let length = null;
- if (endNum && startNum) {
- length = endNum - startNum;
- }
+ const { endNum, startNum, recipesId } = state;
+ // 计算
+ let length = endNum - startNum;
recipesData = recipesDataResult.data.reduce((outArr, dayData, idx) => {
- if (!length || (length && length >= idx)) {
+ if (!recipesId || length >= idx) {
outArr.push({
id: dayData.id,
- numDay: startNum ? startNum + idx : dayData.numDay,
+ numDay: !recipesId ? startNum + idx : dayData.numDay,
dishes: dayData.dishes.reduce((arr, cur) => {
if (
cur.dishesId > -1 &&
@@ -224,15 +283,22 @@ const actions = {
dispatch("getRecipesInfo", { recipesId });
payload.callback &&
payload.callback({
- recipesId: result.data,
name: state.healthyData.name,
- cusId: state.cusId,
planId: state.planId
});
}
// console.log(params);
},
async addDishes({ commit, state }, payload) {
+ console.log(payload);
+ const tarDishesList = state.recipesData[payload.num].dishes.filter(
+ obj => obj.type === payload.data.type
+ );
+ if (tarDishesList.some(obj => obj.dishesId === payload.data.dishesId)) {
+ return new Promise((res, rej) =>
+ rej(`目标餐类已有相同的菜品「${payload.data.name}」`)
+ );
+ }
if (state.recipesId) {
const tarRecipesObj = state.recipesData[payload.num];
if (tarRecipesObj && payload.data) {
@@ -261,34 +327,83 @@ const actions = {
commit("addRecipesDishes", payload);
}
},
+ async replaceDishes({ commit, state }, payload) {
+ // console.log(payload);
+ const tarDishesList = state.recipesData[payload.num].dishes.filter(
+ obj => obj.type === payload.data.type
+ );
+ if (tarDishesList.some(obj => obj.dishesId === payload.data.dishesId)) {
+ return new Promise((res, rej) =>
+ rej(`目标餐类已有相同的菜品「${payload.data.name}」`)
+ );
+ }
+ if (state.recipesId) {
+ const tarDishes = state.recipesData[payload.num].dishes.find(
+ obj => obj.id === payload.data.id
+ );
+ if (tarDishes) {
+ const params = {
+ id: tarDishes.id,
+ dishesId: payload.data.dishesId,
+ detail: payload.data.igdList.map(igd => ({
+ id: igd.id,
+ weight: igd.weight,
+ cus_unit: igd.cusUnit,
+ cus_weight: igd.cusWeight
+ }))
+ };
+ // console.log(params);
+ const result = await updateDishesDetailApi(params);
+ if (result.code === 200) {
+ commit("updateRecipesDishesDetail", {
+ num: payload.num,
+ ...payload.data
+ });
+ }
+ }
+ } else {
+ commit("updateRecipesDishesDetail", {
+ num: payload.num,
+ ...payload.data
+ });
+ }
+ },
async updateDishes({ commit, state }, payload) {
// console.log(payload);
if (state.recipesId) {
const tarDishes = state.recipesData[payload.num].dishes.find(
- obj => obj.dishesId === payload.dishesId
+ obj => obj.id === payload.id
);
if (tarDishes) {
const mTarDishes = JSON.parse(JSON.stringify(tarDishes));
- const tarIgd = mTarDishes.igdList.find(obj => obj.id === payload.igdId);
- if (tarIgd) {
- payload.weight && (tarIgd.weight = payload.weight);
- payload.cusWeight && (tarIgd.cusWeight = payload.cusWeight);
- payload.cusUnit && (tarIgd.cusUnit = payload.cusUnit);
+ let params = {
+ id: mTarDishes.id
+ };
+ if (payload.type !== undefined) {
+ // 修改餐类
+ params.type = payload.type;
+ } else {
+ // 修改食材
+ const tarIgd = mTarDishes.igdList.find(
+ obj => obj.id === payload.igdId
+ );
+ if (tarIgd) {
+ payload.weight && (tarIgd.weight = payload.weight);
+ payload.cusWeight && (tarIgd.cusWeight = payload.cusWeight);
+ payload.cusUnit && (tarIgd.cusUnit = payload.cusUnit);
- const params = {
- id: mTarDishes.id,
- detail: mTarDishes.igdList.map(igd => ({
+ params.detail = mTarDishes.igdList.map(igd => ({
id: igd.id,
weight: igd.weight,
cus_unit: igd.cusUnit,
cus_weight: igd.cusWeight
- }))
- };
- const result = await updateDishesDetailApi(params);
- if (result.code === 200) {
- commit("updateRecipesDishesDetail", payload);
+ }));
}
}
+ const result = await updateDishesDetailApi(params);
+ if (result.code === 200) {
+ commit("updateRecipesDishesDetail", payload);
+ }
}
} else {
commit("updateRecipesDishesDetail", payload);
@@ -310,7 +425,21 @@ const actions = {
commit("deleteSomeDayDishes", payload);
}
},
- async deleteMenu({ commit }, payload) {}
+ async deleteMenu({ commit }, payload) {},
+ async setCopyData({ commit, state }, payload) {
+ return new Promise((res, rej) => {
+ const tarDishes = state.recipesData[payload.num].dishes.find(
+ obj => obj.id === payload.id
+ );
+ if (tarDishes) {
+ commit("updateStateData", { copyData: tarDishes });
+
+ res("复制成功");
+ } else {
+ rej("复制失败");
+ }
+ });
+ }
};
const getters = {
diff --git a/stdiet-ui/src/utils/healthyData.js b/stdiet-ui/src/utils/healthyData.js
index 9023a81a1..c2c6ee0da 100644
--- a/stdiet-ui/src/utils/healthyData.js
+++ b/stdiet-ui/src/utils/healthyData.js
@@ -471,6 +471,16 @@ const moduleObj = {
//健康信息处理,将数组转为字符串
export function dealHealthy(customerHealthy) {
+ customerHealthy.basicBMR = (
+ (10 * customerHealthy.weight) / 2 +
+ 6.25 * customerHealthy.tall -
+ 5 * customerHealthy.age -
+ customerHealthy.sex * 161
+ ).toFixed(1);
+ customerHealthy.notSportHeat = (customerHealthy.basicBMR * 1.3).toFixed(1);
+ customerHealthy.basicBMR += "千卡";
+ customerHealthy.notSportHeat += "千卡";
+
needAttrName.forEach(name => {
if (customerHealthy.hasOwnProperty(name)) {
customerHealthy[name] = (String(customerHealthy[name]) || "")
diff --git a/stdiet-ui/src/utils/orderType.js b/stdiet-ui/src/utils/orderType.js
index 0265c859f..9f40a0fb7 100644
--- a/stdiet-ui/src/utils/orderType.js
+++ b/stdiet-ui/src/utils/orderType.js
@@ -25,7 +25,7 @@ export const orderCountTypeArray = [
}
]
-//订单类型
+//订单类型(订单新增)
export const orderTypeArray = [
{
value: 0,
diff --git a/stdiet-ui/src/utils/request.js b/stdiet-ui/src/utils/request.js
index 112d453da..c26c01fa8 100644
--- a/stdiet-ui/src/utils/request.js
+++ b/stdiet-ui/src/utils/request.js
@@ -32,6 +32,7 @@ service.interceptors.response.use(res => {
// 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) {
+ // console.log(code)
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
diff --git a/stdiet-ui/src/views/custom/commision/detail/index.vue b/stdiet-ui/src/views/custom/commision/detail/index.vue
index 30d219235..3c9e56b93 100644
--- a/stdiet-ui/src/views/custom/commision/detail/index.vue
+++ b/stdiet-ui/src/views/custom/commision/detail/index.vue
@@ -48,6 +48,21 @@
>
+
+
+
+
+
{
+ this.reviewStatusOptions = response.data;
+ });
},
methods: {
/** 查询业务提成比例列表 */
diff --git a/stdiet-ui/src/views/custom/commision/detail_day/index.vue b/stdiet-ui/src/views/custom/commision/detail_day/index.vue
index a4dd3ae47..af3232316 100644
--- a/stdiet-ui/src/views/custom/commision/detail_day/index.vue
+++ b/stdiet-ui/src/views/custom/commision/detail_day/index.vue
@@ -48,6 +48,21 @@
>
+
+
+
+
+
{
+ this.reviewStatusOptions = response.data;
+ });
},
methods: {
/** 查询业务提成比例列表 */
diff --git a/stdiet-ui/src/views/custom/contract/index.vue b/stdiet-ui/src/views/custom/contract/index.vue
index 7e3551c29..1001ef614 100644
--- a/stdiet-ui/src/views/custom/contract/index.vue
+++ b/stdiet-ui/src/views/custom/contract/index.vue
@@ -187,7 +187,7 @@
prop="updateTime"
width="180"
/>
-
+
复制
+
+
+ 二维码
+
@@ -320,9 +330,14 @@ import { addContract, delContract, listContract } from "@/api/custom/contract";
import Clipboard from "clipboard";
import { mapGetters } from "vuex";
+import VueQr from "vue-qr";
+const logo = require("@/assets/logo/logo_b.png");
export default {
name: "Contract",
+ components: {
+ VueQr,
+ },
data() {
const checkServePromise = (rule, value, callback) => {
if (this.form.projectId == 0 && !value) {
@@ -331,6 +346,7 @@ export default {
callback();
};
return {
+ logo,
// 遮罩层
loading: true,
// 选中数组
diff --git a/stdiet-ui/src/views/custom/customer/index.vue b/stdiet-ui/src/views/custom/customer/index.vue
index 9d05de70d..b2136dad0 100644
--- a/stdiet-ui/src/views/custom/customer/index.vue
+++ b/stdiet-ui/src/views/custom/customer/index.vue
@@ -9,7 +9,7 @@
>
-
+
-
+
diff --git a/stdiet-ui/src/views/custom/customerCase/index.vue b/stdiet-ui/src/views/custom/customerCase/index.vue
new file mode 100644
index 000000000..05805f672
--- /dev/null
+++ b/stdiet-ui/src/views/custom/customerCase/index.vue
@@ -0,0 +1,381 @@
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 修改
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+ 文件列表
+
+
+
+
+
+ {{
+ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}")
+ }}
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择所属客户
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/stdiet-ui/src/views/custom/dishes/index.vue b/stdiet-ui/src/views/custom/dishes/index.vue
index e7121530b..497b27e66 100644
--- a/stdiet-ui/src/views/custom/dishes/index.vue
+++ b/stdiet-ui/src/views/custom/dishes/index.vue
@@ -191,7 +191,7 @@
-
+
是
否
@@ -247,17 +247,10 @@
:summary-method="getSummaries"
style="width: 100%"
>
-
-
+
+
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+ {{
+ `${(
+ ((scope.row.proteinRatio * scope.row.weight) / 100) *
+ 4 +
+ ((scope.row.fatRatio * scope.row.weight) / 100) * 9 +
+ ((scope.row.carbonRatio * scope.row.weight) / 100) * 4
+ ).toFixed(1)} kcal`
+ }}
+
@@ -525,7 +536,7 @@ export default {
updateBy: null,
updateTime: null,
igdList: [],
- isMain: 0,
+ isMain: 1,
};
this.selIngIds = [];
this.selIngList = [];
@@ -737,26 +748,27 @@ export default {
}, []);
});
},
- handleInputChange(val) {
- // console.log({ val, table: this.selTableData });
- },
getSummaries(param) {
const { columns, data } = param;
+ // console.log(data);
return columns.reduce(
(arr, cur, idx) => {
if (idx > 1) {
if (idx === 6) {
- // 备注
- return arr;
+ arr[6] = arr[3] * 4 + arr[4] * 9 + arr[5] * 4 + ' kcal';
+ } else {
+ arr[idx] = data.reduce((acc, dAcc) => {
+ if (idx === 2) {
+ return acc + parseFloat(dAcc.weight);
+ }
+ return parseFloat(
+ (
+ acc +
+ (dAcc[cur.property] * parseFloat(dAcc.weight)) / 100
+ ).toFixed(1)
+ );
+ }, 0);
}
- arr[idx] = data.reduce((acc, dAcc) => {
- if (idx === 2) {
- return acc + parseFloat(dAcc.weight);
- }
- return parseFloat(
- (acc + (dAcc[cur.property] * dAcc.weight) / 100).toFixed(1)
- );
- }, 0);
}
return arr;
},
diff --git a/stdiet-ui/src/views/custom/ingredient/index.vue b/stdiet-ui/src/views/custom/ingredient/index.vue
index b44ef216f..61fbff02c 100644
--- a/stdiet-ui/src/views/custom/ingredient/index.vue
+++ b/stdiet-ui/src/views/custom/ingredient/index.vue
@@ -96,13 +96,11 @@
icon="el-icon-search"
size="mini"
@click="handleQuery"
- >搜索
-
+ >搜索
+
重置
-
+ >重置
+
@@ -114,7 +112,7 @@
size="mini"
@click="handleAdd"
v-hasPermi="['custom:ingredient:add']"
- >新增
+ >新增
@@ -124,7 +122,7 @@
size="mini"
@click="handleExport"
v-hasPermi="['custom:ingredient:export']"
- >导出
+ >导出
+
+
+ {{
+ (
+ scope.row.proteinRatio * 4 +
+ scope.row.fatRatio * 9 +
+ scope.row.carbonRatio * 4
+ ).toFixed(1)
+ }}
+
+
-
+
-
+
-
+
修改
+ >修改
删除
+ >删除
@@ -241,7 +250,7 @@
-
+
@@ -376,244 +385,242 @@
diff --git a/stdiet-ui/src/views/custom/order/index.vue b/stdiet-ui/src/views/custom/order/index.vue
index 997aeaecc..cf8333d85 100644
--- a/stdiet-ui/src/views/custom/order/index.vue
+++ b/stdiet-ui/src/views/custom/order/index.vue
@@ -11,7 +11,7 @@
+
+
+
+
+
修改
- 暂停记录管理
-
+ -->
总计:{{ toThousands(this.totalAmount) }} 元总计收款(已除去二开售后提成金额):{{ toThousands(this.totalAmount) }} 元
-
-
-
- 注意事项:
-
1、日期包含当天,如:2021-01-01到2021-01-07,总共暂停七天,2021-01-08继续服务
-
2、每条暂停记录的时间范围不能重叠
-
-
-
@@ -458,8 +455,7 @@
diff --git a/stdiet-ui/src/views/custom/recipesBuild/BodySignView.vue b/stdiet-ui/src/views/custom/recipesBuild/BodySignView.vue
deleted file mode 100644
index 89b1f13bf..000000000
--- a/stdiet-ui/src/views/custom/recipesBuild/BodySignView.vue
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
{{ this.data.name }}
-
-
-
-
-
-
-
-
diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/BarChart.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/BarChart.vue
index 32bb1b6b3..6a06111b8 100644
--- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/BarChart.vue
+++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/BarChart.vue
@@ -30,6 +30,10 @@ export default {
type: Array,
default: [],
},
+ max: {
+ type: Number,
+ default: 0,
+ },
},
data() {
return {
@@ -64,6 +68,7 @@ export default {
this.updateChart(this.data.length > 0 ? this.data : {});
},
updateChart(source) {
+ // console.log(this.max);
this.chart.clear();
this.chart.setOption({
title: {
@@ -87,7 +92,7 @@ export default {
`${seriesName.substring(0, 1)}Weight`
].toFixed(1);
arr.push(
- `${cur.marker} ${nutriName}:${heatVal}千卡(${weightVal}克)`
+ `${cur.marker} ${nutriName}:${weightVal}克(${heatVal}千卡)`
);
return arr;
},
@@ -110,9 +115,9 @@ export default {
source,
},
grid: {
- top: 40,
+ top: 55,
left: 20,
- right: 20,
+ right: 50,
bottom: 10,
containLabel: true,
},
@@ -121,6 +126,10 @@ export default {
},
yAxis: {
type: "value",
+ name: "热量(千卡)",
+ nameTextStyle: {
+ color: "#262626",
+ },
},
series: ["pHeat", "fHeat", "cHeat"].map((dim, idx) => ({
name: dim,
@@ -131,6 +140,13 @@ export default {
y: dim,
x: 0,
},
+ markLine: {
+ data: [{ name: "BMR", yAxis: this.max ? this.max - 400 : 0 }],
+ symbol: "none",
+ lineStyle: {
+ color: "#d96969",
+ },
+ },
itemStyle: {
borderWidth: 2,
borderColor: "#fff",
diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/PieChart.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/PieChart.vue
index ae5739f8e..329b44f4d 100644
--- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/PieChart.vue
+++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/PieChart.vue
@@ -14,25 +14,14 @@
class="small_table"
>
-
-
-
+
+
+
+
+
总热量约等于
+
{{ totalHeat.toFixed(1) }}千卡
+