Merge remote-tracking branch 'origin/master' into master
This commit is contained in:
commit
107def44eb
@ -31,7 +31,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
* 病人报餐Controller
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-26
|
||||
* @date 2020-12-03
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@ -49,14 +49,8 @@ public class FtFoodDemandDaoController extends BaseController {
|
||||
{
|
||||
startPage();
|
||||
LambdaQueryWrapper<FtFoodDemandDao> lqw = Wrappers.lambdaQuery(ftFoodDemandDao);
|
||||
if (ftFoodDemandDao.getType() != null){
|
||||
lqw.eq(FtFoodDemandDao::getType ,ftFoodDemandDao.getType());
|
||||
}
|
||||
if (ftFoodDemandDao.getUpdateAt() != null){
|
||||
lqw.eq(FtFoodDemandDao::getUpdateAt ,ftFoodDemandDao.getUpdateAt());
|
||||
}
|
||||
if (ftFoodDemandDao.getUpdateFrom() != null){
|
||||
lqw.eq(FtFoodDemandDao::getUpdateFrom ,ftFoodDemandDao.getUpdateFrom());
|
||||
if (ftFoodDemandDao.getFlag() != null){
|
||||
lqw.eq(FtFoodDemandDao::getFlag ,ftFoodDemandDao.getFlag());
|
||||
}
|
||||
List<FtFoodDemandDao> list = iFtFoodDemandDaoService.list(lqw);
|
||||
return getDataTable(list);
|
||||
|
@ -0,0 +1,119 @@
|
||||
package com.ruoyi.system.fantang.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.fantang.domain.FtNutritionFoodDao;
|
||||
import com.ruoyi.system.fantang.service.IFtNutritionFoodDaoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 病患营养配餐Controller
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-03
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/fantang/nutritionFood")
|
||||
public class FtNutritionFoodDaoController extends BaseController {
|
||||
|
||||
private final IFtNutritionFoodDaoService iFtNutritionFoodDaoService;
|
||||
|
||||
/**
|
||||
* 查询病患营养配餐列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FtNutritionFoodDao ftNutritionFoodDao) {
|
||||
startPage();
|
||||
LambdaQueryWrapper<FtNutritionFoodDao> lqw = Wrappers.lambdaQuery(ftNutritionFoodDao);
|
||||
if (StringUtils.isNotBlank(ftNutritionFoodDao.getName())) {
|
||||
lqw.like(FtNutritionFoodDao::getName, ftNutritionFoodDao.getName());
|
||||
}
|
||||
if (ftNutritionFoodDao.getPrice() != null) {
|
||||
lqw.eq(FtNutritionFoodDao::getPrice, ftNutritionFoodDao.getPrice());
|
||||
}
|
||||
if (ftNutritionFoodDao.getFlag() != null) {
|
||||
lqw.eq(FtNutritionFoodDao::getFlag, ftNutritionFoodDao.getFlag());
|
||||
}
|
||||
List<FtNutritionFoodDao> list = iFtNutritionFoodDaoService.list(lqw);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出病患营养配餐列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:export')")
|
||||
@Log(title = "病患营养配餐", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(FtNutritionFoodDao ftNutritionFoodDao) {
|
||||
LambdaQueryWrapper<FtNutritionFoodDao> lqw = new LambdaQueryWrapper<FtNutritionFoodDao>(ftNutritionFoodDao);
|
||||
List<FtNutritionFoodDao> list = iFtNutritionFoodDaoService.list(lqw);
|
||||
ExcelUtil<FtNutritionFoodDao> util = new ExcelUtil<FtNutritionFoodDao>(FtNutritionFoodDao.class);
|
||||
return util.exportExcel(list, "nutritionFood");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取病患营养配餐详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(iFtNutritionFoodDaoService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增病患营养配餐
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:add')")
|
||||
@Log(title = "病患营养配餐", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FtNutritionFoodDao ftNutritionFoodDao) {
|
||||
ftNutritionFoodDao.setFlag(1);
|
||||
return toAjax(iFtNutritionFoodDaoService.save(ftNutritionFoodDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改病患营养配餐
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:edit')")
|
||||
@Log(title = "病患营养配餐", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FtNutritionFoodDao ftNutritionFoodDao) {
|
||||
return toAjax(iFtNutritionFoodDaoService.updateById(ftNutritionFoodDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用病患营养配餐
|
||||
*/
|
||||
@PutMapping("/deactivate/{id}")
|
||||
public AjaxResult deactivate(@PathVariable("id") Long id) {
|
||||
FtNutritionFoodDao ftNutritionFoodDao = iFtNutritionFoodDaoService.getById(id);
|
||||
ftNutritionFoodDao.setFlag(0);
|
||||
iFtNutritionFoodDaoService.updateById(ftNutritionFoodDao);
|
||||
return AjaxResult.success("停用成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除病患营养配餐
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:remove')")
|
||||
@Log(title = "病患营养配餐", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(iFtNutritionFoodDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
* 病人报餐对象 ft_food_demand
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-26
|
||||
* @date 2020-12-03
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@ -39,11 +39,12 @@ private static final long serialVersionUID=1L;
|
||||
/** 病人id */
|
||||
private Long patientId;
|
||||
|
||||
/** 订单详情 */
|
||||
/** 正餐清单 */
|
||||
@Excel(name = "正餐清单")
|
||||
private String foods;
|
||||
|
||||
/** 用餐类型 */
|
||||
@Excel(name = "用餐类型")
|
||||
/** 正餐类型 */
|
||||
@Excel(name = "正餐类型")
|
||||
private Long type;
|
||||
|
||||
/** 创建时间 */
|
||||
@ -52,22 +53,37 @@ private static final long serialVersionUID=1L;
|
||||
/** 创建人 */
|
||||
private Long createBy;
|
||||
|
||||
/** 总价 */
|
||||
@Excel(name = "总价")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 有效期 */
|
||||
private Long term;
|
||||
|
||||
/** 更新日期 */
|
||||
@Excel(name = "更新日期" , width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateAt;
|
||||
|
||||
/** 加菜 */
|
||||
@Excel(name = "加菜")
|
||||
private Integer vegetables;
|
||||
|
||||
/** 更新操作人 id */
|
||||
private Long updateBy;
|
||||
|
||||
/** 加肉 */
|
||||
@Excel(name = "加肉")
|
||||
private Integer meat;
|
||||
|
||||
/** 更新来源 */
|
||||
@Excel(name = "更新来源")
|
||||
private Integer updateFrom;
|
||||
|
||||
/** 加饭 */
|
||||
@Excel(name = "加饭")
|
||||
private Integer rice;
|
||||
|
||||
/** 加蛋 */
|
||||
@Excel(name = "加蛋")
|
||||
private Integer egg;
|
||||
|
||||
/** 订单详情 */
|
||||
private String orderInfo;
|
||||
|
||||
/** 启用状态 */
|
||||
@Excel(name = "启用状态")
|
||||
private Integer flag;
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
package com.ruoyi.system.fantang.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 病患营养配餐对象 ft_nutrition_food
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-03
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("ft_nutrition_food")
|
||||
public class FtNutritionFoodDao implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
|
||||
/** id */
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/** 营养餐名称 */
|
||||
@Excel(name = "营养餐名称")
|
||||
private String name;
|
||||
|
||||
/** 价格 */
|
||||
@Excel(name = "价格")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 启用标志 */
|
||||
@Excel(name = "启用标志")
|
||||
private Integer flag;
|
||||
|
||||
/** 创建日期 */
|
||||
private Date createAt;
|
||||
|
||||
/** 创建人 */
|
||||
private String createBy;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.fantang.mapper;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@ -12,11 +12,11 @@ import java.util.List;
|
||||
* 病人报餐Mapper接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-26
|
||||
* @date 2020-12-03
|
||||
*/
|
||||
public interface FtFoodDemandDaoMapper extends BaseMapper<FtFoodDemandDao> {
|
||||
@Insert("insert into ft_food_demand (patient_id, foods, type, price) select #{patient_id}, food_list, type, price FROM ft_food_default")
|
||||
public Integer GenerateOrderByPatientId(@Param("patient_id") Long patientId) ;
|
||||
public Integer GenerateOrderByPatientId(@Param("patient_id") Long patientId);
|
||||
|
||||
@Select("select a.patient_id from ft_patient a where a.patient_id not in (select patient_id from ft_food_demand c )")
|
||||
public List<Long> getNewPatientNotDemand();
|
||||
|
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.system.fantang.mapper;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtNutritionFoodDao;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 病患营养配餐Mapper接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-03
|
||||
*/
|
||||
public interface FtNutritionFoodDaoMapper extends BaseMapper<FtNutritionFoodDao> {
|
||||
|
||||
}
|
@ -7,12 +7,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
* 病人报餐Service接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-26
|
||||
* @date 2020-12-03
|
||||
*/
|
||||
public interface IFtFoodDemandDaoService extends IService<FtFoodDemandDao> {
|
||||
public Integer GenerateOrderByPatientId(Long patientId);
|
||||
|
||||
public Integer GenerateOrderForNewPatient() ;
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.system.fantang.service;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtNutritionFoodDao;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 病患营养配餐Service接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-03
|
||||
*/
|
||||
public interface IFtNutritionFoodDaoService extends IService<FtNutritionFoodDao> {
|
||||
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
package com.ruoyi.system.fantang.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.system.fantang.mapper.FtFoodDemandDaoMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
|
||||
import com.ruoyi.system.fantang.mapper.FtFoodDemandDaoMapper;
|
||||
import com.ruoyi.system.fantang.service.IFtFoodDemandDaoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 病人报餐Service业务层处理
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-26
|
||||
* @date 2020-12-03
|
||||
*/
|
||||
@Service
|
||||
public class FtFoodDemandDaoServiceImpl extends ServiceImpl<FtFoodDemandDaoMapper, FtFoodDemandDao> implements IFtFoodDemandDaoService {
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.system.fantang.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.system.fantang.mapper.FtNutritionFoodDaoMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtNutritionFoodDao;
|
||||
import com.ruoyi.system.fantang.service.IFtNutritionFoodDaoService;
|
||||
|
||||
/**
|
||||
* 病患营养配餐Service业务层处理
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-03
|
||||
*/
|
||||
@Service
|
||||
public class FtNutritionFoodDaoServiceImpl extends ServiceImpl<FtNutritionFoodDaoMapper, FtNutritionFoodDao> implements IFtNutritionFoodDaoService {
|
||||
|
||||
}
|
@ -11,11 +11,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="type" column="type" />
|
||||
<result property="createAt" column="create_at" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="price" column="price" />
|
||||
<result property="term" column="term" />
|
||||
<result property="updateAt" column="update_at" />
|
||||
<result property="vegetables" column="vegetables" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="meat" column="meat" />
|
||||
<result property="updateFrom" column="update_from" />
|
||||
<result property="rice" column="rice" />
|
||||
<result property="egg" column="egg" />
|
||||
<result property="orderInfo" column="order_info" />
|
||||
<result property="flag" column="flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
<?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.ruoyi.system.fantang.mapper.FtNutritionFoodDaoMapper">
|
||||
|
||||
<resultMap type="FtNutritionFoodDao" id="FtNutritionFoodDaoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="price" column="price" />
|
||||
<result property="flag" column="flag" />
|
||||
<result property="createAt" column="create_at" />
|
||||
<result property="createBy" column="create_by" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
62
ruoyi-ui/src/api/fantang/nutritionFood.js
Normal file
62
ruoyi-ui/src/api/fantang/nutritionFood.js
Normal file
@ -0,0 +1,62 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询病患营养配餐列表
|
||||
export function listNutritionFood(query) {
|
||||
return request({
|
||||
url: '/fantang/nutritionFood/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询病患营养配餐详细
|
||||
export function getNutritionFood(id) {
|
||||
return request({
|
||||
url: '/fantang/nutritionFood/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增病患营养配餐
|
||||
export function addNutritionFood(data) {
|
||||
return request({
|
||||
url: '/fantang/nutritionFood',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改病患营养配餐
|
||||
export function updateNutritionFood(data) {
|
||||
return request({
|
||||
url: '/fantang/nutritionFood',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 停用病患营养配餐
|
||||
export function deactivate(id) {
|
||||
return request({
|
||||
url: '/fantang/nutritionFood/deactivate/' + id,
|
||||
method: 'put',
|
||||
params: id
|
||||
})
|
||||
}
|
||||
|
||||
// 删除病患营养配餐
|
||||
export function delNutritionFood(id) {
|
||||
return request({
|
||||
url: '/fantang/nutritionFood/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出病患营养配餐
|
||||
export function exportNutritionFood(query) {
|
||||
return request({
|
||||
url: '/fantang/nutritionFood/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
@ -1,33 +1,14 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="用餐类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择用餐类型" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in typeOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新日期" prop="updateAt">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="queryParams.updateAt"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择更新日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新来源" prop="updateFrom">
|
||||
<el-select v-model="queryParams.updateFrom" placeholder="请选择更新来源" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in updateFromOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item label="启用状态" prop="flag">
|
||||
<el-input
|
||||
v-model="queryParams.flag"
|
||||
placeholder="请输入启用状态"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@ -74,20 +55,24 @@
|
||||
v-hasPermi="['fantang:foodDemand:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="foodDemandList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="id" align="center" prop="id" v-if="false"/>
|
||||
<el-table-column label="用餐类型" align="center" prop="type" :formatter="typeFormat" />
|
||||
<el-table-column label="总价" align="center" prop="price" />
|
||||
<el-table-column label="正餐类型" align="center" prop="type" :formatter="typeFormat" />
|
||||
<el-table-column label="正餐清单" align="center" prop="foods" />
|
||||
<el-table-column label="更新日期" align="center" prop="updateAt" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新来源" align="center" prop="updateFrom" :formatter="updateFromFormat" />
|
||||
<el-table-column label="加菜" align="center" prop="vegetables" />
|
||||
<el-table-column label="加肉" align="center" prop="meat" />
|
||||
<el-table-column label="加饭" align="center" prop="rice" />
|
||||
<el-table-column label="加蛋" align="center" prop="egg" />
|
||||
<el-table-column label="启用状态" align="center" prop="flag" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -119,16 +104,6 @@
|
||||
<!-- 添加或修改病人报餐对话框 -->
|
||||
<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-item label="用餐类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择用餐类型">
|
||||
<el-option
|
||||
v-for="dict in typeOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
@ -165,7 +140,7 @@ export default {
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 用餐类型字典
|
||||
// 正餐类型字典
|
||||
typeOptions: [],
|
||||
// 更新来源字典
|
||||
updateFromOptions: [],
|
||||
@ -173,16 +148,14 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
type: null,
|
||||
updateAt: null,
|
||||
updateFrom: null
|
||||
flag: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
type: [
|
||||
{ required: true, message: "用餐类型不能为空", trigger: "change" }
|
||||
{ required: true, message: "正餐类型不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
};
|
||||
@ -206,7 +179,7 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 用餐类型字典翻译
|
||||
// 正餐类型字典翻译
|
||||
typeFormat(row, column) {
|
||||
return this.selectDictLabel(this.typeOptions, row.type);
|
||||
},
|
||||
@ -228,11 +201,15 @@ export default {
|
||||
type: null,
|
||||
createAt: null,
|
||||
createBy: null,
|
||||
price: null,
|
||||
term: null,
|
||||
updateAt: null,
|
||||
vegetables: null,
|
||||
updateBy: null,
|
||||
updateFrom: null
|
||||
meat: null,
|
||||
updateFrom: null,
|
||||
rice: null,
|
||||
egg: null,
|
||||
orderInfo: null,
|
||||
flag: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -292,28 +269,28 @@ export default {
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$confirm('是否确认删除病人报餐编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delFoodDemand(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delFoodDemand(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有病人报餐数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportFoodDemand(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportFoodDemand(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
312
ruoyi-ui/src/views/fantang/nutritionFood/index.vue
Normal file
312
ruoyi-ui/src/views/fantang/nutritionFood/index.vue
Normal file
@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="营养餐名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入营养餐名称"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="价格" prop="price">
|
||||
<el-input
|
||||
v-model="queryParams.price"
|
||||
placeholder="请输入价格"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用标志" prop="flag">
|
||||
<el-input
|
||||
v-model="queryParams.flag"
|
||||
placeholder="请输入启用标志"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<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>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['fantang:nutritionFood:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['fantang:nutritionFood:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['fantang:nutritionFood:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['fantang:nutritionFood:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="nutritionFoodList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="id" align="center" prop="id" v-if="false"/>
|
||||
<el-table-column label="营养餐名称" align="center" prop="name"/>
|
||||
<el-table-column label="价格" align="center" prop="price"/>
|
||||
<el-table-column label="启用标志" align="center" prop="flag"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['fantang:nutritionFood:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['fantang:nutritionFood:remove']"
|
||||
>停用
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改病患营养配餐对话框 -->
|
||||
<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-item label="营养餐名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入营养餐名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="价格" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入价格"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用标志" prop="flag">
|
||||
<el-input v-model="form.flag" placeholder="请输入启用标志"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addNutritionFood,
|
||||
deactivate,
|
||||
exportNutritionFood,
|
||||
getNutritionFood,
|
||||
listNutritionFood,
|
||||
updateNutritionFood
|
||||
} from "@/api/fantang/nutritionFood";
|
||||
|
||||
export default {
|
||||
name: "NutritionFood",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 病患营养配餐表格数据
|
||||
nutritionFoodList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
price: null,
|
||||
flag: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: "营养餐名称不能为空", trigger: "blur"}
|
||||
],
|
||||
price: [
|
||||
{required: true, message: "价格不能为空", trigger: "blur"}
|
||||
],
|
||||
flag: [
|
||||
{required: true, message: "启用标志不能为空", trigger: "blur"}
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询病患营养配餐列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listNutritionFood(this.queryParams).then(response => {
|
||||
this.nutritionFoodList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
price: null,
|
||||
flag: null,
|
||||
createAt: null,
|
||||
createBy: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加病患营养配餐";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getNutritionFood(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改病患营养配餐";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateNutritionFood(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addNutritionFood(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
// const ids = row.id || this.ids;
|
||||
// this.$confirm('是否确认删除病患营养配餐编号为"' + ids + '"的数据项?', "警告", {
|
||||
// confirmButtonText: "确定",
|
||||
// cancelButtonText: "取消",
|
||||
// type: "warning"
|
||||
// }).then(function() {
|
||||
// return delNutritionFood(ids);
|
||||
// }).then(() => {
|
||||
// this.getList();
|
||||
// this.msgSuccess("删除成功");
|
||||
// })
|
||||
console.log(row);
|
||||
deactivate(row.id).then(response => {
|
||||
this.msgSuccess("停用成功")
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有病患营养配餐数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return exportNutritionFood(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user