新增限额提示,24小时内防止充值等提醒

This commit is contained in:
sangchengzhi
2026-01-12 19:30:24 +08:00
parent 818891a131
commit 04324d5362
2 changed files with 111 additions and 13 deletions

View File

@@ -194,7 +194,7 @@ export const apiInHosPatientInfoQuery = p => post('/userorder/InHosPatientInfoQu
//住院预交记录查询
export const apiInHosChargeRecordQuery = p => post('/userorder/InHosChargeRecordQuery', p);
export const yjjXeQuery = p => post('/userorder/yjjXeQuery', p);
//预存缴费
export const apipay = p => post('/userorder/pay', p);

View File

@@ -24,6 +24,7 @@
<van-tag class="celltag" @click="tagclick">查询预交记录></van-tag>
</template>
</van-cell>
<van-cell title="今日还可充值:" :value="zyinfo.YJJKC" />
</van-cell-group>
<div class="chargemoneyboxbt">
支付金额
@@ -42,12 +43,12 @@
<div :class="this.chargemoney == 4000 ? 'box1' : 'box'" @click="clickmoney(4000)">
<h2>4000</h2>
</div>
<div :class="this.chargemoney == 6000 ? 'box1' : 'box'" @click="clickmoney(6000)">
<h2>6000</h2>
<div :class="this.chargemoney == 5000 ? 'box1' : 'box'" @click="clickmoney(5000)">
<h2>5000</h2>
</div>
<div :class="this.chargemoney == 8000 ? 'box1' : 'box'" @click="clickmoney(8000)">
<!-- <div :class="this.chargemoney == 8000 ? 'box1' : 'box'" @click="clickmoney(8000)">
<h2>8000</h2>
</div>
</div> -->
</div>
</div>
<van-cell-group>
@@ -56,7 +57,7 @@
</van-cell-group>
<div :class="btnclass">
<div @click="onConfirm2">支付</div>
<div @click="onConfirm">支付</div>
</div>
</div>
<van-empty description="住院处暂无该患者信息" v-else style="padding-top:90px" />
@@ -113,18 +114,28 @@ import {
apiInHosChargeRecordQuery,
apipay,
getUserCategory,
apiOpWxQuery
apiOpWxQuery,
yjjXeQuery
} from "@/request/api.js";
import Vue from "vue";
import { Toast, Empty, Calendar, RadioGroup, Radio, Field, ActionSheet } from "vant";
import { Toast, Empty, Calendar, RadioGroup, Radio, Field, ActionSheet, Dialog } from "vant";
Vue.use(ActionSheet);
Vue.use(Calendar);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(Field);
Vue.use(Dialog);
export default {
mounted() {
this.title = this.$route.meta.title;
// 显示住院预交金缴纳须知弹窗
Dialog.alert({
title: '住院预交金缴纳须知',
messageAlign: 'left',
message: '尊敬的患者及家属:\n\n现就住院预交金缴纳事宜告知如下\n\n1、办理住院 24 小时内,暂不支持线上缴预交金,需充值请前往住院收费窗口办理。\n2、24 小时后可通过掌上医院缴费,但每位患者每日最高限 5000 元;超 5000 元需到窗口办理。\n3、窗口办理请携带患者有效身份证件、住院病历号或押金单疑问可咨询护士站或收费窗口。\n\n感谢配合祝您早日康复'
}).then(() => {
// 弹窗关闭后的回调操作
});
},
computed: {
patientActions() {
@@ -145,12 +156,13 @@ export default {
radio: "1",
chargemoney: 1000,
qtchargemoney: "",
zyinfo: {},
zyinfo: { YJJKC: 0 },
showbox: false,
btnclass: "btn",
patientIds: [], // 存储多个 PatientId
patientId: null, // 选中的 PatientId
showPatientSelector: false,
yjjxes :5000
};
},
created() {
@@ -189,7 +201,56 @@ export default {
});
return;
},
yjjxe(){
return yjjXeQuery({patientId:this.patientId}).then(res => {
console.log("预交金限额查询",res);
return res.data;
})
},
onConfirm() {
if(this.zyinfo.YJJKC < this.chargemoney){
Toast({
message: '今日线上剩余可充值额度不足,请调整充值金额或到收费室进行充值!',
duration: 4500 // 设置显示时长为 3 秒
});
return;
// Toast({
// message: '您本日线上预交金充值已限额,如需充值请到收费室充值!',
// duration: 4000 // 设置显示时长为 4秒
// });
}
if(this.patientId != "90134173"){
Toast({
message: '因医院原因,暂时不开放线上充值预交金功能,请到门诊缴费窗口充值!',
duration: 3000 // 设置显示时长为 3 秒
});
return;
}
if(this.zyinfo.HOSDATE ){
// 计算时间差
const hosDate = new Date(this.zyinfo.HOSDATE);
const now = new Date();
const timeDiff = now - hosDate; // 毫秒差
const hoursDiff = timeDiff / (1000 * 60 * 60); // 转换为小时
if (hoursDiff < 24) {
// 计算剩余时间
const remainingMs = (24 - hoursDiff) * 1000 * 60 * 60;
const remainingHours = Math.floor(remainingMs / (1000 * 60 * 60));
const remainingMinutes = Math.floor((remainingMs % (1000 * 60 * 60)) / (1000 * 60));
// 小于24小时显示提示
Toast({
message: `患者24小时内如需充值需在门诊部1楼收费室进行充值${remainingHours}小时${remainingMinutes}分钟后才能线上充值预交金!`,
duration: 5000 // 设置显示时长为 5 秒
});
return;
}
// 大于24小时继续执行下面的流程
}
let _this = this;
let formData = {
@@ -352,7 +413,37 @@ return;
});
},
inputmoney() {
this.chargemoney = this.qtchargemoney;
// 获取原始输入值
const rawInput = this.qtchargemoney;
// 确保输入的是数字,且最多两位小数
// 使用正则表达式验证:只允许数字和小数点后最多两位
if (!/^\d+(\.\d{0,2})?$/.test(rawInput)) {
// 如果输入不符合格式,截取到最后一个有效字符
this.qtchargemoney = rawInput.slice(0, -1);
return;
}
// 确保输入的是数字
let inputMoney = parseFloat(this.qtchargemoney);
// 检查是否为有效数字
if (isNaN(inputMoney)) {
this.qtchargemoney = "";
this.chargemoney = 1000;
return;
}
// 限制最大金额为5000
if (inputMoney > 5000) {
inputMoney = 5000;
this.qtchargemoney = "5000";
}
// 更新金额
this.chargemoney = inputMoney;
// 如果输入为空,设置默认金额
if (this.qtchargemoney == "") {
this.chargemoney = 1000;
}
@@ -384,14 +475,21 @@ return;
if (Array.isArray(dataRows)) {
for (var i = 0; i < dataRows.length; i++) {
if (dataRows[i].HOSSTATE == "0" || dataRows[i].HOSSTATE == "") {
_this.zyinfo = dataRows[i];
_this.yjjxe().then(money => {
dataRows[i].YJJKC = _this.yjjxes - money;
_this.zyinfo = dataRows[i];
_this.showbox = true;
});
}
}
} else {
if (dataRows.HOSSTATE == "0" || dataRows.HOSSTATE == "") {
_this.zyinfo = dataRows;
_this.yjjxe().then(money => {
dataRows.YJJKC = _this.yjjxes - money;
_this.zyinfo = dataRows;
_this.showbox = true;
});
}
}
}