优化日常收费查看详情分页操作

This commit is contained in:
czx 2021-02-04 15:12:12 +08:00
parent de8d04bf3b
commit 642f65bab5
6 changed files with 113 additions and 52 deletions

View File

@ -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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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;
@ -73,7 +74,9 @@ public class FtSettleDaoController extends BaseController {
.eq("patient_id", patientId) .eq("patient_id", patientId)
.eq("dining_flag",1) .eq("dining_flag",1)
.between("dining_at", sdf.format(lastBillingDate), DateUtil.endOfDay(selectBillingDate)); .between("dining_at", sdf.format(lastBillingDate), DateUtil.endOfDay(selectBillingDate));
List<FtReportMealsDao> reportMealsList = iFtReportMealsDaoService.list(reportMealsWrapper); Integer pageNum = settlement.getPageNum();
Integer pageSize = settlement.getPageSize();
IPage<FtReportMealsDao> reportMealsList = iFtReportMealsDaoService.listPage(reportMealsWrapper, pageNum, pageSize);
ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumTotalPrice(patientId, DateUtil.beginOfDay(lastBillingDate), DateUtil.endOfDay(selectBillingDate)); ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumTotalPrice(patientId, DateUtil.beginOfDay(lastBillingDate), DateUtil.endOfDay(selectBillingDate));
@ -84,17 +87,16 @@ public class FtSettleDaoController extends BaseController {
return AjaxResult.success(data); return AjaxResult.success(data);
} }
@GetMapping("/showAllMealsWithNoPay/{patientId}") @GetMapping("/showAllMealsWithNoPay")
public AjaxResult showAllMealsWithNoPay(@PathVariable Long patientId) { public AjaxResult showAllMealsWithNoPay(@RequestParam("patientId") Long patientId, @RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize) {
// 查找该病人所有已用餐未结算记录 // 查找该病人所有已用餐未结算记录
QueryWrapper<FtReportMealsDao> wrapper = new QueryWrapper<>(); QueryWrapper<FtReportMealsDao> wrapper = new QueryWrapper<>();
wrapper.eq("patient_id", patientId); wrapper.eq("patient_id", patientId);
wrapper.eq("dining_flag",0); wrapper.eq("dining_flag",1);
wrapper.eq("settlement_flag",0); wrapper.eq("settlement_flag",0);
List<FtReportMealsDao> reportMealsList = iFtReportMealsDaoService.list(wrapper); IPage<FtReportMealsDao> reportMealsList = iFtReportMealsDaoService.listPage(wrapper, pageNum, pageSize);
ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumAllTotalPrice(patientId); ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumAllTotalPrice(patientId);
Map<String, Object> data = new HashMap<>(2); Map<String, Object> data = new HashMap<>(2);

View File

@ -65,5 +65,7 @@ public class SettleEntity {
// 付款方式 // 付款方式
private Integer payType; private Integer payType;
// 分页信息
private Integer pageNum;
private Integer pageSize;
} }

View File

@ -1,5 +1,7 @@
package com.ruoyi.system.fantang.service; 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.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.fantang.domain.FtReportMealsDao; import com.ruoyi.system.fantang.domain.FtReportMealsDao;
import com.ruoyi.system.fantang.entity.ReportMealsDayEntity; import com.ruoyi.system.fantang.entity.ReportMealsDayEntity;
@ -44,5 +46,7 @@ public interface IFtReportMealsDaoService extends IService<FtReportMealsDao> {
List<FtReportMealsDao> listPatientReportMeals(FtReportMealsDao ftReportMealsDao); List<FtReportMealsDao> listPatientReportMeals(FtReportMealsDao ftReportMealsDao);
void insertTomorrowReportMealByPatient(Long patientId); void insertTomorrowReportMealByPatient(Long patientId);
IPage<FtReportMealsDao> listPage(QueryWrapper<FtReportMealsDao> reportMealsWrapper, Integer pageNum, Integer pageSize);
} }

View File

@ -2,8 +2,12 @@ package com.ruoyi.system.fantang.service.impl;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; 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.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.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.domain.FtReportMealsDao;
import com.ruoyi.system.fantang.entity.ReportMealsDayEntity; import com.ruoyi.system.fantang.entity.ReportMealsDayEntity;
import com.ruoyi.system.fantang.entity.ReportMealsPriceEntity; import com.ruoyi.system.fantang.entity.ReportMealsPriceEntity;
@ -150,4 +154,12 @@ public class FtReportMealsDaoServiceImpl extends ServiceImpl<FtReportMealsDaoMap
public void insertTomorrowReportMealByPatient(Long patientId) { public void insertTomorrowReportMealByPatient(Long patientId) {
ftReportMealVoMapper.insertTomorrowReportMealByPatient(patientId); ftReportMealVoMapper.insertTomorrowReportMealByPatient(patientId);
} }
@Override
public IPage<FtReportMealsDao> listPage(QueryWrapper<FtReportMealsDao> reportMealsWrapper, Integer pageNum, Integer pageSize) {
System.out.println(pageNum);
System.out.println(pageSize);
Page<FtReportMealsDao> page = new Page<>(pageNum, pageSize);
return this.baseMapper.selectPage(page, reportMealsWrapper);
}
} }

View File

@ -15,10 +15,11 @@ export function getLastBillingDateByPatientId(patientId) {
} }
// 查看该病人所有已用餐未结算的记录 // 查看该病人所有已用餐未结算的记录
export function showAllMealsWithNoPay(patientId) { export function showAllMealsWithNoPay(query) {
return request({ return request({
url: '/fantang/settle/showAllMealsWithNoPay/' + patientId, url: '/fantang/settle/showAllMealsWithNoPay/',
method: 'get' method: 'get',
params: query
}) })
} }

View File

