配餐功能列表显示,查询

This commit is contained in:
ryoeiken 2020-12-07 17:43:34 +08:00
parent dea15c69de
commit 10e70120e8
10 changed files with 492 additions and 123 deletions

View File

@ -1,98 +1,118 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.List;
import java.util.Arrays;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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.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.FtCateringDao;
import com.ruoyi.system.fantang.service.IFtCateringDaoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.fantang.service.IFtDepartDaoService;
import com.ruoyi.system.fantang.service.IFtPatientDaoService;
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.Date;
import java.util.List;
/**
* 配餐功能Controller
*
*
* @author ft
* @date 2020-12-07
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/catering" )
@RequestMapping("/fantang/catering")
public class FtCateringDaoController extends BaseController {
private final IFtCateringDaoService iFtCateringDaoService;
private final IFtDepartDaoService departDaoService;
private final IFtPatientDaoService patientDaoService;
/**
* 查询配餐功能列表
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:list')")
@GetMapping("/list")
public TableDataInfo list(FtCateringDao ftCateringDao)
{
public TableDataInfo list(FtCateringDao ftCateringDao) {
startPage();
LambdaQueryWrapper<FtCateringDao> lqw = Wrappers.lambdaQuery(ftCateringDao);
if (ftCateringDao.getFlag() != null){
lqw.eq(FtCateringDao::getFlag ,ftCateringDao.getFlag());
}
List<FtCateringDao> list = iFtCateringDaoService.list(lqw);
// LambdaQueryWrapper<FtCateringDao> lqw = Wrappers.lambdaQuery(ftCateringDao);
// if (ftCateringDao.getFlag() != null) {
// lqw.eq(FtCateringDao::getFlag, ftCateringDao.getFlag());
// }
// List<FtCateringDao> list = iFtCateringDaoService.list(lqw);
// List<FtCateringDao> listWithDepart = iFtCateringDaoService.list(lqw);
// for (FtCateringDao cateringDao : list) {
// FtPatientDao Patient = patientDaoService.getById(cateringDao.getPatientId());
// Long departId = Patient.getDepartId();
// String departName = departDaoService.getById(departId).getDepartName();
// cateringDao.setDepartName(departName);
// cateringDao.setName(Patient.getName());
// cateringDao.setBedId(Patient.getBedId());
// listWithDepart.add(cateringDao);
// }
List<FtCateringDao> list = iFtCateringDaoService.listNewFormatter(ftCateringDao);
return getDataTable(list);
}
/**
* 导出配餐功能列表
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:export')" )
@Log(title = "配餐功能" , businessType = BusinessType.EXPORT)
@GetMapping("/export" )
@PreAuthorize("@ss.hasPermi('fantang:catering:export')")
@Log(title = "配餐功能", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtCateringDao ftCateringDao) {
LambdaQueryWrapper<FtCateringDao> lqw = new LambdaQueryWrapper<FtCateringDao>(ftCateringDao);
List<FtCateringDao> list = iFtCateringDaoService.list(lqw);
ExcelUtil<FtCateringDao> util = new ExcelUtil<FtCateringDao>(FtCateringDao. class);
return util.exportExcel(list, "catering" );
ExcelUtil<FtCateringDao> util = new ExcelUtil<FtCateringDao>(FtCateringDao.class);
return util.exportExcel(list, "catering");
}
/**
* 获取配餐功能详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:query')" )
@GetMapping(value = "/{id}" )
public AjaxResult getInfo(@PathVariable("id" ) Long id) {
@PreAuthorize("@ss.hasPermi('fantang:catering:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtCateringDaoService.getById(id));
}
/**
* 新增配餐功能
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:add')" )
@Log(title = "配餐功能" , businessType = BusinessType.INSERT)
@PreAuthorize("@ss.hasPermi('fantang:catering:add')")
@Log(title = "配餐功能", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtCateringDao ftCateringDao) {
return toAjax(iFtCateringDaoService.save(ftCateringDao) ? 1 : 0);
List<Integer> types = ftCateringDao.getTypes();
for (Integer type : types) {
FtCateringDao ftCatering = new FtCateringDao();
ftCatering.setPatientId(ftCateringDao.getPatientId());
ftCatering.setNumber(ftCateringDao.getNumber());
ftCatering.setFrequency(ftCateringDao.getFrequency());
ftCatering.setCateringUsage(ftCateringDao.getCateringUsage());
ftCatering.setFlag(true);
ftCatering.setCreateAt(new Date());
ftCatering.setType(type);
iFtCateringDaoService.save(ftCatering);
}
return AjaxResult.success("新增成功");
}
/**
* 修改配餐功能
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:edit')" )
@Log(title = "配餐功能" , businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('fantang:catering:edit')")
@Log(title = "配餐功能", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtCateringDao ftCateringDao) {
return toAjax(iFtCateringDaoService.updateById(ftCateringDao) ? 1 : 0);
@ -101,9 +121,9 @@ public class FtCateringDaoController extends BaseController {
/**
* 删除配餐功能
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:remove')" )
@Log(title = "配餐功能" , businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}" )
@PreAuthorize("@ss.hasPermi('fantang:catering:remove')")
@Log(title = "配餐功能", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtCateringDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}

View File

@ -0,0 +1,119 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.List;
import java.util.Arrays;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.fantang.domain.FtConfigDao;
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 饭堂参数Controller
*
* @author ft
* @date 2020-12-07
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/fantangConfig" )
public class FtConfigDaoController extends BaseController {
private final IFtConfigDaoService iFtConfigDaoService;
/**
* 查询饭堂参数列表
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:list')")
@GetMapping("/list")
public TableDataInfo list(FtConfigDao ftConfigDao)
{
startPage();
LambdaQueryWrapper<FtConfigDao> lqw = Wrappers.lambdaQuery(ftConfigDao);
if (ftConfigDao.getCorpId() != null){
lqw.eq(FtConfigDao::getCorpId ,ftConfigDao.getCorpId());
}
if (StringUtils.isNotBlank(ftConfigDao.getConfigKey())){
lqw.eq(FtConfigDao::getConfigKey ,ftConfigDao.getConfigKey());
}
if (StringUtils.isNotBlank(ftConfigDao.getConfigValue())){
lqw.eq(FtConfigDao::getConfigValue ,ftConfigDao.getConfigValue());
}
if (ftConfigDao.getFlag() != null){
lqw.eq(FtConfigDao::getFlag ,ftConfigDao.getFlag());
}
List<FtConfigDao> list = iFtConfigDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出饭堂参数列表
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:export')" )
@Log(title = "饭堂参数" , businessType = BusinessType.EXPORT)
@GetMapping("/export" )
public AjaxResult export(FtConfigDao ftConfigDao) {
LambdaQueryWrapper<FtConfigDao> lqw = new LambdaQueryWrapper<FtConfigDao>(ftConfigDao);
List<FtConfigDao> list = iFtConfigDaoService.list(lqw);
ExcelUtil<FtConfigDao> util = new ExcelUtil<FtConfigDao>(FtConfigDao. class);
return util.exportExcel(list, "fantangConfig" );
}
/**
* 获取饭堂参数详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:query')" )
@GetMapping(value = "/{id}" )
public AjaxResult getInfo(@PathVariable("id" ) Long id) {
return AjaxResult.success(iFtConfigDaoService.getById(id));
}
/**
* 新增饭堂参数
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:add')" )
@Log(title = "饭堂参数" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtConfigDao ftConfigDao) {
return toAjax(iFtConfigDaoService.save(ftConfigDao) ? 1 : 0);
}
/**
* 修改饭堂参数
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:edit')" )
@Log(title = "饭堂参数" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtConfigDao ftConfigDao) {
return toAjax(iFtConfigDaoService.updateById(ftConfigDao) ? 1 : 0);
}
/**
* 删除饭堂参数
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:remove')" )
@Log(title = "饭堂参数" , businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}" )
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtConfigDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
}

View File

@ -1,82 +1,108 @@
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 com.ruoyi.system.fantang.vo.FtCateringVo;
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_catering
*
*
* @author ft
* @date 2020-12-07
*/
@Data
@ToString
@EqualsAndHashCode
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_catering")
public class FtCateringDao implements Serializable {
public class FtCateringDao extends FtCateringVo {
private static final long serialVersionUID=1L;
private static final long serialVersionUID = 1L;
/** id */
/**
* id
*/
@TableId(value = "id")
private Long id;
/** 病人 id */
/**
* 病人 id
*/
private Long patientId;
/** 正餐类型 */
/**
* 正餐类型
*/
@Excel(name = "正餐类型")
private Integer type;
/** 配餐号 */
/**
* 配餐号
*/
@Excel(name = "配餐号")
private Long number;
/** 配餐频次 */
/**
* 配餐频次
*/
@Excel(name = "配餐频次")
private String frequency;
/** 用法 */
/**
* 用法
*/
@Excel(name = "用法")
private Integer usage;
private Integer cateringUsage;
/** 是否代替正餐 */
/**
* 是否代替正餐
*/
private Integer isReplace;
/** 作废标志 */
private Integer flag;
/**
* 作废标志
*/
private Boolean flag;
/** 更新日期 */
/**
* 更新日期
*/
private Date updateAt;
/** 更新人 */
/**
* 更新人
*/
@Excel(name = "更新人")
private String updateBy;
/** 创建时间 */
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
/** 创建人 */
/**
* 创建人
*/
private String createBy;
/** 描述 */
/**
* 描述
*/
@Excel(name = "描述")
private String describe;
private String cateringDescribe;
private String hospitalId;
}

View File

@ -0,0 +1,54 @@
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_config
*
* @author ft
* @date 2020-12-07
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_config")
public class FtConfigDao implements Serializable {
private static final long serialVersionUID=1L;
/** $column.columnComment */
@TableId(value = "id")
private Long id;
/** $column.columnComment */
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
private Long corpId;
/** $column.columnComment */
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
private String configKey;
/** $column.columnComment */
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
private String configValue;
/** $column.columnComment */
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
private Long flag;
}

View File

@ -3,6 +3,8 @@ package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtCateringDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* 配餐功能Mapper接口
*
@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface FtCateringDaoMapper extends BaseMapper<FtCateringDao> {
List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao);
}

