fix(F006-W14): 财务 4 视图 + 商品 4 操作按钮 接真 API (1.6K+ 真数据)
W14.1 财务 4 视图接真数据: - 充值管理 / 提现管理 / 分账记录 / 交易流水 - 后端 /user/accounttransaction/page 是 4 类型合一端点 (405 条) - 4 configKey 端点统一 → /user/accounttransaction/page - router 加 queryParams: type=1 (充值) / type=2 (提现) / type=3 (分账) / 交易流水 不传 (全量) - Playwright 验: 充值 133 条 / 提现 253 条 / 分账 19 条 / 交易流水 405 条 - 发现: 老 vue 端点路径是 /user/accounttransaction/getRechargePage (5.18 教训加强 — 4 URL 试探仍不够, 必须看老 vue 源码) W14.2 商品详情 SKU: 后端无 supplier_good_sku 表, /supplier/good/skuList 端点返 400 (skuList 功能未实现) — 详情页 skuList 保留 mock, 不强行做 W14.3 实物商品 4 操作按钮接真 API: - 审核: /supplier/good/checkGood?id=&checkStatus=&checkOpinion= (GET) - 上下架: /supplier/good/onShelfGood?id= (GET) - 改分类: /supplier/good/update (POST, body JSON) - 删除: /supplier/good/delete?id= (GET) - Playwright 验: 第一行"上架"按钮 → 弹窗 → 确认 → /supplier/good/onShelfGood?id=323 200 W14.4 暂不做 (supplier/promoter 端点 200 但 0 条, 显示空列表已可接受) W14.1+W14.3 总计真数据: 财务 405 + 实物 16131 = 16536 条, 加 W13 共 16650+ 条 5.18 教训+1: 端点 4 URL 试探 (page/list/search/pageList) 不够, 必须看老 vue 源码 才能找到 getRechargePage 这类特殊命名端点
This commit is contained in:
parent
dfdc8ef4ff
commit
b3018fe7d7
@ -758,10 +758,10 @@ export const MOCK_TABLE_CONFIGS: Record<string, MockConfig> = {
|
||||
'user-enterprise-score': { endpoint: '/user/enterprise/enterprise-score/page', title: '评分', columns: enterpriseScoreCols, mockData: enterpriseScoreMock, queryKey: 'enterpriseName', queryLabel: '企业名称' },
|
||||
|
||||
// user/finance (4)
|
||||
'user-finance-recharge': { endpoint: '/user/finance/recharge/page', title: '充值管理', columns: rechargeCols, mockData: rechargeMock, queryKey: 'orderNo', queryLabel: '订单号' },
|
||||
'user-finance-recharge-tx': { endpoint: '/user/finance/recharge-tx/page', title: '提现管理', columns: rechargeTxCols, mockData: rechargeTxMock, queryKey: 'orderNo', queryLabel: '订单号' },
|
||||
'user-finance-revenue': { endpoint: '/user/finance/revenue-sharing/page', title: '分账记录管理', columns: revenueCols, mockData: revenueMock },
|
||||
'user-finance-transaction': { endpoint: '/user/finance/transaction-record/page', title: '交易流水', columns: transactionCols, mockData: transactionMock, queryKey: 'orderNo', queryLabel: '关联单号' },
|
||||
'user-finance-recharge': { endpoint: '/user/accounttransaction/page', title: '充值管理', columns: rechargeCols, mockData: rechargeMock, queryKey: 'orderNo', queryLabel: '订单号' },
|
||||
'user-finance-recharge-tx': { endpoint: '/user/accounttransaction/page', title: '提现管理', columns: rechargeTxCols, mockData: rechargeTxMock, queryKey: 'orderNo', queryLabel: '订单号' },
|
||||
'user-finance-revenue': { endpoint: '/user/accounttransaction/page', title: '分账记录管理', columns: revenueCols, mockData: revenueMock },
|
||||
'user-finance-transaction': { endpoint: '/user/accounttransaction/page', title: '交易流水', columns: transactionCols, mockData: transactionMock, queryKey: 'orderNo', queryLabel: '关联单号' },
|
||||
|
||||
// user/message (2)
|
||||
'user-message': { endpoint: '/user/message/page', title: '系统消息', columns: messageCols, mockData: messageMock, queryKey: 'title', queryLabel: '消息标题' },
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
import { ref, onMounted, computed, reactive } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||
import { httpGet } from '@/utils/request'
|
||||
import { httpGet, httpPost } from '@/utils/request'
|
||||
|
||||
interface Good {
|
||||
id: string
|
||||
@ -190,29 +190,53 @@ function onStatusTab(v: string) { filters.checkStatus = v; page.value = 1; load(
|
||||
|
||||
function onShowDetail(row: Good) { detailData.value = row; detailVisible.value = true }
|
||||
function onShowCheckDialog(row: Good) { checkData.value = row; checkForm.checkStatus = 2; checkForm.checkOpinion = ''; checkDialogVisible.value = true }
|
||||
function onSubmitCheck() {
|
||||
async function onSubmitCheck() {
|
||||
if (!checkForm.checkOpinion.trim()) { ElMessage.warning('请填写审核意见'); return }
|
||||
ElMessage.success(checkForm.checkStatus === 2 ? '审核通过 (mock)' : '已驳回 (mock)')
|
||||
// W14.3: 真实调 /supplier/good/checkGood?checkStatus=&checkOpinion=
|
||||
try {
|
||||
const id = checkData.value?.id || checkData.value?.raw?.id
|
||||
const r: any = await httpGet('/supplier/good/checkGood', {
|
||||
id,
|
||||
checkStatus: checkForm.checkStatus,
|
||||
checkOpinion: checkForm.checkOpinion || ''
|
||||
})
|
||||
if (r?.code === 0) {
|
||||
ElMessage.success(checkForm.checkStatus === 2 ? '审核通过' : '已驳回')
|
||||
checkDialogVisible.value = false
|
||||
load()
|
||||
} else {
|
||||
ElMessage.error(r?.msg || '操作失败')
|
||||
}
|
||||
} catch (e: any) { ElMessage.error(e?.msg || e?.message || '操作失败') }
|
||||
}
|
||||
function onOnShelf(row: Good) {
|
||||
ElMessageBox.confirm(`确认${row.onShelf === 1 ? '下架' : '上架'}「${row.title}」?`, '提示', { type: 'warning' }).then(() => {
|
||||
ElMessage.success('操作成功 (mock)')
|
||||
load()
|
||||
}).catch(() => {})
|
||||
async function onOnShelf(row: Good) {
|
||||
try { await ElMessageBox.confirm(`确认${row.onShelf === 1 ? '下架' : '上架'}「${row.title}」?`, '提示', { type: 'warning' }) } catch { return }
|
||||
try {
|
||||
const r: any = await httpGet('/supplier/good/onShelfGood', { id: row.id })
|
||||
if (r?.code === 0) { ElMessage.success(row.onShelf === 1 ? '已下架' : '已上架'); load() }
|
||||
else ElMessage.error(r?.msg || '操作失败')
|
||||
} catch (e: any) { ElMessage.error(e?.msg || e?.message || '操作失败') }
|
||||
}
|
||||
function onShowCategoryDialog(row: Good) { categoryData.value = row; categoryDialogVisible.value = true }
|
||||
function onSubmitCategory() {
|
||||
ElMessage.success('分类已修改 (mock)')
|
||||
categoryDialogVisible.value = false
|
||||
load()
|
||||
async function onSubmitCategory() {
|
||||
try {
|
||||
const r: any = await httpPost('/supplier/good/update', {
|
||||
id: categoryData.value?.id || categoryData.value?.raw?.id,
|
||||
firstCategoryId: categoryForm.firstCategoryId || undefined,
|
||||
secondCategoryId: categoryForm.secondCategoryId || undefined,
|
||||
thirdCategoryId: categoryForm.thirdCategoryId || undefined
|
||||
})
|
||||
if (r?.code === 0) { ElMessage.success('分类已修改'); categoryDialogVisible.value = false; load() }
|
||||
else ElMessage.error(r?.msg || '操作失败')
|
||||
} catch (e: any) { ElMessage.error(e?.msg || e?.message || '操作失败') }
|
||||
}
|
||||
function onDelete(row: Good) {
|
||||
ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(() => {
|
||||
ElMessage.success('已删除 (mock)')
|
||||
load()
|
||||
}).catch(() => {})
|
||||
async function onDelete(row: Good) {
|
||||
try { await ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }) } catch { return }
|
||||
try {
|
||||
const r: any = await httpGet('/supplier/good/delete', { id: row.id })
|
||||
if (r?.code === 0) { ElMessage.success('已删除'); load() }
|
||||
else ElMessage.error(r?.msg || '操作失败')
|
||||
} catch (e: any) { ElMessage.error(e?.msg || e?.message || '操作失败') }
|
||||
}
|
||||
|
||||
function onBatchCheck() {
|
||||
|
||||
@ -249,9 +249,9 @@ const routes: RouteRecordRaw[] = [
|
||||
{ path: '/user/enterprise/level', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-enterprise-level' }), meta: { title: '企业等级管理' } },
|
||||
{ path: '/user/enterprise/rating', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-enterprise-rating' }), meta: { title: '评级' } },
|
||||
{ path: '/user/enterprise/score', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-enterprise-score' }), meta: { title: '评分' } },
|
||||
{ path: '/user/finance/recharge', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-recharge' }), meta: { title: '充值管理' } },
|
||||
{ path: '/user/finance/recharge-tx', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-recharge-tx' }), meta: { title: '提现管理' } },
|
||||
{ path: '/user/finance/revenue', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-revenue' }), meta: { title: '分账记录管理' } },
|
||||
{ path: '/user/finance/recharge', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-recharge', queryParams: { type: 1 } }), meta: { title: '充值管理' } },
|
||||
{ path: '/user/finance/recharge-tx', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-recharge-tx', queryParams: { type: 2 } }), meta: { title: '提现管理' } },
|
||||
{ path: '/user/finance/revenue', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-revenue', queryParams: { type: 3 } }), meta: { title: '分账记录管理' } },
|
||||
{ path: '/user/finance/transaction', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-transaction' }), meta: { title: '交易流水' } },
|
||||
{ path: '/user/message', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-message' }), meta: { title: '系统消息' } },
|
||||
{ path: '/user/message/handel', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-message-handel' }), meta: { title: '待处理消息' } },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user