提交
This commit is contained in:
1 parent
833544def3
commit
16be6fa22d
204 files changed
+455089
-46491
No files matched your search
@@ -148,10 +148,16 @@ export async function checkConvert(id: number | string) {
|
||||
return { data: unwrapData(res) }
|
||||
}
|
||||
|
||||
export function exportClue(query?: ClueQuery) {
|
||||
export function exportClue(data: Record<string, any> = {}) {
|
||||
const { ids, columns, ...rest } = data
|
||||
const body: Record<string, any> = {
|
||||
...mapListQuery(rest as ClueQuery),
|
||||
...(ids ? { ids } : {}),
|
||||
...(columns ? { columns } : {})
|
||||
}
|
||||
return request.post({
|
||||
url: `${BASE}/export`,
|
||||
data: mapListQuery(query),
|
||||
data: body,
|
||||
responseType: 'blob',
|
||||
showErrorMessage: false
|
||||
})
|
||||
|
||||
@@ -77,10 +77,16 @@ export function approveTransfer(data: {
|
||||
})
|
||||
}
|
||||
|
||||
export async function exportApproval(query: ApprovalQuery) {
|
||||
export async function exportApproval(data: Record<string, any> = {}) {
|
||||
const { ids, columns, ...rest } = data
|
||||
const body: Record<string, any> = {
|
||||
...mapListQuery(rest as ApprovalQuery),
|
||||
...(ids ? { ids } : {}),
|
||||
...(columns ? { columns } : {})
|
||||
}
|
||||
return request.post({
|
||||
url: `${BASE}/export`,
|
||||
data: mapListQuery(query),
|
||||
data: body,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -81,10 +81,16 @@ export function executeChange(id: number | string) {
|
||||
return request.put({ url: `${BASE}/execute/${String(id)}` })
|
||||
}
|
||||
|
||||
export async function exportChange(query: ChangeQuery) {
|
||||
export async function exportChange(data: Record<string, any> = {}) {
|
||||
const { ids, columns, ...rest } = data
|
||||
const body: Record<string, any> = {
|
||||
...mapListQuery(rest as ChangeQuery),
|
||||
...(ids ? { ids } : {}),
|
||||
...(columns ? { columns } : {})
|
||||
}
|
||||
return request.post({
|
||||
url: `${BASE}/export`,
|
||||
data: mapListQuery(query),
|
||||
data: body,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -194,10 +194,16 @@ export function uploadAttachments(data: {
|
||||
})
|
||||
}
|
||||
|
||||
export async function exportContract(query?: ContractQuery) {
|
||||
export async function exportContract(data: Record<string, any> = {}) {
|
||||
const { ids, columns, ...rest } = data
|
||||
const body: Record<string, any> = {
|
||||
...mapListQuery(rest as ContractQuery),
|
||||
...(ids ? { ids } : {}),
|
||||
...(columns ? { columns } : {})
|
||||
}
|
||||
return request.post({
|
||||
url: `${BASE}/export`,
|
||||
data: mapListQuery(query),
|
||||
data: body,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -60,10 +60,16 @@ export function disableTemplate(id: number | string) {
|
||||
return request.put({ url: `${BASE}/disable/${String(id)}` })
|
||||
}
|
||||
|
||||
export async function exportTemplate(query: TemplateQuery) {
|
||||
export async function exportTemplate(data: Record<string, any> = {}) {
|
||||
const { ids, columns, ...rest } = data
|
||||
const body: Record<string, any> = {
|
||||
...mapListQuery(rest as TemplateQuery),
|
||||
...(ids ? { ids } : {}),
|
||||
...(columns ? { columns } : {})
|
||||
}
|
||||
return request.post({
|
||||
url: `${BASE}/export`,
|
||||
data: mapListQuery(query),
|
||||
data: body,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -119,10 +119,16 @@ export function markLost(data: OpportunityMarkLostParams) {
|
||||
})
|
||||
}
|
||||
|
||||
export async function exportOpportunity(query?: OpportunityQuery) {
|
||||
export async function exportOpportunity(data: Record<string, any> = {}) {
|
||||
const { ids, columns, ...rest } = data
|
||||
const body: Record<string, any> = {
|
||||
...mapListQuery(rest as OpportunityQuery),
|
||||
...(ids ? { ids } : {}),
|
||||
...(columns ? { columns } : {})
|
||||
}
|
||||
return request.post({
|
||||
url: `${BASE}/export`,
|
||||
data: mapListQuery(query),
|
||||
data: body,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -26,6 +26,15 @@ export function fetchPoolRecordList(data?: Record<string, any>) {
|
||||
return request.post({ url: '/web/crm/customer/pool/record/list', data })
|
||||
}
|
||||
|
||||
/** 导出公海客户 */
|
||||
export function fetchExportPoolCustomers(data: Record<string, any> = {}) {
|
||||
return request.post({
|
||||
url: '/web/crm/customer/pool/export',
|
||||
data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// ── 公海池规则 ──
|
||||
|
||||
/** 公海池规则列表 */
|
||||
@@ -62,3 +71,13 @@ export function fetchTogglePoolRule(data: { id: string; status: string }) {
|
||||
export function fetchExecutePoolRules(data?: Record<string, any>) {
|
||||
return request.post({ url: '/web/crm/customer/pool/rule/execute', data })
|
||||
}
|
||||
|
||||
/** 导出公海规则 */
|
||||
export function fetchExportPoolRules(data: Record<string, any> = {}) {
|
||||
return request.post({
|
||||
url: '/web/crm/customer/pool/rule/export',
|
||||
data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -161,10 +161,16 @@ export function invalidQuote(id: string | number, remark?: string) {
|
||||
return request.post({ url: `${BASE}/invalid`, data: { id: String(id), remark } })
|
||||
}
|
||||
|
||||
export async function exportQuote(query?: QuoteQuery) {
|
||||
export async function exportQuote(data: Record<string, any> = {}) {
|
||||
const { ids, columns, ...rest } = data
|
||||
const body: Record<string, any> = {
|
||||
...mapListQuery(rest as QuoteQuery),
|
||||
...(ids ? { ids } : {}),
|
||||
...(columns ? { columns } : {})
|
||||
}
|
||||
return request.post({
|
||||
url: `${BASE}/export`,
|
||||
data: mapListQuery(query),
|
||||
data: body,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -104,6 +104,9 @@ export const inventoryApi = {
|
||||
list(params?: InventoryListParams) {
|
||||
return dbRequest.get<InventoryRecord[]>('/inventory', { params, timeout: 60000 })
|
||||
},
|
||||
export(data: Record<string, any>) {
|
||||
return dbRequest.post<Blob>('/inventory/export', data, { responseType: 'blob' })
|
||||
},
|
||||
get(id: string) {
|
||||
return dbRequest.get<InventoryRecord>(`/inventory/${id}`)
|
||||
},
|
||||
|
||||
@@ -131,6 +131,9 @@ export const planApi = {
|
||||
list(params?: PlanListParams) {
|
||||
return dbRequest.get<Plan[]>('/plans', { params })
|
||||
},
|
||||
export(data: Record<string, any>) {
|
||||
return dbRequest.post<Blob>('/plans/export', data, { responseType: 'blob' })
|
||||
},
|
||||
get(id: string) {
|
||||
return dbRequest.get<Plan>(`/plans/${id}`)
|
||||
},
|
||||
|
||||
@@ -104,6 +104,9 @@ export const weighingApi = {
|
||||
list(params?: WeighingListParams) {
|
||||
return dbRequest.get<WeighingRecord[]>('/weighing', { params })
|
||||
},
|
||||
export(data: Record<string, any>) {
|
||||
return dbRequest.post<Blob>('/weighing/export', data, { responseType: 'blob' })
|
||||
},
|
||||
get(id: string) {
|
||||
return dbRequest.get<WeighingRecord>(`/weighing/${id}`)
|
||||
},
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
demoUnits
|
||||
} from './mock-data'
|
||||
import { DEFAULT_LIST_PAGE_SIZE } from '@/utils/table/tableConfig'
|
||||
import request from '@/utils/http'
|
||||
|
||||
type PageParams = { page?: number; pageSize?: number; keyword?: string }
|
||||
|
||||
@@ -387,3 +388,113 @@ export async function fetchAttachmentDownloadUrl(_data: { fileUrl: string; fileN
|
||||
await delay()
|
||||
return { downloadUrl: '#' }
|
||||
}
|
||||
|
||||
|
||||
const DEMO_PRODUCT_EXPORT_COLS = [
|
||||
{ field: 'id', title: 'id' },
|
||||
{ field: 'name', title: '商品名称' },
|
||||
{ field: 'skuCode', title: 'SKU编码' },
|
||||
{ field: 'categoryName', title: '分类' },
|
||||
{ field: 'measureValue', title: '计量' },
|
||||
{ field: 'unitName', title: '单位' },
|
||||
{ field: 'imageUrl', title: '图片URL' },
|
||||
{ field: 'isActive', title: '状态' },
|
||||
{ field: 'createAt', title: '创建时间' }
|
||||
]
|
||||
|
||||
const DEMO_CATEGORY_EXPORT_COLS = [
|
||||
{ field: 'id', title: 'id' },
|
||||
{ field: 'name', title: '分类名称' },
|
||||
{ field: 'parentId', title: '父分类ID' },
|
||||
{ field: 'parentName', title: '父分类名称' },
|
||||
{ field: 'sortOrder', title: '排序' },
|
||||
{ field: 'priceCoefficient', title: '价格系数(%)' },
|
||||
{ field: 'isActive', title: '状态' },
|
||||
{ field: 'imageUrl', title: '图片URL' }
|
||||
]
|
||||
|
||||
function pickExportColumns(
|
||||
all: { field: string; title: string }[],
|
||||
visible?: string[]
|
||||
) {
|
||||
if (!visible?.length) return all
|
||||
const set = new Set(visible)
|
||||
const picked = all.filter((c) => set.has(c.field))
|
||||
return picked.length ? picked : all
|
||||
}
|
||||
|
||||
/** Demo 商品列表导出(Mock 筛行 + 后端 xlsx) */
|
||||
export async function fetchExportDemoProducts(payload: Record<string, any> = {}) {
|
||||
await delay()
|
||||
let list = [...products]
|
||||
if (payload.categoryId) list = list.filter((p) => p.categoryId === payload.categoryId)
|
||||
if (payload.isActive === true || payload.isActive === false) {
|
||||
list = list.filter((p) => p.isActive === payload.isActive)
|
||||
}
|
||||
list = filterKeyword(list, ['name', 'skuCode'], payload.keyword)
|
||||
if (payload.ids?.length) {
|
||||
const idSet = new Set(payload.ids.map(String))
|
||||
list = list.filter((p) => idSet.has(String(p.id)))
|
||||
}
|
||||
const cols = pickExportColumns(DEMO_PRODUCT_EXPORT_COLS, payload.columns)
|
||||
const rows = list.map((row) => ({
|
||||
id: row.id,
|
||||
name: row.name,
|
||||
skuCode: (row as any).skuCode || 'SKU-DEMO',
|
||||
categoryName: row.categoryName,
|
||||
measureValue: (row as any).measureValue ?? 1,
|
||||
unitName: row.unitName,
|
||||
imageUrl: row.imageUrl,
|
||||
isActive: row.isActive ? '启用' : '禁用',
|
||||
createAt: row.createAt
|
||||
}))
|
||||
return request.post({
|
||||
url: '/web/admin/demo/xlsx-export',
|
||||
data: {
|
||||
sheetTitle: '商品数据',
|
||||
filenameStem: '商品数据',
|
||||
columns: cols,
|
||||
rows
|
||||
},
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
/** Demo 分类列表导出(Mock 筛行 + 后端 xlsx) */
|
||||
export async function fetchExportDemoCategories(payload: Record<string, any> = {}) {
|
||||
await delay()
|
||||
let list = [...categories]
|
||||
if (payload.isActive === true || payload.isActive === false) {
|
||||
list = list.filter((c) => c.isActive === payload.isActive)
|
||||
}
|
||||
list = filterKeyword(list, ['name'], payload.keyword)
|
||||
if (payload.ids?.length) {
|
||||
const idSet = new Set(payload.ids.map(String))
|
||||
list = list.filter((c) => idSet.has(String(c.id)))
|
||||
}
|
||||
const idToName = new Map(list.map((c) => [c.id, c.name]))
|
||||
// parent may be outside filtered set — use full categories map
|
||||
const allNames = new Map(categories.map((c) => [c.id, c.name]))
|
||||
const cols = pickExportColumns(DEMO_CATEGORY_EXPORT_COLS, payload.columns)
|
||||
const rows = list.map((row) => ({
|
||||
id: row.id,
|
||||
name: row.name,
|
||||
parentId: row.parentId || '',
|
||||
parentName: row.parentId ? allNames.get(row.parentId) || '' : '',
|
||||
sortOrder: row.sortOrder,
|
||||
priceCoefficient: row.priceCoefficient ?? 0,
|
||||
isActive: row.isActive ? '启用' : '禁用',
|
||||
imageUrl: row.imageUrl || ''
|
||||
}))
|
||||
return request.post({
|
||||
url: '/web/admin/demo/xlsx-export',
|
||||
data: {
|
||||
sheetTitle: '分类数据',
|
||||
filenameStem: '分类数据',
|
||||
columns: cols,
|
||||
rows
|
||||
},
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -55,6 +55,14 @@ export interface PublicIoOrderPage {
|
||||
items: PublicIoOrderItem[]
|
||||
}
|
||||
|
||||
export interface PublicIoOrderHistoryProduct {
|
||||
productName: string
|
||||
model?: string
|
||||
packageSpec?: string
|
||||
quantity?: number | null
|
||||
unit?: string
|
||||
}
|
||||
|
||||
export interface PublicIoOrderHistoryRecord {
|
||||
kind: 'inbound' | 'outbound' | string
|
||||
orderId: string
|
||||
@@ -66,6 +74,11 @@ export interface PublicIoOrderHistoryRecord {
|
||||
supplierName?: string | null
|
||||
customerName?: string | null
|
||||
vehicleNo?: string | null
|
||||
pickupTime?: string | null
|
||||
deliveryTime?: string | null
|
||||
pickupAddress?: string | null
|
||||
destinationAddress?: string | null
|
||||
products?: PublicIoOrderHistoryProduct[]
|
||||
siteAccessToken?: string | null
|
||||
siteUrl?: string | null
|
||||
status?: string | null
|
||||
|
||||
@@ -64,6 +64,14 @@ export interface PublicUploadResult {
|
||||
fileName?: string
|
||||
}
|
||||
|
||||
export interface PublicTransportHistoryProduct {
|
||||
productName: string
|
||||
model?: string
|
||||
packageSpec?: string
|
||||
quantity?: number | null
|
||||
unit?: string
|
||||
}
|
||||
|
||||
export interface PublicTransportHistoryRecord {
|
||||
planId: string
|
||||
planNo: string
|
||||
@@ -75,6 +83,7 @@ export interface PublicTransportHistoryRecord {
|
||||
deliveryTime?: string
|
||||
pickupAddress?: string
|
||||
destinationAddress?: string
|
||||
products?: PublicTransportHistoryProduct[]
|
||||
planVoided?: boolean
|
||||
planArchived?: boolean
|
||||
statusLabel?: string
|
||||
|
||||
Reference in new issue
Block a user