admin_new P0+P1 全批次合并 (84 commits) #2
@ -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-enterprise-score': { endpoint: '/user/enterprise/enterprise-score/page', title: '评分', columns: enterpriseScoreCols, mockData: enterpriseScoreMock, queryKey: 'enterpriseName', queryLabel: '企业名称' },
|
||||||
|
|
||||||
// user/finance (4)
|
// user/finance (4)
|
||||||
'user-finance-recharge': { endpoint: '/user/finance/recharge/page', title: '充值管理', columns: rechargeCols, mockData: rechargeMock, queryKey: 'orderNo', queryLabel: '订单号' },
|
'user-finance-recharge': { endpoint: '/user/accounttransaction/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-recharge-tx': { endpoint: '/user/accounttransaction/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-revenue': { endpoint: '/user/accounttransaction/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-transaction': { endpoint: '/user/accounttransaction/page', title: '交易流水', columns: transactionCols, mockData: transactionMock, queryKey: 'orderNo', queryLabel: '关联单号' },
|
||||||
|
|
||||||
// user/message (2)
|
// user/message (2)
|
||||||
'user-message': { endpoint: '/user/message/page', title: '系统消息', columns: messageCols, mockData: messageMock, queryKey: 'title', queryLabel: '消息标题' },
|
'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 { ref, onMounted, computed, reactive } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import DataTable from '@/components/DataTable/DataTable.vue'
|
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
|
|
||||||
interface Good {
|
interface Good {
|
||||||
id: string
|
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 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 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 }
|
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
|
checkDialogVisible.value = false
|
||||||
load()
|
load()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(r?.msg || '操作失败')
|
||||||
}
|
}
|
||||||
function onOnShelf(row: Good) {
|
} catch (e: any) { ElMessage.error(e?.msg || e?.message || '操作失败') }
|
||||||
ElMessageBox.confirm(`确认${row.onShelf === 1 ? '下架' : '上架'}「${row.title}」?`, '提示', { type: 'warning' }).then(() => {
|
}
|
||||||
ElMessage.success('操作成功 (mock)')
|
async function onOnShelf(row: Good) {
|
||||||
load()
|
try { await ElMessageBox.confirm(`确认${row.onShelf === 1 ? '下架' : '上架'}「${row.title}」?`, '提示', { type: 'warning' }) } catch { return }
|
||||||
}).catch(() => {})
|
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 onShowCategoryDialog(row: Good) { categoryData.value = row; categoryDialogVisible.value = true }
|
||||||
function onSubmitCategory() {
|
async function onSubmitCategory() {
|
||||||
ElMessage.success('分类已修改 (mock)')
|
try {
|
||||||
categoryDialogVisible.value = false
|
const r: any = await httpPost('/supplier/good/update', {
|
||||||
load()
|
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) {
|
async function onDelete(row: Good) {
|
||||||
ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(() => {
|
try { await ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }) } catch { return }
|
||||||
ElMessage.success('已删除 (mock)')
|
try {
|
||||||
load()
|
const r: any = await httpGet('/supplier/good/delete', { id: row.id })
|
||||||
}).catch(() => {})
|
if (r?.code === 0) { ElMessage.success('已删除'); load() }
|
||||||
|
else ElMessage.error(r?.msg || '操作失败')
|
||||||
|
} catch (e: any) { ElMessage.error(e?.msg || e?.message || '操作失败') }
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBatchCheck() {
|
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/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/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/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', 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' }), 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' }), 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/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', 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: '待处理消息' } },
|
{ 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