Compare commits
3 Commits
aaf244eed6
...
c4a06501cb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4a06501cb | ||
|
|
812acfc49b | ||
|
|
7b65d52e21 |
@@ -230,7 +230,7 @@ export default {
|
|||||||
apiUserInfo().then((res) => {
|
apiUserInfo().then((res) => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
this.info = res.data;
|
this.info = res.data;
|
||||||
if (res.data.role === 1) {
|
if (res.data.role >= 1) {
|
||||||
this.hasDataCockpitPermission = true;
|
this.hasDataCockpitPermission = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
<div class="listbt">{{ startdate }}至{{ enddate }}清单</div>
|
<div class="listbt">{{ startdate }}至{{ enddate }}清单</div>
|
||||||
<div class="listbody">
|
<div class="listbody">
|
||||||
<div class="scrollable-content">
|
<div class="scrollable-content">
|
||||||
<van-row>
|
<van-row class="header-row">
|
||||||
<van-col span="9" class="colblack">项目名称</van-col>
|
<van-col span="9" class="colblack">项目名称</van-col>
|
||||||
<van-col span="3" class="colblack">类型</van-col>
|
<van-col span="3" class="colblack">类型</van-col>
|
||||||
<van-col span="3" class="colblack">单价</van-col>
|
<van-col span="3" class="colblack">单价</van-col>
|
||||||
@@ -87,18 +87,29 @@
|
|||||||
<van-col span="3" class="colblack">单位</van-col>
|
<van-col span="3" class="colblack">单位</van-col>
|
||||||
<van-col span="3" class="colblack">总价</van-col>
|
<van-col span="3" class="colblack">总价</van-col>
|
||||||
</van-row>
|
</van-row>
|
||||||
<van-row v-for="item in List" :key="item">
|
|
||||||
<van-col span="9" class="colgray">{{ item.ITEMNAME }}</van-col>
|
<!-- 按日期分组显示 -->
|
||||||
<van-col span="3" class="colgray">{{ item.ACCTYPE }}</van-col>
|
<div v-for="group in groupedList" :key="group.date" class="date-group">
|
||||||
<van-col span="3" class="colgray">{{ item.ITEMPRICE }}</van-col>
|
<!-- 日期标题栏 -->
|
||||||
<van-col span="3" class="colgray">{{ item.ITEMCOUNT }}</van-col>
|
<div class="date-header">
|
||||||
<van-col span="3" class="colgray">{{ item.ITEMUNIT }}</van-col>
|
<span class="date-text">{{ group.date }}收费如下:</span>
|
||||||
<van-col span="3" class="colgray">{{ item.ITEMAMOUNT }}</van-col>
|
<span class="daily-total">当日合计:{{ group.total }}元</span>
|
||||||
</van-row>
|
</div>
|
||||||
|
|
||||||
|
<!-- 当日费用明细 -->
|
||||||
|
<van-row v-for="item in group.items" :key="item" class="item-row">
|
||||||
|
<van-col span="9" class="colgray">{{ item.ITEMNAME }}</van-col>
|
||||||
|
<van-col span="3" class="colgray">{{ item.ACCTYPE }}</van-col>
|
||||||
|
<van-col span="3" class="colgray">{{ item.ITEMPRICE }}</van-col>
|
||||||
|
<van-col span="3" class="colgray">{{ item.ITEMCOUNT }}</van-col>
|
||||||
|
<van-col span="3" class="colgray">{{ item.ITEMUNIT }}</van-col>
|
||||||
|
<van-col span="3" class="colgray">{{ item.ITEMAMOUNT }}</van-col>
|
||||||
|
</van-row>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<van-row class="fixed-total">
|
<van-row class="fixed-total">
|
||||||
<van-col offset="14" span="10" class="colblack">合计:{{ money }}元
|
<van-col span="24" class="colblack text-right">{{ startdate }}至{{ enddate }}日合计:{{ money }}元
|
||||||
</van-col>
|
</van-col>
|
||||||
</van-row>
|
</van-row>
|
||||||
|
|
||||||
@@ -161,6 +172,7 @@ export default {
|
|||||||
patientIds: [],
|
patientIds: [],
|
||||||
patientId: "",
|
patientId: "",
|
||||||
showPatientSelector: false, // 控制是否显示选择弹窗
|
showPatientSelector: false, // 控制是否显示选择弹窗
|
||||||
|
groupedList: [], // 按日期分组后的费用明细
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
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) {
|
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;
|
that.money = 0;
|
||||||
for (let i = 0; i < jsonObj2.response.data.data_row.length; i++) {
|
that.groupedList.forEach(group => {
|
||||||
that.money = (parseFloat(that.money) + parseFloat(jsonObj2.response.data.data_row[i].ITEMAMOUNT)).toFixed(2);
|
that.money = (parseFloat(that.money) + parseFloat(group.total)).toFixed(2);
|
||||||
}
|
});
|
||||||
|
|
||||||
that.resultshow = true;
|
that.resultshow = true;
|
||||||
} else {
|
} else {
|
||||||
// 数据为空的情况
|
// 数据为空的情况
|
||||||
that.List = [];
|
that.groupedList = [];
|
||||||
that.money = 0;
|
that.money = 0;
|
||||||
that.resultshow = true;
|
that.resultshow = true;
|
||||||
Toast("暂无该时间段收费详情信息");
|
Toast("暂无该时间段收费详情信息");
|
||||||
@@ -512,7 +547,7 @@ export default {
|
|||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
|
padding: 0 0 0 0.5rem;
|
||||||
.van-row {
|
.van-row {
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
}
|
}
|
||||||
@@ -558,16 +593,58 @@ export default {
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
flex: 1;
|
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;
|
padding: 10px 0;
|
||||||
|
border-bottom: 1px solid #f0f0f0;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed-total {
|
.fixed-total {
|
||||||
flex-shrink: 0; // 防止压缩
|
flex-shrink: 0; // 防止压缩
|
||||||
padding: 20px 0;
|
//padding: 20px;
|
||||||
border-top: 1px solid #eee;
|
border-top: 2px solid #ddd;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-right {
|
||||||
|
text-align: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -271,8 +271,11 @@ yuyue() {
|
|||||||
apiOpTjYy(formData)
|
apiOpTjYy(formData)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
Toast.success("预约成功");
|
Toast.success({ message: "预约成功", duration: 3000 });
|
||||||
this.$router.push('Zstj_yy');
|
// 延时3秒后跳转到预约页面
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$router.push('Zstj_yy');
|
||||||
|
}, 4000);
|
||||||
} else {
|
} else {
|
||||||
Toast.fail(res.message || "预约失败,请重试");
|
Toast.fail(res.message || "预约失败,请重试");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user