优化日常收费查看详情分页操作
This commit is contained in:
parent
de8d04bf3b
commit
642f65bab5
@ -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<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));
|
||||
|
||||
@ -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<FtReportMealsDao> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("patient_id", patientId);
|
||||
wrapper.eq("dining_flag",0);
|
||||
wrapper.eq("dining_flag",1);
|
||||
wrapper.eq("settlement_flag",0);
|
||||
|
||||
List<FtReportMealsDao> reportMealsList = iFtReportMealsDaoService.list(wrapper);
|
||||
|
||||
IPage<FtReportMealsDao> reportMealsList = iFtReportMealsDaoService.listPage(wrapper, pageNum, pageSize);
|
||||
ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumAllTotalPrice(patientId);
|
||||
|
||||
Map<String, Object> data = new HashMap<>(2);
|
||||
|
@ -65,5 +65,7 @@ public class SettleEntity {
|
||||
|
||||
// 付款方式
|
||||
private Integer payType;
|
||||
|
||||
// 分页信息
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
}
|
||||
|
@ -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<FtReportMealsDao> {
|
||||
List<FtReportMealsDao> listPatientReportMeals(FtReportMealsDao ftReportMealsDao);
|
||||
|
||||
void insertTomorrowReportMealByPatient(Long patientId);
|
||||
|
||||
IPage<FtReportMealsDao> listPage(QueryWrapper<FtReportMealsDao> reportMealsWrapper, Integer pageNum, Integer pageSize);
|
||||
}
|
||||
|
||||
|
@ -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<FtReportMealsDaoMap
|
||||
public void insertTomorrowReportMealByPatient(Long 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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -203,9 +203,9 @@
|
||||
<el-col :span="4">
|
||||
营养餐总价:{{ nutritionTotalPrice }}
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
报餐总价:{{ sumTotalPrice }}
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="mealsList">
|
||||
<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="totalPrice"/>
|
||||
</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 title="用餐详情" :visible.sync="open" width="1000px" append-to-body>
|
||||
<el-form ref="leaveForm" :model="leaveForm" :rules="rules" label-width="160px">
|
||||
<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="totalPrice"/>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="formShowAllMealsWithSelect.total>0"
|
||||
:total="formShowAllMealsWithSelect.total"
|
||||
:page.sync="formShowAllMealsWithSelect.pageNum"
|
||||
:limit.sync="formShowAllMealsWithSelect.pageSize"
|
||||
@pagination="popupShowAllMealsWithSelect"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -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,31 +510,12 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 变更结算日期计算
|
||||
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 {
|
||||
|
||||
dateSpan = Math.abs(dateSpan);
|
||||
iDays = Math.floor(dateSpan / (24 * 3600 * 1000));
|
||||
this.formAddNewSettlement.settlementDays = iDays;
|
||||
}
|
||||
|
||||
if (this.formAddNewSettlement.selectBillingDate != null) {
|
||||
showMealsWithSelect(this.formAddNewSettlement).then(response => {
|
||||
this.mealsList = response.data.reportMealsList;
|
||||
// 查看详情弹出层显示所有未付款数据列表分页
|
||||
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;
|
||||
@ -521,6 +530,48 @@ export default {
|
||||
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');
|
||||
|
||||
dateSpan = sDate2 - sDate1;
|
||||
|
||||
if (dateSpan < 0) {
|
||||
this.msgError("你现在的结算日期小于上一次上次结算 / 首次用餐日期");
|
||||
} else {
|
||||
|
||||
dateSpan = Math.abs(dateSpan);
|
||||
iDays = Math.floor(dateSpan / (24 * 3600 * 1000));
|
||||
this.formAddNewSettlement.settlementDays = iDays;
|
||||
}
|
||||
|
||||
if (this.formAddNewSettlement.selectBillingDate != null) {
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user