diff --git a/frontend/src/views/desktop/WeeklyReport.vue b/frontend/src/views/desktop/WeeklyReport.vue index 8c9150e..1dab369 100644 --- a/frontend/src/views/desktop/WeeklyReport.vue +++ b/frontend/src/views/desktop/WeeklyReport.vue @@ -4,6 +4,7 @@ import { useRoute } from 'vue-router' import { useAuthStore } from '@/stores/auth' import { dashboardApi } from '@/api/dashboard' import { uploadApi } from '@/api/upload' +import { customersApi } from '@/api/customers' import { aiApi } from '@/api/ai' import { ElMessage } from 'element-plus' import ImagePreview from '@/components/ImagePreview.vue' @@ -19,6 +20,7 @@ const activeTab = ref('visits') const filterManagerId = ref('') const filterCustomerId = ref('') const managers = ref([]) +const customers = ref([]) const weekOffset = ref(0) const isHistoricalWeek = computed(() => weekOffset.value < 0) @@ -35,10 +37,15 @@ const currentPhotoUrl = ref('') onMounted(async () => { if (route.query.manager_id) filterManagerId.value = route.query.manager_id as string + if (route.query.customer_id) filterCustomerId.value = route.query.customer_id as string await loadReport() try { - const res = await api.get('/users/', { params: { role: 'manager' } }) - managers.value = res.data + const [mRes, cRes] = await Promise.all([ + api.get('/users/', { params: { role: 'manager' } }), + customersApi.list({ page_size: 500 }), + ]) + managers.value = mRes.data + customers.value = cRes.data.items || cRes.data } catch (_) {} }) @@ -202,11 +209,16 @@ const notesByDate = computed(() => { - + + + + + + 查询