oms/frontend/src/api/productCategory.ts
liufumingren 907df04070 feat(frontend): 商品属性、订单状态与导出任务界面
- 新增商品属性页(分类/品牌/单位)与商品表单的品牌/单位选择
- 新增订单状态页:状态分视图列表、新建/编辑弹窗、明细维护、审核/驳回/取消/作废/恢复/推送仓库等操作
- 导出任务按类型动态渲染筛选表单与任务进度;导出按钮/筛选组件抽为公共组件
- 旧地址 order-split / order-create / order-delivery 重定向到 /order,导航与多标签页适配新页面

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-30 23:06:31 +08:00

58 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { get, post, put, del } from '@/utils/request'
/** 商品分类(按主体隔离) */
export interface ProductCategory {
id: number
principal_id: number
name: string
code: string | null
status: number
sort: number
remark: string | null
/** 是否系统默认:1系统数据(不可改/删,全部主体可见) 0自定义(按主体隔离) */
is_system?: number
/** 被商品使用次数(被引用时禁止删除) */
used_count?: number
created_at?: string
updated_at?: string
}
/** 下拉项(仅启用) */
export interface ProductAttributeOption {
id: number
name: string
code: string | null
}
export interface ProductCategoryPayload {
name: string
code?: string | null
status?: number
sort?: number
remark?: string | null
}
export function getProductCategories(params?: object) {
return get<{ list: ProductCategory[]; total: number; page: number; pageSize: number }>(
'/product-categories',
params,
)
}
/** 下拉用:仅返回启用商品分类(按 sort 升序) */
export function getProductCategoryOptions() {
return get<ProductAttributeOption[]>('/product-categories/select')
}
export function createProductCategory(data: ProductCategoryPayload) {
return post<{ id: number }>('/product-categories', data)
}
export function updateProductCategory(id: number, data: Partial<ProductCategoryPayload>) {
return put<{ id: number }>(`/product-categories/${id}`, data)
}
export function deleteProductCategory(id: number) {
return del<{ id: number }>(`/product-categories/${id}`)
}