mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
营养餐统计
This commit is contained in:
parent
dff06a9106
commit
aa57a01ffa
@ -3,7 +3,6 @@ package com.ruoyi.system.fantang.controller;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
@ -45,7 +44,7 @@ public class FtReportMealsDaoController extends BaseController {
|
||||
public AjaxResult getLastSettlementDate(@PathVariable("patientId") Long patientId) {
|
||||
|
||||
// 获取最近一次已结算的报餐记录,如果首次结算则返回
|
||||
FtReportMealsDao reportMealsDao = iFtReportMealsDaoService.getLastReportMeals(patientId);
|
||||
FtReportMealsDao reportMealsDao = iFtReportMealsDaoService.getLastReportMeals(patientId);
|
||||
|
||||
Date createAt = reportMealsDao.getCreateAt();
|
||||
Date settlementAt = reportMealsDao.getSettlementAt();
|
||||
@ -124,6 +123,14 @@ public class FtReportMealsDaoController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/listStatistics")
|
||||
public TableDataInfo listStatistics(FtReportMealsDao ftReportMealsDao) {
|
||||
|
||||
startPage();
|
||||
|
||||
return getDataTable(iFtReportMealsDaoService.listNutrition(ftReportMealsDao));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('fantang:meals:list')")
|
||||
@GetMapping("/listMealsWithInSettle")
|
||||
public TableDataInfo listMealsWithInSettle(FtReportMealsDao ftReportMealsDao) {
|
||||
|
||||
@ -33,7 +33,7 @@ public class FtReportMealsDao implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
@ -86,18 +86,33 @@ public class FtReportMealsDao implements Serializable {
|
||||
|
||||
private String settlementBy;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String hospitalId;
|
||||
|
||||
/**
|
||||
* 科室 id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String departId;
|
||||
|
||||
/**
|
||||
* 科室名
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String departName;
|
||||
|
||||
/**
|
||||
* 床号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String bedId;
|
||||
|
||||
/**
|
||||
* 病人姓名
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String name;
|
||||
|
||||
@ -136,6 +151,33 @@ public class FtReportMealsDao implements Serializable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer total;
|
||||
|
||||
|
||||
private Boolean openFlag;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer statisticsType;
|
||||
|
||||
/**
|
||||
* 营养餐名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String nutritionName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer cateringUsage;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date diningAt;
|
||||
|
||||
/**
|
||||
* 用餐开始时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Date beginOfDay;
|
||||
|
||||
/**
|
||||
* 用餐结束时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Date endOfDay;
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.system.fantang.mapper;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
|
||||
import com.ruoyi.system.fantang.entity.ReportMealsPriceEntity;
|
||||
@ -37,4 +38,8 @@ public interface FtReportMealsDaoMapper extends BaseMapper<FtReportMealsDao> {
|
||||
*/
|
||||
@Select("SELECT a.patient_id,sum(a.price) as dinner_total_price , sum(a.nutrition_food_price ) as nutrition_total_price , sum(a.total_price) as sum_total_price FROM ft_report_meals a where a.patient_id = #{patientId} and a.create_at BETWEEN #{lastBillingDate} AND #{selectBillingDate}")
|
||||
ReportMealsPriceEntity sumTotalPrice(@Param("patientId") Long patientId, @Param("lastBillingDate") Date lastBillingDate, @Param("selectBillingDate") Date selectBillingDate);
|
||||
|
||||
List<FtReportMealsDao> listNutrition(@Param("beginOfDay") DateTime beginOfDay, @Param("endOfDay") DateTime endOfDay, FtReportMealsDao ftReportMealsDao);
|
||||
|
||||
List<FtReportMealsDao> listAllNutrition(FtReportMealsDao ftReportMealsDao);
|
||||
}
|
||||
|
||||
@ -33,5 +33,9 @@ public interface IFtReportMealsDaoService extends IService<FtReportMealsDao> {
|
||||
ReportMealsPriceEntity sumTotalPrice(Long patientId, Date lastBillingDate, Date selectBillingDate);
|
||||
|
||||
FtReportMealsDao getLastReportMeals(Long patientId);
|
||||
|
||||
List<FtReportMealsDao> listNutrition(FtReportMealsDao ftReportMealsDao);
|
||||
|
||||
List<FtReportMealsDao> listAllNutrition(FtReportMealsDao ftReportMealsDao);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.ruoyi.system.fantang.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
|
||||
@ -85,16 +87,44 @@ public class FtReportMealsDaoServiceImpl extends ServiceImpl<FtReportMealsDaoMap
|
||||
// 如果是首次结算
|
||||
if (flag1ReportMealsDao == null) {
|
||||
|
||||
// 获取最近一条报餐
|
||||
// 获取第一条报餐数据
|
||||
QueryWrapper<FtReportMealsDao> flag0Wrapper = new QueryWrapper<>();
|
||||
flag0Wrapper.eq("patient_id", patientId);
|
||||
flag0Wrapper.eq("settlement_flag", 1);
|
||||
flag0Wrapper.orderByDesc("settlement_at");
|
||||
flag0Wrapper.last("limit 0");
|
||||
flag0Wrapper.orderByAsc("dining_at");
|
||||
flag0Wrapper.last("limit 1");
|
||||
|
||||
return this.baseMapper.selectOne(flag0Wrapper);
|
||||
}
|
||||
|
||||
return flag1ReportMealsDao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FtReportMealsDao> listNutrition(FtReportMealsDao ftReportMealsDao) {
|
||||
|
||||
List<FtReportMealsDao> list;
|
||||
|
||||
Date today = new Date();
|
||||
|
||||
if (ftReportMealsDao.getStatisticsType() == null) {
|
||||
list = this.baseMapper.listAllNutrition(ftReportMealsDao);
|
||||
} else {
|
||||
if (ftReportMealsDao.getStatisticsType() == 1) {
|
||||
ftReportMealsDao.setBeginOfDay(DateUtil.beginOfDay(today));
|
||||
ftReportMealsDao.setEndOfDay(DateUtil.endOfDay(today));
|
||||
} else {
|
||||
DateTime tomorrow = DateUtil.offsetDay(today, 1);
|
||||
ftReportMealsDao.setBeginOfDay(DateUtil.beginOfDay(tomorrow));
|
||||
ftReportMealsDao.setEndOfDay(DateUtil.endOfDay(tomorrow));
|
||||
}
|
||||
list = this.baseMapper.listAllNutrition(ftReportMealsDao);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FtReportMealsDao> listAllNutrition(FtReportMealsDao ftReportMealsDao) {
|
||||
return this.baseMapper.listAllNutrition(ftReportMealsDao);
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
<result property="rice" column="rice"/>
|
||||
<result property="egg" column="egg"/>
|
||||
<result property="openFlag" column="open_flag"/>
|
||||
<result property="diningAt" column="dining_at"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="listMealsWithInSettle" resultType="com.ruoyi.system.fantang.domain.FtReportMealsDao">
|
||||
@ -42,4 +43,76 @@
|
||||
GROUP BY a.patient_id
|
||||
</select>
|
||||
|
||||
<select id="listNutrition" resultType="com.ruoyi.system.fantang.domain.FtReportMealsDao">
|
||||
SELECT
|
||||
a.patient_id,
|
||||
a.type,
|
||||
a.foods,
|
||||
a.nutrition_food_price,
|
||||
a.nutrition_food_id,
|
||||
d.`name` AS nutrition_name,
|
||||
a.nutrition_food_flag,
|
||||
a.is_replace_food,
|
||||
b.`name`,
|
||||
b.depart_id,
|
||||
b.hospital_id,
|
||||
b.bed_id,
|
||||
c.depart_name,
|
||||
f.catering_usage
|
||||
FROM
|
||||
ft_report_meals a
|
||||
LEFT JOIN ft_patient b ON a.patient_id = b.patient_id
|
||||
LEFT JOIN ft_depart c ON b.depart_id = c.depart_id
|
||||
LEFT JOIN ft_nutrition_food d ON a.nutrition_food_id = d.id
|
||||
LEFT JOIN ft_catering f ON a.patient_id = f.patient_id
|
||||
AND a.type = f.type
|
||||
<where>
|
||||
a.open_flag = 1
|
||||
AND a.dining_at BETWEEN #{beginOfDay}
|
||||
AND #{endOfDay}
|
||||
<if test="cateringUsage != null">and f.catering_usage = #{cateringUsage}</if>
|
||||
<if test="departId != null">and b.depart_id = #{departId}</if>
|
||||
<if test="name != null">and b.`name` = #{name}</if>
|
||||
<if test="nutritionFoodId != null">and a.nutrition_food_id = #{nutritionFoodId}</if>
|
||||
<if test="type != null">and a.type = #{type}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="listAllNutrition" resultType="com.ruoyi.system.fantang.domain.FtReportMealsDao">
|
||||
SELECT
|
||||
a.patient_id,
|
||||
a.type,
|
||||
a.foods,
|
||||
a.dining_at,
|
||||
a.nutrition_food_price,
|
||||
a.nutrition_food_id,
|
||||
d.`name` AS nutrition_name,
|
||||
a.nutrition_food_flag,
|
||||
a.is_replace_food,
|
||||
b.`name`,
|
||||
b.depart_id,
|
||||
b.hospital_id,
|
||||
b.bed_id,
|
||||
c.depart_name,
|
||||
f.catering_usage
|
||||
FROM
|
||||
ft_report_meals a
|
||||
LEFT JOIN ft_patient b ON a.patient_id = b.patient_id
|
||||
LEFT JOIN ft_depart c ON b.depart_id = c.depart_id
|
||||
LEFT JOIN ft_nutrition_food d ON a.nutrition_food_id = d.id
|
||||
LEFT JOIN ft_catering f ON a.patient_id = f.patient_id
|
||||
AND a.type = f.type
|
||||
<where>
|
||||
a.open_flag = 1
|
||||
<if test="beginOfDay != null">AND a.dining_at BETWEEN #{beginOfDay}</if>
|
||||
<if test="endOfDay != null">AND #{endOfDay}</if>
|
||||
<if test="cateringUsage != null">and f.catering_usage = #{cateringUsage}</if>
|
||||
<if test="cateringUsage != null">and f.catering_usage = #{cateringUsage}</if>
|
||||
<if test="departId != null">and b.depart_id = #{departId}</if>
|
||||
<if test="name != null">and b.`name` = #{name}</if>
|
||||
<if test="nutritionFoodId != null">and a.nutrition_food_id = #{nutritionFoodId}</if>
|
||||
<if test="type != null">and a.type = #{type}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -2,107 +2,116 @@ import request from '@/utils/request'
|
||||
|
||||
// 查询所有报餐管理列表
|
||||
export function listAll(query) {
|
||||
return request({
|
||||
url: '/fantang/meals/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询所有统计报餐
|
||||
export function listStatistics(query) {
|
||||
return request({
|
||||
url: '/fantang/meals/listStatistics',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询未结算报餐记录
|
||||
export function listNoPay(query) {
|
||||
return request({
|
||||
url: '/fantang/meals/listNoPay',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals/listNoPay',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询已结算报餐记录
|
||||
export function listPayoff(query) {
|
||||
return request({
|
||||
url: '/fantang/meals/listPayoff',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals/listPayoff',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询报餐管理列表
|
||||
export function listMeals(query) {
|
||||
return request({
|
||||
url: '/fantang/meals/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function listMealsWithInSettle(query) {
|
||||
return request({
|
||||
url: '/fantang/meals/listMealsWithInSettle',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals/listMealsWithInSettle',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询报餐管理详细
|
||||
export function getMeals(id) {
|
||||
return request({
|
||||
url: '/fantang/meals/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增报餐管理
|
||||
export function addMeals(data) {
|
||||
return request({
|
||||
url: '/fantang/meals',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改报餐管理
|
||||
export function updateMeals(data) {
|
||||
return request({
|
||||
url: '/fantang/meals',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除报餐管理
|
||||
export function delMeals(id) {
|
||||
return request({
|
||||
url: '/fantang/meals/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出报餐管理
|
||||
export function exportMeals(query) {
|
||||
return request({
|
||||
url: '/fantang/meals/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获取最后结算日期
|
||||
export function getLastSettlementDate(patientId) {
|
||||
return request({
|
||||
url: '/fantang/meals/getLastSettlementDate/' + patientId,
|
||||
method: 'get',
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals/getLastSettlementDate/' + patientId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 计算两个日期之间的结算数据
|
||||
export function countBillingBetween(query) {
|
||||
return request({
|
||||
url: '/fantang/meals/countBillingBetween',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/fantang/meals/countBillingBetween',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
360
ruoyi-ui/src/views/fantang/nutritionStatistics/index.vue
Normal file
360
ruoyi-ui/src/views/fantang/nutritionStatistics/index.vue
Normal file
@ -0,0 +1,360 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="统计日期" prop="statisticsType">
|
||||
<el-select v-model="queryParams.statisticsType" placeholder="请选择统计日期" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in statisticsTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="病人姓名" prop="name">
|
||||
<el-input v-model="queryParams.name" size="small"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="营养餐" prop="nutritionFoodId">
|
||||
<el-select v-model="queryParams.nutritionFoodId" placeholder="请选择营养餐" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in nutritionFoodOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="科室" prop="departId">
|
||||
<el-select v-model="queryParams.departId" placeholder="请选择科室" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in departOptions"
|
||||
:key="item.departId"
|
||||
:label="item.departName"
|
||||
:value="item.departId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用法" prop="cateringUsage">
|
||||
<el-select v-model="queryParams.cateringUsage" placeholder="请选择用法" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in cateringUsageOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="正餐类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择用法" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</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="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['fantang:meals:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="mealsList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="科室" align="center" prop="departName"/>
|
||||
<el-table-column label="姓名" align="center" prop="name"/>
|
||||
<el-table-column label="床号" align="center" prop="bedId"/>
|
||||
<el-table-column label="正餐类型" align="center" prop="type"/>
|
||||
<el-table-column label="营养餐" align="center" prop="nutritionName"/>
|
||||
<el-table-column label="用法" align="center" prop="cateringUsage"/>
|
||||
<el-table-column label="用餐日期" align="center" prop="diningAt">
|
||||
|
||||
</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:meals:edit']"-->
|
||||
<!-- >修改-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['fantang:meals: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="createAt">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="form.createAt"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择报餐日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="报餐类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择报餐类型">
|
||||
<el-option label="请选择字典生成" value=""/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单列表" prop="foods">
|
||||
<el-input v-model="form.foods" placeholder="请输入订单列表"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="正餐总价" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入总价"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form-item>
|
||||
|
||||
</el-form-item>
|
||||
<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 {addMeals, delMeals, exportMeals, getMeals, updateMeals} from "@/api/fantang/meals";
|
||||
import {listStatistics} from "../../../api/fantang/meals";
|
||||
import {listNutritionFood} from "../../../api/fantang/nutritionFood";
|
||||
import {listDepart} from "../../../api/fantang/depart";
|
||||
|
||||
export default {
|
||||
name: "Meals",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
typeOptions: [{
|
||||
value: 1,
|
||||
label: '早餐'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '午餐'
|
||||
}, {
|
||||
value: 3,
|
||||
label: '晚餐'
|
||||
}, {
|
||||
value: 4,
|
||||
label: '加餐'
|
||||
}],
|
||||
cateringUsageOptions: [{
|
||||
value: 1,
|
||||
label: '鼻饲'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '口服'
|
||||
}],
|
||||
departOptions: [],
|
||||
nutritionFoodOptions: [],
|
||||
statisticsTypeOptions: [{
|
||||
value: 1,
|
||||
label: '今日'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '明日'
|
||||
}],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 报餐管理表格数据
|
||||
mealsList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
statisticsType: null,
|
||||
name: null,
|
||||
nutritionFoodId: null,
|
||||
departId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
createAt: [
|
||||
{required: true, message: "报餐日期不能为空", trigger: "blur"}
|
||||
],
|
||||
type: [
|
||||
{required: true, message: "报餐类型不能为空", trigger: "change"}
|
||||
],
|
||||
createBy: [
|
||||
{required: true, message: "报餐人不能为空", trigger: "blur"}
|
||||
],
|
||||
foods: [
|
||||
{required: true, message: "订单列表不能为空", trigger: "blur"}
|
||||
],
|
||||
price: [
|
||||
{required: true, message: "总价不能为空", trigger: "blur"}
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询报餐管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listStatistics(this.queryParams).then(response => {
|
||||
this.mealsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
listNutritionFood().then(response => {
|
||||
this.nutritionFoodOptions = response.rows;
|
||||
})
|
||||
listDepart().then(response => {
|
||||
this.departOptions = response.rows;
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
createAt: null,
|
||||
type: null,
|
||||
patientId: null,
|
||||
createBy: null,
|
||||
foods: null,
|
||||
price: null,
|
||||
settlementFlag: 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
|
||||
getMeals(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) {
|
||||
updateMeals(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addMeals(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 delMeals(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有报餐管理数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return exportMeals(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -159,7 +159,9 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
// this.getList();
|
||||
this.total = 0;
|
||||
this.loading = false;
|
||||
this.getDicts("ft_book_type").then(response => {
|
||||
this.typeOptions = response.data;
|
||||
});
|
||||
|
||||
@ -495,6 +495,10 @@ export default {
|
||||
// console.log("selectBillingDate", this.formAddNewSettlement.selectBillingDate)
|
||||
|
||||
dateSpan = sDate2 - sDate1;
|
||||
|
||||
console.log("sdate2-------", sDate2);
|
||||
console.log("sdate1-------", sDate1);
|
||||
|
||||
if (dateSpan < 0) {
|
||||
this.msgError("你现在的结算日期小于上一次上次结算 / 用餐日期");
|
||||
} else {
|
||||
@ -625,9 +629,9 @@ export default {
|
||||
refund: null
|
||||
};
|
||||
this.formAddNewSettlement = {
|
||||
selectBillingDate:null,
|
||||
payType:null,
|
||||
netPeceipt:null,
|
||||
selectBillingDate: null,
|
||||
payType: null,
|
||||
netPeceipt: null,
|
||||
};
|
||||
|
||||
this.resetForm("form");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user