@ -203,9 +203,9 @@
<el-col :span="4"> <el-col :span="4">
营养餐总价{{ nutritionTotalPrice }} 营养餐总价{{ nutritionTotalPrice }}
</el-col> </el-col>
</el-row> <el-col :span="4">
<el-row> 报餐总价{{ sumTotalPrice }}
报餐总价{{ sumTotalPrice }} </el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="mealsList"> <el-table v-loading="loading" :data="mealsList">
<el-table-column label="报餐日期" align="center" prop="createAt" width="180"> <el-table-column label="报餐日期" align="center" prop="createAt" width="180">
@ -217,9 +217,18 @@
<el-table-column label="营养餐价格" align="center" prop="nutritionFoodPrice"/> <el-table-column label="营养餐价格" align="center" prop="nutritionFoodPrice"/>
<el-table-column label="报餐总价" align="center" prop="totalPrice"/> <el-table-column label="报餐总价" align="center" prop="totalPrice"/>
</el-table> </el-table>
<pagination
v-show="totalDetails > 0"
:total="totalDetails"
:page.sync="formAddNewSettlement.pageNum"
:limit.sync="formAddNewSettlement.pageSize"
@pagination="popupShowMealsWithSelect"
background>
</pagination>
</el-dialog> </el-dialog>
<!-- 出院结算弹出层对话框--> <!-- 查看详情弹出层对话框-->
<el-dialog title="用餐详情" :visible.sync="open" width="1000px" append-to-body> <el-dialog title="用餐详情" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="leaveForm" :model="leaveForm" :rules="rules" label-width="160px"> <el-form ref="leaveForm" :model="leaveForm" :rules="rules" label-width="160px">
<el-form-item label="住院号" prop="hospitalId"> <el-form-item label="住院号" prop="hospitalId">
@ -293,6 +302,13 @@
<el-table-column label="营养餐价格" align="center" prop="nutritionFoodPrice"/> <el-table-column label="营养餐价格" align="center" prop="nutritionFoodPrice"/>
<el-table-column label="报餐总价" align="center" prop="totalPrice"/> <el-table-column label="报餐总价" align="center" prop="totalPrice"/>
</el-table> </el-table>
<pagination
v-show="formShowAllMealsWithSelect.total>0"
:total="formShowAllMealsWithSelect.total"
:page.sync="formShowAllMealsWithSelect.pageNum"
:limit.sync="formShowAllMealsWithSelect.pageSize"
@pagination="popupShowAllMealsWithSelect"
/>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -315,6 +331,16 @@ export default {
components: {}, components: {},
data() { data() {
return { return {
//
totalDetails: 0,
//
formShowAllMealsWithSelect: {
patientId: null,
pageNum: 1,
pageSize: 8,
total: 0
},
payTypeOptions: [{ payTypeOptions: [{
value: 1, value: 1,
label: '现金' label: '现金'
@ -394,6 +420,8 @@ export default {
selectBillingDate: null, selectBillingDate: null,
opera: null, opera: null,
payType: null, payType: null,
pageNum: 1,
pageSize: 7,
}, },
// //
@ -482,19 +510,57 @@ export default {
this.getList(); this.getList();
}, },
methods: { 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) { changeBillingDate(value) {
var dateSpan, iDays; var dateSpan, iDays;
let sDate1 = Date.parse(this.formAddNewSettlement.lastBillingDate); let sDate1 = Date.parse(this.formAddNewSettlement.lastBillingDate);
let sDate2 = Date.parse(value + ' 23:59:59'); let sDate2 = Date.parse(value + ' 23:59:59');
console.log("lastBillingDate", this.formAddNewSettlement.lastBillingDate)
console.log("selectBillingDate", value);
dateSpan = sDate2 - sDate1; dateSpan = sDate2 - sDate1;
console.log("当前选择时间-------", sDate2);
console.log("最后结算时间-------", sDate1);
if (dateSpan < 0) { if (dateSpan < 0) {
this.msgError("你现在的结算日期小于上一次上次结算 / 首次用餐日期"); this.msgError("你现在的结算日期小于上一次上次结算 / 首次用餐日期");
} else { } else {
@ -505,22 +571,7 @@ export default {
} }
if (this.formAddNewSettlement.selectBillingDate != null) { if (this.formAddNewSettlement.selectBillingDate != null) {
showMealsWithSelect(this.formAddNewSettlement).then(response => { this.popupShowMealsWithSelect();
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;
}
})
} else { } else {
this.mealsList = null; this.mealsList = null;
this.dinnerTotalPrice = 0; this.dinnerTotalPrice = 0;
@ -577,14 +628,14 @@ export default {
}); });
}, },
// //
clickAddLeaveSettlement(row) { clickAddLeaveSettlement(row) {
// //
this.mealsList = null; this.mealsList = null;
this.sumTotalPrice = 0; this.sumTotalPrice = 0;
this.dinnerTotalPrice = 0; this.dinnerTotalPrice = 0;
this.nutritionTotalPrice = 0; this.nutritionTotalPrice = 0;
this.formShowAllMealsWithSelect.patientId = row.patientId;
// / // /
getLastSettlementDate(row.patientId).then(response => { getLastSettlementDate(row.patientId).then(response => {
@ -603,23 +654,12 @@ export default {
this.leaveForm.prepayment = response.prepayment.prepaid; this.leaveForm.prepayment = response.prepayment.prepaid;
} }
showAllMealsWithNoPay(row.patientId).then(response => { this.formShowAllMealsWithSelect.total = 0;
console.log(response); this.formShowAllMealsWithSelect.pageNum = 1;
this.mealsList = response.data.reportMealsList; 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.settlementDays = response.reportMeals.days;
this.leaveForm.hospitalId = row.hospitalId; this.leaveForm.hospitalId = row.hospitalId;