From 72d869bafbdfac1657afa5f3c89ea120913fba04 Mon Sep 17 00:00:00 2001 From: v6ole Date: Mon, 13 Jul 2026 00:49:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E6=94=AF=E6=8C=81=E6=90=9C=E7=B4=A2+?= =?UTF-8?q?=E5=88=86=E9=A1=B5(25=E6=9D=A1/=E9=A1=B5)=EF=BC=9B=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E7=A7=BB=E8=87=B3=E8=AF=B7=E5=81=87=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- frontend/src/views/mobile/KeyVisitsList.vue | 23 ++++++++++++++++++-- frontend/src/views/mobile/MiniBizList.vue | 18 +++++++++++++++- frontend/src/views/mobile/NotesList.vue | 23 ++++++++++++++++++-- frontend/src/views/mobile/PlansList.vue | 23 ++++++++++++++++++-- frontend/src/views/mobile/VisitsList.vue | 24 +++++++++++++++++++-- frontend/src/views/mobile/WorkCenter.vue | 4 ++-- 6 files changed, 104 insertions(+), 11 deletions(-) diff --git a/frontend/src/views/mobile/KeyVisitsList.vue b/frontend/src/views/mobile/KeyVisitsList.vue index a2f82a9..81b4531 100644 --- a/frontend/src/views/mobile/KeyVisitsList.vue +++ b/frontend/src/views/mobile/KeyVisitsList.vue @@ -6,17 +6,28 @@ import { keyVisitsApi } from '@/api/keyVisits' const router = useRouter() const loading = ref(false) +const searchText = ref('') +const page = ref(1) +const pageSize = ref(25) +const total = ref(0) const items = ref([]) onMounted(loadItems) async function loadItems() { loading.value = true - try { const res = await keyVisitsApi.list(); items.value = Array.isArray(res.data) ? res.data : (res.data.items || []) } - catch (_) {} + try { + const params: any = { page: page.value, page_size: pageSize.value } + if (searchText.value) params.search = searchText.value + const res = await keyVisitsApi.list() + const raw = Array.isArray(res.data) ? res.data : (res.data.items || []) + items.value = raw; total.value = res.data.total || raw.length + } catch (_) {} finally { loading.value = false } } +function onSearch() { page.value = 1; loadItems() } + const urgencyColors: Record = { '一般': '#5B7FA5', '重要': '#C4934A', '紧急': '#B8472E' } async function handleDelete(id: string) { @@ -41,6 +52,11 @@ async function handleDelete(id: string) { +
+ + 搜索 +
+

暂不要客记录

@@ -56,7 +72,10 @@ async function handleDelete(id: string) {
+
+
+ diff --git a/frontend/src/views/mobile/MiniBizList.vue b/frontend/src/views/mobile/MiniBizList.vue index 293049a..2ca2e11 100644 --- a/frontend/src/views/mobile/MiniBizList.vue +++ b/frontend/src/views/mobile/MiniBizList.vue @@ -6,6 +6,10 @@ import { miniBusinessApi } from '@/api/miniBusiness' const router = useRouter() const loading = ref(false) +const searchText = ref('') +const page = ref(1) +const pageSize = ref(25) +const total = ref(0) const items = ref([]) const statusOrder: Record = { '跟进中': 0, '已签约': 1, '已流失': 2 } @@ -14,13 +18,17 @@ onMounted(loadItems) async function loadItems() { loading.value = true try { + const params: any = { page: page.value, page_size: pageSize.value } + if (searchText.value) params.search = searchText.value const res = await miniBusinessApi.list() const raw = Array.isArray(res.data) ? res.data : (res.data.items || []) - items.value = raw.sort((a: any, b: any) => (statusOrder[a.status] ?? 9) - (statusOrder[b.status] ?? 9)) + items.value = raw; total.value = res.data.total || raw.length } catch (_) {} finally { loading.value = false } } +function onSearch() { page.value = 1; loadItems() } + const statusColors: Record = { '跟进中': '#C4934A', '已签约': '#4A6741', '已流失': '#B8472E' } async function handleDelete(id: string) { @@ -45,6 +53,11 @@ async function handleDelete(id: string) { +
+ + 搜索 +
+

暂无商机记录

@@ -60,7 +73,10 @@ async function handleDelete(id: string) {
+
+
+ diff --git a/frontend/src/views/mobile/NotesList.vue b/frontend/src/views/mobile/NotesList.vue index 635f131..0d7afdb 100644 --- a/frontend/src/views/mobile/NotesList.vue +++ b/frontend/src/views/mobile/NotesList.vue @@ -5,6 +5,10 @@ import api from '@/api/index' const router = useRouter() const loading = ref(false) +const searchText = ref('') +const page = ref(1) +const pageSize = ref(25) +const total = ref(0) const items = ref([]) onMounted(loadItems) @@ -16,10 +20,17 @@ const catColors: Record = { async function loadItems() { loading.value = true - try { const res = await api.get('/daily-notes/'); items.value = Array.isArray(res.data) ? res.data : (res.data.items || []) } - catch (_) {} + try { + const params: any = { page: page.value, page_size: pageSize.value } + if (searchText.value) params.search = searchText.value + const res = await api.get('/daily-notes/', { params }) + const raw = Array.isArray(res.data) ? res.data : (res.data.items || []) + items.value = raw; total.value = res.data.total || raw.length + } catch (_) {} finally { loading.value = false } } + +function onSearch() { page.value = 1; loadItems() } diff --git a/frontend/src/views/mobile/PlansList.vue b/frontend/src/views/mobile/PlansList.vue index 41f310e..fe53f7d 100644 --- a/frontend/src/views/mobile/PlansList.vue +++ b/frontend/src/views/mobile/PlansList.vue @@ -6,17 +6,28 @@ import api from '@/api/index' const router = useRouter() const loading = ref(false) +const searchText = ref('') +const page = ref(1) +const pageSize = ref(25) +const total = ref(0) const items = ref([]) onMounted(loadItems) async function loadItems() { loading.value = true - try { const res = await api.get('/work-plans/'); items.value = Array.isArray(res.data) ? res.data : (res.data.items || []) } - catch (_) {} + try { + const params: any = { page: page.value, page_size: pageSize.value } + if (searchText.value) params.search = searchText.value + const res = await api.get('/work-plans/', { params }) + const raw = Array.isArray(res.data) ? res.data : (res.data.items || []) + items.value = raw; total.value = res.data.total || raw.length + } catch (_) {} finally { loading.value = false } } +function onSearch() { page.value = 1; loadItems() } + async function handleDelete(id: string) { try { await ElMessageBox.confirm('确定删除?', '确认', { type: 'warning' }) @@ -39,6 +50,11 @@ async function handleDelete(id: string) { +
+ + 搜索 +
+

暂无工作计划

@@ -54,7 +70,10 @@ async function handleDelete(id: string) {
+
+
+ diff --git a/frontend/src/views/mobile/VisitsList.vue b/frontend/src/views/mobile/VisitsList.vue index ed92701..905ef3d 100644 --- a/frontend/src/views/mobile/VisitsList.vue +++ b/frontend/src/views/mobile/VisitsList.vue @@ -5,17 +5,29 @@ import api from '@/api/index' const router = useRouter() const loading = ref(false) +const searchText = ref('') +const page = ref(1) +const pageSize = ref(25) +const total = ref(0) const items = ref([]) onMounted(loadItems) async function loadItems() { loading.value = true - try { const res = await api.get('/visits/'); items.value = Array.isArray(res.data) ? res.data : (res.data.items || []) } - catch (_) {} + try { + const params: any = { page: page.value, page_size: pageSize.value } + if (searchText.value) params.search = searchText.value + const res = await api.get('/visits/', { params }) + const raw = Array.isArray(res.data) ? res.data : (res.data.items || []) + items.value = raw; total.value = res.data.total || raw.length + } catch (_) {} finally { loading.value = false } } +function onSearch() { page.value = 1; loadItems() } + + const methodColors: Record = { '上门': '#4A6741', '电话': '#5B7FA5', '微信': '#22c55e', '出差': '#C4934A' } @@ -29,6 +41,11 @@ const methodColors: Record = { '上门': '#4A6741', '电话': '#
+
+ + 搜索 +
+

暂无拜访记录

@@ -44,7 +61,10 @@ const methodColors: Record = { '上门': '#4A6741', '电话': '#
+
+
+ diff --git a/frontend/src/views/mobile/WorkCenter.vue b/frontend/src/views/mobile/WorkCenter.vue index 17c8296..0806e8c 100644 --- a/frontend/src/views/mobile/WorkCenter.vue +++ b/frontend/src/views/mobile/WorkCenter.vue @@ -26,12 +26,12 @@ onMounted(async () => { }) const modules = [ - { path: '/m/visits', label: '历史拜访', icon: '📋', count: () => counts.value.visits, color: '#4A6741' }, - { path: '/m/notes', label: '历史纪要', icon: '📝', count: () => counts.value.notes, color: '#1C3738' }, { path: '/m/plans', label: '工作计划', icon: '📅', count: () => counts.value.plans, color: '#4A6741' }, { path: '/m/mini-biz', label: '商机跟单', icon: '💰', count: () => counts.value.miniBiz, color: '#C4934A' }, { path: '/m/key-visits', label: '要客拜访', icon: '⭐', count: () => counts.value.keyVisits, color: '#5B7FA5' }, { path: '/m/leaves', label: '请假管理', icon: '📋', count: () => counts.value.leaves, color: '#9CA3AF' }, + { path: '/m/visits', label: '历史拜访', icon: '🕐', count: () => counts.value.visits, color: '#4A6741' }, + { path: '/m/notes', label: '历史纪要', icon: '📝', count: () => counts.value.notes, color: '#1C3738' }, ]