Merge remote-tracking branch 'origin/master' into master
# Conflicts: # ruoyi-admin/src/main/resources/application-dev.yml
This commit is contained in:
commit
a65761757b
@ -12,10 +12,10 @@ spring:
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
enabled: true
|
||||
url: jdbc:mysql://120.77.157.122:3306/gch?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: gch
|
||||
password: phJAccAEKaswNfK6
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
|
@ -0,0 +1,100 @@
|
||||
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.poi.ExcelUtil;
|
||||
import com.ruoyi.system.fantang.domain.FtFoodDefaultDao;
|
||||
import com.ruoyi.system.fantang.service.IFtFoodDefaultDaoService;
|
||||
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-11-25
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/fantang/foodDefault")
|
||||
public class FtFoodDefaultDaoController extends BaseController {
|
||||
|
||||
private final IFtFoodDefaultDaoService iFtFoodDefaultDaoService;
|
||||
|
||||
/**
|
||||
* 查询默认报餐管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FtFoodDefaultDao ftFoodDefaultDao) {
|
||||
startPage();
|
||||
LambdaQueryWrapper<FtFoodDefaultDao> lqw = Wrappers.lambdaQuery(ftFoodDefaultDao);
|
||||
if (ftFoodDefaultDao.getType() != null) {
|
||||
lqw.eq(FtFoodDefaultDao::getType, ftFoodDefaultDao.getType());
|
||||
}
|
||||
List<FtFoodDefaultDao> list = iFtFoodDefaultDaoService.list(lqw);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出默认报餐管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:export')")
|
||||
@Log(title = "默认报餐管理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(FtFoodDefaultDao ftFoodDefaultDao) {
|
||||
LambdaQueryWrapper<FtFoodDefaultDao> lqw = new LambdaQueryWrapper<FtFoodDefaultDao>(ftFoodDefaultDao);
|
||||
List<FtFoodDefaultDao> list = iFtFoodDefaultDaoService.list(lqw);
|
||||
ExcelUtil<FtFoodDefaultDao> util = new ExcelUtil<FtFoodDefaultDao>(FtFoodDefaultDao.class);
|
||||
return util.exportExcel(list, "foodDefault");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认报餐管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(iFtFoodDefaultDaoService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增默认报餐管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:add')")
|
||||
@Log(title = "默认报餐管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FtFoodDefaultDao ftFoodDefaultDao) {
|
||||
return toAjax(iFtFoodDefaultDaoService.save(ftFoodDefaultDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改默认报餐管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:edit')")
|
||||
@Log(title = "默认报餐管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FtFoodDefaultDao ftFoodDefaultDao) {
|
||||
return toAjax(iFtFoodDefaultDaoService.updateById(ftFoodDefaultDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除默认报餐管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:remove')")
|
||||
@Log(title = "默认报餐管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(iFtFoodDefaultDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
||||
}
|
||||
}
|
@ -1,109 +0,0 @@
|
||||
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.poi.ExcelUtil;
|
||||
import com.ruoyi.system.fantang.domain.FtSpecialDemandDao;
|
||||
import com.ruoyi.system.fantang.service.IFtSpecialDemandDaoService;
|
||||
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-11-19
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/fantang/demand")
|
||||
public class FtSpecialDemandDaoController extends BaseController {
|
||||
|
||||
private final IFtSpecialDemandDaoService iFtSpecialDemandDaoService;
|
||||
|
||||
/**
|
||||
* 查询特殊用餐管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:demand:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FtSpecialDemandDao ftSpecialDemandDao) {
|
||||
startPage();
|
||||
LambdaQueryWrapper<FtSpecialDemandDao> lqw = Wrappers.lambdaQuery(ftSpecialDemandDao);
|
||||
if (ftSpecialDemandDao.getType() != null) {
|
||||
lqw.eq(FtSpecialDemandDao::getType, ftSpecialDemandDao.getType());
|
||||
}
|
||||
if (ftSpecialDemandDao.getCreateAt() != null) {
|
||||
lqw.eq(FtSpecialDemandDao::getCreateAt, ftSpecialDemandDao.getCreateAt());
|
||||
}
|
||||
if (ftSpecialDemandDao.getPrice() != null) {
|
||||
lqw.eq(FtSpecialDemandDao::getPrice, ftSpecialDemandDao.getPrice());
|
||||
}
|
||||
if (ftSpecialDemandDao.getTerm() != null) {
|
||||
lqw.eq(FtSpecialDemandDao::getTerm, ftSpecialDemandDao.getTerm());
|
||||
}
|
||||
List<FtSpecialDemandDao> list = iFtSpecialDemandDaoService.list(lqw);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出特殊用餐管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:demand:export')")
|
||||
@Log(title = "特殊用餐管理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(FtSpecialDemandDao ftSpecialDemandDao) {
|
||||
LambdaQueryWrapper<FtSpecialDemandDao> lqw = new LambdaQueryWrapper<FtSpecialDemandDao>(ftSpecialDemandDao);
|
||||
List<FtSpecialDemandDao> list = iFtSpecialDemandDaoService.list(lqw);
|
||||
ExcelUtil<FtSpecialDemandDao> util = new ExcelUtil<FtSpecialDemandDao>(FtSpecialDemandDao.class);
|
||||
return util.exportExcel(list, "demand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取特殊用餐管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:demand:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(iFtSpecialDemandDaoService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增特殊用餐管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:demand:add')")
|
||||
@Log(title = "特殊用餐管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FtSpecialDemandDao ftSpecialDemandDao) {
|
||||
return toAjax(iFtSpecialDemandDaoService.save(ftSpecialDemandDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改特殊用餐管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:demand:edit')")
|
||||
@Log(title = "特殊用餐管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FtSpecialDemandDao ftSpecialDemandDao) {
|
||||
return toAjax(iFtSpecialDemandDaoService.updateById(ftSpecialDemandDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除特殊用餐管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:demand:remove')")
|
||||
@Log(title = "特殊用餐管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(iFtSpecialDemandDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
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_food_default
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-25
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("ft_food_default")
|
||||
public class FtFoodDefaultDao implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
|
||||
/** id */
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/** 报餐类型 */
|
||||
@Excel(name = "报餐类型")
|
||||
private Long type;
|
||||
|
||||
/** 菜品列表 */
|
||||
private String foodList;
|
||||
|
||||
/** 创建日期 */
|
||||
@Excel(name = "创建日期" , width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/** 创建人 */
|
||||
private Long createdBy;
|
||||
|
||||
/** 更新日期 */
|
||||
private Date updatedAt;
|
||||
|
||||
/** 更新人 */
|
||||
private Long updatedBy;
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
package com.ruoyi.system.fantang.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 特殊用餐管理对象 ft_special_demand
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-19
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("ft_special_demand")
|
||||
public class FtSpecialDemandDao implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 病人id
|
||||
*/
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@Excel(name = "订单详情")
|
||||
private String foods;
|
||||
|
||||
/**
|
||||
* 用餐类型
|
||||
*/
|
||||
@Excel(name = "用餐类型")
|
||||
private Long type;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createAt;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
@Excel(name = "总价")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 有效期
|
||||
*/
|
||||
@Excel(name = "有效期")
|
||||
private Long term;
|
||||
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
private Date updateAt;
|
||||
|
||||
/**
|
||||
* 更新操作人 id
|
||||
*/
|
||||
private Long updateBy;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.system.fantang.mapper;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtFoodDefaultDao;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 默认报餐管理Mapper接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-25
|
||||
*/
|
||||
public interface FtFoodDefaultDaoMapper extends BaseMapper<FtFoodDefaultDao> {
|
||||
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package com.ruoyi.system.fantang.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtSpecialDemandDao;
|
||||
|
||||
/**
|
||||
* 特殊用餐管理Mapper接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-19
|
||||
*/
|
||||
public interface FtSpecialDemandDaoMapper extends BaseMapper<FtSpecialDemandDao> {
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.system.fantang.service;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtFoodDefaultDao;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 默认报餐管理Service接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-25
|
||||
*/
|
||||
public interface IFtFoodDefaultDaoService extends IService<FtFoodDefaultDao> {
|
||||
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package com.ruoyi.system.fantang.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.system.fantang.domain.FtSpecialDemandDao;
|
||||
|
||||
/**
|
||||
* 特殊用餐管理Service接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-19
|
||||
*/
|
||||
public interface IFtSpecialDemandDaoService extends IService<FtSpecialDemandDao> {
|
||||
|
||||
}
|
@ -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.FtFoodDefaultDaoMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtFoodDefaultDao;
|
||||
import com.ruoyi.system.fantang.service.IFtFoodDefaultDaoService;
|
||||
|
||||
/**
|
||||
* 默认报餐管理Service业务层处理
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-25
|
||||
*/
|
||||
@Service
|
||||
public class FtFoodDefaultDaoServiceImpl extends ServiceImpl<FtFoodDefaultDaoMapper, FtFoodDefaultDao> implements IFtFoodDefaultDaoService {
|
||||
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package com.ruoyi.system.fantang.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.system.fantang.domain.FtSpecialDemandDao;
|
||||
import com.ruoyi.system.fantang.mapper.FtSpecialDemandDaoMapper;
|
||||
import com.ruoyi.system.fantang.service.IFtSpecialDemandDaoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 特殊用餐管理Service业务层处理
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-19
|
||||
*/
|
||||
@Service
|
||||
public class FtSpecialDemandDaoServiceImpl extends ServiceImpl<FtSpecialDemandDaoMapper, FtSpecialDemandDao> implements IFtSpecialDemandDaoService {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?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.FtFoodDefaultDaoMapper">
|
||||
|
||||
<resultMap type="FtFoodDefaultDao" id="FtFoodDefaultDaoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="type" column="type" />
|
||||
<result property="foodList" column="food_list" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="createdBy" column="created_by" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
<result property="updatedBy" column="updated_by" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
@ -1,21 +0,0 @@
|
||||
<?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.FtSpecialDemandDaoMapper">
|
||||
|
||||
<resultMap type="FtSpecialDemandDao" id="FtSpecialDemandDaoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="patientId" column="patient_id" />
|
||||
<result property="foods" column="foods" />
|
||||
<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="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
53
ruoyi-ui/src/api/fantang/foodDefault.js
Normal file
53
ruoyi-ui/src/api/fantang/foodDefault.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询默认报餐管理列表
|
||||
export function listFoodDefault(query) {
|
||||
return request({
|
||||
url: '/fantang/foodDefault/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询默认报餐管理详细
|
||||
export function getFoodDefault(id) {
|
||||
return request({
|
||||
url: '/fantang/foodDefault/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增默认报餐管理
|
||||
export function addFoodDefault(data) {
|
||||
return request({
|
||||
url: '/fantang/foodDefault',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改默认报餐管理
|
||||
export function updateFoodDefault(data) {
|
||||
return request({
|
||||
url: '/fantang/foodDefault',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除默认报餐管理
|
||||
export function delFoodDefault(id) {
|
||||
return request({
|
||||
url: '/fantang/foodDefault/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出默认报餐管理
|
||||
export function exportFoodDefault(query) {
|
||||
return request({
|
||||
url: '/fantang/foodDefault/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
@ -169,7 +169,6 @@ import {
|
||||
careStaffList,
|
||||
delStaffInfo,
|
||||
exportStaffInfo,
|
||||
getStaffInfo,
|
||||
getNursingInfo,
|
||||
updateNursingInfo,
|
||||
} from "@/api/fantang/staffInfo";
|
||||
|
312
ruoyi-ui/src/views/fantang/foodDefault/index.vue
Normal file
312
ruoyi-ui/src/views/fantang/foodDefault/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="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>
|
||||
<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:foodDefault: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:foodDefault: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:foodDefault: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:foodDefault:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="foodDefaultList" @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="createdAt" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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:foodDefault:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['fantang:foodDefault: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="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-item label="菜品列表" prop="foodList">-->
|
||||
<!-- <el-input v-model="form.foodList" placeholder="请输入菜品列表" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="菜品" prop="foodList">
|
||||
<el-select v-model="queryParams.foodList" multiple placeholder="请选择菜品" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in foodListOptions"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.foodId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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 {
|
||||
addFoodDefault,
|
||||
delFoodDefault,
|
||||
exportFoodDefault,
|
||||
getFoodDefault,
|
||||
listFoodDefault,
|
||||
updateFoodDefault
|
||||
} from "@/api/fantang/foodDefault";
|
||||
import {listFood} from "@/api/fantang/food";
|
||||
|
||||
export default {
|
||||
name: "FoodDefault",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
foodListOptions: [],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 默认报餐管理表格数据
|
||||
foodDefaultList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 报餐类型字典
|
||||
typeOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
type: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("ft_book_type").then(response => {
|
||||
this.typeOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询默认报餐管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFoodDefault(this.queryParams).then(response => {
|
||||
this.foodDefaultList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
listFood(this.queryParams).then(response => {
|
||||
console.log("depart", response);
|
||||
this.foodListOptions = response.rows;
|
||||
})
|
||||
},
|
||||
// 报餐类型字典翻译
|
||||
typeFormat(row, column) {
|
||||
return this.selectDictLabel(this.typeOptions, row.type);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
type: null,
|
||||
foodList: null,
|
||||
createdAt: null,
|
||||
createdBy: null,
|
||||
updatedAt: null,
|
||||
updatedBy: 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
|
||||
getFoodDefault(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) {
|
||||
updateFoodDefault(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addFoodDefault(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 delFoodDefault(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有默认报餐管理数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return exportFoodDefault(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -160,10 +160,10 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="科室" prop="deptList">
|
||||
<el-select v-model="form.deptList" placeholder="请选择科室">
|
||||
<el-form-item label="科室" prop="departId">
|
||||
<el-select v-model="form.departId" placeholder="请选择科室">
|
||||
<el-option
|
||||
v-for="item in deptListOptions"
|
||||
v-for="item in departIdOptions"
|
||||
:key="item.departName"
|
||||
:label="item.departName"
|
||||
:value="item.departId">
|
||||
@ -212,7 +212,7 @@ export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
deptListOptions: [],
|
||||
departIdOptions: [],
|
||||
sexOptions: [],
|
||||
postOptions: [],
|
||||
flagOptions: [{
|
||||
@ -268,8 +268,8 @@ export default {
|
||||
sex: [
|
||||
{required: true, message: "性别不能为空", trigger: "change"}
|
||||
],
|
||||
deptList: [
|
||||
{required: true, message: "性别不能为空", trigger: "change"}
|
||||
departId: [
|
||||
{required: true, message: "科室不能为空", trigger: "change"}
|
||||
],
|
||||
tel: [
|
||||
{required: true, message: "手机号码不能为空", trigger: "change"}
|
||||
@ -305,7 +305,7 @@ export default {
|
||||
console.log("flag-----", response);
|
||||
});
|
||||
listDepart(this.queryParams).then(response => {
|
||||
this.deptListOptions = response.rows;
|
||||
this.departIdOptions = response.rows;
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
|
Loading…
x
Reference in New Issue
Block a user