This commit is contained in:
xiezhijun 2021-02-19 09:33:00 +08:00
commit 3c42485f52
40 changed files with 2165 additions and 837 deletions

View File

@ -1,16 +1,11 @@
package com.stdiet.web.controller.custom; package com.stdiet.web.controller.custom;
import java.util.List; import java.util.List;
import com.github.pagehelper.PageHelper;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.stdiet.common.annotation.Log; import com.stdiet.common.annotation.Log;
import com.stdiet.common.core.controller.BaseController; import com.stdiet.common.core.controller.BaseController;
import com.stdiet.common.core.domain.AjaxResult; import com.stdiet.common.core.domain.AjaxResult;
@ -38,7 +33,7 @@ public class SysIngredientController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('custom:ingredient:list')") @PreAuthorize("@ss.hasPermi('custom:ingredient:list')")
@PostMapping("/list") @PostMapping("/list")
public TableDataInfo list(@RequestBody SysIngredient sysIngredient) public TableDataInfo list(@RequestParam Integer pageSize, @RequestParam Integer pageNum, @RequestBody SysIngredient sysIngredient)
{ {
startPage(); startPage();
List<SysIngredient> list = sysIngredientService.selectSysIngredientList(sysIngredient); List<SysIngredient> list = sysIngredientService.selectSysIngredientList(sysIngredient);

View File

@ -0,0 +1,23 @@
package com.stdiet.web.controller.custom;
import com.stdiet.common.core.controller.BaseController;
import com.stdiet.common.core.domain.AjaxResult;
import com.stdiet.custom.service.ISysRecipesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/recipes")
public class SysRecipesController extends BaseController {
@Autowired
private ISysRecipesService sysRecipesService;
@GetMapping(value = "/{resipesId}")
public AjaxResult getInfo(@PathVariable("resipesId") Long resipesId) {
return AjaxResult.success(sysRecipesService.selectSysRecipesByRecipesId(resipesId));
}
}

View File

@ -1,10 +1,10 @@
package com.stdiet.custom.domain; package com.stdiet.custom.domain;
import org.apache.commons.lang3.builder.ToStringBuilder; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.stdiet.common.annotation.Excel; import com.stdiet.common.annotation.Excel;
import com.stdiet.common.core.domain.BaseEntity; import lombok.Data;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -13,22 +13,30 @@ import java.util.List;
* @author wonder * @author wonder
* @date 2020-12-28 * @date 2020-12-28
*/ */
public class SysDishes extends BaseEntity @Data
{ public class SysDishes {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** id */ /**
* id
*/
private Long id; private Long id;
/** 菜品名称 */ /**
* 菜品名称
*/
@Excel(name = "菜品名称") @Excel(name = "菜品名称")
private String name; private String name;
/** 菜品类型 */ /**
* 菜品类型
*/
@Excel(name = "菜品类型") @Excel(name = "菜品类型")
private String type; private String type;
/** 做法 */ /**
* 做法
*/
@Excel(name = "做法") @Excel(name = "做法")
private String methods; private String methods;
@ -36,80 +44,36 @@ public class SysDishes extends BaseEntity
private String reviewStatus; private String reviewStatus;
public Integer getIsMain() { /**
return isMain; * 创建者
} */
private String createBy;
public void setIsMain(Integer isMain) { /**
this.isMain = isMain; * 创建时间
} */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
public void setReviewStatus(String reviewStatus) { /**
this.reviewStatus = reviewStatus; * 更新者
} */
private String updateBy;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 备注
*/
private String remark;
public String getReviewStatus() {
return reviewStatus;
}
private List<SysDishesIngredient> igdList; private List<SysDishesIngredient> igdList;
public void setId(Long id) private List<SysDishesIngredient> detail;
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setMethods(String methods)
{
this.methods = methods;
}
public String getMethods()
{
return methods;
}
public void setIgdList(List<SysDishesIngredient> ingredientList) {
this.igdList = ingredientList;
}
public List<SysDishesIngredient> getIgdList() {
return igdList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("type", getType())
.append("methods", getMethods())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
} }

View File

@ -21,9 +21,7 @@ public class SysDishesIngredient extends SysIngredient {
private Long cusUnit; private Long cusUnit;
private BigDecimal cusWeight; private Integer cusWeight;
private Integer cusWei;
private BigDecimal weight; private BigDecimal weight;

View File

@ -0,0 +1,25 @@
package com.stdiet.custom.domain;
import lombok.Data;
/**
* 食材对象 sys_ingredient
*
* @author wonder
* @date 2020-12-15
*/
@Data
public class SysDishesIngredientInfo {
private static final long serialVersionUID = 1L;
private Long id;
private String cus_unit;
private String cus_weight;
private Integer weight;
private String remark;
}

View File

@ -1,11 +1,11 @@
package com.stdiet.custom.domain; package com.stdiet.custom.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.stdiet.common.annotation.Excel; import com.stdiet.common.annotation.Excel;
import com.stdiet.common.core.domain.BaseEntity; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 食材对象 sys_ingredient * 食材对象 sys_ingredient
@ -13,12 +13,10 @@ import java.math.BigDecimal;
* @author wonder * @author wonder
* @date 2020-12-15 * @date 2020-12-15
*/ */
public class SysIngredient extends BaseEntity { @Data
public class SysIngredient {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private int pageNum;
private int pageSize;
/** /**
* id * id
*/ */
@ -77,131 +75,36 @@ public class SysIngredient extends BaseEntity {
*/ */
private String reviewStatus; private String reviewStatus;
public void setReviewStatus(String reviewStatus) { /**
this.reviewStatus = reviewStatus; * 创建者
} */
private String createBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 更新者
*/
private String updateBy;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 备注
*/
private String remark;
public String getReviewStatus() {
return reviewStatus;
}
private Long[] recIds; private Long[] recIds;
private Long[] notRecIds; private Long[] notRecIds;
public Long[] getRecIds() {
return recIds;
}
public Long[] getNotRecIds() {
return notRecIds;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public BigDecimal getProteinRatio() {
return proteinRatio;
}
public void setProteinRatio(BigDecimal proteinRatio) {
this.proteinRatio = proteinRatio;
}
public BigDecimal getFatRatio() {
return fatRatio;
}
public void setFatRatio(BigDecimal fatRatio) {
this.fatRatio = fatRatio;
}
public BigDecimal getCarbonRatio() {
return carbonRatio;
}
public void setCarbonRatio(BigDecimal carbonRatio) {
this.carbonRatio = carbonRatio;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getNotRec() {
return notRec;
}
public void setNotRec(String notRec) {
this.notRec = notRec;
}
public String getRec() {
return rec;
}
public void setRec(String rec) {
this.rec = rec;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPageNum() {
return pageNum;
}
public int getPageSize() {
return pageSize;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("type", getType())
.append("proteinRatio", getProteinRatio())
.append("fatRatio", getFatRatio())
.append("carbonRatio", getCarbonRatio())
.append("remark", getRemark())
.append("area", getArea())
.append("notRec", getNotRec())
.append("recommend", getRec())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
} }

View File

@ -0,0 +1,47 @@
package com.stdiet.custom.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class SysRecipes {
private static final long serialVersionUID = 1L;
private Long id;
private Integer numDay;
private List<SysDishes> dishes;
private Integer reviewStatus;
/**
* 创建者
*/
private String createBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 更新者
*/
private String updateBy;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 备注
*/
private String remark;
}

View File

@ -0,0 +1,10 @@
package com.stdiet.custom.mapper;
import com.stdiet.custom.domain.SysRecipes;
import java.util.List;
public interface SysRecipesMapper {
public List<SysRecipes> selectSysRecipesByRecipesId(Long id);
}

View File

@ -0,0 +1,9 @@
package com.stdiet.custom.service;
import com.stdiet.custom.domain.SysRecipes;
import java.util.List;
public interface ISysRecipesService {
public List<SysRecipes> selectSysRecipesByRecipesId(Long id);
}

View File

@ -0,0 +1,23 @@
package com.stdiet.custom.service.impl;
import com.stdiet.custom.domain.SysRecipes;
import com.stdiet.custom.mapper.SysRecipesMapper;
import com.stdiet.custom.service.ISysRecipesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional
public class SysRecipesServiceImpl implements ISysRecipesService {
@Autowired
private SysRecipesMapper sysRecipesMapper;
@Override
public List<SysRecipes> selectSysRecipesByRecipesId(Long id) {
return sysRecipesMapper.selectSysRecipesByRecipesId(id);
}
}

View File

@ -0,0 +1,56 @@
package com.stdiet.custom.typehandler;
import com.alibaba.fastjson.JSONArray;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* Created by lixio on 2019/3/28 20:51
* @description 用以mysql中json格式的字段进行转换的自定义转换器转换为实体类的JSONArray属性
* MappedTypes注解中的类代表此转换器可以自动转换为的java对象
* MappedJdbcTypes注解中设置的是对应的jdbctype
*/
@MappedTypes(JSONArray.class)
@MappedJdbcTypes(JdbcType.VARCHAR)
public class ArrayJsonHandler extends BaseTypeHandler<JSONArray> {
//设置非空参数
@Override
public void setNonNullParameter(PreparedStatement ps, int i, JSONArray parameter, JdbcType jdbcType) throws SQLException {
ps.setString(i, String.valueOf(parameter.toJSONString()));
}
//根据列名获取可以为空的结果
@Override
public JSONArray getNullableResult(ResultSet rs, String columnName) throws SQLException {
String sqlJson = rs.getString(columnName);
if (null != sqlJson){
return JSONArray.parseArray(sqlJson);
}
return null;
}
//根据列索引获取可以为空的结果
@Override
public JSONArray getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
String sqlJson = rs.getString(columnIndex);
if (null != sqlJson){
return JSONArray.parseArray(sqlJson);
}
return null;
}
@Override
public JSONArray getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String sqlJson = cs.getString(columnIndex);
if (null != sqlJson){
return JSONArray.parseArray(sqlJson);
}
return null;
}
}

View File

@ -0,0 +1,57 @@
package com.stdiet.custom.typehandler;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* Created by lixio on 2019/3/28 15:44
* @description 用以mysql中json格式的字段进行转换的自定义转换器转换为实体类的JSONObject属性
* MappedTypes注解中的类代表此转换器可以自动转换为的java对象
* MappedJdbcTypes注解中设置的是对应的jdbctype
*/
@MappedTypes(JSONObject.class)
@MappedJdbcTypes(JdbcType.VARCHAR)
public class ObjectJsonHandler extends BaseTypeHandler<JSONObject>{
//设置非空参数
@Override
public void setNonNullParameter(PreparedStatement ps, int i, JSONObject parameter, JdbcType jdbcType) throws SQLException {
ps.setString(i, String.valueOf(parameter.toJSONString()));
}
//根据列名获取可以为空的结果
@Override
public JSONObject getNullableResult(ResultSet rs, String columnName) throws SQLException {
String sqlJson = rs.getString(columnName);
if (null != sqlJson){
return JSONObject.parseObject(sqlJson);
}
return null;
}
//根据列索引获取可以为空的结果
@Override
public JSONObject getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
String sqlJson = rs.getString(columnIndex);
if (null != sqlJson){
return JSONObject.parseObject(sqlJson);
}
return null;
}
@Override
public JSONObject getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String sqlJson = cs.getString(columnIndex);
if (null != sqlJson){
return JSONObject.parseObject(sqlJson);
}
return null;
}
}

View File

@ -28,7 +28,6 @@
<result property="rec" column="rec" /> <result property="rec" column="rec" />
<result property="notRec" column="not_rec" /> <result property="notRec" column="not_rec" />
<result property="cusWeight" column="cus_weight" /> <result property="cusWeight" column="cus_weight" />
<result property="cusWei" column="cus_wei" />
<result property="cusUnit" column="cus_unit" /> <result property="cusUnit" column="cus_unit" />
<result property="weight" column="weight" /> <result property="weight" column="weight" />
</resultMap> </resultMap>
@ -49,7 +48,7 @@
<sql id="selectSysIngreditentsByIdVo"> <sql id="selectSysIngreditentsByIdVo">
SELECT * FROM( SELECT * FROM(
SELECT ingredient_id AS id, ingredient_weight AS weight, cus_weight, cus_wei, cus_unit, remark SELECT ingredient_id AS id, ingredient_weight AS weight, cus_weight, cus_unit, remark
FROM sys_dishes_ingredient FROM sys_dishes_ingredient
WHERE dishes_id = #{id} WHERE dishes_id = #{id}
) dishes ) dishes
@ -149,9 +148,9 @@
</delete> </delete>
<insert id="bashInsertDishesIngredent"> <insert id="bashInsertDishesIngredent">
insert into sys_dishes_ingredient(dishes_id, ingredient_id, ingredient_weight, cus_unit, cus_wei, remark) values insert into sys_dishes_ingredient(dishes_id, ingredient_id, ingredient_weight, cus_unit, cus_weight, remark) values
<foreach collection="list" separator="," item="item" index="index"> <foreach collection="list" separator="," item="item" index="index">
(#{item.dishesId}, #{item.ingredientId}, #{item.weight}, #{item.cusUnit}, #{item.cusWei}, #{item.remark}) (#{item.dishesId}, #{item.ingredientId}, #{item.weight}, #{item.cusUnit}, #{item.cusWeight}, #{item.remark})
</foreach> </foreach>
</insert> </insert>

View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stdiet.custom.mapper.SysRecipesMapper">
<resultMap type="SysRecipes" id="SysRecipesResult">
<result property="id" column="id"/>
<result property="numDay" column="num_day"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="reviewStatus" column="review_status"/>
<association property="dishes" column="id" select="selectDishesByMenuId"/>
</resultMap>
<resultMap id="SysDishesResult" type="SysDishes">
<result property="id" column="dishes_id"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="methods" column="methods"/>
<result property="isMain" column="is_main"/>
<result property="detail" column="detail" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"
javaType="com.stdiet.custom.domain.SysDishesIngredientInfo"/>
<association property="igdList" column="dishes_id" select="selectIngredientsByDishesId"/>
</resultMap>
<resultMap id="SysIgdsResult" type="SysDishesIngredient">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="proteinRatio" column="protein_ratio"/>
<result property="fatRatio" column="fat_ratio"/>
<result property="carbonRatio" column="carbon_ratio"/>
<result property="area" column="area"/>
<result property="rec" column="rec"/>
<result property="notRec" column="not_rec"/>
<result property="cusWeight" column="cus_weight" />
<result property="cusUnit" column="cus_unit" />
<result property="weight" column="weight" />
</resultMap>
<select id="selectSysRecipesByRecipesId" parameterType="Long" resultMap="SysRecipesResult">
SELECT * FROM sys_customer_daily_menu WHERE recipes_id = #{id}
</select>
<select id="selectDishesByMenuId" parameterType="Long" resultMap="SysDishesResult">
SELECT * FROM (SELECT * FROM sys_customer_menu_dishes WHERE menu_id = #{id}) AS menu
LEFT JOIN sys_dishes ON menu.dishes_id = sys_dishes.id
</select>
<select id="selectIngredientsByDishesId" parameterType="Long" resultMap="SysIgdsResult">
SELECT * FROM(
SELECT ingredient_id AS id, ingredient_weight AS weight, cus_weight, cus_unit, remark
FROM sys_dishes_ingredient
WHERE dishes_id = #{id}
) dishes
LEFT JOIN (
SELECT id, name, type, protein_ratio, fat_ratio, carbon_ratio, area, not_rec, rec
FROM sys_ingredient igd
LEFT JOIN (
SELECT ingredient_id as id, GROUP_CONCAT(name SEPARATOR ',') not_rec FROM(
SELECT physical_signs_id as id, ingredient_id
FROM sys_ingredient_not_rec
) notRec JOIN sys_physical_signs phy USING(id)
GROUP BY id
) notRecT USING(id)
LEFT JOIN (
SELECT ingredient_id as id, GROUP_CONCAT(name SEPARATOR ',') rec FROM(
SELECT physical_signs_id as id, ingredient_id
FROM sys_ingredient_rec
) rec JOIN sys_physical_signs phy USING(id)
GROUP BY id
) recT USING(id)
) ing USING(id)
</select>
</mapper>

View File

@ -4,7 +4,7 @@ import request from '@/utils/request'
export function listIngredient(query) { export function listIngredient(query) {
const {recIds, notRecIds} = query; const {recIds, notRecIds} = query;
return request({ return request({
url: '/custom/ingredient/list', url: `/custom/ingredient/list?pageSize=${query.pageSize}&pageNum=${query.pageNum}`,
method: 'post', method: 'post',
data: { data: {
...query, ...query,

View File

@ -0,0 +1,8 @@
import request from "@/utils/request";
export function getRecipes(id) {
return request({
url: "/recipes/" + id,
method: "get"
});
}

View File

@ -413,7 +413,7 @@ export default {
}); });
this.getDicts("cus_account").then((response) => { this.getDicts("cus_account").then((response) => {
this.accountIdOptions = response.data; this.accountIdOptions = response.data;
console.log(response.data); // console.log(response.data);
this.accountIdOptions.splice(0, 0, { this.accountIdOptions.splice(0, 0, {
dictLabel: "无", dictLabel: "无",
dictValue: "0", dictValue: "0",
@ -559,7 +559,7 @@ export default {
accountId, accountId,
...obj, ...obj,
}; };
console.log(this.form); // console.log(this.form);
this.resetForm("form"); this.resetForm("form");
}, },
handleOnClosed() { handleOnClosed() {
@ -600,7 +600,7 @@ export default {
watch: { watch: {
// //
"form.accountId": function (newVal, oldVal) { "form.accountId": function (newVal, oldVal) {
console.log("updte"); // console.log("updte");
this.initPlanningAndOperation(); this.initPlanningAndOperation();
}, },
}, },

View File

@ -130,7 +130,7 @@ export default {
// //
healthyTitleData:[ healthyTitleData:[
[ [
["创建时间","客户姓名","手机号"],["调理项目","性别","年龄"],["身高(厘米)","体重(斤)","位置"] ["创建时间","客户姓名","手机号"],["调理项目","性别","年龄"],["身高(厘米)","体重(斤)","地域"]
], ],
[ [
["减脂经历","减脂遇到的困难","减脂是否反弹"],["是否意识到生活习惯是减脂关键","",""] ["减脂经历","减脂遇到的困难","减脂是否反弹"],["是否意识到生活习惯是减脂关键","",""]
@ -177,7 +177,7 @@ export default {
[ [
["breakfastType","breakfastFood","lunchType"],["dinner","vegetableRate","commonMeat"], ["breakfastType","breakfastFood","lunchType"],["dinner","vegetableRate","commonMeat"],
["dinnerTime","supperNum","supperFood"],["dietHotAndCold","dietFlavor","vegetablesNum"], ["dinnerTime","supperNum","supperFood"],["dietHotAndCold","dietFlavor","vegetablesNum"],
["vegetablesRateType","fruitsNum","fruitsTime"],["fruitsRate","riceNum","riceNum"], ["vegetablesRateType","fruitsNum","fruitsTime"],["fruitsRate","riceNum","riceFull"],
["eatingSpeed","makeFoodType","snacks"], ["eatingSpeed","makeFoodType","snacks"],
["healthProductsFlag","healthProductsBrand","healthProductsName"], ["healthProductsFlag","healthProductsBrand","healthProductsName"],
["healthProductsWeekRate","dishesIngredient",""] ["healthProductsWeekRate","dishesIngredient",""]

View File

@ -0,0 +1,87 @@
<template>
<div class="main">
<div class="aspect">指标</div>
<div class="recipes">
<el-table :data="mData" border :span-method="spanMethod" size="mini">
<el-table-column :label="`${name}第${num}天`"></el-table-column>
<el-table-column label="菜品" prop="name"></el-table-column>
</el-table>
</div>
</div>
</template>
<script>
export default {
name: "RecipesCom",
props: {
data: {
type: Array,
default: [],
required: true,
},
name: {
type: String,
default: "",
},
num: {
type: Number,
default: 0,
},
},
components: {},
mounted() {
// console.log(this.data);
},
data() {
return {};
},
computed: {
mData() {
if (!this.data.dishes) {
return [];
}
const mData = this.data.dishes.reduce((arr, cur) => {
if (cur.id > 0) {
cur.igdList.forEach((igd) => {
if (igd.id > 0) {
const tarDetail = cur.detail.find((det) => det.id == igd.id);
arr.push({
id: cur.id,
name: cur.name,
type: cur.type,
isMain: cur.isMain,
methods: cur.methods,
igdId: igd.id,
igdName: igd.name,
proteinRatio: igd.proteinRatio,
fatRatio: igd.fatRatio,
carbonRatio: igd.carbonRatio,
rec: igd.rec,
notRec: igd.notRec,
weight: tarDetail ? tarDetail.weight : igd.weight,
cusWeight: tarDetail ? tarDetail.cus_weight : igd.cusWeight,
cusUnit: tarDetail ? tarDetail.cus_unit : igd.cusUnit,
});
}
});
}
return arr;
}, []);
// console.log(mData);
return mData;
},
},
methods: {
spanMethod({ row, column, rowIndex, columnIndex }) {},
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.main {
.aspect {
}
.recipies {
}
}
</style>

View File

@ -35,7 +35,7 @@ export default {
if (typeof val !== 'string') return if (typeof val !== 'string') return
const themeCluster = this.getThemeCluster(val.replace('#', '')) const themeCluster = this.getThemeCluster(val.replace('#', ''))
const originalCluster = this.getThemeCluster(oldVal.replace('#', '')) const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
console.log(themeCluster, originalCluster) // console.log(themeCluster, originalCluster)
const $message = this.$message({ const $message = this.$message({
message: ' Compiling the theme', message: ' Compiling the theme',

View File

@ -1,10 +1,10 @@
import Vue from 'vue' import Vue from "vue";
import Router from 'vue-router' import Router from "vue-router";
Vue.use(Router) Vue.use(Router);
/* Layout */ /* Layout */
import Layout from '@/layout' import Layout from "@/layout";
/** /**
* Note: 路由配置项 * Note: 路由配置项
@ -27,35 +27,35 @@ import Layout from '@/layout'
// 公共路由 // 公共路由
export const constantRoutes = [ export const constantRoutes = [
{ {
path: '/redirect', path: "/redirect",
component: Layout, component: Layout,
hidden: true, hidden: true,
children: [ children: [
{ {
path: '/redirect/:path(.*)', path: "/redirect/:path(.*)",
component: (resolve) => require(['@/views/redirect'], resolve) component: resolve => require(["@/views/redirect"], resolve)
} }
] ]
}, },
{ {
path: '/login', path: "/login",
component: (resolve) => require(['@/views/login'], resolve), component: resolve => require(["@/views/login"], resolve),
hidden: true hidden: true
}, },
{ {
path: '/404', path: "/404",
component: (resolve) => require(['@/views/error/404'], resolve), component: resolve => require(["@/views/error/404"], resolve),
hidden: true hidden: true
}, },
{ {
path: '/401', path: "/401",
component: (resolve) => require(['@/views/error/401'], resolve), component: resolve => require(["@/views/error/401"], resolve),
hidden: true hidden: true
}, },
{ {
path: '', path: "",
component: Layout, component: Layout,
redirect: 'index', redirect: "index",
children: [ children: [
// { // {
// path: 'index', // path: 'index',
@ -64,101 +64,120 @@ export const constantRoutes = [
// meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } // meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
// } // }
{ {
path: 'index', path: "index",
component: (resolve) => require(['@/views/custom/order'], resolve), component: resolve => require(["@/views/custom/order"], resolve),
name: '订单', name: "订单",
meta: { title: '订单管理', icon: 'build', noCache: true, affix: true } meta: { title: "订单管理", icon: "build", noCache: true, affix: true }
} }
] ]
}, },
{ {
path: '/order', path: "/order",
component: Layout, component: Layout,
hidden: true, hidden: true,
children: [ children: [
{ {
path: 'orderPause/:orderId', path: "orderPause/:orderId",
component: (resolve) => require(['@/views/custom/order/orderPause'], resolve), component: resolve =>
name: 'orderPause', require(["@/views/custom/order/orderPause"], resolve),
meta: { title: '订单暂停记录'} name: "orderPause",
meta: { title: "订单暂停记录" }
} }
] ]
}, },
{ {
path: '/user', path: "/user",
component: Layout, component: Layout,
hidden: true, hidden: true,
redirect: 'noredirect', redirect: "noredirect",
children: [ children: [
{ {
path: 'profile', path: "profile",
component: (resolve) => require(['@/views/system/user/profile/index'], resolve), component: resolve =>
name: 'Profile', require(["@/views/system/user/profile/index"], resolve),
meta: { title: '个人中心', icon: 'user' } name: "Profile",
meta: { title: "个人中心", icon: "user" }
} }
] ]
}, },
{ {
path: '/dict', path: "/dict",
component: Layout, component: Layout,
hidden: true, hidden: true,
children: [ children: [
{ {
path: 'type/data/:dictId(\\d+)', path: "type/data/:dictId(\\d+)",
component: (resolve) => require(['@/views/system/dict/data'], resolve), component: resolve => require(["@/views/system/dict/data"], resolve),
name: 'Data', name: "Data",
meta: { title: '字典数据', icon: '' } meta: { title: "字典数据", icon: "" }
} }
] ]
}, },
{ {
path: '/job', path: "/job",
component: Layout, component: Layout,
hidden: true, hidden: true,
children: [ children: [
{ {
path: 'log', path: "log",
component: (resolve) => require(['@/views/monitor/job/log'], resolve), component: resolve => require(["@/views/monitor/job/log"], resolve),
name: 'JobLog', name: "JobLog",
meta: { title: '调度日志' } meta: { title: "调度日志" }
} }
] ]
}, },
{ {
path: '/gen', path: "/gen",
component: Layout, component: Layout,
hidden: true, hidden: true,
children: [ children: [
{ {
path: 'edit/:tableId(\\d+)', path: "edit/:tableId(\\d+)",
component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), component: resolve => require(["@/views/tool/gen/editTable"], resolve),
name: 'GenEdit', name: "GenEdit",
meta: { title: '修改生成配置' } meta: { title: "修改生成配置" }
} }
] ]
}, },
{ {
path: '/f/contract/:id(\\d+)', path: "/recipes",
component: Layout,
hidden: true, hidden: true,
component: (resolve) => require(['@/views/custom/signContract'], resolve), children: [
meta: { title: '合同' }
},
{ {
path: '/question', path: "build/:cusId/:planId/:recipesId",
component: (resolve) => require(['@/views/custom/investigate/questionnaire'], resolve), component: resolve =>
hidden: true, require(["@/views/custom/recipesBuild"], resolve),
meta: { title: '营养体征调查问卷'} name: "RecipiesBuild",
}, props: true,
{ meta: { title: "食谱制作" }
path: '/subhealthyInvestigation/:id',
component: (resolve) => require(['@/views/custom/subhealthy/investigation'], resolve),
hidden: true,
meta: { title: '胜唐体控健康评估表'}
} }
] ]
},
{
path: "/f/contract/:id(\\d+)",
hidden: true,
component: resolve => require(["@/views/custom/signContract"], resolve),
meta: { title: "合同" }
},
{
path: "/question",
component: resolve =>
require(["@/views/custom/investigate/questionnaire"], resolve),
hidden: true,
meta: { title: "营养体征调查问卷" }
},
{
path: "/subhealthyInvestigation/:id",
component: resolve =>
require(["@/views/custom/subhealthy/investigation"], resolve),
hidden: true,
meta: { title: "胜唐体控健康评估表" }
}
];
export default new Router({ export default new Router({
mode: 'history', // 去掉url中的# mode: "history", // 去掉url中的#
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes routes: constantRoutes
}) });

View File

@ -1,13 +1,15 @@
import Vue from 'vue' import Vue from "vue";
import Vuex from 'vuex' import Vuex from "vuex";
import app from './modules/app' import app from "./modules/app";
import user from './modules/user' import user from "./modules/user";
import tagsView from './modules/tagsView' import tagsView from "./modules/tagsView";
import permission from './modules/permission' import permission from "./modules/permission";
import settings from './modules/settings' import settings from "./modules/settings";
import getters from './getters' import recipes from "./modules/recipes";
Vue.use(Vuex) import getters from "./getters";
Vue.use(Vuex);
const store = new Vuex.Store({ const store = new Vuex.Store({
modules: { modules: {
@ -15,9 +17,10 @@ const store = new Vuex.Store({
user, user,
tagsView, tagsView,
permission, permission,
settings settings,
recipes
}, },
getters getters
}) });
export default store export default store;

View File

@ -0,0 +1,71 @@
import { getOrder } from "@/api/custom/order";
import { getCustomerPhysicalSignsByCusId } from "@/api/custom/customer";
import { dealHealthy } from "@/utils/healthyData";
import { getRecipesPlan } from "@/api/custom/recipesPlan";
import { getRecipes } from "@/api/custom/recipes";
const oriState = {
healthyData: {},
healthyDataType: 0,
recipesData: []
};
const mutations = {
setHealtyData(state, payload) {
state.healthyDataType = payload.healthyDataType;
state.healthyData = payload.healthyData;
},
setRecipesData(state, payload) {
state.recipesData = payload.recipesData;
},
clean(state) {
// console.log("clean");
Object.keys(oriState).forEach(key => {
state[key] = oriState[key];
});
}
};
const actions = {
async init({ commit }, payload) {
const orderResult = await getOrder(payload.cusId);
if (!orderResult.data.cusId) {
throw new Error("未找到用户id");
}
// 健康数据
const healthyDataResult = await getCustomerPhysicalSignsByCusId(
orderResult.data.cusId
);
if (healthyDataResult.code === 200) {
commit("setHealtyData", {
healthyDataType: healthyDataResult.data.type,
healthyData: dealHealthy(healthyDataResult.data.customerHealthy)
});
} else {
throw new Error(healthyDataResult.msg);
}
// 食谱数据
if (payload.recipesId) {
const recipesDataResult = await getRecipes(payload.recipesId);
if (recipesDataResult.code === 200) {
commit("setRecipesData", {
recipesData: recipesDataResult.data
});
} else {
throw new Error(recipesDataResult.msg);
}
}
}
};
const getters = {};
export default {
namespaced: true,
state: Object.assign({}, oriState),
mutations,
actions,
getters
};

View File

@ -8,188 +8,552 @@ export const titleArray = [
"七、睡眠质量评估", "七、睡眠质量评估",
"八、既往病史/用药史评估", "八、既往病史/用药史评估",
"九、体检报告" "九、体检报告"
] ];
export const condimentArray = [ export const condimentArray = [
{"name":"鸡精", "value":"1"}, { name: "鸡精", value: "1" },
{"name":"耗油", "value":"2"}, { name: "耗油", value: "2" },
{"name":"生抽", "value":"3"}, { name: "生抽", value: "3" },
{"name":"老抽", "value":"4"}, { name: "老抽", value: "4" },
{"name":"香油", "value":"5"}, { name: "香油", value: "5" },
{"name":"浓汤宝", "value":"6"}, { name: "浓汤宝", value: "6" },
{"name":"鸡粉", "value":"7"}, { name: "鸡粉", value: "7" },
{"name":"花椒", "value":"8"}, { name: "花椒", value: "8" },
{"name":"辣椒油", "value":"9"} { name: "辣椒油", value: "9" }
] ];
export const cookingStyleArray = [ export const cookingStyleArray = [
{"name":"煎","value":"1"},{"name":"烤","value":"2"},{"name":"炸","value":"3"},{"name":"卤","value":"4"}, { name: "煎", value: "1" },
{"name":"腌","value":"5"},{"name":"腊","value":"6"},{"name":"煲","value":"7"},{"name":"炒","value":"8"}, { name: "烤", value: "2" },
{"name":"蒸","value":"9"},{"name":"刺身","value":"10"},{"name":"水煮","value":"11"} { name: "炸", value: "3" },
] { name: "卤", value: "4" },
{ name: "腌", value: "5" },
export const cookingStyleRateArray = ["煎","炸","卤","腌","腊","煲"] { name: "腊", value: "6" },
{ name: "煲", value: "7" },
{ name: "炒", value: "8" },
{ name: "蒸", value: "9" },
{ name: "刺身", value: "10" },
{ name: "水煮", value: "11" }
];
export const washVegetablesStyleArray = [ export const washVegetablesStyleArray = [
{"name":"先切后洗","value": "1"},{"name":"先洗后切","value": "2"},{"name":"切后浸泡","value": "3"} { name: "先切后洗", value: "1" },
] { name: "先洗后切", value: "2" },
{ name: "切后浸泡", value: "3" }
];
export const breakfastTypeArray = [ export const breakfastTypeArray = [
{"name":"不吃","value": "1"},{"name":"偶尔吃","value": "2"},{"name":"每天吃","value": "3"} { name: "不吃", value: "1" },
] { name: "偶尔吃", value: "2" },
{ name: "每天吃", value: "3" }
];
export const lunchTypeArray = [ export const lunchTypeArray = [
{"name":"外卖","value":"1"},{"name":"自带餐","value":"2"},{"name":"快餐","value":"3"},{"name":"餐厅","value":"4"} { name: "外卖", value: "1" },
] { name: "自带餐", value: "2" },
{ name: "快餐", value: "3" },
{ name: "餐厅", value: "4" }
];
export const dinnerArray = [ export const dinnerArray = [
{"name":"餐馆吃","value":"1"},{"name":"在家吃","value":"2"},{"name":"丰盛","value":"3"},{"name":"清淡","value":"4"} { name: "餐馆吃", value: "1" },
] { name: "在家吃", value: "2" },
{ name: "丰盛", value: "3" },
{ name: "清淡", value: "4" }
];
export const dietHotAndColdArray = [ export const dietHotAndColdArray = [
{"name":"偏冷食","value":"1"},{"name":"偏热食","value":"2"},{"name":"正常","value":"3"} { name: "偏冷食", value: "1" },
] { name: "偏热食", value: "2" },
{ name: "正常", value: "3" }
];
export const dietFlavorArray = [ export const dietFlavorArray = [
{"name":"偏油","value":"1"},{"name":"偏咸","value":"2"},{"name":"偏辣","value":"3"}, { name: "偏油", value: "1" },
{"name":"偏甜","value":"4"},{"name":"偏酸","value":"5"},{"name":"清淡","value":"6"} { name: "偏咸", value: "2" },
] { name: "偏辣", value: "3" },
{ name: "偏甜", value: "4" },
{ name: "偏酸", value: "5" },
{ name: "清淡", value: "6" }
];
export const vegetablesRateTypeArray = [ export const vegetablesRateTypeArray = [
{"name":"每天吃","value":"1"},{"name":"经常吃","value":"2"},{"name":"偶尔吃","value":"3"},{"name":"从不吃","value":"4"} { name: "每天吃", value: "1" },
] { name: "经常吃", value: "2" },
{ name: "偶尔吃", value: "3" },
{ name: "从不吃", value: "4" }
];
export const fruitsTimeArray = [ export const fruitsTimeArray = [
{"name":"餐前","value":"1"},{"name":"餐后","value":"2"},{"name":"餐间","value":"3"} { name: "餐前", value: "1" },
] { name: "餐后", value: "2" },
{ name: "餐间", value: "3" }
];
export const fruitsRateArray = [ export const fruitsRateArray = [
{"name":"每天吃","value":"1"},{"name":"经常吃","value":"2"},{"name":"偶尔吃","value":"3"},{"name":"从不吃","value":"4"} { name: "每天吃", value: "1" },
] { name: "经常吃", value: "2" },
{ name: "偶尔吃", value: "3" },
{ name: "从不吃", value: "4" }
];
export const eatingSpeedArray = [ export const eatingSpeedArray = [
{"name":"很快","value":"1"},{"name":"偏快","value":"2"},{"name":"正常","value":"3"},{"name":"偏慢","value":"4"} { name: "很快", value: "1" },
,{"name":"很慢","value":"5"} { name: "偏快", value: "2" },
] { name: "正常", value: "3" },
{ name: "偏慢", value: "4" },
{ name: "很慢", value: "5" }
];
export const snacksArray = [ export const snacksArray = [
{"name":"面包","value":"1"},{"name":"蛋糕","value":"2"},{"name":"饼干","value":"3"},{"name":"冰淇淋","value":"4"} { name: "面包", value: "1" },
,{"name":"糖果","value":"5"},{"name":"巧克力","value":"6"},{"name":"方便面","value":"7"},{"name":"薯条","value":"8"},{"name":"肉干","value":"9"}, { name: "蛋糕", value: "2" },
{"name":"坚果","value":"10"},{"name":"饮料","value":"11"},{"name":"果脯","value":"12"},{"name":"牛奶","value":"13"} { name: "饼干", value: "3" },
] { name: "冰淇淋", value: "4" },
{ name: "糖果", value: "5" },
{ name: "巧克力", value: "6" },
{ name: "方便面", value: "7" },
{ name: "薯条", value: "8" },
{ name: "肉干", value: "9" },
{ name: "坚果", value: "10" },
{ name: "饮料", value: "11" },
{ name: "果脯", value: "12" },
{ name: "牛奶", value: "13" }
];
export const waterTypeArray = [ export const waterTypeArray = [
{"name":"冰水","value":"1"},{"name":"温水","value":"2"},{"name":"常温水","value":"3"} { name: "冰水", value: "1" },
] { name: "温水", value: "2" },
{ name: "常温水", value: "3" }
];
export const waterHabitArray = [ export const waterHabitArray = [
{"name":"均匀地喝","value":"1"},{"name":"餐前多喝","value":"2"},{"name":"餐后多喝","value":"3"},{"name":"餐间多喝","value":"4"}, { name: "均匀地喝", value: "1" },
{"name":"随时喝","value":"5"} { name: "餐前多喝", value: "2" },
] { name: "餐后多喝", value: "3" },
{ name: "餐间多喝", value: "4" },
export const drinksNumArray = ["老火汤","咖啡","浓茶","奶茶","冷饮","碳酸饮料","甜饮料","鲜榨果汁"] { name: "随时喝", value: "5" }
];
export const drinkWineFlagArray = [ export const drinkWineFlagArray = [
{"name":"经常饮酒","value": "1"},{"name":"不饮酒","value": "2"},{"name":"偶尔","value": "3"} { name: "经常饮酒", value: "1" },
] { name: "不饮酒", value: "2" },
{ name: "偶尔", value: "3" }
];
export const drinkWineClassifyArray = [ export const drinkWineClassifyArray = [
{"name":"白酒","value": "1"},{"name":"红酒","value": "2"},{"name":"啤酒","value": "3"} { name: "白酒", value: "1" },
] { name: "红酒", value: "2" },
{ name: "啤酒", value: "3" }
export const drinkWineAmountArray = ["白酒","啤酒","红酒"] ];
export const drinkWineAmountUnitArray = ["两","瓶","毫升"]
export const smokeRateArray = ["每天抽烟","烟龄","已戒烟"]
export const smokeRateUnitArray = ["次","年","年"]
export const workTypeArray = [ export const workTypeArray = [
{"name":"工作时间长","value": "1"},{"name":"久坐","value": "2"},{"name":"久站","value": "3"}, { name: "工作时间长", value: "1" },
{"name":"走动多","value": "4"},{"name":"强度大","value": "5"},{"name":"用电脑多","value": "6"},{"name":"体力工作多","value": "7"} { name: "久坐", value: "2" },
] { name: "久站", value: "3" },
{ name: "走动多", value: "4" },
{ name: "强度大", value: "5" },
{ name: "用电脑多", value: "6" },
{ name: "体力工作多", value: "7" }
];
export const defecationTimeArray = [ export const defecationTimeArray = [
{"name":"上午","value": "1"},{"name":"中午","value": "2"},{"name":"晚上","value": "3"} { name: "上午", value: "1" },
] { name: "中午", value: "2" },
{ name: "晚上", value: "3" }
];
export const aerobicMotionClassifyArray = [ export const aerobicMotionClassifyArray = [
{"name":"跳绳","value": "1"},{"name":"跑步","value": "2"},{"name":"游泳","value": "3"} { name: "跳绳", value: "1" },
] { name: "跑步", value: "2" },
{ name: "游泳", value: "3" }
];
export const anaerobicMotionClassifyArray = [ export const anaerobicMotionClassifyArray = [
{"name":"撸铁","value": "1"},{"name":"俯卧撑","value": "2"} { name: "撸铁", value: "1" },
] { name: "俯卧撑", value: "2" }
];
export const anaerobicAerobicMotionClassifyArray = [ export const anaerobicAerobicMotionClassifyArray = [
{"name":"拳击","value": "1"},{"name":"瑜伽","value": "2"} { name: "拳击", value: "1" },
] { name: "瑜伽", value: "2" }
];
export const motionFieldArray = [ export const motionFieldArray = [
{"name":"居家","value": "1"},{"name":"健身房","value": "2"},{"name":"户外","value": "3"}, {"name":"瑜伽馆","value": "4"} { name: "居家", value: "1" },
] { name: "健身房", value: "2" },
{ name: "户外", value: "3" },
{ name: "瑜伽馆", value: "4" }
];
export const sleepQualityArray = [ export const sleepQualityArray = [
{"name":"好","value": "1"},{"name":"一般","value": "2"},{"name":"入睡难","value": "3"}, { name: "好", value: "1" },
{"name":"失眠","value": "4"},{"name":"易醒","value": "5"},{"name":"多梦","value": "6"} { name: "一般", value: "2" },
] { name: "入睡难", value: "3" },
{ name: "失眠", value: "4" },
{ name: "易醒", value: "5" },
{ name: "多梦", value: "6" }
];
export const familyIllnessHistoryArray = [ export const familyIllnessHistoryArray = [
{"name":"高血压病","value": "1"},{"name":"脑卒中","value": "2"},{"name":"冠心病","value": "3"}, { name: "高血压病", value: "1" },
{"name":"外周血管病","value": "4"},{"name":"心力衰竭","value": "5"},{"name":"冠心病","value": "6"}, { name: "脑卒中", value: "2" },
{"name":"肥胖症","value": "7"},{"name":"慢性肾脏疾病","value": "8"},{"name":"骨质疏松","value": "9"}, { name: "冠心病", value: "3" },
{"name":"痛风","value": "10"},{"name":"精神疾病","value": "11"},{"name":"恶性肿瘤","value": "12"}, { name: "外周血管病", value: "4" },
{"name":"慢性阻塞性肺病","value": "13"},{"name":"风湿性免疫性疾病","value": "14"}, { name: "心力衰竭", value: "5" },
] { name: "冠心病", value: "6" },
{ name: "肥胖症", value: "7" },
{ name: "慢性肾脏疾病", value: "8" },
{ name: "骨质疏松", value: "9" },
{ name: "痛风", value: "10" },
{ name: "精神疾病", value: "11" },
{ name: "恶性肿瘤", value: "12" },
{ name: "慢性阻塞性肺病", value: "13" },
{ name: "风湿性免疫性疾病", value: "14" }
];
export const operationHistoryArray = [ export const operationHistoryArray = [
{"name":"头颅(含脑)","value": "1"},{"name":"眼","value": "2"},{"name":"耳鼻咽喉","value": "3"}, { name: "头颅(含脑)", value: "1" },
{"name":"颌面部及口腔","value": "4"},{"name":"颈部或甲状腺","value": "5"},{"name":"胸部(含肺部)","value": "6"}, { name: "眼", value: "2" },
{"name":"心脏(含心脏介入)","value": "7"},{"name":"外周血管","value": "8"},{"name":"胃肠","value": "9"}, { name: "耳鼻咽喉", value: "3" },
{"name":"肝胆","value": "10"},{"name":"肾脏","value": "11"},{"name":"脊柱","value": "12"}, { name: "颌面部及口腔", value: "4" },
{"name":"四肢及关节","value": "13"},{"name":"前列腺","value": "14"},{"name":"妇科","value": "15"},{"name":"乳腺","value": "16"} { name: "颈部或甲状腺", value: "5" },
,{"name":"膀胱","value": "17"} { name: "胸部(含肺部)", value: "6" },
] { name: "心脏(含心脏介入)", value: "7" },
{ name: "外周血管", value: "8" },
{ name: "胃肠", value: "9" },
{ name: "肝胆", value: "10" },
{ name: "肾脏", value: "11" },
{ name: "脊柱", value: "12" },
{ name: "四肢及关节", value: "13" },
{ name: "前列腺", value: "14" },
{ name: "妇科", value: "15" },
{ name: "乳腺", value: "16" },
{ name: "膀胱", value: "17" }
];
export const longEatDrugClassifyArray = [ export const longEatDrugClassifyArray = [
{"name":"降压药","value": "1"},{"name":"降糖药","value": "2"},{"name":"降尿酸药","value": "3"}, { name: "降压药", value: "1" },
{"name":"抗心律失常药","value": "4"},{"name":"缓解哮喘药物","value": "5"},{"name":"抗压郁药物","value": "6"}, { name: "降糖药", value: "2" },
{"name":"雌激素类药物","value": "7"},{"name":"利尿剂","value": "8"},{"name":"中草药","value": "9"}, { name: "降尿酸药", value: "3" },
{"name":"避孕药","value": "10"},{"name":"强的松类药物","value": "11"},{"name":"镇静剂或安眠药","value": "12"}, { name: "抗心律失常药", value: "4" },
{"name":"调值药(降脂药)","value": "13"},{"name":"解热镇痛药(如布洛芬等)","value": "14"} { name: "缓解哮喘药物", value: "5" },
] { name: "抗压郁药物", value: "6" },
{ name: "雌激素类药物", value: "7" },
{ name: "利尿剂", value: "8" },
{ name: "中草药", value: "9" },
{ name: "避孕药", value: "10" },
{ name: "强的松类药物", value: "11" },
{ name: "镇静剂或安眠药", value: "12" },
{ name: "调值药(降脂药)", value: "13" },
{ name: "解热镇痛药(如布洛芬等)", value: "14" }
];
export const allergenArray = [ export const allergenArray = [
{"name":"青霉素","value": "1"},{"name":"磺胺类","value": "2"},{"name":"链霉素","value": "3"}, { name: "青霉素", value: "1" },
{"name":"头孢类","value": "4"},{"name":"鸡蛋","value": "5"},{"name":"牛奶","value": "6"}, { name: "磺胺类", value: "2" },
{"name":"海鲜","value": "7"},{"name":"花粉或尘螨","value": "8"},{"name":"粉尘","value": "9"}, { name: "链霉素", value: "3" },
{"name":"洗洁剂","value": "10"},{"name":"化妆品","value": "11"} { name: "头孢类", value: "4" },
] { name: "鸡蛋", value: "5" },
{ name: "牛奶", value: "6" },
{ name: "海鲜", value: "7" },
{ name: "花粉或尘螨", value: "8" },
{ name: "粉尘", value: "9" },
{ name: "洗洁剂", value: "10" },
{ name: "化妆品", value: "11" }
];
export const makeFoodTypeArray = [ export const makeFoodTypeArray = [
{"name":"居家做饭","value": "1"},{"name":"外卖食堂","value": "2"},{"name":"居家和外食","value": "3"},{"name":"国外饮食","value": "4"}, { name: "居家做饭", value: "1" },
{"name":"运动饮食","value": "5"} { name: "外卖食堂", value: "2" },
] { name: "居家和外食", value: "3" },
{ name: "国外饮食", value: "4" },
{ name: "运动饮食", value: "5" }
];
export const yesNoDict = { 0: "是", 1: "否" };
export const sexDict = { 0: "男", 1: "女" };
export const positionDict = { 0: "南方", 1: "北方" };
export const makeFoodTypeDict = { 0: "自己做", 1: "外面吃" };
export const makeFoodTasteDict = { 0: "清淡", 1: "重口味" };
export const walkDict = { 0: "久坐多", 1: "走动多" };
export const cookingStyleRateArray = ["煎", "炸", "卤", "腌", "腊", "煲"];
export const cookingStyleRateUnitArray = cookingStyleRateArray.map(() => "次");
export const drinksNumArray = [
"老火汤",
"咖啡",
"浓茶",
"奶茶",
"冷饮",
"碳酸饮料",
"甜饮料",
"鲜榨果汁"
];
export const drinksNumUnitArray = drinksNumArray.map(() => "次");
export const drinkWineAmountArray = ["白酒", "啤酒", "红酒"];
export const drinkWineAmountUnitArray = ["两", "瓶", "毫升"];
export const smokeRateArray = ["每天抽烟", "烟龄", "已戒烟"];
export const smokeRateUnitArray = ["次", "年", "年"];
//需要将数组转成字符串的属性名称,包含对象数组、字符串数组 //需要将数组转成字符串的属性名称,包含对象数组、字符串数组
export const arrayName = [ export const arrayName = [
"condiment","cookingStyle","cookingStyleRate", "washVegetablesStyle","lunchType","dinner","dietFlavor", "condiment",
"snacks","waterType","waterHabit","drinksNum","drinkWineClassify","drinkWineAmount","smokeRate", "cookingStyle",
"workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify", "cookingStyleRate",
"motionField","sleepQuality", "physicalSignsId","moistureDate","bloodData","familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen", "washVegetablesStyle",
"medicalReport","medicalReportName" "lunchType",
] "dinner",
"dietFlavor",
"snacks",
"waterType",
"waterHabit",
"drinksNum",
"drinkWineClassify",
"drinkWineAmount",
"smokeRate",
"workType",
"defecationTime",
"aerobicMotionClassify",
"anaerobicMotionClassify",
"anaerobicAerobicMotionClassify",
"motionField",
"sleepQuality",
"physicalSignsId",
"moistureDate",
"bloodData",
"familyIllnessHistory",
"operationHistory",
"longEatDrugClassify",
"allergen",
"medicalReport",
"medicalReportName"
];
//需要将数字下标转成中文含义的属性名 //需要将数字下标转成中文含义的属性名
export const needAttrName = [ export const needAttrName = [
"condiment","cookingStyle", "washVegetablesStyle","breakfastType","lunchType","dinner","dietFlavor","vegetablesRateType","dietHotAndCold", "condiment",
"fruitsTime","fruitsRate","eatingSpeed", "cookingStyle",
"snacks","waterType","waterHabit","drinkWineFlag","drinkWineClassify", "washVegetablesStyle",
"workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify", "breakfastType",
"motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen" "lunchType",
] "dinner",
"dietFlavor",
"vegetablesRateType",
"dietHotAndCold",
"fruitsTime",
"fruitsRate",
"eatingSpeed",
"snacks",
"waterType",
"waterHabit",
"drinkWineFlag",
"drinkWineClassify",
"workType",
"defecationTime",
"aerobicMotionClassify",
"anaerobicMotionClassify",
"anaerobicAerobicMotionClassify",
"motionField",
"sleepQuality",
"familyIllnessHistory",
"operationHistory",
"longEatDrugClassify",
"allergen"
];
export const needCombineName = [
"cookingStyleRate",
"drinksNum",
"drinkWineAmount",
"smokeRate"
];
export const yesNoName = [
"constipation",
"staylate",
"motion",
"night",
"weakness",
"rebound",
"crux",
"stayupLateFlag",
"nearOperationFlag",
"longEatDrugFlag",
"allergyFlag",
"smokeFlag",
"secondSmoke"
];
export const dictName = [
"sex",
"position",
"makeFoodType",
"makeFoodTaste",
"walk"
];
export const newLineName = ["bloodData", "moistureDate"];
export const bloodDataArray = [
{ value: "1", name: "1.体质虚弱,免疫力差" },
{ value: "2", name: "2.畏寒肢冷,自汗,头晕耳鸣" },
{ value: "3", name: "3.心悸气短,神疲乏力,气短懒言" },
{ value: "4", name: "4.失眠多梦,健忘,精神恍惚" },
{ value: "5", name: "5.面色淡白或萎黄,皮肤干燥,毛发枯萎" },
{ value: "6", name: "6.女性月经量少,延期或闭经" },
{ value: "7", name: "7.唇甲色淡,舌淡脉虚" }
];
export const moistureDateArray = [
{ value: "1", name: "1.体质虚弱,免疫力差" },
{ value: "2", name: "2.畏寒肢冷,自汗,头晕耳鸣" },
{ value: "3", name: "3.心悸气短,神疲乏力,气短懒言" },
{ value: "4", name: "4.失眠多梦,健忘,精神恍惚" },
{ value: "5", name: "5.面色淡白或萎黄,皮肤干燥,毛发枯萎" },
{ value: "6", name: "6.女性月经量少,延期或闭经" },
{ value: "7", name: "7.唇甲色淡,舌淡脉虚" }
];
const moduleObj = {
condimentArray,
cookingStyleArray,
washVegetablesStyleArray,
breakfastTypeArray,
lunchTypeArray,
dinnerArray,
dietHotAndColdArray,
dietFlavorArray,
vegetablesRateTypeArray,
fruitsTimeArray,
fruitsRateArray,
eatingSpeedArray,
snacksArray,
waterTypeArray,
waterHabitArray,
drinkWineFlagArray,
drinkWineClassifyArray,
workTypeArray,
defecationTimeArray,
aerobicMotionClassifyArray,
anaerobicMotionClassifyArray,
anaerobicAerobicMotionClassifyArray,
motionFieldArray,
sleepQualityArray,
familyIllnessHistoryArray,
operationHistoryArray,
longEatDrugClassifyArray,
allergenArray,
makeFoodTypeArray,
//
cookingStyleRateArray,
cookingStyleRateUnitArray,
drinksNumArray,
drinksNumUnitArray,
drinkWineAmountArray,
drinkWineAmountUnitArray,
smokeRateArray,
smokeRateUnitArray,
//
yesNoDict,
sexDict,
positionDict,
makeFoodTypeDict,
makeFoodTasteDict,
walkDict,
//
bloodDataArray,
moistureDateArray
};
//健康信息处理,将数组转为字符串
export function dealHealthy(customerHealthy) {
needAttrName.forEach(name => {
if (customerHealthy.hasOwnProperty(name)) {
customerHealthy[name] = (String(customerHealthy[name]) || "")
.split(",")
.map(val => {
const tarObj = moduleObj[`${name}Array`].find(
obj => obj.value === val
);
if (tarObj) {
return tarObj.name;
}
return "";
})
.join("");
}
});
needCombineName.forEach(name => {
if (customerHealthy.hasOwnProperty(name)) {
customerHealthy[name] = (String(customerHealthy[name]) || "")
.split(",")
.map((val, idx) => {
return `${moduleObj[`${name}Array`][idx]}${val}${
moduleObj[`${name}UnitArray`][idx]
}`;
})
.join("");
}
});
newLineName.forEach(name => {
if (customerHealthy.hasOwnProperty(name)) {
customerHealthy[name] = (String(customerHealthy[name]) || "")
.split(",")
.map(val => {
const tarObj = moduleObj[`${name}Array`].find(
obj => obj.value === val
);
if (tarObj) {
return tarObj.name;
}
return "";
})
.join("</br>");
}
});
yesNoName.forEach(name => {
if (customerHealthy.hasOwnProperty(name)) {
customerHealthy[name] = yesNoDict[customerHealthy[name]];
}
});
dictName.forEach(name => {
if (customerHealthy.hasOwnProperty(name)) {
customerHealthy[name] = moduleObj[`${name}Dict`][customerHealthy[name]];
}
});
if (customerHealthy.hasOwnProperty("tall")) {
customerHealthy.tall += "cm";
}
if (customerHealthy.hasOwnProperty("weight")) {
customerHealthy.weight += "斤";
}
if (customerHealthy.hasOwnProperty("vegetableRate")) {
customerHealthy.vegetableRate += "成";
}
if (customerHealthy.hasOwnProperty("stayupLateWeekNum")) {
customerHealthy.stayupLateWeekNum += "次/周";
}
if (customerHealthy.hasOwnProperty("riceFull")) {
customerHealthy.riceFull += "成";
}
if (customerHealthy.hasOwnProperty("connectTime")) {
customerHealthy.connectTime += "点";
}
if (customerHealthy.hasOwnProperty("sleepTime")) {
customerHealthy.sleepTime += "点";
}
if (customerHealthy.hasOwnProperty("getupTime")) {
customerHealthy.getupTime += "点";
}
if (customerHealthy.hasOwnProperty("signList")) {
customerHealthy.signStr = customerHealthy.signList
.map(obj => obj.name)
.join("");
}
return customerHealthy;
}

View File

@ -166,7 +166,7 @@
getList() { getList() {
this.loading = true; this.loading = true;
const dateRange = [dayjs(this.month).startOf('month').format('YYYY-MM-DD'), dayjs(this.month).endOf('month').format('YYYY-MM-DD')]; const dateRange = [dayjs(this.month).startOf('month').format('YYYY-MM-DD'), dayjs(this.month).endOf('month').format('YYYY-MM-DD')];
console.log(dateRange) // console.log(dateRange)
detailCommision(this.addDateRange(this.queryParams, dateRange)).then(response => { detailCommision(this.addDateRange(this.queryParams, dateRange)).then(response => {
this.commisionList = response.rows; this.commisionList = response.rows;
this.total = response.total; this.total = response.total;

View File

@ -215,7 +215,7 @@
getList() { getList() {
this.loading = true; this.loading = true;
const dateRange = [dayjs(this.month).startOf('month').format('YYYY-MM-DD'), dayjs(this.month).endOf('month').format('YYYY-MM-DD')]; const dateRange = [dayjs(this.month).startOf('month').format('YYYY-MM-DD'), dayjs(this.month).endOf('month').format('YYYY-MM-DD')];
console.log(dateRange) // console.log(dateRange)
detailDayCommision(this.addDateRange(this.queryParams, dateRange)).then(response => { detailDayCommision(this.addDateRange(this.queryParams, dateRange)).then(response => {
this.commisionList = response.rows; this.commisionList = response.rows;
this.total = response.total; this.total = response.total;

View File

@ -482,13 +482,13 @@ export default {
this.$refs["cusContractDrawerRef"].showDrawer(row); this.$refs["cusContractDrawerRef"].showDrawer(row);
}, },
handleOnBodySignClick(row) { handleOnBodySignClick(row) {
console.log(row); // console.log(row);
}, },
handleOnHealthSignClick(row) { handleOnHealthSignClick(row) {
this.$refs["physicalSignsDialogRef"].showDialog(row); this.$refs["physicalSignsDialogRef"].showDialog(row);
}, },
handleOnMenuClick(row) { handleOnMenuClick(row) {
console.log(row); // console.log(row);
}, },
// //
cancel() { cancel() {

View File

@ -169,12 +169,12 @@
<div class="drawer_content"> <div class="drawer_content">
<el-row class="content_detail"> <el-row class="content_detail">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-col span="24"> <el-col :span="24">
<el-form-item label="菜品名称" prop="name"> <el-form-item label="菜品名称" prop="name">
<el-input v-model="form.name" placeholder="请输入菜品名称" /> <el-input v-model="form.name" placeholder="请输入菜品名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="12"> <el-col :span="12">
<el-form-item label="菜品类型" prop="type"> <el-form-item label="菜品类型" prop="type">
<el-select <el-select
v-model="form.type" v-model="form.type"
@ -190,7 +190,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="12"> <el-col :span="12">
<el-form-item label="是否主食" prop="type"> <el-form-item label="是否主食" prop="type">
<el-radio-group v-model="form.isMain"> <el-radio-group v-model="form.isMain">
<el-radio :label="0"></el-radio> <el-radio :label="0"></el-radio>
@ -198,7 +198,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="24"> <el-col :span="24">
<el-form-item label="食材" prop="ingIds"> <el-form-item label="食材" prop="ingIds">
<el-transfer <el-transfer
style="text-align: left; display: inline-block" style="text-align: left; display: inline-block"
@ -237,7 +237,7 @@
</el-transfer> </el-transfer>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="24"> <el-col :span="24">
<el-form-item label="分量" prop="weight"> <el-form-item label="分量" prop="weight">
<el-table <el-table
:data="selTableData" :data="selTableData"
@ -258,7 +258,7 @@
step="0.5" step="0.5"
:min="0.5" :min="0.5"
/> --> /> -->
<el-select size="mini" v-model="scope.row.cusWei"> <el-select size="mini" v-model="scope.row.cusWeight">
<el-option <el-option
v-for="dict in cusWeightOptions" v-for="dict in cusWeightOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -286,7 +286,7 @@
controls-position="right" controls-position="right"
@change="handleInputChange" @change="handleInputChange"
:min="0" :min="0"
step="50" :step="50"
/> />
</template> </template>
</el-table-column> </el-table-column>
@ -301,7 +301,7 @@
</el-table> </el-table>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="24"> <el-col :span="24">
<el-form-item label="推荐人群"> <el-form-item label="推荐人群">
<el-tag <el-tag
style="margin-right: 4px" style="margin-right: 4px"
@ -313,7 +313,7 @@
</el-tag> </el-tag>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="24"> <el-col :span="24">
<el-form-item label="忌口人群"> <el-form-item label="忌口人群">
<el-tag <el-tag
style="margin-right: 4px" style="margin-right: 4px"
@ -325,7 +325,7 @@
</el-tag> </el-tag>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="24"> <el-col :span="24">
<el-form-item label="审核状态" prop="reviewStatus"> <el-form-item label="审核状态" prop="reviewStatus">
<el-select <el-select
v-model="form.reviewStatus" v-model="form.reviewStatus"
@ -341,7 +341,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="24"> <el-col :span="24">
<el-form-item label="做法" prop="methods"> <el-form-item label="做法" prop="methods">
<el-input <el-input
v-model="form.methods" v-model="form.methods"
@ -485,7 +485,7 @@ export default {
notRecTags, notRecTags,
}; };
}); });
console.log(this.dishesList); // console.log(this.dishesList);
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
@ -502,7 +502,7 @@ export default {
return this.selectDictLabel(this.cusUnitOptions, row.type); return this.selectDictLabel(this.cusUnitOptions, row.type);
}, },
cusWeightFormat(row, column) { cusWeightFormat(row, column) {
return this.selectDictLabel(this.cusWeightOptions, row.cusWei); return this.selectDictLabel(this.cusWeightOptions, row.cusWeight);
}, },
// //
reviewStatusFormat(row, column) { reviewStatusFormat(row, column) {
@ -597,7 +597,7 @@ export default {
listAllIngredient({ type: this.ingType }).then((res) => { listAllIngredient({ type: this.ingType }).then((res) => {
this.open = true; this.open = true;
this.title = "修改菜品"; this.title = "修改菜品";
this.oriDataList = res.rows; this.oriDataList = res.rows.concat(this.form.igdList);
this.ingDataList = this.oriDataList.reduce((arr, cur) => { this.ingDataList = this.oriDataList.reduce((arr, cur) => {
if (!arr.some(({ key }) => key === cur.id)) { if (!arr.some(({ key }) => key === cur.id)) {
arr.push({ arr.push({
@ -606,7 +606,7 @@ export default {
}); });
} }
return arr; return arr;
}, this.selIngList.slice()); }, []);
}); });
}); });
}, },
@ -614,10 +614,15 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.form.igdList = this.selTableData; if (!this.selTableData.length) {
this.form.type = this.form.type.join(","); this.$message.error("食材不能为空");
if (this.form.id != null) { return;
updateDishes(this.form).then((response) => { }
const data = JSON.parse(JSON.stringify(this.form));
data.igdList = this.selTableData;
data.type = data.type.join(",");
if (data.id != null) {
updateDishes(data).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -625,7 +630,7 @@ export default {
} }
}); });
} else { } else {
addDishes(this.form).then((response) => { addDishes(data).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -670,7 +675,13 @@ export default {
.catch(function () {}); .catch(function () {});
}, },
handleChange(value, direction, movedKeys) { handleChange(value, direction, movedKeys) {
// console.log({oriIgdList: this.oriDataList, selIgdList: this.form.igdList}); console.log({
oriIgdList: this.oriDataList,
selIgdList: this.form.igdList,
ingDataList: this.ingDataList,
value,
ingType: this.ingType,
});
const newTableData = []; const newTableData = [];
this.selRec = []; this.selRec = [];
this.selNotRec = []; this.selNotRec = [];
@ -686,7 +697,7 @@ export default {
newTableData.push({ newTableData.push({
...tmpTableObj, ...tmpTableObj,
weight: 100, weight: 100,
cusWei: 1, cusWeight: 1,
cusUnit: 1, cusUnit: 1,
}); });
} }
@ -714,7 +725,7 @@ export default {
}, },
handleOnTypeChange(value) { handleOnTypeChange(value) {
listAllIngredient({ type: value }).then((res) => { listAllIngredient({ type: value }).then((res) => {
this.oriDataList = res.rows; this.oriDataList = res.rows.concat(this.form.igdList);
this.ingDataList = this.oriDataList.reduce((arr, cur) => { this.ingDataList = this.oriDataList.reduce((arr, cur) => {
if (!arr.some(({ key }) => key === cur.id)) { if (!arr.some(({ key }) => key === cur.id)) {
arr.push({ arr.push({
@ -723,11 +734,11 @@ export default {
}); });
} }
return arr; return arr;
}, this.selIngList.slice()); }, []);
}); });
}, },
handleInputChange(val) { handleInputChange(val) {
console.log({ val, table: this.selTableData }); // console.log({ val, table: this.selTableData });
}, },
getSummaries(param) { getSummaries(param) {
const { columns, data } = param; const { columns, data } = param;
@ -755,80 +766,85 @@ export default {
}, },
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss">
<style > #el-drawer__title {
/** & > span:focus {
/deep/ :focus {
outline: 0; outline: 0;
} }
*/ }
.el-transfer-panel__filter { .el-transfer-panel__filter {
margin: 2px; margin: 2px;
} }
.el-transfer-panel__list.is-filterable {
padding-bottom: 28px;
}
.cus-unit { .cus-unit {
display: inline-flex; display: inline-flex;
} .el-input-number--mini {
.cus-unit .el-input-number--mini {
width: 38px; width: 38px;
} }
.cus-unit .el-input-number .el-input-number__decrease { .el-input-number {
.el-input-number__decrease {
display: none;
}
.el-input-number__increase {
display: none; display: none;
} }
.cus-unit .el-input-number .el-input-number__increase { .el-input {
display: none;
}
.cus-unit .el-input-number .el-input {
width: 38px; width: 38px;
} }
.cus-unit .el-input-number .el-input .el-input__inner { .el-input .el-input__inner {
padding: 0; padding: 0;
border-radius: 0; border-radius: 0;
border: unset; border: unset;
border-bottom: 1px solid #dcdfe6; border-bottom: 1px solid #dcdfe6;
} }
}
.cus-unit .el-select .el-input__suffix { .el-select {
.el-input__suffix {
display: none; display: none;
} }
.cus-unit .el-select .el-input__inner { .el-input__inner {
padding: 0 4px; padding: 0 4px;
/* border: unset; */ /* border: unset; */
text-align: center; text-align: center;
} }
}
}
.weight { .weight {
width: 70px; width: 70px;
}
.weight .el-input .el-input__inner { .el-input .el-input__inner {
padding: 0 32px 0 4px; padding: 0 32px 0 4px;
} }
}
.drawer_content { .drawer_content {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
}
.drawer_content .content_detail { .content_detail {
flex: 1 1 0; flex: 1 1 0;
padding: 12px; padding: 12px;
overflow: auto; overflow: auto;
} }
.drawer_content .dialog-footer { .dialog-footer {
flex: 0 0 45px; flex: 0 0 45px;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
padding: 0 12px; padding: 0 12px;
} }
}
</style> </style>

View File

@ -703,7 +703,7 @@
detailHealthy.condiment += detailHealthy.otherCondiment ? (""+detailHealthy.otherCondiment) : ""; detailHealthy.condiment += detailHealthy.otherCondiment ? (""+detailHealthy.otherCondiment) : "";
// //
let cookingStyleRate = ""; let cookingStyleRate = "";
console.log(detailHealthy.cookingStyleRate); // console.log(detailHealthy.cookingStyleRate);
if(detailHealthy.cookingStyleRate != null){ if(detailHealthy.cookingStyleRate != null){
detailHealthy.cookingStyleRate.split(",").forEach(function(item, index){ detailHealthy.cookingStyleRate.split(",").forEach(function(item, index){
cookingStyleRate += (cookingStyleRate != "" ? "" : "") + (healthyData["cookingStyleRateArray"][index])+item +"次"; cookingStyleRate += (cookingStyleRate != "" ? "" : "") + (healthyData["cookingStyleRateArray"][index])+item +"次";

View File

@ -365,7 +365,7 @@ export default {
}, },
methods: { methods: {
onSubmit() { onSubmit() {
console.log("submit!"); // console.log("submit!");
}, },
/** 查询体征列表 */ /** 查询体征列表 */
getPhysicalSignsList() { getPhysicalSignsList() {
@ -402,7 +402,7 @@ export default {
cusMessage.connectTime = cusMessage.connectTime.substring(0, 2); cusMessage.connectTime = cusMessage.connectTime.substring(0, 2);
addCustomer(cusMessage).then((response) => { addCustomer(cusMessage).then((response) => {
if (response.code === 200) { if (response.code === 200) {
console.log("成功"); // console.log("");
this.$notify({ this.$notify({
title: "提交成功", title: "提交成功",
message: "", message: "",
@ -439,7 +439,7 @@ export default {
}, },
beforeCreate() { beforeCreate() {
document.title = this.$route.meta.title; document.title = this.$route.meta.title;
console.log(this.$route.meta.title); // console.log(this.$route.meta.title);
}, },
}; };
</script> </script>

View File

@ -705,10 +705,10 @@ export default {
.catch(function () {}); .catch(function () {});
}, },
handleStatusClick(data) { handleStatusClick(data) {
console.log(data); // console.log(data);
}, },
orderPauseManage(order) { orderPauseManage(order) {
console.log(order.orderId); // console.log(order.orderId);
this.pauseTitle = order.customer; this.pauseTitle = order.customer;
this.orderPauseId = order.orderId; this.orderPauseId = order.orderId;
this.openPause = true; this.openPause = true;

View File

@ -316,7 +316,7 @@
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
console.log(this.queryParams.pauseStartDate); // console.log(this.queryParams.pauseStartDate);
//this.getList(); //this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
@ -356,7 +356,7 @@
if (valid) { if (valid) {
this.form.pauseStartDate = dayjs(this.dateScope[0]).format("YYYY-MM-DD"); this.form.pauseStartDate = dayjs(this.dateScope[0]).format("YYYY-MM-DD");
this.form.pauseEndDate = dayjs(this.dateScope[1]).format("YYYY-MM-DD"); this.form.pauseEndDate = dayjs(this.dateScope[1]).format("YYYY-MM-DD");
console.log(this.form.pauseStartDate + "-" + this.form.pauseEndDate); // console.log(this.form.pauseStartDate + "-" + this.form.pauseEndDate);
if (this.form.id != null) { if (this.form.id != null) {
updatePause(this.form).then(response => { updatePause(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {

View File

@ -0,0 +1,87 @@
<template>
<div>
<div>
<h2>{{ this.data.name }}</h2>
<div class="msg-info" v-for="(info, idx) in basicInfo" :key="idx">
<text-info
v-for="con in info"
:title="con.title"
:key="con.title"
:value="data[con.value]"
extraclass="text-info-extra"
/>
</div>
</div>
</div>
</template>
<script>
import TextInfo from "./TextInfo.vue";
export default {
name: "BodySignView",
props: ["data"],
components: {
"text-info": TextInfo,
},
data() {
return {
basicInfo: [
[
{ title: "性别", value: "sex" },
{ title: "年龄", value: "age" },
],
[
{ title: "电话", value: "phone" },
{ title: "地域", value: "position" },
],
[
{ title: "身高", value: "tall" },
{ title: "体重", value: "weight" },
],
[
{ title: "工作职业", value: "vocation" },
{ title: "上夜班", value: "night" },
],
[
{ title: "熬夜失眠", value: "staylate" },
{ title: "运动情况", value: "walk" },
],
[
{ title: "浑身乏力", value: "weakness" },
{ title: "经常运动", value: "motion" },
],
[
{ title: "睡觉时间", value: "sleepTime" },
{ title: "起床时间", value: "getupTime" },
],
[
{ title: "饮食方式", value: "makeFoodType" },
{ title: "饮食特点", value: "makeFoodTaste" },
],
[{ title: "便秘", value: "constipation" }],
[{ title: "饮食备注", value: "remarks" }],
[{ title: "减脂反弹", value: "rebound" }],
[{ title: "意识到生活习惯是减脂关键", value: "crux" }],
[{ title: "减脂遇到的困难", value: "difficulty" }],
[{ title: "湿气数据", value: "moistureDate" }],
[{ title: "气血数据", value: "bloodData" }],
[{ title: "病史", value: "signStr" }],
[{ title: "忌口或过敏源", value: "dishesIngredientId" }],
[{ title: "方便沟通时间", value: "connectTime" }],
[{ title: "备注", value: "remark" }],
],
};
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.msg-info {
display: flex;
margin-bottom: 8px;
.text-info-extra {
margin-bottom: 2px;
}
}
</style>

View File

@ -0,0 +1,193 @@
<template>
<div>
<div>
<h2>{{ this.data.name }}</h2>
<div class="msg-info" v-for="(info, idx) in basicInfo" :key="idx">
<text-info
v-for="con in info"
:title="con.title"
:key="con.title"
:value="data[con.value]"
extraclass="text-info-extra"
/>
</div>
</div>
<el-collapse>
<el-collapse-item
v-for="item in healthyInvestigate"
:key="item.title"
:title="item.title"
:name="item.title"
>
<div v-for="con in item.content" :key="con.value">
<text-info
:title="con.title"
:value="data[con.value]"
extraclass="text-info-extra"
/>
</div>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script>
import TextInfo from "./TextInfo.vue";
export default {
name: "HealthyView",
props: ["data"],
components: {
"text-info": TextInfo,
},
data() {
return {
basicInfo: [
[
{ title: "调理项目", value: "conditioningProject" },
{ title: "电话", value: "phone" },
],
[
{ title: "性别", value: "sex" },
{ title: "年龄", value: "age" },
],
[
{ title: "身高", value: "tall" },
{ title: "体重", value: "weight" },
],
[{ title: "地域", value: "position" }],
[{ title: "备注", value: "remark" }],
],
healthyInvestigate: [
{
title: "减脂经历评估",
content: [
{ title: "减脂经历", value: "experience" },
{ title: "减肥遇到的困难", value: "difficulty" },
{ title: "减脂是否反弹", value: "rebound" },
{ title: "是否意识到生活习惯是减脂关键", value: "crux" },
],
},
{
title: "食品安全评估",
content: [
{ title: "调味品种", value: "condiment" },
{ title: "烹调方式", value: "cookingStyle" },
{ title: "烹调频次", value: "cookingStyleRate" },
{ title: "洗菜方式", value: "washVegetablesStyle" },
],
},
{
title: "饮食结构评估",
content: [
{ title: "早餐习惯", value: "breakfastType" },
{ title: "早餐吃的食物", value: "breakfastFood" },
{ title: "午餐习惯", value: "lunchType" },
{ title: "晚餐习惯", value: "dinner" },
{ title: "正餐中素菜占比", value: "vegetableRate" },
{ title: "最常吃的肉类", value: "commonMeat" },
{ title: "晚餐时间", value: "dinnerTime" },
{ title: "每周吃夜宵次数", value: "supperNum" },
{ title: "夜宵通常吃的食物", value: "supperFood" },
{ title: "食物的冷热偏好", value: "dietHotAndCold" },
{ title: "食物的口味偏好", value: "dietFlavor" },
{ title: "平均每周吃生蔬菜几次", value: "vegetablesNum" },
{ title: "每周吃生蔬菜的频次类型", value: "vegetablesRateType" },
{ title: "平均每天吃水果次数", value: "fruitsNum" },
{ title: "吃水果的时间段", value: "fruitsTime" },
{ title: "平时吃水果的频次", value: "fruitsRate" },
{ title: "一餐吃几碗饭", value: "riceNum" },
{ title: "吃几成饱", value: "riceFull" },
{ title: "吃饭速度", value: "eatingSpeed" },
{ title: "饮食特点", value: "makeFoodType" },
{ title: "常吃的零食", value: "snacks" },
{ title: "有无服用营养保健品", value: "healthProductsFlag" },
{ title: "营养保健品品牌名", value: "healthProductsBrand" },
{ title: "营养保健品产品名", value: "healthProductsName" },
{ title: "服用营养保健品频次", value: "healthProductsWeekRate" },
{ title: "忌口过敏食物", value: "dishesIngredient" },
],
},
{
title: "生活习惯评估",
content: [
{ title: "每天的饮水量", value: "waterNum" },
{ title: "喜欢喝什么水", value: "waterType" },
{ title: "喝水习惯", value: "waterHabit" },
{ title: "常喝的饮品的每周频次", value: "drinksNum" },
{ title: "是否喝酒", value: "drinkWineFlag" },
{ title: "喝酒种类", value: "drinkWineClassify" },
{ title: "对应酒的量", value: "drinkWineAmount" },
{ title: "是否抽烟", value: "smokeFlag" },
{ title: "抽烟频次和烟龄", value: "smokeRate" },
{ title: "是否经常抽二手烟", value: "secondSmoke" },
{ title: "工作行业", value: "workIndustry" },
{ title: "工作性质", value: "workType" },
{ title: "排便次数", value: "defecationNum" },
{ title: "排便时间段", value: "defecationTime" },
{ title: "排便的形状", value: "defecationShape" },
{ title: "排便的气味", value: "defecationSmell" },
{ title: "排便的速度", value: "defecationSpeed" },
{ title: "排便的颜色", value: "defecationColor" },
],
},
{
title: "运动习惯评估",
content: [
{ title: "每周运动次数", value: "motionNum" },
{ title: "每次运动的时长", value: "motionDuration" },
{ title: "每天运动的时间", value: "motionTime" },
{ title: "运动", value: "motion" },
{ title: "运动场地", value: "motionField" },
],
},
{
title: "睡眠质量评估",
content: [
{ title: "睡觉时间", value: "sleepTime" },
{ title: "睡眠质量", value: "sleepQuality" },
{ title: "是否有辅助入睡药物", value: "sleepDrugFlag" },
{ title: "辅助睡眠类药物名称", value: "sleepDrug" },
{ title: "是否经常熬夜", value: "stayupLateFlag" },
{ title: "熬夜频次", value: "stayupLateWeekNum" },
],
},
{
title: "既往病史/用药史评估",
content: [
{ title: "病史体征", value: "physicalSigns" },
{ title: "湿气数据", value: "moistureDate" },
{ title: "气血数据", value: "bloodData" },
{ title: "家族疾病史", value: "familyIllnessHistory" },
{ title: "手术史", value: "operationHistory" },
{ title: "近期是否做过手术", value: "nearOperationFlag" },
{ title: "手术恢复情况", value: "recoveryeSituation" },
{ title: "是否长期服用药物", value: "longEatDrugFlag" },
{ title: "长期服用的药物", value: "longEatDrugClassify" },
{ title: "是否出现过过敏症状", value: "allergyFlag" },
{ title: "过敏症状", value: "allergySituation" },
{ title: "过敏源", value: "allergen" },
],
},
{
title: "体检报告",
content: [
{ title: "体检报告1", value: "medicalReport_one" },
{ title: "体检报告2", value: "medicalReport_two" },
{ title: "体检报告3", value: "medicalReport_three" },
],
},
],
};
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.msg-info {
display: flex;
margin-bottom: 8px;
.text-info-extra {
margin-bottom: 2px;
}
}
</style>

View File

@ -0,0 +1,17 @@
<template>
<div>
<RecipesCom v-for="item in data" :key="item.id" :data="item" />
</div>
</template>
<script>
import RecipesCom from "@/components/RecipesCom";
export default {
name: "RecipesView",
components: {
RecipesCom,
},
props: ["data"],
};
</script>
<style rel="stylesheet/scss" lang="scss">
</style>

View File

@ -0,0 +1,52 @@
<template>
<div :class="classname">
<span class="title">{{ title }}</span>
<span v-if="newLine">
<div v-for="value in mValue" :key="value">{{ value }}</div>
</span>
<span v-else class="value">{{ mValue }}</span>
</div>
</template>
<script>
export default {
name: "TextInfo",
data() {
return {
classname: `text_info_wrapper ${this.extraclass || ""}`,
newLine: false,
};
},
computed: {
mValue: function () {
if (
this.value &&
typeof this.value === "string" &&
this.value.includes("</br>")
) {
this.newLine = true;
return this.value.split("</br>");
}
return this.value;
},
},
props: ["title", "value", "extraclass"],
};
</script>
<style rel="stylesheet/scss" lang="scss">
.text_info_wrapper {
display: flex;
margin-right: 24px;
min-width: 120px;
font-size: 14px;
.title {
color: #8c8c8c;
width: auto;
}
.value {
/* color: #696969; */
flex: 1 1 0;
}
}
</style>

View File

@ -0,0 +1,80 @@
<template>
<div class="app-container">
<div class="content">
<div class="left">
<RecipesView :data="recipesData" />
</div>
<div class="right">
<HealthyView :data="healthyData" v-if="healthyDataType === 0" />
<BodySignView :data="healthyData" v-else />
</div>
</div>
</div>
</template>
<script>
import { createNamespacedHelpers } from "vuex";
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
"recipes"
);
import HealthyView from "./HealthyView";
import BodySignView from "./BodySignView";
import RecipesView from "./RecipesView";
export default {
name: "BuildRecipies",
data() {
return {};
},
mounted() {
//
// console.log({
// cusId: this.cusId,
// recipesId: this.recipesId,
// });
this.init({ cusId: this.cusId, recipesId: this.recipesId }).catch((err) => {
this.$message.error(err.message);
});
},
destroyed() {
this.clean();
},
created() {},
components: {
HealthyView,
BodySignView,
RecipesView,
},
props: ["planId", "cusId", "recipesId"],
computed: {
...mapState({
healthyData: (state) => state.healthyData,
healthyDataType: (state) => state.healthyDataType,
recipesData: (state) => state.recipesData,
}),
},
methods: {
...mapActions(["init"]),
...mapMutations(["clean"]),
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.content {
display: flex;
height: calc(100vh - 124px);
.left {
flex: 4;
border-right: 1px solid #e6ebf5;
height: 100%;
overflow: auto;
}
.right {
flex: 1;
height: 100%;
padding-left: 20px;
overflow: auto;
}
}
</style>

View File

@ -1,6 +1,11 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"> <el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
>
<el-form-item label="客户信息" prop="customer"> <el-form-item label="客户信息" prop="customer">
<el-input <el-input
v-model="queryParams.customer" v-model="queryParams.customer"
@ -9,17 +14,27 @@
size="small" size="small"
/> />
</el-form-item> </el-form-item>
<el-form-item label="食谱开始日期范围" prop="planStartDateScope" label-width="130px"> <el-form-item
label="食谱开始日期范围"
prop="planStartDateScope"
label-width="130px"
>
<el-date-picker <el-date-picker
v-model="planStartDateScope" v-model="planStartDateScope"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="营养师" prop="nutritionistId"> <el-form-item label="营养师" prop="nutritionistId">
<el-select v-model="queryParams.nutritionistId" placeholder="请选择营养师" clearable size="small"> <el-select
v-model="queryParams.nutritionistId"
placeholder="请选择营养师"
clearable
size="small"
>
<el-option <el-option
v-for="dict in nutritionistIdOptions" v-for="dict in nutritionistIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -29,7 +44,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="营养师助理" prop="nutritionistAssisId"> <el-form-item label="营养师助理" prop="nutritionistAssisId">
<el-select v-model="queryParams.nutritionistAssisId" placeholder="请选择营养师助理" clearable size="small"> <el-select
v-model="queryParams.nutritionistAssisId"
placeholder="请选择营养师助理"
clearable
size="small"
>
<el-option <el-option
v-for="dict in nutriAssisIdOptions" v-for="dict in nutriAssisIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -39,14 +59,25 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> type="cyan"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div><span style="color:#E6A23C;font-family:PingFang SC"> <div>
<span style="color: #e6a23c; font-family: PingFang SC">
注意事项 注意事项
<br/>12021年1月开始的订单才会自动生成食谱计划</span></div> <br />12021年1月开始的订单才会自动生成食谱计划</span
<el-row :gutter="10" class="mb8" style="margin-top:10px;"> >
</div>
<el-row :gutter="10" class="mb8" style="margin-top: 10px">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="success" type="success"
@ -69,35 +100,64 @@
</el-button> </el-button>
</el-col> </el-col>
<!--<div><span style="margin-left:10px;font-size:16px;color:#E6A23C;font-family:PingFang SC">备注2021年1月开始的订单才会自动生成食谱计划</span></div>--> <!--<div><span style="margin-left:10px;font-size:16px;color:#E6A23C;font-family:PingFang SC">备注2021年1月开始的订单才会自动生成食谱计划</span></div>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="recipesPlanList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="recipesPlanList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="客户姓名" align="center" prop="customer" /> <el-table-column label="客户姓名" align="center" prop="customer" />
<el-table-column label="客户手机号" align="center" prop="hidePhone" width="180"/> <el-table-column
<el-table-column label="食谱日期范围" align="center" prop="scopeDate" width="200"/> label="客户手机号"
align="center"
prop="hidePhone"
width="180"
/>
<el-table-column
label="食谱日期范围"
align="center"
prop="scopeDate"
width="200"
/>
<el-table-column label="营养师" align="center" prop="nutritionist" /> <el-table-column label="营养师" align="center" prop="nutritionist" />
<el-table-column label="营养师助理" align="center" prop="nutritionistAssis" width="180"/> <el-table-column
label="营养师助理"
align="center"
prop="nutritionistAssis"
width="180"
/>
<el-table-column label="是否发送" align="center" prop="sendFlag"> <el-table-column label="是否发送" align="center" prop="sendFlag">
<!--<template slot-scope="scope"> <!--<template slot-scope="scope">
<span>{{ scope.row.sendFlag == 1 ? "已发送" : "未发送"}}</span> <span>{{ scope.row.sendFlag == 1 ? "已发送" : "未发送"}}</span>
</template>(.sendFlag == 1) ? 'success' : 'warning'--> </template>(.sendFlag == 1) ? 'success' : 'warning'-->
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag <el-tag :type="getTagType(scope.row)" disable-transitions>
:type="getTagType(scope.row)"
disable-transitions>
{{ scope.row.sendFlag == 1 ? "已发送" : "未发送" }} {{ scope.row.sendFlag == 1 ? "已发送" : "未发送" }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="食谱发送时间" align="center" prop="sendTime" width="180"> <el-table-column
label="食谱发送时间"
align="center"
prop="sendTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.sendTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.sendTime, "{y}-{m}-{d}") }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300"> <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="300"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -111,7 +171,10 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="allRecipesPlanQueryParam.orderId = scope.row.orderId; getAllPlanByOrderId()" @click="
allRecipesPlanQueryParam.orderId = scope.row.orderId;
getAllPlanByOrderId();
"
>查看完整计划 >查看完整计划
</el-button> </el-button>
<el-button <el-button
@ -130,13 +193,13 @@
v-hasPermi="['custom:customer:query']" v-hasPermi="['custom:customer:query']"
>查看体征 >查看体征
</el-button> </el-button>
<!--<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-edit"
@click="handleDelete(scope.row)" @click="handleBuild(scope.row)"
v-hasPermi="['recipes:recipesPlan:remove']" >{{ `${scope.row.recipes_id ? "编辑" : "制作"}食谱` }}</el-button
>删除</el-button>--> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -152,7 +215,11 @@
<!-- 添加或修改食谱计划对话框 --> <!-- 添加或修改食谱计划对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="食谱是否已发送" prop="sendFlag" label-width="120px"> <el-form-item
label="食谱是否已发送"
prop="sendFlag"
label-width="120px"
>
<el-select v-model="form.sendFlag" placeholder="请选择"> <el-select v-model="form.sendFlag" placeholder="请选择">
<el-option label="否" :value="parseInt('0')" /> <el-option label="否" :value="parseInt('0')" />
<el-option label="是" :value="parseInt('1')" /> <el-option label="是" :value="parseInt('1')" />
@ -166,17 +233,36 @@
</el-dialog> </el-dialog>
<!-- 查看完整计划 --> <!-- 查看完整计划 -->
<el-dialog title="食谱计划表" v-if="allRecipesPlanOpen" :visible.sync="allRecipesPlanOpen" width="800px" append-to-body> <el-dialog
<el-form :model="allRecipesPlanQueryParam" ref="allPlanQueryFrom" :inline="true"> title="食谱计划表"
v-if="allRecipesPlanOpen"
:visible.sync="allRecipesPlanOpen"
width="800px"
append-to-body
>
<el-form
:model="allRecipesPlanQueryParam"
ref="allPlanQueryFrom"
:inline="true"
>
<el-form-item label="发送状态" prop="sendFlag"> <el-form-item label="发送状态" prop="sendFlag">
<el-select v-model="allRecipesPlanQueryParam.sendFlag" placeholder="请选择"> <el-select
v-model="allRecipesPlanQueryParam.sendFlag"
placeholder="请选择"
>
<el-option label="全部" :value="null" /> <el-option label="全部" :value="null" />
<el-option label="未发送" :value="parseInt('0')" /> <el-option label="未发送" :value="parseInt('0')" />
<el-option label="已发送" :value="parseInt('1')" /> <el-option label="已发送" :value="parseInt('1')" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="getAllPlanByOrderId()">搜索</el-button> <el-button
type="cyan"
icon="el-icon-search"
size="mini"
@click="getAllPlanByOrderId()"
>搜索</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -185,23 +271,30 @@
<!--<el-table-column label="营养师名称" align="center" prop="nutritionist" /> <!--<el-table-column label="营养师名称" align="center" prop="nutritionist" />
<el-table-column label="营养师助理名称" align="center" prop="nutritionistAssis" />--> <el-table-column label="营养师助理名称" align="center" prop="nutritionistAssis" />-->
<el-table-column label="食谱时间范围" align="center" prop="scopeDate" width="250"/> <el-table-column
label="食谱时间范围"
align="center"
prop="scopeDate"
width="250"
/>
<el-table-column label="食谱是否发送" align="center" prop="sendFlag"> <el-table-column label="食谱是否发送" align="center" prop="sendFlag">
<!--<template slot-scope="scope"> <!--<template slot-scope="scope">
<span>{{ scope.row.sendFlag == 1 ? "已发送" : "未发送"}}</span> <span>{{ scope.row.sendFlag == 1 ? "已发送" : "未发送"}}</span>
</template>(.sendFlag == 1) ? 'success' : 'warning'--> </template>(.sendFlag == 1) ? 'success' : 'warning'-->
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag <el-tag :type="getTagType(scope.row)" disable-transitions>
:type="getTagType(scope.row)"
disable-transitions>
{{ scope.row.sendFlag == 1 ? "已发送" : "未发送" }} {{ scope.row.sendFlag == 1 ? "已发送" : "未发送" }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="食谱发送时间" align="center" prop="sendTime" width="180"> <el-table-column
label="食谱发送时间"
align="center"
prop="sendTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.sendTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.sendTime, "{y}-{m}-{d}") }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -225,15 +318,20 @@
</template> </template>
<script> <script>
import {exportRecipesPlan, getRecipesPlan, listRecipesPlan, updateRecipesPlan} from "@/api/custom/recipesPlan"; import {
exportRecipesPlan,
getRecipesPlan,
listRecipesPlan,
updateRecipesPlan,
} from "@/api/custom/recipesPlan";
import { getOptions } from "@/api/custom/order"; import { getOptions } from "@/api/custom/order";
import OrderDetail from '@/components/OrderDetail'; import OrderDetail from "@/components/OrderDetail";
import BodySignDetail from '@/components/BodySignDetail'; import BodySignDetail from "@/components/BodySignDetail";
import dayjs from 'dayjs'; import dayjs from "dayjs";
import store from "@/store"; import store from "@/store";
const nextDate = dayjs().add(1, 'day').format("YYYY-MM-DD"); const nextDate = dayjs().add(1, "day").format("YYYY-MM-DD");
const weekDate = dayjs().add(6, 'day').format("YYYY-MM-DD"); const weekDate = dayjs().add(6, "day").format("YYYY-MM-DD");
const userId = store.getters && store.getters.userId; const userId = store.getters && store.getters.userId;
export default { export default {
name: "recipesPlan", name: "recipesPlan",
@ -266,7 +364,7 @@
startDate: null, startDate: null,
endDate: null, endDate: null,
nutritionistId: null, nutritionistId: null,
nutritionistAssisId: null nutritionistAssisId: null,
}, },
// //
form: {}, form: {},
@ -283,7 +381,7 @@
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
orderId: null, orderId: null,
sendFlag: 0 sendFlag: 0,
}, },
// //
allRecipesPlanTotal: 0, allRecipesPlanTotal: 0,
@ -292,25 +390,34 @@
// //
nutriAssisIdOptions: [], nutriAssisIdOptions: [],
}; };
}, },
components: { components: {
"order-dialog": OrderDetail, "order-dialog": OrderDetail,
"body_sign_dialog": BodySignDetail body_sign_dialog: BodySignDetail,
}, },
created() { created() {
getOptions().then(response => { getOptions().then((response) => {
const options = response.data.reduce((opts, cur) => { const options = response.data.reduce((opts, cur) => {
if (!opts[cur.postCode]) { if (!opts[cur.postCode]) {
opts[cur.postCode] = [{dictValue: null, dictLabel: '全部', remark: null}]; opts[cur.postCode] = [
{ dictValue: null, dictLabel: "全部", remark: null },
];
} }
opts[cur.postCode].push({dictValue: cur.userId, dictLabel: cur.userName, remark: cur.remark}) opts[cur.postCode].push({
dictValue: cur.userId,
dictLabel: cur.userName,
remark: cur.remark,
});
return opts; return opts;
}, {}) }, {});
this.nutritionistIdOptions = options['nutri'] || []; this.nutritionistIdOptions = options["nutri"] || [];
this.nutriAssisIdOptions = options['nutri_assis'] || []; this.nutriAssisIdOptions = options["nutri_assis"] || [];
const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.dictValue == userId); const defaultNutritionist = this.nutritionistIdOptions.find(
const defaultNutriAssisId = this.nutriAssisIdOptions.find(opt => opt.dictValue == userId); (opt) => opt.dictValue == userId
);
const defaultNutriAssisId = this.nutriAssisIdOptions.find(
(opt) => opt.dictValue == userId
);
if (defaultNutritionist) { if (defaultNutritionist) {
this.queryParams.nutritionistId = userId; this.queryParams.nutritionistId = userId;
} }
@ -318,23 +425,33 @@
this.queryParams.nutritionistAssisId = userId; this.queryParams.nutritionistAssisId = userId;
} }
this.getList(); this.getList();
}) });
}, },
methods: { methods: {
/** 查询食谱计划列表 */ /** 查询食谱计划列表 */
getList() { getList() {
this.loading = true; this.loading = true;
if (this.planStartDateScope != null && this.planStartDateScope.length > 0) { if (
this.queryParams.startDate = dayjs(this.planStartDateScope[0]).format('YYYY-MM-DD'); this.planStartDateScope != null &&
this.queryParams.endDate = dayjs(this.planStartDateScope[1]).format('YYYY-MM-DD'); this.planStartDateScope.length > 0
) {
this.queryParams.startDate = dayjs(this.planStartDateScope[0]).format(
"YYYY-MM-DD"
);
this.queryParams.endDate = dayjs(this.planStartDateScope[1]).format(
"YYYY-MM-DD"
);
} else { } else {
this.queryParams.startDate = null; this.queryParams.startDate = null;
this.queryParams.endDate = null; this.queryParams.endDate = null;
} }
listRecipesPlan(this.queryParams).then(response => { listRecipesPlan(this.queryParams).then((response) => {
this.recipesPlanList = response.rows; this.recipesPlanList = response.rows;
this.recipesPlanList.forEach(function (item, index) { this.recipesPlanList.forEach(function (item, index) {
item.scopeDate = dayjs(item.startDate).format("YYYY-MM-DD") + " 到 " + dayjs(item.endDate).format("YYYY-MM-DD") item.scopeDate =
dayjs(item.startDate).format("YYYY-MM-DD") +
" 到 " +
dayjs(item.endDate).format("YYYY-MM-DD");
}); });
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -348,10 +465,13 @@
if (this.allRecipesPlanQueryParam.sendFlag === "") { if (this.allRecipesPlanQueryParam.sendFlag === "") {
this.allRecipesPlanQueryParam.sendFlag = null; this.allRecipesPlanQueryParam.sendFlag = null;
} }
listRecipesPlan(this.allRecipesPlanQueryParam).then(response => { listRecipesPlan(this.allRecipesPlanQueryParam).then((response) => {
this.allRecipesPlanList = response.rows; this.allRecipesPlanList = response.rows;
this.allRecipesPlanList.forEach(function (item, index) { this.allRecipesPlanList.forEach(function (item, index) {
item.scopeDate = dayjs(item.startDate).format("YYYY-MM-DD") + " 到 " + dayjs(item.endDate).format("YYYY-MM-DD") item.scopeDate =
dayjs(item.startDate).format("YYYY-MM-DD") +
" 到 " +
dayjs(item.endDate).format("YYYY-MM-DD");
}); });
this.allRecipesPlanOpen = true; this.allRecipesPlanOpen = true;
this.allRecipesPlanTotal = response.total; this.allRecipesPlanTotal = response.total;
@ -379,7 +499,7 @@
createBy: null, createBy: null,
updateTime: null, updateTime: null,
updateBy: null, updateBy: null,
delFlag: null delFlag: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -396,15 +516,15 @@
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getRecipesPlan(id).then(response => { getRecipesPlan(id).then((response) => {
this.form.id = response.data.id; this.form.id = response.data.id;
this.form.sendFlag = response.data.sendFlag; this.form.sendFlag = response.data.sendFlag;
this.open = true; this.open = true;
@ -413,10 +533,10 @@
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateRecipesPlan(this.form).then(response => { updateRecipesPlan(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -430,16 +550,18 @@
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$confirm('是否确认导出所有食谱计划数据项?', "警告", { this.$confirm("是否确认导出所有食谱计划数据项?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(function () { })
.then(function () {
return exportRecipesPlan(queryParams); return exportRecipesPlan(queryParams);
}).then(response => { })
.then((response) => {
this.download(response.msg); this.download(response.msg);
}).catch(function () { })
}); .catch(function () {});
}, },
getTagType(row) { getTagType(row) {
if (row.sendFlag == 1) { if (row.sendFlag == 1) {
@ -453,7 +575,12 @@
}, },
// //
columnStyle({ row, column, rowIndex, columnIndex }) { columnStyle({ row, column, rowIndex, columnIndex }) {
if (columnIndex == 0 || columnIndex == 2 || columnIndex == 4 || columnIndex == 6) { if (
columnIndex == 0 ||
columnIndex == 2 ||
columnIndex == 4 ||
columnIndex == 6
) {
//23 //23
return "background:#f3f6fc;font-weight:bold"; return "background:#f3f6fc;font-weight:bold";
} else { } else {
@ -466,17 +593,33 @@
if (rowIndex % 4 === 0) { if (rowIndex % 4 === 0) {
return { return {
rowspan: 4, rowspan: 4,
colspan: 1 colspan: 1,
}; };
} else { } else {
return { return {
rowspan: 0, rowspan: 0,
colspan: 0 colspan: 0,
}; };
} }
} }
},
handleBuild(data) {
// const params = { id: data.id, cusId: data.orderId };
let path = `/recipes/build/${data.orderId}/${data.id}`;
if (data.recipes_id) {
// params.recipesId = data.recipes_id;
path += `/${data.recipes_id}`;
} }
} // test
// params.recipesId = "61";
path += '/73';
// this.$router.push({
// name: "build",
// params,
// });
this.$router.push(path);
},
},
}; };
</script> </script>

View File

@ -266,7 +266,7 @@ export default {
}); });
}, },
fail(){ fail(){
console.log("定时--------"); // console.log("--------");
this.submitFlag = false; this.submitFlag = false;
}, },
nextStep(step){ nextStep(step){

View File

@ -452,7 +452,7 @@
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
console.log(this.form) // console.log(this.form)
if (this.form.id != null) { if (this.form.id != null) {
updateWxUserLog(this.form).then(response => { updateWxUserLog(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {