让凭证数组与套餐作废任务进入可联调状态
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m52s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m52s
Constraint: 后端订单套餐作废接口使用 /api/admin/order-package-invalidate-tasks,上传 purpose 只能使用 attachment。 Rejected: 继续提交逗号拼接凭证字符串 | 新提交路径必须使用 string[],历史字符串只做读取归一化。 Confidence: high Scope-risk: broad Directive: 新增订单套餐作废权限时需同时配置菜单 URL 与 order_package_invalidate_task:create/detail 按钮权限。 Tested: bun run build;development 真实后端联调上传、创建、列表、详情通过;复机接口未触发。 Not-tested: 未逐一手工覆盖所有历史凭证数据、全部角色权限组合和所有文件扩展名预览
This commit is contained in:
@@ -21,6 +21,16 @@ export function useAgentManagement() {
|
||||
// 分页
|
||||
const { pagination, setTotal, handleCurrentChange, handleSizeChange } = usePagination()
|
||||
|
||||
const agentService = AccountService as unknown as {
|
||||
getAgents: (params?: AgentQueryParams) => Promise<any>
|
||||
getAgentTree: () => Promise<any>
|
||||
getAgent: (id: string | number) => Promise<any>
|
||||
createAgent: (data: CreateAgentParams) => Promise<any>
|
||||
updateAgent: (id: string | number, data: Partial<CreateAgentParams>) => Promise<any>
|
||||
toggleAgentStatus: (id: string | number, status: 0 | 1) => Promise<any>
|
||||
getSubAgents: (id: string | number) => Promise<any>
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取代理商列表
|
||||
* @param params 查询参数
|
||||
@@ -28,7 +38,7 @@ export function useAgentManagement() {
|
||||
const fetchAgentList = async (params?: AgentQueryParams) => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await AccountService.getAgents({
|
||||
const res = await agentService.getAgents({
|
||||
current: pagination.current,
|
||||
size: pagination.size,
|
||||
...params
|
||||
@@ -50,7 +60,7 @@ export function useAgentManagement() {
|
||||
const fetchAgentTree = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await AccountService.getAgentTree()
|
||||
const res = await agentService.getAgentTree()
|
||||
treeData.value = res.data
|
||||
} catch (error) {
|
||||
console.error('获取代理商树失败:', error)
|
||||
@@ -67,7 +77,7 @@ export function useAgentManagement() {
|
||||
const fetchAgentDetail = async (id: string | number) => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await AccountService.getAgent(id)
|
||||
const res = await agentService.getAgent(id)
|
||||
return res.data
|
||||
} catch (error) {
|
||||
console.error('获取代理商详情失败:', error)
|
||||
@@ -85,7 +95,7 @@ export function useAgentManagement() {
|
||||
const createAgent = async (data: CreateAgentParams) => {
|
||||
loading.value = true
|
||||
try {
|
||||
await AccountService.createAgent(data)
|
||||
await agentService.createAgent(data)
|
||||
ElMessage.success('创建成功')
|
||||
return true
|
||||
} catch (error) {
|
||||
@@ -105,7 +115,7 @@ export function useAgentManagement() {
|
||||
const updateAgent = async (id: string | number, data: Partial<CreateAgentParams>) => {
|
||||
loading.value = true
|
||||
try {
|
||||
await AccountService.updateAgent(id, data)
|
||||
await agentService.updateAgent(id, data)
|
||||
ElMessage.success('更新成功')
|
||||
return true
|
||||
} catch (error) {
|
||||
@@ -125,7 +135,7 @@ export function useAgentManagement() {
|
||||
const toggleStatus = async (id: string | number, status: 0 | 1) => {
|
||||
loading.value = true
|
||||
try {
|
||||
await AccountService.toggleAgentStatus(id, status)
|
||||
await agentService.toggleAgentStatus(id, status)
|
||||
ElMessage.success('状态更新成功')
|
||||
return true
|
||||
} catch (error) {
|
||||
@@ -144,7 +154,7 @@ export function useAgentManagement() {
|
||||
const fetchSubAgents = async (id: string | number) => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await AccountService.getSubAgents(id)
|
||||
const res = await agentService.getSubAgents(id)
|
||||
return res.data
|
||||
} catch (error) {
|
||||
console.error('获取下级代理失败:', error)
|
||||
|
||||
@@ -6,6 +6,7 @@ import { ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { CardService } from '@/api/modules'
|
||||
import type { Card, CardQueryParams, CardOperationParams } from '@/types/api'
|
||||
import { getErrorMessage } from '@/utils/business'
|
||||
import { usePagination } from './usePagination'
|
||||
import { useTableSelection } from './useTableSelection'
|
||||
|
||||
@@ -116,7 +117,7 @@ export function useCardManagement() {
|
||||
return true
|
||||
} catch (error) {
|
||||
console.error('复机失败:', error)
|
||||
console.log('复机失败')
|
||||
ElMessage.error(getErrorMessage(error, '复机失败'))
|
||||
return false
|
||||
} finally {
|
||||
loading.value = false
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface ColumnOption {
|
||||
fixed?: boolean | 'left' | 'right'
|
||||
sortable?: boolean
|
||||
disabled?: boolean
|
||||
formatter?: (row: any) => any
|
||||
formatter?: (row: any, ...args: any[]) => any
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
* 表格选择管理 Composable
|
||||
*/
|
||||
|
||||
import { ref, computed } from 'vue'
|
||||
import { computed, shallowRef } from 'vue'
|
||||
|
||||
export function useTableSelection<T = any>() {
|
||||
// 选中的行
|
||||
const selectedRows = ref<T[]>([])
|
||||
const selectedRows = shallowRef<T[]>([])
|
||||
|
||||
// 选中的ID列表
|
||||
const selectedIds = computed(() => {
|
||||
@@ -38,9 +38,9 @@ export function useTableSelection<T = any>() {
|
||||
const toggleSelection = (row: T) => {
|
||||
const index = selectedRows.value.findIndex((item: any) => item.id === (row as any).id)
|
||||
if (index > -1) {
|
||||
selectedRows.value.splice(index, 1)
|
||||
selectedRows.value = selectedRows.value.filter((_, itemIndex) => itemIndex !== index)
|
||||
} else {
|
||||
selectedRows.value.push(row)
|
||||
selectedRows.value = [...selectedRows.value, row]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user