实现首次结算的时候,提示这个病人是首次收费,不显示上次结算日期
This commit is contained in:
parent
206fecd2b0
commit
49c93f59eb
@ -12,7 +12,6 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
|
||||
import com.ruoyi.system.fantang.domain.FtSettleDao;
|
||||
import com.ruoyi.system.fantang.entity.ReportMealsDayEntity;
|
||||
import com.ruoyi.system.fantang.service.IFtReportMealsDaoService;
|
||||
import com.ruoyi.system.fantang.vo.FtReportMealVo;
|
||||
@ -39,7 +38,7 @@ public class FtReportMealsDaoController extends BaseController {
|
||||
private final IFtReportMealsDaoService iFtReportMealsDaoService;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 查询指定用户上一次结算的日期,并通过这个日期计算未结算的天数
|
||||
*/
|
||||
@GetMapping("/getLastSettlementDate/{patientId}")
|
||||
@ -50,9 +49,17 @@ public class FtReportMealsDaoController extends BaseController {
|
||||
wrapper.orderByDesc("settlement_at");
|
||||
wrapper.last("limit 1");
|
||||
FtReportMealsDao ftReportMealsDao = iFtReportMealsDaoService.getOne(wrapper);
|
||||
Date createAt = ftReportMealsDao.getCreateAt();
|
||||
Date settlementAt = ftReportMealsDao.getSettlementAt();
|
||||
long days = DateUtil.between(settlementAt, new Date(), DateUnit.DAY);
|
||||
ReportMealsDayEntity reportMealsDayEntity = new ReportMealsDayEntity();
|
||||
if (settlementAt == null) {
|
||||
long betweenDays = DateUtil.between(createAt, new Date(), DateUnit.DAY);
|
||||
reportMealsDayEntity.setDays(betweenDays);
|
||||
reportMealsDayEntity.setLastCreateDate(createAt);
|
||||
return AjaxResult.success(reportMealsDayEntity);
|
||||
}
|
||||
long days = DateUtil.between(settlementAt, new Date(), DateUnit.DAY);
|
||||
|
||||
reportMealsDayEntity.setSettlementAt(settlementAt);
|
||||
reportMealsDayEntity.setDays(days);
|
||||
|
||||
@ -134,7 +141,8 @@ public class FtReportMealsDaoController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 计算两个日期之间的未结算数据
|
||||
* 计算两个日期之间的未结算数据
|
||||
*
|
||||
* @param dao
|
||||
* @return
|
||||
*/
|
||||
|
@ -15,4 +15,6 @@ public class ReportMealsDayEntity extends FtReportMealsDao {
|
||||
private Date selectBillingDate;
|
||||
// 自上一次结算累计未结算天数
|
||||
private Long days;
|
||||
// 上次缴费日期
|
||||
private Date lastCreateDate;
|
||||
}
|
||||
|
@ -184,13 +184,13 @@
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="上次结算日期" prop="lastBillingDate">
|
||||
<!-- <el-input v-model="formAddNewSettlement.lastBillingDate" :disabled="true"/>-->
|
||||
<el-form-item label="上次结算日期" prop="lastBillingDate" v-if="lastBillFlag">
|
||||
<!-- <el-input v-model="formAddNewSettlement.lastBillingDate" :disabled="true"/>-->
|
||||
<el-date-picker
|
||||
v-model="formAddNewSettlement.lastBillingDate"
|
||||
align="right"
|
||||
type="date"
|
||||
:disabled="true">
|
||||
:disabled="true">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -264,10 +264,9 @@
|
||||
|
||||
<script>
|
||||
import {addSettle, delSettle, exportSettle, getSettle, listSettle, updateSettle} from "@/api/fantang/settle";
|
||||
import {listAll, listNoPay, listPayoff} from "@/api/fantang/meals";
|
||||
import {getLastSettlementDate, listAll, listNoPay, listPayoff} from "@/api/fantang/meals";
|
||||
import {getUserProfile} from "@/api/system/user";
|
||||
import {getPrepaymentByPatientId} from "@/api/fantang/prepayment";
|
||||
import {getLastSettlementDate} from "@/api/fantang/meals";
|
||||
|
||||
export default {
|
||||
name: "Settle",
|
||||
@ -299,6 +298,8 @@ export default {
|
||||
}
|
||||
}]
|
||||
},
|
||||
//上次结算日期标志
|
||||
lastBillFlag: true,
|
||||
// 权限相关的参数
|
||||
userName: null,
|
||||
roleGroup: null,
|
||||
@ -418,12 +419,15 @@ export default {
|
||||
var dateSpan, iDays;
|
||||
let sDate1 = Date.parse(this.formAddNewSettlement.lastBillingDate);
|
||||
let sDate2 = Date.parse(value);
|
||||
console.log("sDate1---",sDate1,"sDate2---",sDate2)
|
||||
dateSpan = sDate2 - sDate1;
|
||||
console.log("qqqqqqqqqqqqqqqqqqqqqqqqqqq",dateSpan);
|
||||
if (dateSpan <= 0) {
|
||||
this.msgError("你现在的结算日期小于上一次结算日期!!");
|
||||
} else {
|
||||
dateSpan = Math.abs(dateSpan);
|
||||
iDays = Math.floor(dateSpan / (24 * 3600 * 1000));
|
||||
console.log("ddddddddddddddddddddddddddddd",iDays);
|
||||
this.formAddNewSettlement.settlementDays = iDays;
|
||||
}
|
||||
},
|
||||
@ -440,7 +444,14 @@ export default {
|
||||
clickAddNewSettlement(row) {
|
||||
getLastSettlementDate(row.patientId).then(response => {
|
||||
console.log("getLastBillingDateByPatientId-->", response);
|
||||
this.formAddNewSettlement.lastBillingDate = response.data.settlementAt;
|
||||
if (response.data.settlementAt === null) {
|
||||
this.lastBillFlag = false;
|
||||
this.formAddNewSettlement.lastBillingDate = response.data.lastCreateDate;
|
||||
this.msgInfo("该病人首次收费")
|
||||
}else {
|
||||
this.lastBillFlag = true;
|
||||
this.formAddNewSettlement.lastBillingDate = response.data.settlementAt;
|
||||
}
|
||||
this.formAddNewSettlement.settlementDays = response.data.days;
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user