From 812acfc49b8e6386784106f8e916514f657c5f17 Mon Sep 17 00:00:00 2001
From: sangchengzhi <2305486879@qq.com>
Date: Wed, 14 Jan 2026 17:02:09 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=BE=E9=A9=B6=E8=88=B1?=
=?UTF-8?q?=E6=9D=83=E9=99=90=EF=BC=8C=E5=8F=8A=E4=BD=8F=E9=99=A2=E7=9A=84?=
=?UTF-8?q?=E6=98=8E=E7=BB=86=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Member.vue | 2 +-
src/views/ZYdailylist.vue | 107 ++++++++++++++++++++++++++++++++------
2 files changed, 91 insertions(+), 18 deletions(-)
diff --git a/src/views/Member.vue b/src/views/Member.vue
index 5492a84..0bdfede 100644
--- a/src/views/Member.vue
+++ b/src/views/Member.vue
@@ -230,7 +230,7 @@ export default {
apiUserInfo().then((res) => {
console.log(res.data);
this.info = res.data;
- if (res.data.role === 1) {
+ if (res.data.role >= 1) {
this.hasDataCockpitPermission = true;
}
});
diff --git a/src/views/ZYdailylist.vue b/src/views/ZYdailylist.vue
index 871eff1..239ad19 100644
--- a/src/views/ZYdailylist.vue
+++ b/src/views/ZYdailylist.vue
@@ -79,7 +79,7 @@
-
+
-
- {{ item.ITEMNAME }}
- {{ item.ACCTYPE }}
- {{ item.ITEMPRICE }}
- {{ item.ITEMCOUNT }}
- {{ item.ITEMUNIT }}
- {{ item.ITEMAMOUNT }}
-
+
+
+
+
+
+
+
+
+ {{ item.ITEMNAME }}
+ {{ item.ACCTYPE }}
+ {{ item.ITEMPRICE }}
+ {{ item.ITEMCOUNT }}
+ {{ item.ITEMUNIT }}
+ {{ item.ITEMAMOUNT }}
+
+
- 合计:{{ money }}元
+ {{ startdate }}至{{ enddate }}日 合计:{{ money }}元
@@ -161,6 +172,7 @@ export default {
patientIds: [],
patientId: "",
showPatientSelector: false, // 控制是否显示选择弹窗
+ groupedList: [], // 按日期分组后的费用明细
};
},
created() {
@@ -339,15 +351,38 @@ export default {
// 检查数据是否存在
if (jsonObj2 && jsonObj2.response && jsonObj2.response.data && jsonObj2.response.data.data_row && jsonObj2.response.data.data_row.length > 0) {
- that.List = jsonObj2.response.data.data_row;
+ // 原始数据列表
+ const originalList = jsonObj2.response.data.data_row;
+
+ // 按日期分组
+ const groupedData = {};
+ originalList.forEach(item => {
+ // 假设TRDATETIME格式为YYYY-MM-DD HH:MM:SS,提取日期部分"2026-01-12 23:00:14"
+ const date = item.TRDATETIME ? item.TRDATETIME.split(' ')[0] : '未知日期';
+ if (!groupedData[date]) {
+ groupedData[date] = {
+ date: date,
+ items: [],
+ total: 0
+ };
+ }
+ groupedData[date].items.push(item);
+ groupedData[date].total = (parseFloat(groupedData[date].total) + parseFloat(item.ITEMAMOUNT)).toFixed(2);
+ });
+
+ // 转换为数组格式
+ that.groupedList = Object.values(groupedData).sort((a, b) => new Date(a.date) - new Date(b.date));
+
+ // 计算总金额
that.money = 0;
- for (let i = 0; i < jsonObj2.response.data.data_row.length; i++) {
- that.money = (parseFloat(that.money) + parseFloat(jsonObj2.response.data.data_row[i].ITEMAMOUNT)).toFixed(2);
- }
+ that.groupedList.forEach(group => {
+ that.money = (parseFloat(that.money) + parseFloat(group.total)).toFixed(2);
+ });
+
that.resultshow = true;
} else {
// 数据为空的情况
- that.List = [];
+ that.groupedList = [];
that.money = 0;
that.resultshow = true;
Toast("暂无该时间段收费详情信息");
@@ -558,16 +593,54 @@ export default {
overflow-y: auto;
flex: 1;
- .van-row {
+ .header-row {
+ padding: 15px 0;
+ border-bottom: 2px solid #ddd;
+ }
+
+ .date-group {
+ margin-bottom: 20px;
+ border: 1px solid #f0f0f0;
+ border-radius: 8px;
+ overflow: hidden;
+ }
+
+ .date-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 15px;
+ background-color: #f5f5f5;
+ font-weight: 600;
+ border-bottom: 1px solid #eee;
+ }
+
+ .date-text {
+ font-size: 28px;
+ color: #333;
+ }
+
+ .daily-total {
+ font-size: 26px;
+ color: #166bcc;
+ }
+
+ .item-row {
padding: 10px 0;
+ border-bottom: 1px solid #f0f0f0;
+
+ &:last-child {
+ border-bottom: none;
+ }
}
}
.fixed-total {
flex-shrink: 0; // 防止压缩
padding: 20px 0;
- border-top: 1px solid #eee;
+ border-top: 2px solid #ddd;
background-color: #fff;
+ font-size: 32px;
}
}