From 4e0bbbf3e36ad79e0865a365f94c1c06e8f59577 Mon Sep 17 00:00:00 2001
From: Jafeng <2998840497@qq.com>
Date: Fri, 30 Jan 2026 10:45:36 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E6=A0=B7=E5=BC=8F=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../archive-detail/customer-profile-tab.vue | 150 +++++++++++------
pages/case/case.vue | 151 +++++++++++-------
2 files changed, 190 insertions(+), 111 deletions(-)
diff --git a/components/archive-detail/customer-profile-tab.vue b/components/archive-detail/customer-profile-tab.vue
index 58c1687..8178965 100644
--- a/components/archive-detail/customer-profile-tab.vue
+++ b/components/archive-detail/customer-profile-tab.vue
@@ -91,10 +91,9 @@
转入团队:{{ r.executeTeamName }}
转入方式:{{ r.eventTypeName }}
-
+
操作人:
- 系统自动建档
- {{ r.creatorUserId }}
+ {{ r.creatorUserName }}
@@ -271,6 +270,7 @@ function scrollToAnchor(key) {
const transferPopupRef = ref(null);
const transferRecords = ref([]);
const latestTransferRecord = computed(() => transferRecords.value[0]);
+const userNameMap = ref({});
const CURRENT_TEAM_STORAGE_KEY = 'ykt_case_current_team';
@@ -281,18 +281,55 @@ function getCorpId() {
return String(d.corpId || a.corpId || team.corpId || '') || '';
}
+async function loadTeamMembers() {
+ const corpId = getCorpId();
+ const team = uni.getStorageSync(CURRENT_TEAM_STORAGE_KEY) || {};
+ const teamId = team?.teamId ? String(team.teamId) : '';
+ if (!corpId || !teamId) return;
+ if (Object.keys(userNameMap.value || {}).length > 0) return;
+
+ try {
+ const res = await api('getTeamData', { corpId, teamId });
+ if (!res?.success) return;
+ const t = res?.data && typeof res.data === 'object' ? res.data : {};
+ const members = Array.isArray(t.memberList) ? t.memberList : [];
+ userNameMap.value = members.reduce((acc, m) => {
+ const uid = String(m?.userid || '');
+ if (!uid) return acc;
+ acc[uid] = String(m?.anotherName || m?.name || m?.userid || '') || uid;
+ return acc;
+ }, {});
+ } catch (e) {
+ console.error('获取团队成员失败', e);
+ }
+}
+
+function resolveUserName(userId) {
+ const id = String(userId || '');
+ if (!id) return '';
+ const map = userNameMap.value || {};
+ return String(map[id] || id) || id;
+}
+
const ServiceType = {
remindFiling: '自主开拓',
adminTransferTeams: '团队流转',
adminRemoveTeams: '移出团队',
systemAutoDistribute: '系统分配',
bindWechatCustomer: '绑定企业微信',
+ share: '共享',
+ transfer: '转移',
+ importCustomer: '导入客户',
+ addCustomer: '新增客户',
};
async function fetchTransferRecords() {
const customerId = props.data?._id;
if (!customerId) return;
+ // 先加载团队成员信息
+ await loadTeamMembers();
+
try {
const res = await api('customerTransferRecord', { customerId });
if (res?.success && res.list) {
@@ -302,6 +339,7 @@ async function fetchTransferRecords() {
record.createTime = dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss');
record.executeTeamName = allTeams.find((team) => team.teamId === item.executeTeamId)?.name || item.executeTeamName;
record.eventTypeName = ServiceType[item.eventType] || item.eventType;
+ record.creatorUserName = item.creatorUserId === 'system' ? '系统自动建档' : resolveUserName(item.creatorUserId);
if (item.transferToTeamIds && Array.isArray(item.transferToTeamIds)) {
record.teamName = item.transferToTeamIds.map((teamId) => allTeams.find((team) => team.teamId === teamId)?.name).join('、');
}
@@ -337,48 +375,48 @@ watch(() => props.data?._id, () => {
diff --git a/pages/case/case.vue b/pages/case/case.vue
index a72c6ac..49472f3 100644
--- a/pages/case/case.vue
+++ b/pages/case/case.vue
@@ -85,7 +85,7 @@
- {{ patient.createTime || '-' }} / {{ patient.creator || '-' }}
+ {{ patient.createTime || '-' }} / {{ resolveCreatorName(patient) || '-' }}
@@ -99,7 +99,7 @@
-
+
@@ -163,6 +163,9 @@ const tabs = computed(() => {
const isBatchMode = ref(false);
const selectedItems = ref([]); // Stores patient phone or unique ID
+// Team Members Map
+const userNameMap = ref({});
+
// 新增流程所需状态(认证相关)
const managedArchiveCountAllTeams = ref(0); // 在管档案数(所有团队)
const verifyStatus = ref(''); // unverified | verifying | verified | failed
@@ -221,6 +224,35 @@ function getTeamId() {
return String(currentTeam.value?.teamId || '') || '';
}
+async function loadTeamMembers() {
+ const corpId = getCorpId();
+ const teamId = getTeamId();
+ if (!corpId || !teamId) return;
+
+ try {
+ const res = await api('getTeamData', { corpId, teamId });
+ if (!res?.success) return;
+ const t = res?.data && typeof res.data === 'object' ? res.data : {};
+ const members = Array.isArray(t.memberList) ? t.memberList : [];
+ // Update map
+ members.forEach(m => {
+ const uid = String(m?.userid || '');
+ if (uid) {
+ userNameMap.value[uid] = String(m?.anotherName || m?.name || m?.userid || '') || uid;
+ }
+ });
+ } catch (e) {
+ console.error('获取团队成员失败', e);
+ }
+}
+
+function resolveCreatorName(patient) {
+ const val = patient.creator;
+ if (!val) return '';
+ return userNameMap.value[val] || val;
+}
+
+
function applyVerifyStatus(status, reason) {
verifyStatus.value = status || '';
isVerified.value = verifyStatus.value === 'verified';
@@ -570,6 +602,7 @@ const toggleTeamPopup = () => {
if (currentTeam.value) uni.setStorageSync(CURRENT_TEAM_STORAGE_KEY, currentTeam.value);
currentTabKey.value = 'all';
loadGroups();
+ loadTeamMembers();
reload(true);
}
});
@@ -770,6 +803,7 @@ onLoad(async () => {
await loadTeams();
if (currentTeam.value) {
await loadGroups();
+ loadTeamMembers();
await reload(true);
}
await refreshVerifyStatus();
@@ -793,6 +827,7 @@ onShow(async () => {
} else {
await loadGroups();
}
+ loadTeamMembers();
await refreshVerifyStatus();
});
@@ -808,7 +843,7 @@ onShow(async () => {
// Padding for batch footer
/* &.is-batch {
- padding-bottom: 50px;
+ padding-bottom: 100rpx;
} */
// We can't use &.is-batch because scoped style and root element is tricky depending on uni-app version/style
// Instead we handle it in content-body or separate view
@@ -818,30 +853,30 @@ onShow(async () => {
display: flex;
justify-content: space-between;
align-items: center;
- padding: 10px 15px;
+ padding: 20rpx 30rpx;
background-color: #fff;
- border-bottom: 1px solid #f0f0f0;
+ border-bottom: 2rpx solid #f0f0f0;
.team-selector {
display: flex;
align-items: center;
- font-size: 32rpx; /* 16px */
+ font-size: 32rpx;
font-weight: bold;
color: #333;
.team-name {
- margin-right: 5px;
+ margin-right: 10rpx;
}
.team-icon {
- font-size: 32rpx; /* 16px */
+ font-size: 32rpx;
color: #333;
}
}
.header-actions {
display: flex;
- gap: 15px;
+ gap: 30rpx;
.action-item {
display: flex;
@@ -850,9 +885,9 @@ onShow(async () => {
justify-content: center;
.action-text {
- font-size: 20rpx; /* 10px */
+ font-size: 20rpx;
color: #333;
- margin-top: 2px;
+ margin-top: 4rpx;
}
}
}
@@ -862,8 +897,8 @@ onShow(async () => {
display: flex;
align-items: center;
background-color: #f5f7fa;
- border-bottom: 1px solid #eee;
- padding-right: 15px; // Padding for the count
+ border-bottom: 2rpx solid #eee;
+ padding-right: 30rpx; // Padding for the count
.tabs-scroll {
flex: 1;
@@ -872,15 +907,15 @@ onShow(async () => {
.tabs-container {
display: flex;
- padding: 10px 15px;
+ padding: 20rpx 30rpx;
.tab-item {
- padding: 5px 15px;
- margin-right: 10px;
- font-size: 28rpx; /* 14px */
+ padding: 10rpx 30rpx;
+ margin-right: 20rpx;
+ font-size: 28rpx;
color: #666;
background-color: #fff;
- border-radius: 4px;
+ border-radius: 8rpx;
flex-shrink: 0;
&.active {
@@ -893,11 +928,11 @@ onShow(async () => {
}
.total-count-inline {
- font-size: 24rpx; /* 12px */
+ font-size: 24rpx;
color: #666;
white-space: nowrap;
flex-shrink: 0;
- min-width: 50px;
+ min-width: 100rpx;
text-align: right;
}
}
@@ -916,22 +951,22 @@ onShow(async () => {
}
.group-title {
- padding: 5px 15px;
- font-size: 28rpx; /* 14px */
+ padding: 10rpx 30rpx;
+ font-size: 28rpx;
color: #333;
}
.patient-card {
display: flex;
background-color: #fff;
- padding: 15px;
- margin-bottom: 1px; // Separator line
- border-bottom: 1px solid #f0f0f0;
+ padding: 30rpx;
+ margin-bottom: 2rpx; // Separator line
+ border-bottom: 2rpx solid #f0f0f0;
.checkbox-area {
display: flex;
align-items: center;
- margin-right: 10px;
+ margin-right: 20rpx;
}
.card-content {
@@ -941,46 +976,46 @@ onShow(async () => {
.card-row-top {
display: flex;
align-items: center;
- margin-bottom: 8px;
+ margin-bottom: 16rpx;
flex-wrap: wrap;
.patient-info {
display: flex;
align-items: flex-end;
- margin-right: 10px;
+ margin-right: 20rpx;
.patient-name {
- font-size: 32rpx; /* 16px */
+ font-size: 32rpx;
font-weight: bold;
color: #333;
- margin-right: 8px;
+ margin-right: 16rpx;
}
.patient-meta {
- font-size: 24rpx; /* 12px */
+ font-size: 24rpx;
color: #999;
- margin-bottom: 2px;
+ margin-bottom: 4rpx;
}
}
.patient-tags {
display: flex;
- gap: 5px;
+ gap: 10rpx;
.tag {
- font-size: 20rpx; /* 10px */
+ font-size: 20rpx;
color: #5d8aff;
- border: 1px solid #5d8aff;
- padding: 0 4px;
- border-radius: 8px;
- height: 16px;
- line-height: 14px;
+ border: 2rpx solid #5d8aff;
+ padding: 0 8rpx;
+ border-radius: 16rpx;
+ height: 32rpx;
+ line-height: 28rpx;
}
}
}
.card-row-bottom {
- font-size: 28rpx; /* 14px */
+ font-size: 28rpx;
.record-text {
color: #666;
@@ -1005,39 +1040,39 @@ onShow(async () => {
bottom: 0;
left: 0;
right: 0;
- height: 50px;
+ height: 100rpx;
background-color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
- padding: 0 15px;
- box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
+ padding: 0 30rpx;
+ box-shadow: 0 -4rpx 20rpx rgba(0,0,0,0.05);
z-index: 99;
.left-action {
display: flex;
align-items: center;
.footer-text {
- margin-left: 5px;
- font-size: 28rpx; /* 14px */
+ margin-left: 10rpx;
+ font-size: 28rpx;
color: #333;
}
}
.right-actions {
display: flex;
- gap: 10px;
+ gap: 20rpx;
.footer-btn {
- font-size: 28rpx; /* 14px */
- padding: 0 15px;
- height: 32px;
- line-height: 32px;
+ font-size: 28rpx;
+ padding: 0 30rpx;
+ height: 64rpx;
+ line-height: 64rpx;
margin: 0;
- border-radius: 4px;
+ border-radius: 8rpx;
&.plain {
- border: 1px solid #ddd;
+ border: 2rpx solid #ddd;
background-color: #fff;
color: #666;
}
@@ -1056,11 +1091,11 @@ onShow(async () => {
}
.sidebar-index {
- width: 20px;
+ width: 40rpx;
position: absolute;
right: 0;
- top: 20px;
- bottom: 20px;
+ top: 40rpx;
+ bottom: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
@@ -1069,10 +1104,10 @@ onShow(async () => {
z-index: 10;
.index-item {
- font-size: 20rpx; /* 10px */
+ font-size: 20rpx;
color: #555;
- padding: 2px 0;
- width: 20px;
+ padding: 4rpx 0;
+ width: 40rpx;
text-align: center;
font-weight: 500;
}