标签儿管理

This commit is contained in:
ZLI263
2025-12-03 08:29:05 +08:00
parent d42d236452
commit 3805684053
4 changed files with 743 additions and 151 deletions

View File

@@ -38,7 +38,8 @@
:list="serviceList"
:total="serviceListTotal"
@itemClick="viewDetail"
@filterClick="refreshServiceList" />
@filterClick="refreshServiceList"
@reachBottom="onServiceListReachBottom" />
<!-- 客户列表 -->
<CustomerList
@@ -565,6 +566,16 @@
// 重新加载数据,传递查询参数
this.loadServiceList(filterParams);
},
// 服务记录列表到底部加载更多
onServiceListReachBottom() {
// 如果已经加载全部数据,则不再请求
if (this.serviceList.length >= this.serviceListTotal) {
return;
}
// 下一页
this.serviceListPage.current += 1;
this.loadServiceList();
},
async viewDetail(item) {
// 查看详情
this.currentServiceDetail = { ...item };
@@ -1645,12 +1656,8 @@
});
if (res.statusCode === 200 && res.data && res.data.success) {
uni.showToast({
title: '获取服务记录 成功!',
icon: 'none'
});
// 转换后端数据为页面需要的格式
this.serviceList = res.data.data.map(item => {
const mappedList = res.data.data.map(item => {
// 格式化时间:将 ISO 格式转换为 YYYY-MM-DD HH:mm:ss
let formattedTime = '';
if (item.createTime) {
@@ -1674,6 +1681,12 @@
rawData: item
};
});
// 分页:第一页或刷新时重置,其他情况追加
if (this.serviceListPage.current === 1) {
this.serviceList = mappedList;
} else {
this.serviceList = this.serviceList.concat(mappedList);
}
this.serviceListTotal = res.data.total || 0;
} else {
uni.showToast({