修改住院模块流程页面,修改限额时段

This commit is contained in:
sangchengzhi
2026-02-06 14:37:09 +08:00
parent 6af4a4d549
commit 1dafcb4364
16 changed files with 1827 additions and 458 deletions

BIN
dist.zip Normal file

Binary file not shown.

BIN
src/assets/住院费用.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 B

BIN
src/assets/预交金.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

View File

@@ -331,6 +331,11 @@ export const apiUpdateBA = p => post('/bingan/apiUpdateBA', p);
//退费接口
export const WxRefundOrder = p => post('/pay/wxpay/refundOrder', p);
//获取线上缴费金额总数
export const SumWxBalance = p => post('/sfs/SumWxBalance', p);
//获取线上退费金额
export const DelWxBalance = p => post('/sfs/DelWxBalance', p);

View File

@@ -89,6 +89,10 @@ import Zhdz_ai from "../views/Zhdz_ai.vue";
import tui from "../views/tui.vue";
import ybAUTH from "../views/ybAUTH.vue";
import Zstj_home from "../views/Zstj_home.vue";
import ZYindex2 from "../views/ZYindex2.vue";
import ZYdetail from "../views/ZYdetail.vue";
Vue.use(VueRouter);
const router = new VueRouter({
@@ -637,6 +641,22 @@ const router = new VueRouter({
meta: {
title: "住院管理",
},
},
{
path: "/ZYindex2",
name: "ZYindex2",
component: ZYindex2,
meta: {
title: "住院列表",
},
},
{
path: "/ZYdetail",
name: "ZYdetail",
component: ZYdetail,
meta: {
title: "住院详情",
},
},
{
path: "/ZYCharge",

View File

@@ -388,6 +388,18 @@ export default {
// 确认支付
confirmPayment() {
// 检查当前时间是否在23:00-00:01之间这个时间段内禁止充值
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes();
if ((hours === 23 && minutes >= 0) || (hours === 0 && minutes <= 1)) {
Toast({
message: '当前时间段(23:00-00:01)正在对账暂不支持支付操作请0点过后再试',
duration: 5000
});
return;
}
// 防止重复点击:如果正在支付中,直接返回
if (this.isPaying) return;

View File

@@ -358,14 +358,14 @@ export default {
Toast("请选择支付方式");
return;
}
// 检查当前时间是否在23:48-00:01之间这个时间段内禁止充值
// 检查当前时间是否在23:00-00:01之间这个时间段内禁止充值
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes();
if ((hours === 23 && minutes >= 48) || (hours === 0 && minutes <= 1)) {
if ((hours === 23 && minutes >= 0) || (hours === 0 && minutes <= 1)) {
Toast({
message: '当前时间段(23:48-00:01)正在对账暂不支持支付操作请0点过后再试',
message: '当前时间段(23:00-00:01)正在对账暂不支持支付操作请0点过后再试',
duration: 5000
});
return;

View File

@@ -79,7 +79,7 @@
</router-link>
</li>
<li>
<router-link to="ZYindex">
<router-link to="ZYindex2">
<img src="../assets/住院管理-功能按键.png" alt="住院管理" />
</router-link>
</li>

View File

@@ -262,9 +262,9 @@ export default {
const hours = now.getHours();
const minutes = now.getMinutes();
if ((hours === 23 && minutes >= 48) || (hours === 0 && minutes <= 1)) {
if ((hours === 23 && minutes >= 0) || (hours === 0 && minutes <= 1)) {
Toast({
message: '当前时间段(23:48-00:01)正在对账暂不支持支付操作请0点过后再试',
message: '当前时间段(23:00-00:01)正在对账暂不支持支付操作请0点过后再试',
duration: 5000
});
return;

View File

@@ -506,12 +506,17 @@ console.log(item);
let that = this;
that.list = [];
that.lislist = [];
// 计算加1天后的结束日期
let endDate = new Date(that.enddate);
endDate.setDate(endDate.getDate() + 1);
let formattedEndDate = that.formatDate(endDate);
let formData = {
QueryCode: that.card.cardNo,
//QueryCode:"0001238384",
QueryType: 1,
StartTime: that.startdate + " 00:00:00",
EndTime: that.enddate + " 23:59:59",
EndTime: formattedEndDate+ " 23:59:59",
};
if (that.card.cardNo == null) {
Toast("请选择就诊人");

View File

@@ -1,8 +1,8 @@
<template>
<div class="home">
<nav-bar></nav-bar>
<div class="lxr" @click="handleCardSelect">
<div class="lxrr" v-if="card && card.id">
<div class="lxr" @click="handleCardSelect" v-if="card && card.id">
<div class="lxrr">
<h2>
{{ card.name }}
<p>卡号{{ card.cardNo }}</p>
@@ -11,7 +11,6 @@
<i class="van-icon van-icon-arrow van-cell__right-icon"></i>
</h3>
</div>
<van-contact-card type="add" add-text="请选择就诊人" v-else />
</div>
<div v-if="showbox">
<van-cell-group class="cell_box">
@@ -132,7 +131,7 @@ export default {
Dialog.alert({
title: '住院预交金缴纳须知',
messageAlign: 'left',
message: '尊敬的患者及家属:\n\n现就住院预交金缴纳事宜告知如下\n\n1、办理住院 24 小时内,暂不支持线上缴预交金,需充值请前往住院收费窗口办理。\n2、24 小时后可通过掌上医院缴费,但每位患者每日最高限 5000 元;超 5000 元需到窗口办理。\n3、窗口办理请携带患者有效身份证件、住院病历号或押金单疑问可咨询护士站或收费窗口。\n\n感谢配合祝您早日康复'
message: '尊敬的患者及家属:\n\n现就住院预交金缴纳事宜告知如下\n\n1、办理住院 24 小时内,暂不支持线上缴预交金,需充值请前往住院收费窗口办理。\n2、24 小时后可通过掌上医院缴费,但每位患者每日最高限 3000 元;超 3000 元需到窗口办理。\n3、窗口办理请携带患者有效身份证件、住院病历号或押金单疑问可咨询护士站或收费窗口。\n\n感谢配合祝您早日康复'
}).then(() => {
// 弹窗关闭后的回调操作
});
@@ -166,7 +165,41 @@ export default {
};
},
created() {
// 优先检查是否有 hospitalizationItem 数据
const hospitalizationItem = sessionStorage.getItem('hospitalizationItem');
if (hospitalizationItem) {
const item = JSON.parse(hospitalizationItem);
this.patientId = item.INHOSPATIENTID; // 使用 INHOSPATIENTID 作为 patientId
this.zyinfo = {
INHOSNUM: item.INHOSNUM,
PATIENTNAME: item.PATIENTNAME,
PATIENTSEX: item.PATIENTSEX,
BIRTHDAY: item.BIRTHDAY,
PHONENUM: item.PHONENUM,
ADDRESS: item.ADDRESS,
IDCARDNO: item.IDCARDNO,
DEPARTCODE: item.DEPARTCODE,
DEPTNAME: item.DEPTNAME || item.SECTIONTYPE,
BEDNO: item.BEDNO,
HOSDATE: item.HOSDATE,
OUTHOSDATE: item.OUTHOSDATE,
HOSSTATE: item.HOSSTATE,
HOSBALANCE: item.HOSBALANCE,
PATIENTSOURCE: item.PATIENTSOURCE,
};
// 获取预交金限额
this.yjjxe().then((res) => {
this.zyinfo.YJJKC = this.yjjxes - res;
this.showbox = true;
}).catch(() => {
// 如果获取限额失败仍然显示页面但限额默认为3000
this.zyinfo.YJJKC = this.yjjxes;
this.showbox = true;
});
return;
}
// 如果没有 hospitalizationItem 数据,执行原来的逻辑
this.card = JSON.parse(sessionStorage.getItem("card"));
if (this.card) {
this.getZYInfo();
@@ -213,9 +246,9 @@ return;
const hours = now.getHours();
const minutes = now.getMinutes();
if ((hours === 23 && minutes >= 48) || (hours === 0 && minutes <= 1)) {
if ((hours === 23 && minutes >= 0) || (hours === 0 && minutes <= 1)) {
Toast({
message: '当前时间段(23:48-00:01)正在对账暂不支持支付操作请0点过后再试',
message: '当前时间段(23:00-00:01)正在对账暂不支持支付操作请0点过后再试',
duration: 5000
});
return;
@@ -487,10 +520,12 @@ return;
if (jsonObj2.response.returnresult.returncode == "1") {
if (Array.isArray(dataRows)) {
for (var i = 0; i < dataRows.length; i++) {
if (dataRows[i].HOSSTATE == "0" || dataRows[i].HOSSTATE == "") {
// 创建一个局部变量保存当前的 dataRow
let currentDataRow = dataRows[i];
if (currentDataRow.HOSSTATE == "0" || currentDataRow.HOSSTATE == "") {
_this.yjjxe().then(money => {
dataRows[i].YJJKC = _this.yjjxes - money;
_this.zyinfo = dataRows[i];
currentDataRow.YJJKC = _this.yjjxes - money;
_this.zyinfo = currentDataRow;
_this.showbox = true;
});
}

View File

@@ -2,8 +2,8 @@
<div class="home">
<nav-bar></nav-bar>
<div class="bj"></div>
<div class="lxr" @click="handleCardSelect">
<div class="lxrr" v-if="card && card.id">
<div class="lxr" @click="handleCardSelect" v-if="card && card.id">
<div class="lxrr">
<h2>
{{ card.name }}
<p>卡号{{ card.cardNo }}</p>
@@ -12,7 +12,6 @@
<i class="van-icon van-icon-arrow van-cell__right-icon"></i>
</h3>
</div>
<van-contact-card type="add" add-text="请选择就诊人" v-else />
</div>
<div v-if="showbox">
<div class="cellbody">
@@ -176,6 +175,35 @@ export default {
};
},
created() {
// 首先检查 sessionStorage 中是否有 hospitalizationItem 数据
const hospitalizationItem = sessionStorage.getItem('hospitalizationItem');
if (hospitalizationItem) {
const item = JSON.parse(hospitalizationItem);
this.INHOSNUM = item.INHOSNUM;
this.zyinfo = {
INHOSNUM: item.INHOSNUM,
PATIENTNAME: item.PATIENTNAME,
PATIENTSEX: item.PATIENTSEX,
BIRTHDAY: item.BIRTHDAY,
PHONENUM: item.PHONENUM,
ADDRESS: item.ADDRESS,
IDCARDNO: item.IDCARDNO,
DEPARTCODE: item.DEPARTCODE,
DEPTNAME: item.DEPTNAME,
BEDNO: item.BEDNO,
HOSDATE: item.HOSDATE,
OUTHOSDATE: item.OUTHOSDATE,
HOSSTATE: item.HOSSTATE,
HOSBALANCE: item.HOSBALANCE,
PATIENTSOURCE: item.PATIENTSOURCE,
};
this.startdate = this.formatDate(item.HOSDATE);
this.enddate = this.formatDate(item.OUTHOSDATE);
this.showbox = true;
return;
}
// 如果没有 hospitalizationItem 数据,执行原来的逻辑
this.card = JSON.parse(sessionStorage.getItem("card"));
if (this.card) {
this.getZYInfo();
@@ -299,10 +327,31 @@ export default {
});
},
formatDate(date) {
let year = date.getFullYear();
let month = date.getMonth() + 1;
// 处理空值、undefined、null 或空字符串
if (!date || date === '') {
return '';
}
let dateObj;
if (typeof date === 'string') {
// 如果是字符串,将空格替换为 'T' 以兼容 iOS然后创建 Date 对象
dateObj = new Date(date.replace(' ', 'T'));
} else if (date instanceof Date) {
// 如果是 Date 对象,直接使用
dateObj = date;
} else {
return '';
}
// 检查是否是有效的日期
if (isNaN(dateObj.getTime())) {
return '';
}
let year = dateObj.getFullYear();
let month = dateObj.getMonth() + 1;
month = month > 9 ? month : "0" + month;
let day = date.getDate();
let day = dateObj.getDate();
day = day > 9 ? day : "0" + day;
return year + "-" + month + "-" + day;
}

299
src/views/ZYdetail.vue Normal file
View File

@@ -0,0 +1,299 @@
<template>
<div class="home">
<nav-bar></nav-bar>
<div class="bj"></div>
<!-- 顶部信息区域 -->
<div class="header-info" v-if="hospitalizationItem">
<div class="info-header">
<div class="info-left">
<div class="info-item">
<span class="info-label">住院号</span>
<span class="info-value">{{ hospitalizationItem.INHOSNUM }}</span>
</div>
<div class="info-item">
<span class="info-label">姓名</span>
<span class="info-value">{{ hospitalizationItem.PATIENTNAME }}</span>
</div>
<div class="info-item">
<span class="info-label">住院科室</span>
<span class="info-value">{{ hospitalizationItem.SECTIONTYPE }}</span>
</div>
</div>
<!-- 修改点1替换Vant Tag为自定义状态标签删除van-tag相关代码 -->
<div class="info-right">
<div class="state-tag state-tag--out" v-if="hospitalizationItem.HOSSTATE == '2'">已出院</div>
<div class="state-tag state-tag--in" v-else>住院中</div>
</div>
</div>
<!-- 费用信息 -->
<div class="cost-info">
<div class="cost-item">
<span class="cost-value">{{ hospitalizationItem.HOSBALANCE }}</span>
<span class="cost-label">可用余额</span>
</div>
<div class="cost-item">
<span class="cost-value">{{ hospitalizationItem.BEDNO || '暂无' }}</span>
<span class="cost-label">病床号</span>
</div>
<div class="cost-item">
<span class="cost-value">{{ hospitalizationItem.PATIENTSOURCE == '1' ? '门诊患者' : '转诊患者' }}</span>
<span class="cost-label">患者来源</span>
</div>
</div>
</div>
<!-- 业务办理模块 -->
<div class="business-section">
<h3 class="section-title">业务办理</h3>
<div class="business-item" @click="navigateToZYCharge">
<div class="business-icon">
<img src="../assets/预交金.png" alt="预交金查询" />
</div>
<div class="business-content">
<h4 class="business-title">我的预交金</h4>
<p class="business-desc">查询充值记录在线充值预交金</p>
</div>
<van-icon name="arrow" class="business-arrow" />
</div>
<div class="business-item" @click="navigateToZYdailylist">
<div class="business-icon">
<img src="../assets/住院费用清单.png" alt="日清单查询" />
</div>
<div class="business-content">
<h4 class="business-title">日清单查询</h4>
<p class="business-desc">每日费用明细</p>
</div>
<van-icon name="arrow" class="business-arrow" />
</div>
</div>
</template>
<script>
import Vue from "vue";
import { Icon } from "vant"; // 【修改点2】删除Tag的引入只保留Icon即可
Vue.use(Icon); // 【修改点3】只注册Icon删除Tag的注册
export default {
mounted() {
this.title = this.$route.meta.title;
},
computed: {},
data() {
return {
title: "住院详情",
hospitalizationItem: null
};
},
created() {
const item = sessionStorage.getItem('hospitalizationItem');
if (item) {
this.hospitalizationItem = JSON.parse(item);
}
},
methods: {
navigateToZYCharge() {
sessionStorage.setItem('hospitalizationItem', JSON.stringify(this.hospitalizationItem));
this.$router.push({ path: "/ZYCharge" });
},
navigateToZYdailylist() {
sessionStorage.setItem('hospitalizationItem', JSON.stringify(this.hospitalizationItem));
this.$router.push({ path: "/ZYdailylist" });
}
}
}
</script>
<style scoped lang="scss">
// 背景样式
.bj {
background: #f5f5f5;
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
z-index: -2;
}
// 顶部信息区域
.header-info {
background-color: #d4e8ff;
background-image: linear-gradient(#d4e8ff, #e7f1fe);
border-radius: 15px;
margin: 15px;
padding: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.info-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 20px;
}
.info-left {
flex: 1;
}
.info-item {
margin-bottom: 12px;
font-size: .4rem;
}
.info-item:first-child{
font-size: .45rem;
font-weight: 700;
}
.info-item:first-child .info-value{
color: black;
font-weight: 700;
}
.info-item:first-child .info-label{
color: black;
font-weight: 700;
}
.info-label {
color: #666;
margin-right: 10px;
}
.info-value {
color: #333;
font-weight: 500;
}
.info-right {
margin-left: 15px;
// 让标签垂直靠上对齐,和左侧信息匹配
display: flex;
align-items: flex-start;
}
// 【新增核心样式】自定义状态标签(住院中/已出院)
.state-tag {
display: inline-flex;
align-items: center;
gap: 4px; // 圆点和文字的间距
padding: 4px 12px; // 内边距,上下小左右大,更精致
font-size: .36rem; // 适配移动端的字体大小
font-weight: 500;
border-radius: 20px; // 超大圆角,柔化边缘
white-space: nowrap; // 防止文字换行
// 状态小圆点的通用样式
&::before {
content: '';
display: block;
width: 6px;
height: 6px;
border-radius: 50%; // 圆形圆点
}
}
// 住院中标签样式
.state-tag--in {
background-color: #e6f7ef;
color: #36c779;
&::before {
background-color: #36c779; // 圆点和文字同色,视觉统一
}
}
// 已出院标签样式
.state-tag--out {
background-color: #f5f2f8;
color: #9061c7;
&::before {
background-color: #9061c7;
}
}
// 费用信息
.cost-info {
display: flex;
justify-content: space-around;
padding-top: 15px;
border-top: 1px solid #f0f0f0;
}
.cost-item {
text-align: center;
}
.cost-value {
display: block;
font-size: .44rem;
font-weight: 600;
color: #2196F3;
margin-bottom: 5px;
}
.cost-label {
font-size: .35rem;
color: #666;
}
// 业务办理模块
.business-section {
background-color: #fff;
border-radius: 15px;
margin: 0 15px 15px;
padding: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.section-title {
font-size: 26px;
font-weight: 600;
color: #333;
margin: 0 0 20px;
}
.business-item {
display: flex;
align-items: center;
padding: .5rem 0;
border-bottom: 2px solid #f0f0f0;
margin: 5px 0;
}
.business-item:last-child {
border-bottom: none;
}
.business-icon {
width: 1rem;
height: 1rem;
border-radius: 50%;
background-color: #E3F2FD;
display: flex;
align-items: center;
justify-content: center;
margin-right: 15px;
img {
width: .6rem;
object-fit: contain;
}
}
.business-content {
flex: 1;
}
.business-title {
font-size: .4rem;
font-weight: 500;
color: #333;
margin: 0 0 5px;
}
.business-desc {
font-size: .32rem;
color: #999;
margin: 0;
}
.business-arrow {
font-size: .4rem;
color: #1296db;
}
</style>

817
src/views/ZYindex2.vue Normal file
View File

@@ -0,0 +1,817 @@
<template>
<div class="home">
<nav-bar></nav-bar>
<div class="bj"></div>
<div class="lxr" @click="handleCardSelect">
<div class="lxrr" v-if="card && card.id">
<h2>
{{ card.name }}
<p>卡号{{ card.cardNo }}</p>
</h2>
<h3>
<i class="van-icon van-icon-arrow van-cell__right-icon"></i>
</h3>
</div>
<van-contact-card type="add" add-text="请选择就诊人" v-else />
</div>
<div v-if="showbox">
<div class="header-section">
<h3 class="list-title">住院信息</h3>
<span class="filter-text" @click="showFilter = true">筛选</span>
</div>
<!-- 筛选弹窗 -->
<van-popup v-model="showFilter" position="bottom" :style="{ height: '50%' }">
<div class="filter-popup">
<div class="filter-header">
<h4>筛选条件</h4>
<van-icon name="cross" @click="showFilter = false" class="close-icon" />
</div>
<div class="filter-content">
<div class="filter-item">
<span class="filter-label">住院状态</span>
<van-radio-group v-model="filterState">
<van-radio name="">全部</van-radio>
<van-radio name="hospitalized">住院中</van-radio>
<van-radio name="discharged">已出院</van-radio>
</van-radio-group>
</div>
<div class="filter-item">
<span class="filter-label">住院病区</span>
<van-dropdown-menu>
<van-dropdown-item v-model="filterDepartment" :options="departmentOptions" placeholder="全部" />
</van-dropdown-menu>
</div>
<div class="filter-item">
<span class="filter-label">住院时间范围</span>
<van-radio-group v-model="filterTimeRange">
<van-radio name="">全部</van-radio>
<van-radio name="7">近7天</van-radio>
<van-radio name="30">近30天</van-radio>
<van-radio name="90">近90天</van-radio>
</van-radio-group>
</div>
</div>
<div class="filter-footer">
<van-button type="default" @click="resetFilter" class="reset-button">重置</van-button>
<van-button type="primary" @click="applyFilter" class="apply-button">确认筛选</van-button>
</div>
</div>
</van-popup>
<div class="hospitalization-list">
<div v-for="(item, index) in filteredList" :key="index" class="hospitalization-item" @click="navigateToDetail(item)">
<div class="item-header">
<h4>{{ item.SECTIONTYPE }}</h4>
<span :class="['status-tag', item.HOSSTATE == '2' ? 'discharged' : 'hospitalized']">
{{ item.HOSSTATE == '2' ? '出院' : '住院' }}
</span>
</div>
<div class="item-content">
<div class="info-row">
<span class="info-label">入院时间</span>
<span class="info-value">{{ item.HOSDATE }}</span>
</div>
<!-- <div class="info-row">
<span class="info-label">出院时间</span>
<span class="info-value">{{ item.OUTHOSDATE }}</span>
</div> -->
<div class="info-row last-row">
<div class="left-content">
<span class="info-label">住院编号</span>
<span class="info-value">{{ item.INHOSNUM }}-{{ item.ZYCS }}</span>
</div>
<div class="right-content">
<span class="info-value">住院{{ item.hospitalDays }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
<van-empty description="住院处暂无该患者信息" v-else style="padding-top:90px" />
<van-action-sheet
v-model="showPatientSelector"
title="请选择使用的患者ID"
:actions="patientActions"
@select="onPatientSelect"
cancel-text="取消"
@cancel="showPatientSelector = false"
/>
</div>
</template>
<script>
import {
apiUserCardList,
apiInHosPatientInfoQuery,
getUserCategory
} from "@/request/api.js";
import Vue from "vue";
import { ActionSheet } from "vant";
Vue.use(ActionSheet);
export default {
mounted() {
this.title = this.$route.meta.title;
},
computed: {
patientActions() {
return this.patientIds.map(id => ({ name: `患者ID: ${id}`, id }));
}
},
data() {
return {
title: "",
card: {},
showbox: false,
zyinfo: {},
hospitalizationList: [], // 原始住院记录列表
filteredList: [], // 筛选后的住院记录列表
patientIds: [],
patientId: "",
showPatientSelector: false, // 控制是否显示选择弹窗
showFilter: false, // 控制是否显示筛选弹窗
filterState: "", // 筛选状态:空-全部hospitalized-住院discharged-出院
filterDepartment: "", // 筛选病区
filterTimeRange: "", // 筛选时间范围:空-全部7-近7天30-近30天90-近90天
departmentOptions: [], // 病区选项
};
},
created() {
this.card = JSON.parse(sessionStorage.getItem("card"));
if (this.card) {
this.getZYInfo();
return;
}
apiUserCardList({ isYes: 0 }).then((res) => {
this.card = res.data[0];
this.getZYInfo();
});
},
methods: {
onPatientSelect(action) {
this.patientId = action.id;
this.showPatientSelector = false;
console.log("选中的 patientId:", this.patientId);
// 如果需要根据 patientId 做其他查询,可在这里调用
let formData2 = {
QueryCode: this.patientId,
QueryType: 2,
};
this.apiInHosPatientInfoQuery(formData2);
},
apiInHosPatientInfoQuery(formData) {
apiInHosPatientInfoQuery(formData).then((res) => {
console.log(res);
let jsonObj = this.$x2js.xml2js(res.data);
console.log(jsonObj);
let jsonObj2 = this.$x2js.xml2js(
jsonObj.Envelope.Body.MOP_InHosPatientInfoQueryResponse
.MOP_InHosPatientInfoQueryResult
);
console.log(jsonObj2);
let dataRows = jsonObj2.response.data.data_row;
if (jsonObj2.response.returnresult.returncode == "1") {
this.hospitalizationList = [];
if (Array.isArray(dataRows)) {
// 处理数组形式的数据
for (var i = 0; i < dataRows.length; i++) {
let item = dataRows[i];
let hospitalizationItem = {
ADDRESS: item.ADDRESS,
BEDNO: item.BEDNO,
BIRTHDAY: item.BIRTHDAY,
DEPARTCODE: item.DEPARTCODE,
DEPTNAME: item.DEPTNAME,
HOSBALANCE: item.HOSBALANCE,
HOSDATE: item.HOSDATE,
HOSNATURE: item.HOSNATURE,
HOSSTATE: item.HOSSTATE,
IDCARDNO: item.IDCARDNO,
IDTYPE: item.IDTYPE,
INHOSNUM: item.INHOSNUM,
INHOSPATIENTID: item.INHOSPATIENTID,
OUTHOSDATE: item.OUTHOSDATE,
PATIENTNAME: item.PATIENTNAME,
PATIENTSEX: item.PATIENTSEX,
PATIENTSOURCE: item.PATIENTSOURCE,
PHONENUM: item.PHONENUM,
SECTIONTYPE: item.SECTIONTYPE || item.DEPTNAME,
ZYCS: item.ZYCS,
hospitalDays: this.calculateHospitalDays(item.HOSDATE, item.OUTHOSDATE, item.HOSSTATE)
};
this.hospitalizationList.push(hospitalizationItem);
}
} else {
// 处理单个对象形式的数据
let item = dataRows;
let hospitalizationItem = {
ADDRESS: item.ADDRESS,
BEDNO: item.BEDNO,
BIRTHDAY: item.BIRTHDAY,
DEPARTCODE: item.DEPARTCODE,
DEPTNAME: item.DEPTNAME,
HOSBALANCE: item.HOSBALANCE,
HOSDATE: item.HOSDATE,
HOSNATURE: item.HOSNATURE,
HOSSTATE: item.HOSSTATE,
IDCARDNO: item.IDCARDNO,
IDTYPE: item.IDTYPE,
INHOSNUM: item.INHOSNUM,
INHOSPATIENTID: item.INHOSPATIENTID,
OUTHOSDATE: item.OUTHOSDATE,
PATIENTNAME: item.PATIENTNAME,
PATIENTSEX: item.PATIENTSEX,
PATIENTSOURCE: item.PATIENTSOURCE,
PHONENUM: item.PHONENUM,
SECTIONTYPE: item.SECTIONTYPE || item.DEPTNAME,
ZYCS: item.ZYCS,
hospitalDays: this.calculateHospitalDays(item.HOSDATE, item.OUTHOSDATE, item.HOSSTATE)
};
this.hospitalizationList.push(hospitalizationItem);
}
// 设置患者基本信息(使用第一条记录的数据)
if (this.hospitalizationList.length > 0) {
let firstItem = this.hospitalizationList[0];
this.zyinfo = {
PATIENTNAME: firstItem.PATIENTNAME,
PATIENTSEX: firstItem.PATIENTSEX
};
// 初始化筛选列表
this.filteredList = [...this.hospitalizationList];
// 提取病区列表
this.extractDepartments();
this.showbox = true;
}
}
})
},
// 计算住院天数
calculateHospitalDays(hosDate, outHosDate, hosState) {
// 处理日期字符串,确保在 iOS 上兼容
let startDate = this.parseDate(hosDate);
let endDate;
if (outHosDate && hosState == '2') {
// 已出院,使用出院日期
endDate = this.parseDate(outHosDate);
} else {
// 未出院,使用今天日期
endDate = new Date();
}
// 计算天数差
let timeDiff = Math.abs(endDate.getTime() - startDate.getTime());
let dayDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
return dayDiff;
},
// 解析日期字符串,确保在 iOS 上兼容
parseDate(dateString) {
if (!dateString) return new Date();
// 将 "2025-07-17 11:59:05" 格式转换为 "2025-07-17T11:59:05" 格式,确保 iOS 兼容
const isoDateString = dateString.replace(' ', 'T');
return new Date(isoDateString);
},
getZYInfo() {
let _this = this;
console.log(_this.card);
let formData = {
queryCode: _this.card.idNo,
queryType: 7,
};
getUserCategory(formData).then((res) => {
console.log(res);
let jsonObj = this.$x2js.xml2js(res.data);
let jsonObj2 = jsonObj.Envelope.Body.MOP_OutpPatInfoQueryResponse
.request;
console.log(jsonObj2);
if (Array.isArray(jsonObj2.request.data)) {
// 如果是数组,遍历获取每个元素的 PatientId
this.patientIds = jsonObj2.request.data.map(item => item.PatientId);
} else {
// 如果不是数组,说明只有一个对象
this.patientIds = [jsonObj2.request.data.PatientId];
}
if (this.patientIds.length === 1) {
this.patientId = this.patientIds[0];
let formData2 = {
QueryCode: this.patientId,
QueryType: 2,
};
this.apiInHosPatientInfoQuery(formData2);
} else if (this.patientIds.length > 1) {
this.showPatientSelector = true; // 弹出选择器
}
console.log(this.patientIds);
});
},
handleCardSelect() {
this.$router.push({ path: "/Member_jzr", query: { f: 1 } });
},
// 跳转到住院详情页面
navigateToDetail(item) {
// 使用 sessionStorage 存储住院记录数据,避免通过地址栏传递大量参数
sessionStorage.setItem('hospitalizationItem', JSON.stringify(item));
// 跳转到住院详情页面
this.$router.push({ path: "/ZYdetail" });
},
// 提取病区列表
extractDepartments() {
const departments = new Set();
this.hospitalizationList.forEach(item => {
if (item.SECTIONTYPE) {
departments.add(item.SECTIONTYPE);
}
});
// 生成符合 van-dropdown-item 要求的 options 格式
this.departmentOptions = Array.from(departments).map(dept => ({
value: dept,
text: dept
}));
},
// 应用筛选条件
applyFilter() {
this.filteredList = this.hospitalizationList.filter(item => {
// 筛选住院状态
if (this.filterState) {
if (this.filterState === 'hospitalized' && item.HOSSTATE === '2') {
return false;
}
if (this.filterState === 'discharged' && item.HOSSTATE !== '2') {
return false;
}
}
// 筛选病区
if (this.filterDepartment && item.SECTIONTYPE !== this.filterDepartment) {
return false;
}
// 筛选时间范围
if (this.filterTimeRange) {
const days = parseInt(this.filterTimeRange);
const cutoffDate = new Date();
cutoffDate.setDate(cutoffDate.getDate() - days);
const hosDate = this.parseDate(item.HOSDATE);
if (hosDate < cutoffDate) {
return false;
}
}
return true;
});
this.showFilter = false;
},
// 重置筛选条件
resetFilter() {
this.filterState = '';
this.filterDepartment = '';
this.filterTimeRange = '';
this.filteredList = [...this.hospitalizationList];
this.showFilter = false;
}
},
}
</script>
<style scoped lang="scss">
// 背景样式
.bj {
background: #f5f5f5;
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
z-index: -2;
}
// 就诊人卡片样式
.lxr {
.van-cell--center {
border-radius: 15px;
padding: 20px;
background: url(../assets/lxrbj.png) no-repeat;
background-size: 100% 100%;
background-position: center center;
color: #fff;
.van-cell__value--alone {
color: #fff;
}
.van-cell__right-icon {
color: #fff;
}
}
.van-contact-card::before {
background: none;
}
::v-deep .van-contact-card--add .van-cell__left-icon {
color: #fff;
opacity: 0.6;
}
.lxrr {
border-radius: 15px;
padding: 20px;
background: url(../assets/lxrbj.png) no-repeat;
background-size: 100% 100%;
background-position: center center;
color: #fff;
padding: 30px;
display: flex;
align-items: center;
justify-content: space-between;
h2 {
font-size: 32px;
p {
font-size: 28px;
padding-top: 10px;
}
}
h3 .van-cell__right-icon {
color: #fff;
}
}
}
// 通用文字颜色
.colblack {
color: #000;
font-weight: 600;
}
.colgray {
color: #aaa;
}
/* 头部标题和筛选按钮布局 */
.header-section {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
padding: 0 5px;
}
.list-title {
font-size: 28px;
font-weight: 600;
color: #333;
margin: 0;
}
.filter-text {
font-size: 24px;
color: #2196F3;
cursor: pointer;
padding: 5px;
}
// ---------------------- 优化后的筛选弹窗样式 ----------------------
::v-deep .van-popup {
&.van-popup--bottom {
border-top-left-radius: 20px;
border-top-right-radius: 20px;
box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
overflow: hidden;
}
}
.filter-popup {
height: 100%;
display: flex;
flex-direction: column;
background-color: #ffffff;
}
// 筛选弹窗头部
.filter-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 24px;
border-bottom: 1px solid #f5f7fa;
h4 {
font-size: 30px;
font-weight: 700;
color: #1a1a1a;
margin: 0;
}
.close-icon {
font-size: 32px;
color: #999999;
padding: 8px;
border-radius: 50%;
transition: all 0.2s ease;
&:active {
background-color: #f5f7fa;
color: #666666;
}
}
}
// 筛选弹窗内容区域
.filter-content {
flex: 1;
padding: 24px;
overflow-y: auto;
background-color: #fafbfc;
// 单个筛选项容器
.filter-item {
margin-bottom: 32px;
background-color: #ffffff;
padding: 20px;
border-radius: 16px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
&:last-child {
margin-bottom: 0;
}
// 筛选项标签
.filter-label {
font-size: 26px;
font-weight: 600;
color: #333333;
margin-bottom: 16px;
display: block;
padding-left: 4px;
}
}
// 单选框组样式(住院状态/时间范围)
::v-deep .van-radio-group {
display: flex;
flex-wrap: wrap;
gap: 12px;
padding: 4px 0;
.van-radio {
flex: 1;
min-width: 120px;
height: 80px;
margin: 0;
.van-radio__wrapper {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border: 2px solid #e5e7eb;
border-radius: 12px;
background-color: #ffffff;
transition: all 0.2s ease;
padding: 0;
// 单选框圆点隐藏(用背景色区分选中状态,更直观)
.van-radio__input {
display: none;
}
// 单选框文字
.van-radio__label {
font-size: 24px;
color: #666666;
margin: 0;
transition: all 0.2s ease;
}
}
// 选中状态样式
&.van-radio--checked {
.van-radio__wrapper {
border-color: #2196F3;
background-color: #E3F2FD;
}
.van-radio__label {
color: #2196F3;
font-weight: 600;
}
}
// 触摸反馈
&:active {
.van-radio__wrapper {
opacity: 0.8;
transform: scale(0.98);
}
}
}
}
// 病区选择器样式
.department-select-wrap {
height: 80px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
border: 2px solid #e5e7eb;
border-radius: 12px;
background-color: #ffffff;
transition: all 0.2s ease;
&:active {
opacity: 0.8;
transform: scale(0.98);
}
.department-value {
font-size: 24px;
color: #333333;
}
.department-icon {
font-size: 24px;
color: #999999;
}
}
// 病区picker样式优化穿透vant
::v-deep .department-picker {
.van-picker__toolbar {
background-color: #fafbfc;
border-bottom: 1px solid #f5f7fa;
.van-picker__cancel,
.van-picker__confirm {
font-size: 26px;
font-weight: 600;
color: #2196F3;
}
}
.van-picker__column {
text-align: center;
.van-picker__option {
font-size: 26px;
color: #333333;
}
}
}
}
// 筛选弹窗底部按钮
.filter-footer {
padding: 20px 24px;
background-color: #ffffff;
display: flex;
justify-content: space-between;
gap: 16px;
.reset-button,
.apply-button {
flex: 1;
height: 88px;
font-size: 28px;
font-weight: 600;
border-radius: 16px;
border: none;
transition: all 0.2s ease;
&:active {
opacity: 0.8;
transform: scale(0.98);
}
}
.reset-button {
background-color: #f5f7fa;
color: #666666;
border: 2px solid #e5e7eb;
&:hover {
background-color: #eff1f5;
}
}
.apply-button {
background-color: #2196F3;
color: #ffffff;
&:hover {
background-color: #1976D2;
}
}
}
/* 住院记录列表样式 */
.hospitalization-list {
margin-top: 15px;
}
.hospitalization-item {
background-color: #fff;
border-radius: 15px;
padding: 20px;
margin-bottom: 15px;
position: relative;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
h4 {
font-size: .47rem;
font-weight: 600;
color: #333;
}
}
/* 状态标签样式 */
.status-tag {
font-size: .42rem;
padding: 4px 12px;
border-radius: 12px;
}
.status-tag.discharged {
color: #4CAF50;
background-color: #E8F5E9;
}
.status-tag.hospitalized {
color: #2196F3;
background-color: #E3F2FD;
}
/* 信息行样式 */
.item-content {
.info-row {
display: flex;
align-items: center;
margin-bottom: 10px;
font-size: .38rem;
}
.info-label {
color: #666;
margin-right: 10px;
min-width: 100px;
}
.info-value {
color: #333;
font-weight: 500;
}
.right-label {
margin-left: 30px;
}
}
/* 最后一行特殊处理 */
.item-content .info-row:last-child {
justify-content: space-between;
}
/* 住院编号和住院天数布局 */
.info-row.last-row {
display: flex;
justify-content: space-between;
align-items: center;
}
.left-content {
display: flex;
align-items: center;
}
.right-content {
display: flex;
align-items: center;
}
</style>

File diff suppressed because it is too large Load Diff