From 642f65bab5f22fcc34549bff1447e89c93db8f72 Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Thu, 4 Feb 2021 15:12:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=A5=E5=B8=B8=E6=94=B6?= =?UTF-8?q?=E8=B4=B9=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FtSettleDaoController.java | 14 +- .../system/fantang/entity/SettleEntity.java | 4 +- .../service/IFtReportMealsDaoService.java | 4 + .../impl/FtReportMealsDaoServiceImpl.java | 12 ++ ruoyi-ui/src/api/fantang/settle.js | 7 +- ruoyi-ui/src/views/fantang/settle/index.vue | 124 ++++++++++++------ 6 files changed, 113 insertions(+), 52 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java index 505f9b7b4..28d1a38b0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java @@ -4,6 +4,7 @@ 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.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; @@ -73,7 +74,9 @@ public class FtSettleDaoController extends BaseController { .eq("patient_id", patientId) .eq("dining_flag",1) .between("dining_at", sdf.format(lastBillingDate), DateUtil.endOfDay(selectBillingDate)); - List reportMealsList = iFtReportMealsDaoService.list(reportMealsWrapper); + Integer pageNum = settlement.getPageNum(); + Integer pageSize = settlement.getPageSize(); + IPage reportMealsList = iFtReportMealsDaoService.listPage(reportMealsWrapper, pageNum, pageSize); ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumTotalPrice(patientId, DateUtil.beginOfDay(lastBillingDate), DateUtil.endOfDay(selectBillingDate)); @@ -84,17 +87,16 @@ public class FtSettleDaoController extends BaseController { return AjaxResult.success(data); } - @GetMapping("/showAllMealsWithNoPay/{patientId}") - public AjaxResult showAllMealsWithNoPay(@PathVariable Long patientId) { + @GetMapping("/showAllMealsWithNoPay") + public AjaxResult showAllMealsWithNoPay(@RequestParam("patientId") Long patientId, @RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize) { // 查找该病人所有已用餐未结算记录 QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("patient_id", patientId); - wrapper.eq("dining_flag",0); + wrapper.eq("dining_flag",1); wrapper.eq("settlement_flag",0); - List reportMealsList = iFtReportMealsDaoService.list(wrapper); - + IPage reportMealsList = iFtReportMealsDaoService.listPage(wrapper, pageNum, pageSize); ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumAllTotalPrice(patientId); Map data = new HashMap<>(2); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/SettleEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/SettleEntity.java index ea1a52a39..a4aef6274 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/SettleEntity.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/SettleEntity.java @@ -65,5 +65,7 @@ public class SettleEntity { // 付款方式 private Integer payType; - + // 分页信息 + private Integer pageNum; + private Integer pageSize; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java index ab7202bdd..2ccf02a4d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java @@ -1,5 +1,7 @@ package com.ruoyi.system.fantang.service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.system.fantang.domain.FtReportMealsDao; import com.ruoyi.system.fantang.entity.ReportMealsDayEntity; @@ -44,5 +46,7 @@ public interface IFtReportMealsDaoService extends IService { List listPatientReportMeals(FtReportMealsDao ftReportMealsDao); void insertTomorrowReportMealByPatient(Long patientId); + + IPage listPage(QueryWrapper reportMealsWrapper, Integer pageNum, Integer pageSize); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java index efe370779..f4fe1ab20 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java @@ -2,8 +2,12 @@ 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.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.fantang.domain.FtOrderDao; import com.ruoyi.system.fantang.domain.FtReportMealsDao; import com.ruoyi.system.fantang.entity.ReportMealsDayEntity; import com.ruoyi.system.fantang.entity.ReportMealsPriceEntity; @@ -150,4 +154,12 @@ public class FtReportMealsDaoServiceImpl extends ServiceImpl listPage(QueryWrapper reportMealsWrapper, Integer pageNum, Integer pageSize) { + System.out.println(pageNum); + System.out.println(pageSize); + Page page = new Page<>(pageNum, pageSize); + return this.baseMapper.selectPage(page, reportMealsWrapper); + } } diff --git a/ruoyi-ui/src/api/fantang/settle.js b/ruoyi-ui/src/api/fantang/settle.js index e92ab45cf..55efce54c 100644 --- a/ruoyi-ui/src/api/fantang/settle.js +++ b/ruoyi-ui/src/api/fantang/settle.js @@ -15,10 +15,11 @@ export function getLastBillingDateByPatientId(patientId) { } // 查看该病人所有已用餐未结算的记录 -export function showAllMealsWithNoPay(patientId) { +export function showAllMealsWithNoPay(query) { return request({ - url: '/fantang/settle/showAllMealsWithNoPay/' + patientId, - method: 'get' + url: '/fantang/settle/showAllMealsWithNoPay/', + method: 'get', + params: query }) } diff --git a/ruoyi-ui/src/views/fantang/settle/index.vue b/ruoyi-ui/src/views/fantang/settle/index.vue index 42c44dd0e..ebd5faa75 100644 --- a/ruoyi-ui/src/views/fantang/settle/index.vue +++ b/ruoyi-ui/src/views/fantang/settle/index.vue @@ -203,9 +203,9 @@ 营养餐总价:{{ nutritionTotalPrice }} - - - 报餐总价:{{ sumTotalPrice }} + + 报餐总价:{{ sumTotalPrice }} + @@ -217,9 +217,18 @@ + + + - + @@ -293,6 +302,13 @@ + @@ -315,6 +331,16 @@ export default { components: {}, data() { return { + // 弹出层查询详情计数器 + totalDetails: 0, + // 查看详情弹出层数据 + formShowAllMealsWithSelect: { + patientId: null, + pageNum: 1, + pageSize: 8, + total: 0 + }, + payTypeOptions: [{ value: 1, label: '现金' @@ -394,6 +420,8 @@ export default { selectBillingDate: null, opera: null, payType: null, + pageNum: 1, + pageSize: 7, }, // 结算类型字典 @@ -482,19 +510,57 @@ export default { this.getList(); }, methods: { + // 查看详情弹出层显示所有未付款数据列表分页 + popupShowAllMealsWithSelect() { + showAllMealsWithNoPay(this.formShowAllMealsWithSelect).then(response => { + console.log(response); + this.mealsList = response.data.reportMealsList.records; + this.formShowAllMealsWithSelect.total = response.data.reportMealsList.total; + + if (response.data.reportMealsPrice == null) { + this.dinnerTotalPrice = 0; + this.nutritionTotalPrice = 0; + this.sumTotalPrice = 0; + } + + if (response.data.reportMealsPrice != null) { + this.dinnerTotalPrice = response.data.reportMealsPrice.dinnerTotalPrice; + this.nutritionTotalPrice = response.data.reportMealsPrice.nutritionTotalPrice; + this.sumTotalPrice = response.data.reportMealsPrice.sumTotalPrice; + this.formAddNewSettlement.netPeceipt = this.sumTotalPrice; + } + }) + }, + + // 收费弹出层所有根据时间范围未付费数据列表 + popupShowMealsWithSelect() { + showMealsWithSelect(this.formAddNewSettlement).then(response => { + this.mealsList = response.data.reportMealsList.records; + this.totalDetails = response.data.reportMealsList.total; + + if (response.data.reportMealsPrice == null) { + this.dinnerTotalPrice = 0; + this.nutritionTotalPrice = 0; + this.sumTotalPrice = 0; + } + + if (response.data.reportMealsPrice != null) { + this.dinnerTotalPrice = response.data.reportMealsPrice.dinnerTotalPrice; + this.nutritionTotalPrice = response.data.reportMealsPrice.nutritionTotalPrice; + this.sumTotalPrice = response.data.reportMealsPrice.sumTotalPrice; + this.formAddNewSettlement.netPeceipt = this.sumTotalPrice; + } + }) + }, + // 变更结算日期计算 changeBillingDate(value) { var dateSpan, iDays; let sDate1 = Date.parse(this.formAddNewSettlement.lastBillingDate); let sDate2 = Date.parse(value + ' 23:59:59'); - console.log("lastBillingDate", this.formAddNewSettlement.lastBillingDate) - console.log("selectBillingDate", value); dateSpan = sDate2 - sDate1; - console.log("当前选择时间-------", sDate2); - console.log("最后结算时间-------", sDate1); - if (dateSpan < 0) { this.msgError("你现在的结算日期小于上一次上次结算 / 首次用餐日期"); } else { @@ -505,22 +571,7 @@ export default { } if (this.formAddNewSettlement.selectBillingDate != null) { - showMealsWithSelect(this.formAddNewSettlement).then(response => { - this.mealsList = response.data.reportMealsList; - - if (response.data.reportMealsPrice == null) { - this.dinnerTotalPrice = 0; - this.nutritionTotalPrice = 0; - this.sumTotalPrice = 0; - } - - if (response.data.reportMealsPrice != null) { - this.dinnerTotalPrice = response.data.reportMealsPrice.dinnerTotalPrice; - this.nutritionTotalPrice = response.data.reportMealsPrice.nutritionTotalPrice; - this.sumTotalPrice = response.data.reportMealsPrice.sumTotalPrice; - this.formAddNewSettlement.netPeceipt = this.sumTotalPrice; - } - }) + this.popupShowMealsWithSelect(); } else { this.mealsList = null; this.dinnerTotalPrice = 0; @@ -577,14 +628,14 @@ export default { }); }, - // 出院伙食费结算按钮 + // 查看详情按钮 clickAddLeaveSettlement(row) { - // 清空数据 this.mealsList = null; this.sumTotalPrice = 0; this.dinnerTotalPrice = 0; this.nutritionTotalPrice = 0; + this.formShowAllMealsWithSelect.patientId = row.patientId; // 获取上次结算日期/首次用餐日期 getLastSettlementDate(row.patientId).then(response => { @@ -603,23 +654,12 @@ export default { this.leaveForm.prepayment = response.prepayment.prepaid; } - showAllMealsWithNoPay(row.patientId).then(response => { - console.log(response); - this.mealsList = response.data.reportMealsList; + this.formShowAllMealsWithSelect.total = 0; + this.formShowAllMealsWithSelect.pageNum = 1; + this.formShowAllMealsWithSelect.pageSize = 8; + this.popupShowAllMealsWithSelect(); - if (response.data.reportMealsPrice == null) { - this.dinnerTotalPrice = 0; - this.nutritionTotalPrice = 0; - this.sumTotalPrice = 0; - } - if (response.data.reportMealsPrice != null) { - this.dinnerTotalPrice = response.data.reportMealsPrice.dinnerTotalPrice; - this.nutritionTotalPrice = response.data.reportMealsPrice.nutritionTotalPrice; - this.sumTotalPrice = response.data.reportMealsPrice.sumTotalPrice; - this.formAddNewSettlement.netPeceipt = this.sumTotalPrice; - } - }) this.leaveForm.settlementDays = response.reportMeals.days; this.leaveForm.hospitalId = row.hospitalId;