From f723279a95a037c5af7f99fb2f3731e4a1669c23 Mon Sep 17 00:00:00 2001 From: weicw1996 Date: Sun, 11 Oct 2026 22:50:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=B7=91=E5=BA=97=E5=A1=AB=E6=8A=A5):=20?= =?UTF-8?q?=E8=87=AA=E4=B8=BB=E5=A1=AB=E6=8A=A5=E5=88=97=E8=A1=A8=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=A9=BB=E5=BA=97/=E8=B7=91=E5=BA=97=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=8E=E8=B7=91=E5=BA=97=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 跑店填报数据在新表 yxe_visit_report,字段与 yxe_self_report 不同, 列表用顶部单选切换类型、各自分页与导出,不做 UNION 混排。 - 新增 src/api/yxe/yxeVisitReport(index.ts + model) - 自主填报列表页顶部加「驻店填报 / 跑店填报」单选: 切换时同时换数据源、换列定义、清空选中,并重置到第一页 - 跑店列:ID / 提交人 / 巡店门店数 / 活动小结 / 奖金 / 状态 / 驳回原因 / 创建时间 / 操作;驻店列保持不变 - 新增 yxeVisitReportDetail:展示巡店列表(每条含连锁、门店、定位、 打卡照片),展开详情时按 id 拉完整 store_list - 状态切换与批量删除、导出按当前类型路由到对应接口 - 搜索栏在跑店类型下隐藏「活动时间」:yxe_visit_report 无 activity_time 列 验证:vue-tsc 本次改动文件 0 错误;vite build 成功。 --- src/api/yxe/yxeVisitReport/index.ts | 97 ++++++++ src/api/yxe/yxeVisitReport/model/index.ts | 57 +++++ .../yxe/yxeSelfReport/components/search.vue | 3 + .../components/yxeVisitReportDetail.vue | 224 ++++++++++++++++++ src/views/yxe/yxeSelfReport/index.vue | 188 +++++++++++++-- 5 files changed, 548 insertions(+), 21 deletions(-) create mode 100644 src/api/yxe/yxeVisitReport/index.ts create mode 100644 src/api/yxe/yxeVisitReport/model/index.ts create mode 100644 src/views/yxe/yxeSelfReport/components/yxeVisitReportDetail.vue diff --git a/src/api/yxe/yxeVisitReport/index.ts b/src/api/yxe/yxeVisitReport/index.ts new file mode 100644 index 0000000..3172117 --- /dev/null +++ b/src/api/yxe/yxeVisitReport/index.ts @@ -0,0 +1,97 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { YxeVisitReport, YxeVisitReportParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; +import type { FileRecord } from '@/api/system/file/model'; + +export async function pageYxeVisitReport(params: YxeVisitReportParam) { + const res = await request.get>>( + MODULES_API_URL + '/yxe/yxe-visit-report/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +export async function listYxeVisitReport(params?: YxeVisitReportParam) { + const res = await request.get>( + MODULES_API_URL + '/yxe/yxe-visit-report', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +export async function addYxeVisitReport(data: YxeVisitReport) { + const res = await request.post>( + MODULES_API_URL + '/yxe/yxe-visit-report', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +export async function updateYxeVisitReport(data: YxeVisitReport) { + const res = await request.put>( + MODULES_API_URL + '/yxe/yxe-visit-report', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +export async function removeYxeVisitReport(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/yxe/yxe-visit-report/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +export async function removeBatchYxeVisitReport(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/yxe/yxe-visit-report/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +export async function getYxeVisitReport(id: number) { + const res = await request.get>( + MODULES_API_URL + '/yxe/yxe-visit-report/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +export async function exportYxeVisitReport(params?: YxeVisitReportParam) { + const res = await request.post>( + MODULES_API_URL + '/yxe/yxe-visit-report/export', + params + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/yxe/yxeVisitReport/model/index.ts b/src/api/yxe/yxeVisitReport/model/index.ts new file mode 100644 index 0000000..45f9391 --- /dev/null +++ b/src/api/yxe/yxeVisitReport/model/index.ts @@ -0,0 +1,57 @@ +import type { PageParam } from '@/api'; +import type { User } from '@/api/system/user/model'; + +/** 巡店单条明细(store_list JSON 反序列化后的结构) */ +export interface YxeVisitReportStore { + merchantId?: number | string; + merchantName?: string; + chainId?: string; + chainName?: string; + visitTime?: string; + province?: string; + city?: string; + merchantLat?: string | number; + merchantLng?: string | number; + merchantAddress?: string; + lat?: string | number; + lng?: string | number; + location?: string; + photos?: string[]; +} + +export interface YxeVisitReport { + id?: number; + userId?: number; + storeCount?: number; + storeList?: string; + image?: string; + summary?: string; + reward?: number | string; + lat?: string; + lng?: string; + location?: string; + sortNumber?: number; + comments?: string; + status?: number; + rejectReason?: string; + deleted?: number; + tenantId?: number; + createTime?: string; + updateTime?: string; + user?: User; + realName?: string; + userGroup?: string; + nickname?: string; + phone?: string; +} + +export interface YxeVisitReportParam extends PageParam { + id?: number; + idList?: string; + keywords?: string; + realName?: string; + userGroup?: string; + chainName?: string; + merchantName?: string; + status?: number | number[]; +} diff --git a/src/views/yxe/yxeSelfReport/components/search.vue b/src/views/yxe/yxeSelfReport/components/search.vue index 15569ba..dbfa973 100644 --- a/src/views/yxe/yxeSelfReport/components/search.vue +++ b/src/views/yxe/yxeSelfReport/components/search.vue @@ -29,6 +29,7 @@ @pressEnter="search" /> (); const emit = defineEmits<{ diff --git a/src/views/yxe/yxeSelfReport/components/yxeVisitReportDetail.vue b/src/views/yxe/yxeSelfReport/components/yxeVisitReportDetail.vue new file mode 100644 index 0000000..e486116 --- /dev/null +++ b/src/views/yxe/yxeSelfReport/components/yxeVisitReportDetail.vue @@ -0,0 +1,224 @@ + + + + + diff --git a/src/views/yxe/yxeSelfReport/index.vue b/src/views/yxe/yxeSelfReport/index.vue index ce3c559..6383624 100644 --- a/src/views/yxe/yxeSelfReport/index.vue +++ b/src/views/yxe/yxeSelfReport/index.vue @@ -14,9 +14,20 @@ class="sys-org-table" >