搭建病患配餐页面
This commit is contained in:
parent
a8567345c9
commit
e6e6a94784
@ -1,31 +1,23 @@
|
|||||||
package com.ruoyi.system.fantang.controller;
|
package com.ruoyi.system.fantang.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
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.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.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
|
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
|
||||||
import com.ruoyi.system.fantang.service.IFtFoodDemandDaoService;
|
import com.ruoyi.system.fantang.service.IFtFoodDemandDaoService;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import lombok.RequiredArgsConstructor;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
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
|
* 病人报餐Controller
|
||||||
@ -95,6 +87,7 @@ public class FtFoodDemandDaoController extends BaseController {
|
|||||||
@Log(title = "病人报餐" , businessType = BusinessType.UPDATE)
|
@Log(title = "病人报餐" , businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody FtFoodDemandDao ftFoodDemandDao) {
|
public AjaxResult edit(@RequestBody FtFoodDemandDao ftFoodDemandDao) {
|
||||||
|
ftFoodDemandDao.setUpdateAt(new Date());
|
||||||
return toAjax(iFtFoodDemandDaoService.updateById(ftFoodDemandDao) ? 1 : 0);
|
return toAjax(iFtFoodDemandDaoService.updateById(ftFoodDemandDao) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
package com.ruoyi.system.fantang.domain;
|
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.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.experimental.Accessors;
|
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.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 病人报餐对象 ft_food_demand
|
* 病人报餐对象 ft_food_demand
|
||||||
@ -29,61 +27,91 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||||||
@TableName("ft_food_demand")
|
@TableName("ft_food_demand")
|
||||||
public class FtFoodDemandDao implements Serializable {
|
public class FtFoodDemandDao implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID=1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
/** id */
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
@TableId(value = "id")
|
@TableId(value = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 病人id */
|
/**
|
||||||
|
* 病人id
|
||||||
|
*/
|
||||||
private Long patientId;
|
private Long patientId;
|
||||||
|
|
||||||
/** 正餐清单 */
|
/**
|
||||||
|
* 正餐清单
|
||||||
|
*/
|
||||||
@Excel(name = "正餐清单")
|
@Excel(name = "正餐清单")
|
||||||
private String foods;
|
private String foods;
|
||||||
|
|
||||||
/** 正餐类型 */
|
/**
|
||||||
|
* 正餐类型
|
||||||
|
*/
|
||||||
@Excel(name = "正餐类型")
|
@Excel(name = "正餐类型")
|
||||||
private Long type;
|
private Long type;
|
||||||
|
|
||||||
/** 创建时间 */
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
private Date createAt;
|
private Date createAt;
|
||||||
|
|
||||||
/** 创建人 */
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
private Long createBy;
|
private Long createBy;
|
||||||
|
|
||||||
/** 更新日期 */
|
/**
|
||||||
@Excel(name = "更新日期" , width = 30, dateFormat = "yyyy-MM-dd")
|
* 更新日期
|
||||||
|
*/
|
||||||
|
@Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date updateAt;
|
private Date updateAt;
|
||||||
|
|
||||||
/** 加菜 */
|
/**
|
||||||
|
* 加菜
|
||||||
|
*/
|
||||||
@Excel(name = "加菜")
|
@Excel(name = "加菜")
|
||||||
private Integer vegetables;
|
private Integer vegetables;
|
||||||
|
|
||||||
/** 更新操作人 id */
|
/**
|
||||||
|
* 更新操作人 id
|
||||||
|
*/
|
||||||
private Long updateBy;
|
private Long updateBy;
|
||||||
|
|
||||||
/** 加肉 */
|
/**
|
||||||
|
* 加肉
|
||||||
|
*/
|
||||||
@Excel(name = "加肉")
|
@Excel(name = "加肉")
|
||||||
private Integer meat;
|
private Integer meat;
|
||||||
|
|
||||||
/** 更新来源 */
|
/**
|
||||||
|
* 更新来源
|
||||||
|
*/
|
||||||
private Integer updateFrom;
|
private Integer updateFrom;
|
||||||
|
|
||||||
/** 加饭 */
|
/**
|
||||||
|
* 加饭
|
||||||
|
*/
|
||||||
@Excel(name = "加饭")
|
@Excel(name = "加饭")
|
||||||
private Integer rice;
|
private Integer rice;
|
||||||
|
|
||||||
/** 加蛋 */
|
/**
|
||||||
|
* 加蛋
|
||||||
|
*/
|
||||||
@Excel(name = "加蛋")
|
@Excel(name = "加蛋")
|
||||||
private Integer egg;
|
private Integer egg;
|
||||||
|
|
||||||
/** 订单详情 */
|
/**
|
||||||
|
* 订单详情
|
||||||
|
*/
|
||||||
private String orderInfo;
|
private String orderInfo;
|
||||||
|
|
||||||
/** 启用状态 */
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
@Excel(name = "启用状态")
|
@Excel(name = "启用状态")
|
||||||
private Integer flag;
|
private Boolean flag;
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,56 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="启用状态" prop="flag">
|
<el-form-item label="姓名" prop="patientName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.flag"
|
v-model="queryParams.name"
|
||||||
placeholder="请输入启用状态"
|
placeholder="请输入姓名"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="床号" prop="bedId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.bedId"
|
||||||
|
placeholder="请输入床号"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="科室" prop="departName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.departName"
|
||||||
|
placeholder="请输入科室"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="住院号" prop="hospitalId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.hospitalId"
|
||||||
|
placeholder="请输入住院号"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="启用状态" prop="flag">
|
||||||
|
<el-select v-model="queryParams.flag" placeholder="请选择启用状态"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery">
|
||||||
|
<el-option
|
||||||
|
v-for="item in flagOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</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 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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@ -24,27 +65,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['fantang:foodDemand:add']"
|
v-hasPermi="['fantang:foodDemand:add']"
|
||||||
>新增</el-button>
|
>自动生成
|
||||||
</el-col>
|
</el-button>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['fantang:foodDemand: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:foodDemand:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -53,26 +75,32 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['fantang:foodDemand:export']"
|
v-hasPermi="['fantang:foodDemand:export']"
|
||||||
>导出</el-button>
|
>导出
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<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="foodDemandList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="foodDemandList" @selection-change="handleSelectionChange" border>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<!-- <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="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="hospitalId"/>-->
|
||||||
<el-table-column label="正餐清单" align="center" prop="foods" />
|
<el-table-column label="姓名" align="center" prop="name" width="100px"/>
|
||||||
<el-table-column label="更新日期" align="center" prop="updateAt" width="180">
|
<!-- <el-table-column label="科室" align="center" prop="departName"/>-->
|
||||||
<template slot-scope="scope">
|
<el-table-column label="床号" align="center" prop="bedId" width="100px"/>
|
||||||
<span>{{ parseTime(scope.row.updateAt, '{y}-{m}-{d}') }}</span>
|
<el-table-column label="正餐" align="center" prop="type" :formatter="typeFormat" width="100px"/>
|
||||||
</template>
|
<el-table-column label="正餐清单" align="center" prop="foods"/>
|
||||||
</el-table-column>
|
<el-table-column label="加菜" align="center" prop="vegetables" width="80px"/>
|
||||||
<el-table-column label="加菜" align="center" prop="vegetables" />
|
<el-table-column label="加肉" align="center" prop="meat" width="80px"/>
|
||||||
<el-table-column label="加肉" align="center" prop="meat" />
|
<el-table-column label="加饭" align="center" prop="rice" width="80px"/>
|
||||||
<el-table-column label="加饭" align="center" prop="rice" />
|
<el-table-column label="加蛋" align="center" prop="egg" width="80px"/>
|
||||||
<el-table-column label="加蛋" align="center" prop="egg" />
|
<el-table-column label="营养配餐" align="center" prop="nutritionFood" width="120px"/>
|
||||||
<el-table-column label="启用状态" align="center" prop="flag" />
|
<!-- <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="flag" width="80px"/>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@ -81,14 +109,8 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['fantang:foodDemand:edit']"
|
v-hasPermi="['fantang:foodDemand:edit']"
|
||||||
>修改</el-button>
|
>修改
|
||||||
<el-button
|
</el-button>
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['fantang:foodDemand:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -104,6 +126,9 @@
|
|||||||
<!-- 添加或修改病人报餐对话框 -->
|
<!-- 添加或修改病人报餐对话框 -->
|
||||||
<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="姓名">
|
||||||
|
<el-input label="姓名"></el-input>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
@ -114,14 +139,27 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listFoodDemand, getFoodDemand, delFoodDemand, addFoodDemand, updateFoodDemand, exportFoodDemand } from "@/api/fantang/foodDemand";
|
import {
|
||||||
|
addFoodDemand,
|
||||||
|
delFoodDemand,
|
||||||
|
exportFoodDemand,
|
||||||
|
getFoodDemand,
|
||||||
|
listFoodDemand,
|
||||||
|
updateFoodDemand
|
||||||
|
} from "@/api/fantang/foodDemand";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "FoodDemand",
|
name: "FoodDemand",
|
||||||
components: {
|
components: {},
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
flagOptions: [{
|
||||||
|
value: 1,
|
||||||
|
label: '启用'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
label: '禁用'
|
||||||
|
}],
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@ -155,7 +193,7 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
type: [
|
type: [
|
||||||
{ required: true, message: "正餐类型不能为空", trigger: "change" }
|
{required: true, message: "正餐类型不能为空", trigger: "change"}
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -226,7 +264,7 @@ export default {
|
|||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
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
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
@ -265,20 +303,6 @@ 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("删除成功");
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
@ -286,7 +310,7 @@ export default {
|
|||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(function() {
|
}).then(function () {
|
||||||
return exportFoodDemand(queryParams);
|
return exportFoodDemand(queryParams);
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user