View File

@ -1,7 +1,9 @@
package com.ruoyi.system.fantang.service;
import com.ruoyi.system.fantang.domain.FtCateringDao;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.fantang.domain.FtCateringDao;
import java.util.List;
/**
* 配餐功能Service接口
@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IFtCateringDaoService extends IService<FtCateringDao> {
List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao);
}

View File

@ -1,10 +1,12 @@
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.FtCateringDaoMapper;
import com.ruoyi.system.fantang.domain.FtCateringDao;
import com.ruoyi.system.fantang.mapper.FtCateringDaoMapper;
import com.ruoyi.system.fantang.service.IFtCateringDaoService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 配餐功能Service业务层处理
@ -15,4 +17,8 @@ import com.ruoyi.system.fantang.service.IFtCateringDaoService;
@Service
public class FtCateringDaoServiceImpl extends ServiceImpl<FtCateringDaoMapper, FtCateringDao> implements IFtCateringDaoService {
@Override
public List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao) {
return this.baseMapper.listNewFormatter(ftCateringDao);
}
}

View File

@ -0,0 +1,30 @@
package com.ruoyi.system.fantang.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class FtCateringVo {
@TableField(exist = false)
private String bedId;
@TableField(exist = false)
private Long departId;
@TableField(exist = false)
private List<Integer> types;
@TableField(exist = false)
private String departName;
@TableField(exist = false)
private String name;
}

View File

@ -1,24 +1,32 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.fantang.mapper.FtCateringDaoMapper">
<resultMap type="FtCateringDao" id="FtCateringDaoResult">
<result property="id" column="id" />
<result property="patientId" column="patient_id" />
<result property="type" column="type" />
<result property="number" column="number" />
<result property="frequency" column="frequency" />
<result property="usage" column="usage" />
<result property="isReplace" column="is_replace" />
<result property="flag" column="flag" />
<result property="updateAt" column="update_at" />
<result property="updateBy" column="update_by" />
<result property="createAt" column="create_at" />
<result property="createBy" column="create_by" />
<result property="describe" column="describe" />
<result property="id" column="id"/>
<result property="patientId" column="patient_id"/>
<result property="type" column="type"/>
<result property="number" column="number"/>
<result property="frequency" column="frequency"/>
<result property="cateringUsage" column="catering_usage"/>
<result property="isReplace" column="is_replace"/>
<result property="flag" column="flag"/>
<result property="updateAt" column="update_at"/>
<result property="updateBy" column="update_by"/>
<result property="createAt" column="create_at"/>
<result property="createBy" column="create_by"/>
<result property="cateringDescribe" column="catering_describe"/>
</resultMap>
<select id="listNewFormatter" resultType="com.ruoyi.system.fantang.domain.FtCateringDao">
select a.*, b.name, b.bed_id, c.depart_name, b.hospital_id from ft_catering a LEFT JOIN ft_patient b LEFT
JOIN ft_depart c on b.depart_id = c.depart_id on a.patient_id = b.patient_id where b.off_flag = 0
<if test="name != null and name !=''">and b.name = #{name}</if>
<if test="bedId != null">and b.bed_id = #{bedId}</if>
<if test="departId != null">and b.depart_id = #{departId}</if>
<if test="hospitalId != null">and b.hospital_id = #{hospitalId}</if>
<if test="flag != null">and a.flag = #{flag}</if>
</select>
</mapper>

View File

@ -184,8 +184,8 @@
<el-table-column label="正餐类型" align="center" prop="type" :formatter="typeFormat" v-if="false"/>
<el-table-column label="配餐号" align="center" prop="number"/>
<el-table-column label="配餐频次" align="center" prop="frequency"/>
<el-table-column label="用法" align="center" prop="usage"/>
<el-table-column label="描述" align="center" prop="describe"/>
<el-table-column label="用法" align="center" prop="cateringUsage"/>
<el-table-column label="描述" align="center" prop="cateringDescribe"/>
<el-table-column label="启用标示" align="center" prop="flag"/>
<el-table-column label="创建时间" align="center" prop="createAt" width="180">
<template slot-scope="scope">
@ -223,7 +223,7 @@
@pagination="getList"
/>
<!-- 添加或修改配餐功能对话框 -->
<!-- 添加配餐功能对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="科室" prop="departId">
@ -254,17 +254,24 @@
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="配餐号" prop="number">
<el-input v-model="form.number" placeholder="请输入配餐号"/>
<el-select v-model="form.number" placeholder="请选择配餐号">
<el-option
v-for="item in numberOptions"
:key="item.label"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="用法" prop="usage">
<el-select v-model="form.usage" placeholder="请选择用法">
<el-form-item label="用法" prop="cateringUsage">
<el-select v-model="form.cateringUsage" placeholder="请选择用法">
<el-option
v-for="item in usageOptions"
v-for="item in cateringUsageOptions"
:key="item.label"
:label="item.label"
:value="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
@ -272,8 +279,8 @@
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="正餐类型" prop="type">
<el-select v-model="form.type"
<el-form-item label="正餐类型" prop="types">
<el-select v-model="form.types"
multiple
@change="changeDinnerType"
placeholder="请选择正餐类型">
@ -288,16 +295,108 @@
</el-col>
<el-col :span="12">
<el-form-item label="配餐频次" prop="frequency">
<el-select v-model="form.frequency" placeholder="请选择频次">
<!-- <el-select v-model="form.frequency" placeholder="频次" :disabled="true">-->
<!-- <el-option-->
<!-- v-for="item in frequencyOptions"-->
<!-- :key="item.label"-->
<!-- :label="item.label"-->
<!-- :value="item.label"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<el-input v-model="form.frequency" placeholder="频次" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
</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>
<!-- 修改配餐功能对话框 -->
<el-dialog :title="title" :visible.sync="modifyItem" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="科室" prop="departId">
<el-select v-model="form.departId"
placeholder="请选择科室"
@change="changeDepart">
<el-option
v-for="item in departOptions"
:key="item.departName"
:label="item.departName"
:value="item.departId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="病人" prop="patientId">
<el-select v-model="form.patientId" placeholder="请选择病人" @change="changePatient">
<el-option
v-for="item in patientOptions"
:key="item.name"
:label="item.name"
:value="item.patientId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="床号" prop="bedId">
<el-input v-model="form.bedId" placeholder="床号" :disabled="true"/>
</el-form-item>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="配餐号" prop="number">
<el-select v-model="form.number" placeholder="请选择配餐号">
<el-option
v-for="item in frequencyOptions"
v-for="item in numberOptions"
:key="item.label"
:label="item.label"
:value="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="用法" prop="cateringUsage">
<el-select v-model="form.cateringUsage" placeholder="请选择用法">
<el-option
v-for="item in cateringUsageOptions"
:key="item.label"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="正餐类型" prop="types">
<el-select v-model="form.types"
multiple
@change="changeDinnerType"
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-col>
<el-col :span="12">
<el-form-item label="配餐频次" prop="frequency">
<!-- <el-select v-model="form.frequency" placeholder="频次" :disabled="true">-->
<!-- <el-option-->
<!-- v-for="item in frequencyOptions"-->
<!-- :key="item.label"-->
<!-- :label="item.label"-->
<!-- :value="item.label"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<el-input v-model="form.frequency" placeholder="频次" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
@ -325,23 +424,19 @@ export default {
components: {},
data() {
return {
//
frequencyOptions:[{
value: 'qd',
label: 'qd'
//
numberOptions: [{
value: 1,
label: '配餐 1'
}, {
value: 'bid',
label: 'bid'
value: 2,
label: '配餐 2'
}, {
value: 'tid',
label: 'tid'
}, {
value: 'qn',
label: 'qn'
}
],
value: 3,
label: '配餐 3'
}],
//
usageOptions: [{
cateringUsageOptions: [{
value: 1,
label: '鼻饲'
}, {
@ -378,6 +473,8 @@ export default {
title: "",
//
open: false,
//
modifyItem: false,
//
typeOptions: [],
//
@ -438,6 +535,7 @@ export default {
this.loading = true;
listCatering(this.queryParams).then(response => {
this.cateringList = response.rows;
console.log(response);
this.total = response.total;
this.loading = false;
});
@ -449,6 +547,7 @@ export default {
//
cancel() {
this.open = false;
this.modifyItem = false;
this.reset();
},
//
@ -459,14 +558,14 @@ export default {
type: null,
number: null,
frequency: null,
usage: null,
cateringUsage: null,
isReplace: null,
flag: null,
updateAt: null,
updateBy: null,
createAt: null,
createBy: null,
describe: null
cateringDescribe: null
};
this.resetForm("form");
},
@ -498,8 +597,8 @@ export default {
const id = row.id || this.ids
getCatering(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改配餐功能";
this.modifyItem = true;
this.title = "修改配餐";
});
},
/** 提交按钮 */
@ -513,6 +612,7 @@ export default {
this.getList();
});
} else {
console.log(this.form);
addCatering(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;