admin_new P0+P1 全批次合并 (84 commits) #2
@ -74,7 +74,7 @@ export const MENU_LABELS: MenuLabel[] = [
|
|||||||
|
|
||||||
// ===== 供应商模块 =====
|
// ===== 供应商模块 =====
|
||||||
{ url: 'supplier/good', label: '实物商品', icon: 'Box', path: '/supplier/good', sort: 300 },
|
{ url: 'supplier/good', label: '实物商品', icon: 'Box', path: '/supplier/good', sort: 300 },
|
||||||
{ url: 'supplier/servicegood', label: '服务商品', icon: 'Box', path: '/supplier/good', sort: 301 },
|
{ url: 'supplier/servicegood', label: '服务商品', icon: 'Box', path: '/supplier/servicegood', sort: 301 },
|
||||||
{ url: 'supplier/activityzone', label: '活动专区', icon: 'Promotion', path: '/supplier/activity', sort: 302 },
|
{ url: 'supplier/activityzone', label: '活动专区', icon: 'Promotion', path: '/supplier/activity', sort: 302 },
|
||||||
{ url: 'supplier/coupon', label: '优惠券', icon: 'Ticket', path: '/supplier/coupon', sort: 303 },
|
{ url: 'supplier/coupon', label: '优惠券', icon: 'Ticket', path: '/supplier/coupon', sort: 303 },
|
||||||
{ url: 'supplier/promoter', label: '推广返佣', icon: 'UserFilled', path: '/supplier/promoter', sort: 304 },
|
{ url: 'supplier/promoter', label: '推广返佣', icon: 'UserFilled', path: '/supplier/promoter', sort: 304 },
|
||||||
|
|||||||
@ -143,27 +143,28 @@ async function load() {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
error.value = null
|
error.value = null
|
||||||
try {
|
try {
|
||||||
// 后端 /supplier/good/page 400 (按 id 查), 真实分页端点是 /supplier/good/search (16080 条)
|
// W13.1: /supplier/good/pageList 返完整字段 (16133 条) — 比 search 端点更全
|
||||||
const data = await httpGet<{ total: number | string; list: any[] }>('/supplier/good/search', {
|
const data = await httpGet<{ total: number | string; list: any[] }>('/supplier/good/pageList', {
|
||||||
page: page.value,
|
page: page.value,
|
||||||
limit: limit.value,
|
limit: limit.value,
|
||||||
|
type: 1, // 1=实物商品 (2=服务商品, 在 ServiceGoodListView 单独展示)
|
||||||
...(filters.title ? { title: filters.title } : {})
|
...(filters.title ? { title: filters.title } : {})
|
||||||
})
|
})
|
||||||
let rows = (data.list || []).map((it: any) => ({
|
let rows = (data.list || []).map((it: any) => ({
|
||||||
id: String(it.id),
|
id: String(it.id),
|
||||||
supplierGoodId: 'G' + String(it.id),
|
supplierGoodId: it.supplierGoodId || String(it.id),
|
||||||
icon: it.icon || null,
|
icon: it.icon || null,
|
||||||
title: it.title || '--',
|
title: it.title || '--',
|
||||||
enterpriseName: '--', // search 端点不返, 留占位
|
enterpriseName: it.enterpriseName || '--',
|
||||||
firstCategoryName: it.firstCategoryName || '',
|
firstCategoryName: it.firstCategoryName || '',
|
||||||
secondCategoryName: it.secondCategoryName || '',
|
secondCategoryName: it.secondCategoryName || '',
|
||||||
thirdCategoryName: it.thirdCategoryName || '',
|
thirdCategoryName: it.thirdCategoryName || '',
|
||||||
brandName: it.brandName || '--',
|
brandName: it.brandName || '--',
|
||||||
unitName: '--', // search 端点不返
|
unitName: it.unitName || '--',
|
||||||
onShelf: it.onShelf ?? 1,
|
onShelf: it.onShelf ?? 1,
|
||||||
checkOpinion: '',
|
checkOpinion: it.checkOpinion || '',
|
||||||
checkStatus: 2, // search 不返, 默认已通过
|
checkStatus: it.checkStatus ?? 2,
|
||||||
createDate: '',
|
createDate: it.createDate || '',
|
||||||
raw: it
|
raw: it
|
||||||
}))
|
}))
|
||||||
if (filters.enterpriseName) rows = rows.filter(r => r.enterpriseName.includes(filters.enterpriseName))
|
if (filters.enterpriseName) rows = rows.filter(r => r.enterpriseName.includes(filters.enterpriseName))
|
||||||
|
|||||||
@ -80,17 +80,37 @@ async function load() {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
error.value = null
|
error.value = null
|
||||||
try {
|
try {
|
||||||
await new Promise(r => setTimeout(r, 200))
|
// W13.2: /supplier/good/pageList?type=2 是服务商品端点 (与实物商品共用 supplier_good 表, type 区分)
|
||||||
let rows = [...FALLBACK]
|
const data = await httpGet<{ total: number | string; list: any[] }>('/supplier/good/pageList', {
|
||||||
|
page: page.value,
|
||||||
|
limit: limit.value,
|
||||||
|
type: 2
|
||||||
|
})
|
||||||
|
let rows = (data.list || []).map((it: any) => ({
|
||||||
|
id: String(it.id),
|
||||||
|
serviceGoodId: it.supplierGoodId || String(it.id),
|
||||||
|
icon: it.icon || null,
|
||||||
|
title: it.title || '--',
|
||||||
|
enterpriseName: it.enterpriseName || '--',
|
||||||
|
categoryName: [it.firstCategoryName, it.secondCategoryName, it.thirdCategoryName].filter(Boolean).join(' / ') || '--',
|
||||||
|
serviceArea: it.enterpriseAddress || '--',
|
||||||
|
price: it.remark || '--', // 服务的"价格"实际在 remark 字段 (家政类)
|
||||||
|
checkStatus: it.checkStatus ?? 2,
|
||||||
|
onShelf: it.onShelf ?? 1,
|
||||||
|
createDate: it.createDate || '',
|
||||||
|
unit: '--',
|
||||||
|
checkOpinion: it.checkOpinion || '',
|
||||||
|
raw: it
|
||||||
|
}))
|
||||||
if (filters.title) rows = rows.filter(r => r.title.includes(filters.title))
|
if (filters.title) rows = rows.filter(r => r.title.includes(filters.title))
|
||||||
if (filters.enterpriseName) rows = rows.filter(r => r.enterpriseName.includes(filters.enterpriseName))
|
if (filters.enterpriseName) rows = rows.filter(r => r.enterpriseName.includes(filters.enterpriseName))
|
||||||
if (filters.checkStatus) rows = rows.filter(r => String(r.checkStatus) === filters.checkStatus)
|
if (filters.checkStatus) rows = rows.filter(r => String(r.checkStatus) === filters.checkStatus)
|
||||||
list.value = rows
|
list.value = rows
|
||||||
total.value = rows.length
|
total.value = Number(data.total) || 0
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
error.value = e?.msg || '加载失败'
|
error.value = e?.msg || e?.message || '加载失败'
|
||||||
list.value = FALLBACK
|
list.value = []
|
||||||
total.value = FALLBACK.length
|
total.value = 0
|
||||||
} finally { loading.value = false }
|
} finally { loading.value = false }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user