From dcb0b826de9ba848e0b5e3bd85a93a012d70a491 Mon Sep 17 00:00:00 2001 From: v6ole Date: Sun, 12 Jul 2026 13:45:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A1=8C=E9=9D=A2=E7=AB=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=97=B6=E5=AE=A2=E6=88=B7=E5=90=8D=E7=A7=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BAUUID=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WorkPlans/MiniBusiness/KeyVisits/ManagerWorkspace 四个页面的 openEdit 均直接 spread item 到 form,未确保客户在 el-select 选项列表中。修复:编辑前检查并补充客户到 customers 列表。 Co-Authored-By: Claude --- frontend/src/views/desktop/KeyVisits.vue | 18 +++++++++++++++++- .../src/views/desktop/ManagerWorkspace.vue | 3 +++ frontend/src/views/desktop/MiniBusiness.vue | 3 +++ frontend/src/views/desktop/WorkPlans.vue | 3 +++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/desktop/KeyVisits.vue b/frontend/src/views/desktop/KeyVisits.vue index 2f28885..3bfb9a4 100644 --- a/frontend/src/views/desktop/KeyVisits.vue +++ b/frontend/src/views/desktop/KeyVisits.vue @@ -45,6 +45,19 @@ const filteredItems = computed(() => { return list }) +// ── Three-level sort: urgency → planned_date → manager pinyin ── +const urgencyWeight: Record = { '紧急': 0, '重要': 1, '普通': 2 } + +const sortedItems = computed(() => { + return [...filteredItems.value].sort((a: any, b: any) => { + const ua = urgencyWeight[a.urgency_level] ?? 3 + const ub = urgencyWeight[b.urgency_level] ?? 3 + if (ua !== ub) return ua - ub + if (a.planned_date !== b.planned_date) return (a.planned_date || '').localeCompare(b.planned_date || '') + return (a.manager_name || '').localeCompare(b.manager_name || '', 'zh-CN') + }) +}) + function resetFilters() { filterManager.value = '' filterStatus.value = '' @@ -103,6 +116,9 @@ function openCreate() { function openEdit(item: any) { dialogMode.value = 'edit' form.value = { ...item } + if (item.customer_id && item.customer_name && !customers.value.find((c: any) => c.id === item.customer_id)) { + customers.value.unshift({ id: item.customer_id, name: item.customer_name }) + } plannedVisitors.value = item.planned_visitor ? item.planned_visitor.split('、') : [] dialogVisible.value = true } @@ -200,7 +216,7 @@ async function quickStatusChange(row: any, newStatus: string) { - +