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" >