mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 09:55:16 +08:00
预付费出院结清,收费
This commit is contained in:
parent
ffa745bac0
commit
8d6c43e457
@ -3,7 +3,6 @@ package com.ruoyi.system.fantang.controller;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.config.RuoYiConfig;
|
||||
@ -22,6 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -64,10 +64,6 @@ public class FtPrepaymentDaoController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/getPrepaymentByPatientId/{patientId}")
|
||||
public AjaxResult getPrepaymentByPatientId(@PathVariable("patientId") Long patientId) {
|
||||
// FtPrepaymentVo dao = iFtPrepaymentDaoService.getCountById(patientId);
|
||||
// if (dao == null)
|
||||
// return AjaxResult.error("无该记录");
|
||||
// return AjaxResult.success("操作成功", dao);
|
||||
FtPrepaymentDao ftPrepaymentDao = iFtPrepaymentDaoService.getByPatientId(patientId);
|
||||
if (ftPrepaymentDao == null) {
|
||||
return AjaxResult.error("无该记录");
|
||||
@ -164,14 +160,9 @@ public class FtPrepaymentDaoController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('fantang:prepayment:add')")
|
||||
@Log(title = "收费管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FtPrepaymentVo ftPrepaymentDao) {
|
||||
|
||||
Long patientId = ftPrepaymentDao.getPatientId();
|
||||
QueryWrapper<FtPrepaymentVo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("patient_id", patientId);
|
||||
|
||||
public AjaxResult add(@RequestBody FtPrepaymentDao ftPrepaymentDao) {
|
||||
ftPrepaymentDao.setCollectAt(new Date());
|
||||
ftPrepaymentDao.setSettlementFlag(0L);
|
||||
|
||||
return toAjax(iFtPrepaymentDaoService.save(ftPrepaymentDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
@ -195,6 +186,9 @@ public class FtPrepaymentDaoController extends BaseController {
|
||||
return toAjax(iFtPrepaymentDaoService.removeByIds(Arrays.asList(prepaymentIds)) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成 pdf 收据
|
||||
*/
|
||||
@PostMapping("/generateReceiptPdf")
|
||||
public AjaxResult generateReceiptPdf(@RequestBody JSONObject params) {
|
||||
|
||||
@ -213,6 +207,21 @@ public class FtPrepaymentDaoController extends BaseController {
|
||||
String downloadPath = "profile/upload/饭堂票据" + patientId + ".pdf";
|
||||
|
||||
return AjaxResult.success(fileWebUrl + downloadPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出院结清
|
||||
*/
|
||||
@PutMapping("/leaveSettlePrepayment/{prepaymentId}")
|
||||
public AjaxResult leaveSettlePrepayment(@PathVariable Long prepaymentId){
|
||||
|
||||
FtPrepaymentDao prepaymentDao = new FtPrepaymentDao();
|
||||
prepaymentDao.setPrepaymentId(prepaymentId);
|
||||
prepaymentDao.setPrepaid(new BigDecimal(0));
|
||||
prepaymentDao.setSettlementFlag(1);
|
||||
prepaymentDao.setSettlementAt(new Date());
|
||||
|
||||
iFtPrepaymentDaoService.updateById(prepaymentDao);
|
||||
return AjaxResult.success("已结清");
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ public class FtPrepaymentDao implements Serializable {
|
||||
* 结算标志
|
||||
*/
|
||||
@Excel(name = "结算标志")
|
||||
private Long settlementFlag;
|
||||
private Integer settlementFlag;
|
||||
|
||||
/**
|
||||
* 预付费金额
|
||||
|
||||
@ -109,3 +109,10 @@ export function generateReceiptPdf(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function leaveSettlePrepayment(prepaymentId) {
|
||||
return request({
|
||||
url: '/fantang/prepayment/leaveSettlePrepayment/' + prepaymentId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算标志" prop="settlementFlag">
|
||||
<el-form-item label="是否已缴费" prop="settlementFlag" label-width="90px">
|
||||
<el-select v-model="queryParams.settlementFlag" @change="selectSettlementFlag" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in settlementFlagOptions"
|
||||
@ -29,7 +29,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预付费时间" prop="prepaidAt" label-width="50">
|
||||
<el-form-item label="预付费时间" prop="prepaidAt" label-width="50" v-if="payFlag">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="queryParams.prepaidAt"
|
||||
type="date"
|
||||
@ -101,12 +101,12 @@
|
||||
:modal="true">
|
||||
<el-form ref="formAddPrepayment" :model="formAddPrepayment" :rules="rules" label-width="120px">
|
||||
<el-form-item label="住院号" prop="hospitalId">
|
||||
<el-autocomplete
|
||||
popper-class="my-autocomplete"
|
||||
v-model="formAddPrepayment.hospitalId"
|
||||
:fetch-suggestions="querySearch"
|
||||
placeholder="请输入住院号"
|
||||
@select="handleSelect" style="width: 250px">
|
||||
<el-autocomplete :disabled="payFlag"
|
||||
popper-class="my-autocomplete"
|
||||
v-model="formAddPrepayment.hospitalId"
|
||||
:fetch-suggestions="querySearch"
|
||||
placeholder="请输入住院号"
|
||||
@select="handleSelect" style="width: 250px">
|
||||
<i
|
||||
class="el-icon-edit el-input__icon"
|
||||
slot="suffix"
|
||||
@ -131,7 +131,8 @@
|
||||
<el-input v-model="formAddPrepayment.prepaid"
|
||||
onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" type="number"
|
||||
placeholder="请输入预付费金额"
|
||||
style="width: 250px"/>
|
||||
style="width: 250px"
|
||||
:disabled="payFlag"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预付费时间" prop="collectAt">
|
||||
<el-date-picker clearable size="small" style="width: 250px"
|
||||
@ -144,7 +145,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitformAddPrepayment">收 费</el-button>
|
||||
<el-button type="primary" @click="submitLeaveSettle">结 清</el-button>
|
||||
<el-button @click="cancel">关 闭</el-button>
|
||||
<el-button @click="clickPrintSettle">打印收据</el-button>
|
||||
</div>
|
||||
@ -158,6 +159,7 @@
|
||||
<el-form ref="formAddPrepayment" :model="formAddPrepayment" :rules="rules" label-width="120px">
|
||||
<el-form-item label="住院号" prop="hospitalId">
|
||||
<el-autocomplete
|
||||
:disabled="!this.payFlag"
|
||||
popper-class="my-autocomplete"
|
||||
v-model="formAddPrepayment.hospitalId"
|
||||
:fetch-suggestions="querySearch"
|
||||
@ -187,7 +189,8 @@
|
||||
<el-input v-model="formAddPrepayment.prepaid"
|
||||
onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" type="number"
|
||||
placeholder="请输入预付费金额"
|
||||
style="width: 250px"/>
|
||||
style="width: 250px"
|
||||
:disabled="!this.payFlag"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预付费时间" prop="collectAt">
|
||||
<el-date-picker clearable size="small" style="width: 250px"
|
||||
@ -200,9 +203,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitformChangePrepayment">收 费</el-button>
|
||||
<el-button type="primary" @click="submitFormChangePrepayment">收 费</el-button>
|
||||
<el-button @click="cancel">关 闭</el-button>
|
||||
<el-button @click="clickPrintSettle">打印收据</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@ -216,16 +218,18 @@ import {
|
||||
exportPrepayment,
|
||||
generateReceiptPdf,
|
||||
getPrepayment,
|
||||
leaveSettlePrepayment,
|
||||
listNoPrepayment,
|
||||
listPrepay
|
||||
} from "../../../api/fantang/prepayment";
|
||||
import {getUserProfile} from "../../../api/system/user";
|
||||
|
||||
export default {
|
||||
name: "Prepayment",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 缴费标志
|
||||
payFlag: true,
|
||||
openChargeDialogTitle: null,
|
||||
openChargeDialogFlag: false,
|
||||
// 权限相关的参数
|
||||
@ -238,7 +242,7 @@ export default {
|
||||
label: '已缴费'
|
||||
}, {
|
||||
value: 1,
|
||||
label: '未交费'
|
||||
label: '未缴费'
|
||||
}],
|
||||
suggestionList: [],
|
||||
NoPrepayments: [],
|
||||
@ -279,7 +283,10 @@ export default {
|
||||
name: null,
|
||||
prepaid: null,
|
||||
collectAt: null,
|
||||
row: null
|
||||
row: null,
|
||||
userName: null,
|
||||
patientId: null,
|
||||
settlementFlag: null,
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
@ -296,7 +303,6 @@ export default {
|
||||
created() {
|
||||
this.getList();
|
||||
this.buildSuggestionList();
|
||||
this.myGetUser();
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
@ -310,8 +316,7 @@ export default {
|
||||
// 相应处理出院结清功能
|
||||
clickSettle(row) {
|
||||
this.open = true;
|
||||
getPrepayment(row.prepaymentId).then(response =>{
|
||||
console.log(response);
|
||||
getPrepayment(row.prepaymentId).then(response => {
|
||||
this.formAddPrepayment.hospitalId = row.hospitalId;
|
||||
this.formAddPrepayment.name = row.name;
|
||||
this.formAddPrepayment.collectAt = response.data.prepayment = response.data.collectAt;
|
||||
@ -324,9 +329,7 @@ export default {
|
||||
if (this.queryParams.settlementFlag === 0) {
|
||||
// 查询已交预付费信息
|
||||
listPrepay(this.queryParams).then(response => {
|
||||
console.log(response);
|
||||
this.prepaymentList = response.rows.map((item) => {
|
||||
console.log(item);
|
||||
item.noPrepayment = true;
|
||||
return item;
|
||||
});
|
||||
@ -344,27 +347,16 @@ export default {
|
||||
generateReceiptPdf(row).then(response => {
|
||||
window.open(response.msg)
|
||||
})
|
||||
console.log(process.env);
|
||||
},
|
||||
// 获取用户相关信息
|
||||
myGetUser() {
|
||||
getUserProfile().then(response => {
|
||||
this.user = response.data;
|
||||
this.roleGroup = response.roleGroup;
|
||||
this.postGroup = response.postGroup;
|
||||
});
|
||||
},
|
||||
// 处理筛选结算标志
|
||||
selectSettlementFlag(value) {
|
||||
this.payFlag = value !== 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
// 响应自动查询回显
|
||||
querySearch(queryString, cb) {
|
||||
var restaurants = this.suggestionList;
|
||||
console.log("restaurants-->", restaurants);
|
||||
console.log("queryString", queryString)
|
||||
console.log("cb-->", cb)
|
||||
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
|
||||
// 调用 callback 返回建议列表的数据
|
||||
cb(results);
|
||||
@ -379,7 +371,6 @@ export default {
|
||||
|
||||
buildSuggestionList() {
|
||||
listNoPrepayment(this.queryParams).then(response => {
|
||||
console.log("aaaaaaaaaaaaa", response);
|
||||
let prepaymentList = response.rows;
|
||||
this.suggestionList = prepaymentList.map(item => {
|
||||
return {
|
||||
@ -398,7 +389,6 @@ export default {
|
||||
this.loading = true;
|
||||
listNoPrepayment(this.queryParams).then(response => {
|
||||
this.prepaymentList = response.rows.map(item => {
|
||||
console.log(item);
|
||||
item.noPrepayment = false;
|
||||
return item;
|
||||
});
|
||||
@ -428,12 +418,12 @@ export default {
|
||||
|
||||
// 处理点击查询图标的事件
|
||||
handleIconClick(ev) {
|
||||
console.log(ev);
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.openChargeDialogFlag = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
@ -482,7 +472,6 @@ export default {
|
||||
this.reset();
|
||||
const prepaymentId = row.prepaymentId || this.ids
|
||||
|
||||
console.log('row:',row);
|
||||
this.formAddPrepayment.hospitalId = row.hospitalId;
|
||||
this.formAddPrepayment.name = row.name;
|
||||
this.formAddPrepayment.collectAt = new Date();
|
||||
@ -490,36 +479,38 @@ export default {
|
||||
this.formAddPrepayment.row = row;
|
||||
this.openChargeDialogFlag = true;
|
||||
},
|
||||
submitformChangePrepayment() {
|
||||
submitFormChangePrepayment() {
|
||||
this.formAddPrepayment.collectBy = this.$store.state.user.name;
|
||||
this.formAddPrepayment.patientId = this.formAddPrepayment.row.patientId;
|
||||
this.formAddPrepayment.settlementFlag = 0;
|
||||
this.formAddPrepayment.collectAt = null;
|
||||
this.formAddPrepayment.prepaidAt = null;
|
||||
|
||||
console.log("bbbbbbbbbb", this.formAddPrepayment);
|
||||
addPrepayment(this.formAddPrepayment).then(response => {
|
||||
this.msgSuccess("已收费")
|
||||
this.openChargeDialogFlag = false;
|
||||
this.reset();
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
|
||||
/** 提交按钮 */
|
||||
submitformAddPrepayment() {
|
||||
|
||||
// 1、检查该用户是否找推荐列表中,如果不在,认为该用户是已经缴费的用户
|
||||
let hospitalId = this.formAddPrepayment.hospitalId;
|
||||
this.formAddPrepayment.collectBy = this.user.userName;
|
||||
this.$refs["formAddPrepayment"].validate(valid => {
|
||||
if (valid) {
|
||||
if (!this.suggestionList.find(x => {
|
||||
return x.value === hospitalId;
|
||||
})) {
|
||||
this.msgError("未找到该住院号记录,请先添加!");
|
||||
return;
|
||||
}
|
||||
|
||||
this.formAddPrepayment.prepaidAt = null;
|
||||
console.log("form -->", this.formAddPrepayment)
|
||||
addPrepayment(this.formAddPrepayment).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.buildSuggestionList();
|
||||
});
|
||||
}
|
||||
});
|
||||
submitFormAddPrepayment() {
|
||||
this.formAddPrepayment.userName = this.$store.state.user.name
|
||||
console.log(this.formAddPrepayment);
|
||||
},
|
||||
|
||||
submitLeaveSettle() {
|
||||
console.log(this.formAddPrepayment.row);
|
||||
leaveSettlePrepayment(this.formAddPrepayment.row.prepaymentId).then(response => {
|
||||
this.msgSuccess("已结清")
|
||||
this.open = false;
|
||||
this.reset();
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const prepaymentIds = row.prepaymentId || this.ids;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user