客户列表显示时间应该是最后一次更新时间
This commit is contained in:
@@ -180,10 +180,11 @@
|
||||
|
||||
// 将 CustomerManagement 数据映射为显示格式
|
||||
const mappedList = customerRecords.map(item => {
|
||||
// 格式化创建时间
|
||||
// 格式化列表展示时间:按需求优先显示更新时间
|
||||
let formattedTime = '';
|
||||
if (item.createTime) {
|
||||
const date = new Date(item.createTime);
|
||||
const displayTimeRaw = item.updateTime || item.update_time || item.createTime;
|
||||
if (displayTimeRaw) {
|
||||
const date = new Date(displayTimeRaw);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
@@ -216,7 +217,7 @@
|
||||
serviceStaff: item.salesName || '',
|
||||
serviceCount: item.contactCount || item.recordingCount || 0,
|
||||
lastService: formattedTime,
|
||||
lastServiceTime: item.updateTime || item.createTime,
|
||||
lastServiceTime: item.updateTime || item.update_time || item.createTime,
|
||||
tags: tags,
|
||||
phone: item.contact || item.salesPhone || '',
|
||||
budget: item.intendedModel || '', // 意向车型作为预算信息
|
||||
|
||||
@@ -2432,10 +2432,10 @@
|
||||
}
|
||||
return null;
|
||||
};
|
||||
// 录音开始时间:优先后端专用字段,兼容多种命名,最后退回创建时间
|
||||
// 列表展示时间:按需求优先显示更新时间,兼容多种命名,最后退回开始/创建时间
|
||||
const recordingStartRaw =
|
||||
item.startTime ||
|
||||
item.createTime;
|
||||
item.updateTime ||
|
||||
item.update_time ;
|
||||
let formattedTime = '';
|
||||
if (recordingStartRaw) {
|
||||
const date = new Date(recordingStartRaw);
|
||||
@@ -2453,7 +2453,7 @@
|
||||
return {
|
||||
id: item.id,
|
||||
title: `${item.salesName || ''}的服务记录`,
|
||||
date: formattedTime ? `开始时间:${formattedTime}` : '',
|
||||
date: formattedTime ? `更新时间:${formattedTime}` : '',
|
||||
description: item.summary || '',
|
||||
customerName: item.customerName || '',
|
||||
recordingName: item.recordingName || '', // 记录名称
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
class="tab-item"
|
||||
:class="{ active: activeTab === 'status' }"
|
||||
@click="switchTab('status')">
|
||||
<text>服务状态</text>
|
||||
<text>服务中</text>
|
||||
</view>
|
||||
<view
|
||||
class="tab-item"
|
||||
@@ -263,6 +263,12 @@ import CommonBeginReception from "./common_begin_reception.vue";
|
||||
import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
incomingTab: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
// #ifdef APP
|
||||
components: {
|
||||
statusBar,
|
||||
@@ -330,6 +336,14 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
showTagActionMenu: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
incomingTab: {
|
||||
immediate: true,
|
||||
handler(tab) {
|
||||
this.applyIncomingTab(tab);
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 计算导航栏和内容区域的位置(使用计算属性确保响应式)
|
||||
computedNavbarTop() {
|
||||
@@ -453,6 +467,21 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
applyIncomingTab(tab) {
|
||||
const allowed = ['status', 'reception', 'tag'];
|
||||
if (!allowed.includes(tab)) return;
|
||||
|
||||
// 切tab并执行必要初始化(开始接待需要重置表单)
|
||||
if (this.activeTab !== tab) {
|
||||
this.activeTab = tab;
|
||||
}
|
||||
if (tab === 'reception') {
|
||||
this.resetReceptionForm();
|
||||
} else if (tab === 'tag') {
|
||||
this.tagViewMode = 'list';
|
||||
this.fetchTagList({ force: true });
|
||||
}
|
||||
},
|
||||
// 计算并更新导航栏和内容区域的位置
|
||||
updateNavbarPosition() {
|
||||
console.log('[FurnitureReception][updateNavbarPosition] 开始更新导航栏位置');
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
backgroundColor="#FFFFFF">
|
||||
</uni-nav-bar>
|
||||
|
||||
<view class="content">
|
||||
<view class="content" :style="{ paddingTop: contentTop }">
|
||||
<view class="scene-grid">
|
||||
<view
|
||||
class="scene-card"
|
||||
@@ -37,6 +37,19 @@
|
||||
import statusBar from "@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar";
|
||||
// #endif
|
||||
|
||||
function getSystemInfo() {
|
||||
try {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
return {
|
||||
statusBarHeight: systemInfo.statusBarHeight || 20,
|
||||
};
|
||||
} catch (e) {
|
||||
return {
|
||||
statusBarHeight: 20,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
// #ifdef APP
|
||||
components: {
|
||||
@@ -44,7 +57,10 @@
|
||||
},
|
||||
// #endif
|
||||
data() {
|
||||
const systemInfo = getSystemInfo();
|
||||
const totalNavbarHeight = systemInfo.statusBarHeight * 2 + 44 * 2;
|
||||
return {
|
||||
contentTop: totalNavbarHeight + 'rpx',
|
||||
scenes: [
|
||||
{
|
||||
id: 'meeting',
|
||||
@@ -115,54 +131,56 @@
|
||||
}
|
||||
|
||||
.content {
|
||||
padding-top: 44px;
|
||||
padding: 44px 16px 20px;
|
||||
padding-left: 24rpx;
|
||||
padding-right: 24rpx;
|
||||
padding-bottom: 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.scene-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16px;
|
||||
gap: 24rpx;
|
||||
}
|
||||
|
||||
.scene-card {
|
||||
background: #FFFFFF;
|
||||
border-radius: 12px;
|
||||
padding: 24px 16px;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||
box-shadow: 0 2rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.scene-card:active {
|
||||
transform: scale(0.98);
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.scene-icon {
|
||||
margin-bottom: 12px;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin-bottom: 16rpx;
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, rgba(42, 104, 255, 0.1) 0%, rgba(42, 104, 255, 0.05) 100%);
|
||||
border-radius: 16px;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
.scene-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
margin-bottom: 8px;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
margin-bottom: 12rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.scene-desc {
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="subpackage-host">
|
||||
<component v-if="Impl" :is="Impl" />
|
||||
<component v-if="Impl" :is="Impl" :incomingTab="incomingTab" />
|
||||
<view v-else class="loading">
|
||||
<text v-if="error">{{ error }}</text>
|
||||
<text v-else>正在加载接待模块...</text>
|
||||
@@ -13,12 +13,26 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
Impl: null,
|
||||
incomingTab: '',
|
||||
error: ''
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.loadImpl();
|
||||
},
|
||||
onShow() {
|
||||
// tabBar 的 switchTab 不稳定携带 query,因此从 storage 消费目标tab
|
||||
try {
|
||||
const allowed = ['status', 'reception', 'tag'];
|
||||
const tab = (uni.getStorageSync('workbench-reception-tab') || '').toString();
|
||||
if (allowed.includes(tab)) {
|
||||
this.incomingTab = tab;
|
||||
uni.removeStorageSync('workbench-reception-tab');
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadSubPackagePagesSubpackage() {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -7,16 +7,17 @@
|
||||
<text class="category-title">接待页面标签</text>
|
||||
</view>
|
||||
<view class="function-grid">
|
||||
<view class="function-item" @click="openReceptionTab('status')">
|
||||
<view class="function-icon">📌</view>
|
||||
<text class="function-name">服务状态</text>
|
||||
<text class="function-desc">进入接待页并切到服务状态</text>
|
||||
</view>
|
||||
<view class="function-item" @click="openReceptionTab('reception')">
|
||||
<view class="function-icon">🛎️</view>
|
||||
<text class="function-name">开始接待</text>
|
||||
<text class="function-desc">进入接待页并切到开始接待</text>
|
||||
</view>
|
||||
<view class="function-item" @click="openReceptionTab('status')">
|
||||
<view class="function-icon">📌</view>
|
||||
<text class="function-name">服务中</text>
|
||||
<text class="function-desc">进入接待页并切到服务中</text>
|
||||
</view>
|
||||
|
||||
<view class="function-item" @click="openReceptionTab('tag')">
|
||||
<view class="function-icon">🗂️</view>
|
||||
<text class="function-name">标签管理</text>
|
||||
|
||||
@@ -93,7 +93,7 @@ page {
|
||||
|
||||
.redirecting-text {
|
||||
padding: 40rpx 30rpx;
|
||||
color: #999;
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user