1812 lines
50 KiB
TypeScript
1812 lines
50 KiB
TypeScript
import request from '@/utils/http'
|
||
import type { AppRouteRecord } from '@/types/router'
|
||
import { MAX_ADMIN_LIST_PAGE_SIZE } from '@/utils/fetch-paged-list'
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 后端菜单 / 角色(与 router 后端模式、用户弹窗对齐)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
/** 后端菜单模式:拉取动态路由 */
|
||
export async function fetchGetMenuList() {
|
||
const res = await request.get<AppRouteRecord[] | { menuList?: AppRouteRecord[] }>({
|
||
url: '/web/menu/list'
|
||
})
|
||
if (Array.isArray(res)) return res
|
||
return res?.menuList || []
|
||
}
|
||
|
||
/** 用户表单等:角色下拉 */
|
||
export function fetchGetRoleList() {
|
||
return request.get<Array<{ label: string; value: string }>>({
|
||
url: '/web/admin/roles'
|
||
})
|
||
}
|
||
|
||
/** 流程设计器:用户下拉选项(label=昵称,value=用户ID) */
|
||
export function fetchUserOptions() {
|
||
return request.get<Array<{ label: string; value: string }>>({
|
||
url: '/web/admin/users/options'
|
||
})
|
||
}
|
||
|
||
/** 流程设计器:角色下拉选项(label=角色名,value=角色ID UUID) */
|
||
export function fetchRoleOptions() {
|
||
return request.get<Array<{ label: string; value: string }>>({
|
||
url: '/web/admin/roles/options'
|
||
})
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 租户(系统管理)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchTenantList(params?: { page?: number; pageSize?: number; keyword?: string }) {
|
||
return request.get<{
|
||
list: Api.Tenant.TenantItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({
|
||
url: '/web/admin/tenants',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateTenant(data: {
|
||
tenantNo: string
|
||
tenantName: string
|
||
contactName?: string
|
||
contactPhone?: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post<Api.Tenant.TenantItem>({
|
||
url: '/web/admin/tenants',
|
||
data,
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateTenant(
|
||
id: string,
|
||
data: Partial<{
|
||
tenantNo: string
|
||
tenantName: string
|
||
contactName: string
|
||
contactPhone: string
|
||
orderNum: number
|
||
remark: string
|
||
}>
|
||
) {
|
||
return request.put<Api.Tenant.TenantItem>({
|
||
url: `/web/admin/tenants/${id}`,
|
||
data,
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
|
||
export function fetchDeleteTenant(id: string) {
|
||
return request.del({
|
||
url: `/web/admin/tenants/${id}`,
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 用户管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchUserList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
deptId?: string
|
||
status?: string
|
||
}) {
|
||
return request.get<{
|
||
list: Api.User.UserItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({
|
||
url: '/web/admin/users',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchUserDetail(id: string) {
|
||
return request.get<Api.User.UserItem>({
|
||
url: `/web/admin/users/${id}`
|
||
})
|
||
}
|
||
|
||
export function fetchCreateUser(data: {
|
||
userNo: string
|
||
nickName: string
|
||
password: string
|
||
deptId?: string
|
||
email?: string
|
||
phoneNo?: string
|
||
sex?: string
|
||
avatar?: string
|
||
status?: string
|
||
orderNum?: number
|
||
remark?: string
|
||
roleIds?: string[]
|
||
postIds?: string[]
|
||
}) {
|
||
return request.post({
|
||
url: '/web/admin/users',
|
||
data,
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateUser(
|
||
id: string,
|
||
data: Partial<{
|
||
nickName: string
|
||
deptId: string
|
||
email: string
|
||
phoneNo: string
|
||
sex: string
|
||
avatar: string
|
||
status: string
|
||
orderNum: number
|
||
remark: string
|
||
roleIds: string[]
|
||
postIds: string[]
|
||
}>
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/users/${id}`,
|
||
data,
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
|
||
export function fetchDeleteUser(id: string) {
|
||
return request.del({
|
||
url: `/web/admin/users/${id}`,
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
|
||
export function fetchResetPassword(id: string) {
|
||
return request.post({
|
||
url: `/web/admin/users/${id}/reset-password`,
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
|
||
/** 上传用户头像,返回存储后的 URL,供写入 avatarUrl */
|
||
export function fetchUploadUserAvatar(data: FormData) {
|
||
return request.post<{ url: string }>({
|
||
url: '/web/admin/users/upload-avatar',
|
||
data
|
||
})
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 区域(仅列表分页供 fetchNotDeletedRegions 使用 + 启用列表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
function fetchRegionList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
isActive?: boolean
|
||
}) {
|
||
return request.get<{
|
||
list: Api.Region.RegionItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({
|
||
url: '/web/admin/regions',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchActiveRegions() {
|
||
const now = Date.now()
|
||
const anyFn = fetchActiveRegions as any
|
||
const cache = anyFn.__cache as undefined | { ts: number; data: Api.Region.RegionItem[] }
|
||
if (cache && now - cache.ts < 5 * 60 * 1000) return Promise.resolve(cache.data)
|
||
|
||
return request
|
||
.get<Api.Region.RegionItem[]>({
|
||
url: '/web/admin/regions/active'
|
||
})
|
||
.then((data) => {
|
||
anyFn.__cache = { ts: now, data: data || [] }
|
||
return data
|
||
})
|
||
}
|
||
|
||
/** 未删除的全量区域(含禁用),供各页区域 Tab */
|
||
export async function fetchNotDeletedRegions() {
|
||
const now = Date.now()
|
||
const anyFn = fetchNotDeletedRegions as any
|
||
const cache = anyFn.__cache as undefined | { ts: number; data: Api.Region.RegionItem[] }
|
||
if (cache && now - cache.ts < 5 * 60 * 1000) return cache.data
|
||
|
||
const pageSize = MAX_ADMIN_LIST_PAGE_SIZE
|
||
const all: Api.Region.RegionItem[] = []
|
||
let page = 1
|
||
|
||
while (true) {
|
||
const res: any = await fetchRegionList({ page, pageSize })
|
||
const list: Api.Region.RegionItem[] = Array.isArray(res?.list) ? res.list : []
|
||
all.push(...list)
|
||
|
||
const total = Number(res?.total ?? 0)
|
||
if (!total || all.length >= total || list.length < pageSize) break
|
||
page++
|
||
}
|
||
|
||
anyFn.__cache = { ts: now, data: all }
|
||
return all
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 商品分类
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchCategoryList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
isActive?: boolean
|
||
}) {
|
||
return request.get<{
|
||
list: Api.Category.CategoryItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({
|
||
url: '/web/admin/categories',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateCategory(data: {
|
||
name: string
|
||
parentId?: string
|
||
sortOrder?: number
|
||
imageUrl?: string
|
||
priceCoefficient?: number
|
||
}) {
|
||
return request.post({
|
||
url: '/web/admin/categories',
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateCategory(
|
||
id: string,
|
||
data: Partial<{
|
||
name: string
|
||
parentId?: string
|
||
sortOrder?: number
|
||
isActive?: boolean
|
||
imageUrl?: string
|
||
priceCoefficient?: number
|
||
}>
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/categories/${id}`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function fetchDeleteCategory(id: string) {
|
||
return request.del({
|
||
url: `/web/admin/categories/${id}`
|
||
})
|
||
}
|
||
|
||
export function fetchUploadCategoryImage(data: FormData) {
|
||
return request.post({
|
||
url: '/web/admin/categories/upload-image',
|
||
data
|
||
})
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 商品单位
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchUnitList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
isActive?: boolean
|
||
}) {
|
||
return request.get<{
|
||
list: Api.Unit.UnitItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({
|
||
url: '/web/admin/units',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateUnit(data: { name: string; code: string }) {
|
||
return request.post({
|
||
url: '/web/admin/units',
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateUnit(
|
||
id: string,
|
||
data: Partial<{
|
||
name: string
|
||
code: string
|
||
isActive?: boolean
|
||
}>
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/units/${id}`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function fetchDeleteUnit(id: string) {
|
||
return request.del({
|
||
url: `/web/admin/units/${id}`
|
||
})
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 商品
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchProductList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
categoryId?: string
|
||
isActive?: boolean
|
||
}) {
|
||
return request.get<{
|
||
list: Api.Product.ProductItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({
|
||
url: '/web/admin/products',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchProductDetail(id: string) {
|
||
return request.get<Api.Product.ProductDetail>({
|
||
url: `/web/admin/products/${id}`
|
||
})
|
||
}
|
||
|
||
export function fetchProductRegionPrices(productId: string) {
|
||
return request.get<{
|
||
list: Array<{
|
||
regionId: string
|
||
regionName: string
|
||
price: number | null
|
||
unitId?: string | null
|
||
unitName?: string | null
|
||
}>
|
||
}>({
|
||
url: `/web/admin/products/${productId}/region-prices`
|
||
})
|
||
}
|
||
|
||
export function fetchCreateProduct(data: {
|
||
name: string
|
||
skuCode?: string
|
||
categoryId?: string
|
||
unitId?: string
|
||
measureValue?: number | null
|
||
description?: string
|
||
imageUrl?: string
|
||
priceCoefficient?: number
|
||
isActive?: boolean
|
||
detailContent?: string
|
||
}) {
|
||
return request.post({
|
||
url: '/web/admin/products',
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateProduct(
|
||
id: string,
|
||
data: Partial<{
|
||
name: string
|
||
skuCode?: string
|
||
categoryId?: string
|
||
unitId?: string
|
||
measureValue?: number | null
|
||
description?: string
|
||
imageUrl?: string
|
||
priceCoefficient?: number
|
||
isActive?: boolean
|
||
detailContent?: string
|
||
}>
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/products/${id}`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function fetchDeleteProduct(id: string) {
|
||
return request.del({
|
||
url: `/web/admin/products/${id}`
|
||
})
|
||
}
|
||
|
||
// --- 轮播图 ---
|
||
|
||
export function fetchProductBannerList(productId: string) {
|
||
return request.get<{
|
||
list: Api.Product.ProductBanner[]
|
||
total: number
|
||
}>({
|
||
url: `/web/admin/product-banners/product/${productId}`
|
||
})
|
||
}
|
||
|
||
export function fetchCreateProductBanners(
|
||
productId: string,
|
||
items: Api.Product.ProductBannerCreate[]
|
||
) {
|
||
return request.post({
|
||
url: `/web/admin/product-banners/product/${productId}`,
|
||
params: items
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateProductBannerSort(
|
||
productId: string,
|
||
items: { id: string; sortOrder: number }[]
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/product-banners/product/${productId}/sort`,
|
||
params: { items }
|
||
})
|
||
}
|
||
|
||
export function fetchDeleteProductBanner(id: string) {
|
||
return request.del({
|
||
url: `/web/admin/product-banners/${id}`
|
||
})
|
||
}
|
||
|
||
// --- 详情媒体 ---
|
||
|
||
export function fetchProductDetailMediaList(productId: string) {
|
||
return request.get<{
|
||
list: Api.Product.ProductDetailMedia[]
|
||
total: number
|
||
}>({
|
||
url: `/web/admin/product-detail-media/product/${productId}`
|
||
})
|
||
}
|
||
|
||
export function fetchCreateProductDetailMedia(
|
||
productId: string,
|
||
items: Api.Product.ProductDetailMediaCreate[]
|
||
) {
|
||
return request.post({
|
||
url: `/web/admin/product-detail-media/product/${productId}`,
|
||
params: items
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateProductDetailMediaSort(
|
||
productId: string,
|
||
items: { id: string; sortOrder: number }[]
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/product-detail-media/product/${productId}/sort`,
|
||
params: { items }
|
||
})
|
||
}
|
||
|
||
export function fetchDeleteProductDetailMedia(id: string) {
|
||
return request.del({
|
||
url: `/web/admin/product-detail-media/${id}`
|
||
})
|
||
}
|
||
|
||
// --- 参数模板(简洁列表供分类/商品选择) ---
|
||
|
||
export function fetchProductParameterSimple() {
|
||
return request.get<{
|
||
list: Api.Product.ProductParameterSimple[]
|
||
total: number
|
||
}>({
|
||
url: '/web/admin/product-parameters/simple'
|
||
})
|
||
}
|
||
|
||
// --- 分类关联参数 ---
|
||
|
||
export function fetchCategoryParameters(categoryId: string) {
|
||
return request.get<{
|
||
list: Api.Product.CategoryParameter[]
|
||
total: number
|
||
}>({
|
||
url: `/web/admin/categories/${categoryId}/parameters`
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateCategoryParameters(
|
||
categoryId: string,
|
||
items: Api.Product.CategoryParameterCreate[]
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/categories/${categoryId}/parameters`,
|
||
params: { items }
|
||
})
|
||
}
|
||
|
||
// --- 商品参数值 ---
|
||
|
||
export function fetchProductParameterValues(productId: string) {
|
||
return request.get<{
|
||
list: Api.Product.ProductParameterValue[]
|
||
total: number
|
||
}>({
|
||
url: `/web/admin/product-parameter-values/product/${productId}`
|
||
})
|
||
}
|
||
|
||
export function fetchSaveProductParameterValues(
|
||
productId: string,
|
||
values: Api.Product.ProductParameterValueCreate[]
|
||
) {
|
||
return request.post({
|
||
url: `/web/admin/product-parameter-values/product/${productId}`,
|
||
params: { productId, values }
|
||
})
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 字典类型
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchDictTypeList(params?: { page?: number; pageSize?: number; keyword?: string }) {
|
||
return request.get<{
|
||
list: Api.Dict.DictTypeItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({
|
||
url: '/web/admin/dict-types',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateDictType(data: {
|
||
dictName: string
|
||
dictType: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/dict-types', params: data })
|
||
}
|
||
|
||
export function fetchUpdateDictType(
|
||
id: string,
|
||
data: Partial<{
|
||
dictName: string
|
||
dictType: string
|
||
orderNum: number
|
||
remark: string
|
||
}>
|
||
) {
|
||
return request.put({ url: `/web/admin/dict-types/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteDictType(id: string) {
|
||
return request.del({ url: `/web/admin/dict-types/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 字典数据
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchDictDataList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
dictType?: string
|
||
keyword?: string
|
||
}) {
|
||
return request.get<{
|
||
list: Api.Dict.DictDataItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({
|
||
url: '/web/admin/dict-data',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateDictData(data: {
|
||
dictLabel: string
|
||
dictValue: string
|
||
dictType: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/dict-data', params: data })
|
||
}
|
||
|
||
export function fetchUpdateDictData(
|
||
id: string,
|
||
data: Partial<{
|
||
dictLabel: string
|
||
dictValue: string
|
||
orderNum: number
|
||
remark: string
|
||
}>
|
||
) {
|
||
return request.put({ url: `/web/admin/dict-data/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteDictData(id: string) {
|
||
return request.del({ url: `/web/admin/dict-data/${id}` })
|
||
}
|
||
|
||
export function fetchDictDataOptions(dictType: string) {
|
||
return request.get<Api.Dict.DictDataOption[]>({
|
||
url: '/web/admin/dict-data/options',
|
||
params: { dictType }
|
||
})
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 组织管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchDeptTree(params?: { keyword?: string }) {
|
||
return request.get<Api.Dept.DeptItem[]>({
|
||
url: '/web/admin/depts',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateDept(data: {
|
||
parentId?: string
|
||
deptName: string
|
||
deptCategoryCode?: string
|
||
status?: string
|
||
leader?: string
|
||
leaderPhone?: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/depts', params: data })
|
||
}
|
||
|
||
export function fetchUpdateDept(
|
||
id: string,
|
||
data: Partial<{
|
||
deptName: string
|
||
deptCategoryCode: string
|
||
status: string
|
||
leader: string
|
||
leaderPhone: string
|
||
orderNum: number
|
||
remark: string
|
||
}>
|
||
) {
|
||
return request.put({ url: `/web/admin/depts/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteDept(id: string) {
|
||
return request.del({ url: `/web/admin/depts/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 站点管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchSiteList(params?: { page?: number; pageSize?: number; keyword?: string }) {
|
||
return request.get<{
|
||
list: Api.Site.SiteItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({ url: '/web/admin/sites', params })
|
||
}
|
||
export function fetchCreateSite(data: {
|
||
siteName: string
|
||
siteCode: string
|
||
siteType?: string
|
||
status?: string
|
||
address?: string
|
||
contactName?: string
|
||
contactPhone?: string
|
||
businessScope?: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/sites', params: data })
|
||
}
|
||
export function fetchUpdateSite(
|
||
id: string,
|
||
data: Partial<{
|
||
siteName: string
|
||
siteCode: string
|
||
siteType: string
|
||
status: string
|
||
address: string
|
||
contactName: string
|
||
contactPhone: string
|
||
businessScope: string
|
||
orderNum: number
|
||
remark: string
|
||
}>
|
||
) {
|
||
return request.put({ url: `/web/admin/sites/${id}`, params: data })
|
||
}
|
||
export function fetchDeleteSite(id: string) {
|
||
return request.del({ url: `/web/admin/sites/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 职位管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchPostList(params?: { page?: number; pageSize?: number; keyword?: string }) {
|
||
return request.get<{
|
||
list: Api.Post.PostItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({ url: '/web/admin/posts', params })
|
||
}
|
||
export function fetchCreatePost(data: {
|
||
postName: string
|
||
postCode: string
|
||
status?: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/posts', params: data })
|
||
}
|
||
export function fetchUpdatePost(
|
||
id: string,
|
||
data: Partial<{
|
||
postName: string
|
||
postCode: string
|
||
status: string
|
||
orderNum: number
|
||
remark: string
|
||
}>
|
||
) {
|
||
return request.put({ url: `/web/admin/posts/${id}`, params: data })
|
||
}
|
||
export function fetchDeletePost(id: string) {
|
||
return request.del({ url: `/web/admin/posts/${id}` })
|
||
}
|
||
|
||
export function fetchPostBoundUserIds(postId: string) {
|
||
return request.get<{ userIds: string[] }>({ url: `/web/admin/posts/${postId}/users` })
|
||
}
|
||
|
||
export function fetchUpdatePostBoundUsers(postId: string, userIds: string[]) {
|
||
return request.put({
|
||
url: `/web/admin/posts/${postId}/users`,
|
||
params: { userIds },
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 物品单位管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchItemUnitList(params?: { page?: number; pageSize?: number; keyword?: string }) {
|
||
return request.get<{
|
||
list: Api.ItemUnit.ItemUnitItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({ url: '/web/admin/item-units', params })
|
||
}
|
||
export function fetchCreateItemUnit(data: {
|
||
unitCode: string
|
||
unitName: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/item-units', params: data })
|
||
}
|
||
export function fetchUpdateItemUnit(
|
||
id: string,
|
||
data: Partial<{ unitCode: string; unitName: string; orderNum: number; remark: string }>
|
||
) {
|
||
return request.put({ url: `/web/admin/item-units/${id}`, params: data })
|
||
}
|
||
export function fetchDeleteItemUnit(id: string) {
|
||
return request.del({ url: `/web/admin/item-units/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 基础信息管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
type PageResult<T> = {
|
||
list: T[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}
|
||
|
||
export function fetchCustomerList(params?: { page?: number; pageSize?: number; keyword?: string }) {
|
||
return request.get<PageResult<Api.BizCustomer.CustomerItem>>({
|
||
url: '/web/admin/customers',
|
||
params
|
||
})
|
||
}
|
||
export function fetchCreateCustomer(data: {
|
||
customerName: string
|
||
sex?: string
|
||
idCardNo?: string
|
||
age?: number | null
|
||
phoneNo?: string
|
||
customerTags?: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/customers', params: data })
|
||
}
|
||
export function fetchUpdateCustomer(
|
||
id: string,
|
||
data: Partial<{
|
||
customerName: string
|
||
sex: string
|
||
idCardNo: string
|
||
age: number | null
|
||
phoneNo: string
|
||
customerTags: string
|
||
orderNum: number
|
||
remark: string
|
||
}>
|
||
) {
|
||
return request.put({ url: `/web/admin/customers/${id}`, params: data })
|
||
}
|
||
export function fetchDeleteCustomer(id: string) {
|
||
return request.del({ url: `/web/admin/customers/${id}` })
|
||
}
|
||
|
||
export function fetchCellSampleTypeList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get<PageResult<Api.BizCellSampleType.CellSampleTypeItem>>({
|
||
url: '/web/admin/cell-sample-types',
|
||
params
|
||
})
|
||
}
|
||
export function fetchCreateCellSampleType(data: {
|
||
typeCode: string
|
||
typeName: string
|
||
storageYears?: number | null
|
||
storagePrice?: number | null
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/cell-sample-types', params: data })
|
||
}
|
||
export function fetchUpdateCellSampleType(
|
||
id: string,
|
||
data: Partial<{
|
||
typeCode: string
|
||
typeName: string
|
||
storageYears: number | null
|
||
storagePrice: number | null
|
||
orderNum: number
|
||
remark: string
|
||
}>
|
||
) {
|
||
return request.put({ url: `/web/admin/cell-sample-types/${id}`, params: data })
|
||
}
|
||
export function fetchDeleteCellSampleType(id: string) {
|
||
return request.del({ url: `/web/admin/cell-sample-types/${id}` })
|
||
}
|
||
|
||
export function fetchCollectionRegionList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get<PageResult<Api.BizCollectionRegion.RegionItem>>({
|
||
url: '/web/admin/collection-regions',
|
||
params
|
||
})
|
||
}
|
||
export function fetchCreateCollectionRegion(data: {
|
||
regionName: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/collection-regions', params: data })
|
||
}
|
||
export function fetchUpdateCollectionRegion(
|
||
id: string,
|
||
data: Partial<{ regionName: string; orderNum: number; remark: string }>
|
||
) {
|
||
return request.put({ url: `/web/admin/collection-regions/${id}`, params: data })
|
||
}
|
||
export function fetchDeleteCollectionRegion(id: string) {
|
||
return request.del({ url: `/web/admin/collection-regions/${id}` })
|
||
}
|
||
|
||
export function fetchHospitalList(
|
||
regionId: string,
|
||
params?: { page?: number; pageSize?: number; keyword?: string }
|
||
) {
|
||
return request.get<PageResult<Api.BizCollectionHospital.HospitalItem>>({
|
||
url: `/web/admin/collection-regions/${regionId}/hospitals`,
|
||
params
|
||
})
|
||
}
|
||
export function fetchCreateHospital(
|
||
regionId: string,
|
||
data: { hospitalName: string; orderNum?: number; remark?: string }
|
||
) {
|
||
return request.post({ url: `/web/admin/collection-regions/${regionId}/hospitals`, params: data })
|
||
}
|
||
export function fetchUpdateHospital(
|
||
regionId: string,
|
||
hospitalId: string,
|
||
data: Partial<{ hospitalName: string; orderNum: number; remark: string }>
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/collection-regions/${regionId}/hospitals/${hospitalId}`,
|
||
params: data
|
||
})
|
||
}
|
||
export function fetchDeleteHospital(regionId: string, hospitalId: string) {
|
||
return request.del({ url: `/web/admin/collection-regions/${regionId}/hospitals/${hospitalId}` })
|
||
}
|
||
|
||
export function fetchCollectionProtocolNoList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get<PageResult<Api.BizCollectionProtocolNo.ProtocolNoItem>>({
|
||
url: '/web/admin/collection-protocol-nos',
|
||
params
|
||
})
|
||
}
|
||
export function fetchCreateCollectionProtocolNo(data: {
|
||
protocolNo: string
|
||
issued?: number
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/collection-protocol-nos', params: data })
|
||
}
|
||
export function fetchUpdateCollectionProtocolNo(
|
||
id: string,
|
||
data: Partial<{ protocolNo: string; issued: number; orderNum: number; remark: string }>
|
||
) {
|
||
return request.put({ url: `/web/admin/collection-protocol-nos/${id}`, params: data })
|
||
}
|
||
export function fetchDeleteCollectionProtocolNo(id: string) {
|
||
return request.del({ url: `/web/admin/collection-protocol-nos/${id}` })
|
||
}
|
||
|
||
export function fetchBatchGenerateProtocolNos(data: {
|
||
prefix: string
|
||
middle: string
|
||
seqStart: number
|
||
seqEnd: number
|
||
digitCount?: number
|
||
}) {
|
||
return request.post({
|
||
url: '/web/admin/collection-protocol-nos/batch-generate',
|
||
params: data,
|
||
showSuccessMessage: true,
|
||
timeout: 120_000
|
||
})
|
||
}
|
||
|
||
export function fetchBatchIssueProtocolNos(data: {
|
||
ids: string[]
|
||
issuedUserId: string
|
||
issuedUserName?: string
|
||
}) {
|
||
return request.post({
|
||
url: '/web/admin/collection-protocol-nos/batch-issue',
|
||
params: data,
|
||
showSuccessMessage: true,
|
||
timeout: 120_000
|
||
})
|
||
}
|
||
|
||
export function fetchBatchRevokeProtocolNos(ids: string[]) {
|
||
return request.post({
|
||
url: '/web/admin/collection-protocol-nos/batch-revoke',
|
||
params: { ids },
|
||
showSuccessMessage: true,
|
||
timeout: 120_000
|
||
})
|
||
}
|
||
|
||
export function fetchSampleCodeList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get<PageResult<Api.BizSampleCode.SampleCodeItem>>({
|
||
url: '/web/admin/sample-codes',
|
||
params
|
||
})
|
||
}
|
||
export function fetchCreateSampleCode(data: {
|
||
sampleCode: string
|
||
issued?: number
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/sample-codes', params: data })
|
||
}
|
||
export function fetchUpdateSampleCode(
|
||
id: string,
|
||
data: Partial<{ sampleCode: string; issued: number; orderNum: number; remark: string }>
|
||
) {
|
||
return request.put({ url: `/web/admin/sample-codes/${id}`, params: data })
|
||
}
|
||
export function fetchDeleteSampleCode(id: string) {
|
||
return request.del({ url: `/web/admin/sample-codes/${id}` })
|
||
}
|
||
export function fetchBatchGenerateSampleCodes(data: {
|
||
sampleCodeType: string
|
||
middle: string
|
||
seqStart: number
|
||
seqEnd: number
|
||
digitCount?: number
|
||
}) {
|
||
return request.post({
|
||
url: '/web/admin/sample-codes/batch-generate',
|
||
params: data,
|
||
showSuccessMessage: true,
|
||
timeout: 120_000
|
||
})
|
||
}
|
||
export function fetchBatchIssueSampleCodes(data: {
|
||
ids: string[]
|
||
issuedUserId: string
|
||
issuedUserName?: string
|
||
}) {
|
||
return request.post({
|
||
url: '/web/admin/sample-codes/batch-issue',
|
||
params: data,
|
||
showSuccessMessage: true,
|
||
timeout: 120_000
|
||
})
|
||
}
|
||
|
||
export function fetchBatchRevokeSampleCodes(ids: string[]) {
|
||
return request.post({
|
||
url: '/web/admin/sample-codes/batch-revoke',
|
||
params: { ids },
|
||
showSuccessMessage: true,
|
||
timeout: 120_000
|
||
})
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 快递公司管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchExpressCompanyList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get<{
|
||
list: Api.ExpressCompany.ExpressCompanyItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({ url: '/web/admin/express-companies', params })
|
||
}
|
||
export function fetchCreateExpressCompany(data: {
|
||
expressCode: string
|
||
expressName: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/express-companies', params: data })
|
||
}
|
||
export function fetchUpdateExpressCompany(
|
||
id: string,
|
||
data: Partial<{ expressCode: string; expressName: string; orderNum: number; remark: string }>
|
||
) {
|
||
return request.put({ url: `/web/admin/express-companies/${id}`, params: data })
|
||
}
|
||
export function fetchDeleteExpressCompany(id: string) {
|
||
return request.del({ url: `/web/admin/express-companies/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 菜单管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchMenuTree(params?: { keyword?: string }) {
|
||
return request.get<Api.Menu.MenuItem[]>({
|
||
url: '/web/admin/menus',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateMenu(data: {
|
||
menuName: string
|
||
parentId?: string
|
||
menuType?: string
|
||
path?: string
|
||
component?: string
|
||
perms?: string
|
||
isFrame?: number
|
||
visible?: string
|
||
status?: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/menus', params: data })
|
||
}
|
||
|
||
export function fetchUpdateMenu(
|
||
id: string,
|
||
data: Partial<{
|
||
menuName: string
|
||
parentId: string
|
||
menuType: string
|
||
path: string
|
||
component: string
|
||
perms: string
|
||
isFrame: number
|
||
visible: string
|
||
status: string
|
||
orderNum: number
|
||
remark: string
|
||
}>
|
||
) {
|
||
return request.put({ url: `/web/admin/menus/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteMenu(id: string) {
|
||
return request.del({ url: `/web/admin/menus/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 角色管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchRoleList(params?: { page?: number; pageSize?: number; keyword?: string }) {
|
||
return request.get<{
|
||
list: Api.Role.RoleItem[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({ url: '/web/admin/role-management', params })
|
||
}
|
||
export function fetchCreateRole(data: {
|
||
roleName: string
|
||
dataScope?: string
|
||
status?: string
|
||
orderNum?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/role-management', params: data, showSuccessMessage: true })
|
||
}
|
||
export function fetchUpdateRole(
|
||
id: string,
|
||
data: Partial<{
|
||
roleName: string
|
||
dataScope: string
|
||
status: string
|
||
orderNum: number
|
||
remark: string
|
||
}>
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/role-management/${id}`,
|
||
params: data,
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
export function fetchDeleteRole(id: string) {
|
||
return request.del({ url: `/web/admin/role-management/${id}`, showSuccessMessage: true })
|
||
}
|
||
export function fetchRoleMenuIds(roleId: string) {
|
||
return request.get<{ menuIds: string[] }>({ url: `/web/admin/role-management/${roleId}/menus` })
|
||
}
|
||
export function fetchUpdateRoleMenus(roleId: string, menuIds: string[]) {
|
||
return request.put({
|
||
url: `/web/admin/role-management/${roleId}/menus`,
|
||
params: { menuIds },
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
export function fetchRoleDataScope(roleId: string) {
|
||
return request.get<{
|
||
dataScope: string
|
||
scopeDetails: Array<{ scopeType: string; scopeValue: string }>
|
||
}>({ url: `/web/admin/role-management/${roleId}/data-scope` })
|
||
}
|
||
export function fetchUpdateRoleDataScope(
|
||
roleId: string,
|
||
data: { dataScope: string; scopeDetails?: Array<{ scopeType: string; scopeValue: string }> }
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/role-management/${roleId}/data-scope`,
|
||
params: data,
|
||
showSuccessMessage: true
|
||
})
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 洁净室管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchCleanRoomList(params?: { page?: number; pageSize?: number; keyword?: string }) {
|
||
return request.get({ url: '/web/admin/clean-rooms', params })
|
||
}
|
||
|
||
export function fetchCreateCleanRoom(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/clean-rooms', params: data })
|
||
}
|
||
|
||
export function fetchUpdateCleanRoom(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/clean-rooms/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteCleanRoom(id: string) {
|
||
return request.del({ url: `/web/admin/clean-rooms/${id}` })
|
||
}
|
||
|
||
export function fetchAccessLogList(params?: { page?: number; pageSize?: number; cleanRoomId?: string; keyword?: string }) {
|
||
return request.get({ url: '/web/admin/clean-room-access-logs', params })
|
||
}
|
||
|
||
export function fetchCreateAccessLog(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/clean-room-access-logs', params: data })
|
||
}
|
||
|
||
export function fetchUpdateAccessLog(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/clean-room-access-logs/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteAccessLog(id: string) {
|
||
return request.del({ url: `/web/admin/clean-room-access-logs/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 库位管理
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchStorageFacilityList(params?: { keyword?: string }) {
|
||
return request.get({ url: '/web/admin/storage-facilities', params })
|
||
}
|
||
|
||
export function fetchCreateStorageFacility(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/storage-facilities', params: data })
|
||
}
|
||
|
||
export function fetchUpdateStorageFacility(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/storage-facilities/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteStorageFacility(id: string) {
|
||
return request.del({ url: `/web/admin/storage-facilities/${id}` })
|
||
}
|
||
|
||
export function fetchStorageSlotList(params?: { facilityNodeId?: string }) {
|
||
return request.get({ url: '/web/admin/storage-facility-slots', params })
|
||
}
|
||
|
||
export function fetchCreateStorageSlot(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/storage-facility-slots', params: data })
|
||
}
|
||
|
||
export function fetchBatchCreateSlots(data: { facilityNodeId: string; rows: number; cols: number; codePrefix?: string }) {
|
||
return request.post({ url: '/web/admin/storage-facility-slots/batch', params: data })
|
||
}
|
||
|
||
export function fetchUpdateStorageSlot(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/storage-facility-slots/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteStorageSlot(id: string) {
|
||
return request.del({ url: `/web/admin/storage-facility-slots/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 展馆预约
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchExhibitionAppointmentList(params?: { page?: number; pageSize?: number; keyword?: string }) {
|
||
return request.get({ url: '/web/admin/exhibition-appointments', params })
|
||
}
|
||
|
||
export function fetchCreateExhibitionAppointment(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/exhibition-appointments', params: data })
|
||
}
|
||
|
||
export function fetchUpdateExhibitionAppointment(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/exhibition-appointments/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteExhibitionAppointment(id: string) {
|
||
return request.del({ url: `/web/admin/exhibition-appointments/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 细胞产品类型
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchCellProductTypeList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get({
|
||
url: '/web/admin/cell-product-types',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateCellProductType(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/cell-product-types', params: data })
|
||
}
|
||
|
||
export function fetchUpdateCellProductType(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/cell-product-types/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteCellProductType(id: string) {
|
||
return request.del({ url: `/web/admin/cell-product-types/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 细胞产品规格
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchCellProductSpecList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get({
|
||
url: '/web/admin/cell-product-specs',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateCellProductSpec(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/cell-product-specs', params: data })
|
||
}
|
||
|
||
export function fetchUpdateCellProductSpec(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/cell-product-specs/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteCellProductSpec(id: string) {
|
||
return request.del({ url: `/web/admin/cell-product-specs/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 细胞产品价格
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchCellProductPriceList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
cellProductTypeId?: string
|
||
}) {
|
||
return request.get({
|
||
url: '/web/admin/cell-product-prices',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateCellProductPrice(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/cell-product-prices', params: data })
|
||
}
|
||
|
||
export function fetchUpdateCellProductPrice(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/cell-product-prices/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteCellProductPrice(id: string) {
|
||
return request.del({ url: `/web/admin/cell-product-prices/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 项目价格体系(主表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchProjectSystemList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get({
|
||
url: '/web/admin/project-price-systems',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateProjectSystem(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/project-price-systems', params: data })
|
||
}
|
||
|
||
export function fetchUpdateProjectSystem(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/project-price-systems/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteProjectSystem(id: string) {
|
||
return request.del({ url: `/web/admin/project-price-systems/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 项目价格体系明细(子表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchProjectSystemItems(systemId: string) {
|
||
return request.get({ url: `/web/admin/project-price-systems/${systemId}/items` })
|
||
}
|
||
|
||
export function fetchCreateProjectSystemItem(systemId: string, data: Record<string, any>) {
|
||
return request.post({ url: `/web/admin/project-price-systems/${systemId}/items`, params: data })
|
||
}
|
||
|
||
export function fetchUpdateProjectSystemItem(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/project-system-items/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteProjectSystemItem(id: string) {
|
||
return request.del({ url: `/web/admin/project-system-items/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 渠道信息(主表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchChannelList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get({
|
||
url: '/web/admin/channels',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateChannel(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/channels', params: data })
|
||
}
|
||
|
||
export function fetchUpdateChannel(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/channels/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteChannel(id: string) {
|
||
return request.del({ url: `/web/admin/channels/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 渠道开票信息(子表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchChannelInvoices(channelId: string) {
|
||
return request.get({ url: `/web/admin/channels/${channelId}/invoices` })
|
||
}
|
||
|
||
export function fetchCreateChannelInvoice(channelId: string, data: Record<string, any>) {
|
||
return request.post({ url: `/web/admin/channels/${channelId}/invoices`, params: data })
|
||
}
|
||
|
||
export function fetchUpdateChannelInvoice(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/channel-invoices/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteChannelInvoice(id: string) {
|
||
return request.del({ url: `/web/admin/channel-invoices/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 渠道邮寄地址(子表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchChannelMailAddresses(channelId: string) {
|
||
return request.get({ url: `/web/admin/channels/${channelId}/mail-addresses` })
|
||
}
|
||
|
||
export function fetchCreateChannelMailAddress(channelId: string, data: Record<string, any>) {
|
||
return request.post({ url: `/web/admin/channels/${channelId}/mail-addresses`, params: data })
|
||
}
|
||
|
||
export function fetchUpdateChannelMailAddress(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/channel-mail-addresses/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteChannelMailAddress(id: string) {
|
||
return request.del({ url: `/web/admin/channel-mail-addresses/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 渠道协议(子表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchChannelAgreements(channelId: string) {
|
||
return request.get({ url: `/web/admin/channels/${channelId}/agreements` })
|
||
}
|
||
|
||
export function fetchCreateChannelAgreement(channelId: string, data: Record<string, any>) {
|
||
return request.post({ url: `/web/admin/channels/${channelId}/agreements`, params: data })
|
||
}
|
||
|
||
export function fetchUpdateChannelAgreement(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/channel-agreements/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteChannelAgreement(id: string) {
|
||
return request.del({ url: `/web/admin/channel-agreements/${id}` })
|
||
}
|
||
|
||
export function fetchActivateChannelAgreement(id: string) {
|
||
return request.put({ url: `/web/admin/channel-agreements/${id}/activate` })
|
||
}
|
||
|
||
export function fetchVoidChannelAgreement(id: string) {
|
||
return request.put({ url: `/web/admin/channel-agreements/${id}/void` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 渠道协议产品价格(子表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchChannelAgreementPrices(agreementId: string) {
|
||
return request.get({ url: `/web/admin/channel-agreements/${agreementId}/product-prices` })
|
||
}
|
||
|
||
export function fetchCreateChannelAgreementPrice(agreementId: string, data: Record<string, any>) {
|
||
return request.post({
|
||
url: `/web/admin/channel-agreements/${agreementId}/product-prices`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateChannelAgreementPrice(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/channel-agreement-product-prices/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteChannelAgreementPrice(id: string) {
|
||
return request.del({ url: `/web/admin/channel-agreement-product-prices/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 体检机构(主表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchCheckupInstitutionList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get({
|
||
url: '/web/admin/checkup-institutions',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchCreateCheckupInstitution(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/checkup-institutions', params: data })
|
||
}
|
||
|
||
export function fetchUpdateCheckupInstitution(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/checkup-institutions/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteCheckupInstitution(id: string) {
|
||
return request.del({ url: `/web/admin/checkup-institutions/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 体检机构开票信息(子表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchCheckupInstitutionInvoices(institutionId: string) {
|
||
return request.get({ url: `/web/admin/checkup-institutions/${institutionId}/invoices` })
|
||
}
|
||
|
||
export function fetchCreateCheckupInstitutionInvoice(
|
||
institutionId: string,
|
||
data: Record<string, any>
|
||
) {
|
||
return request.post({
|
||
url: `/web/admin/checkup-institutions/${institutionId}/invoices`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateCheckupInstitutionInvoice(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/checkup-institution-invoices/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteCheckupInstitutionInvoice(id: string) {
|
||
return request.del({ url: `/web/admin/checkup-institution-invoices/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 体检机构项目及价格(子表)
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchCheckupInstitutionProjects(institutionId: string) {
|
||
return request.get({ url: `/web/admin/checkup-institutions/${institutionId}/projects` })
|
||
}
|
||
|
||
export function fetchCreateCheckupInstitutionProject(
|
||
institutionId: string,
|
||
data: Record<string, any>
|
||
) {
|
||
return request.post({
|
||
url: `/web/admin/checkup-institutions/${institutionId}/projects`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateCheckupInstitutionProject(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/checkup-institution-projects/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteCheckupInstitutionProject(id: string) {
|
||
return request.del({ url: `/web/admin/checkup-institution-projects/${id}` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 中试服务管理 — 体检机构项目套餐
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchCheckupInstitutionPackages(institutionId: string) {
|
||
return request.get({ url: `/web/admin/checkup-institutions/${institutionId}/packages` })
|
||
}
|
||
|
||
export function fetchCheckupInstitutionPackageDetail(packageId: string) {
|
||
return request.get({ url: `/web/admin/checkup-institution-packages/${packageId}` })
|
||
}
|
||
|
||
export function fetchCreateCheckupInstitutionPackage(
|
||
institutionId: string,
|
||
data: Record<string, unknown>
|
||
) {
|
||
return request.post({
|
||
url: `/web/admin/checkup-institutions/${institutionId}/packages`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function fetchUpdateCheckupInstitutionPackage(
|
||
packageId: string,
|
||
data: Record<string, unknown>
|
||
) {
|
||
return request.put({ url: `/web/admin/checkup-institution-packages/${packageId}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteCheckupInstitutionPackage(packageId: string) {
|
||
return request.del({ url: `/web/admin/checkup-institution-packages/${packageId}` })
|
||
}
|
||
|
||
// ============ 保险公司管理 ============
|
||
|
||
export function fetchInsuranceCompanyList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
}) {
|
||
return request.get({ url: '/web/admin/insurance-companies', params })
|
||
}
|
||
|
||
export function fetchCreateInsuranceCompany(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/insurance-companies', params: data })
|
||
}
|
||
|
||
export function fetchUpdateInsuranceCompany(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/insurance-companies/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteInsuranceCompany(id: string) {
|
||
return request.del({ url: `/web/admin/insurance-companies/${id}` })
|
||
}
|
||
|
||
// 保险公司开票信息
|
||
export function fetchInsuranceCompanyInvoices(companyId: string) {
|
||
return request.get({ url: `/web/admin/insurance-companies/${companyId}/invoices` })
|
||
}
|
||
|
||
export function fetchCreateInsuranceCompanyInvoice(companyId: string, data: Record<string, any>) {
|
||
return request.post({ url: `/web/admin/insurance-companies/${companyId}/invoices`, params: data })
|
||
}
|
||
|
||
export function fetchUpdateInsuranceCompanyInvoice(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/insurance-company-invoices/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteInsuranceCompanyInvoice(id: string) {
|
||
return request.del({ url: `/web/admin/insurance-company-invoices/${id}` })
|
||
}
|
||
|
||
// 保险项目价格
|
||
export function fetchInsuranceProjectPrices(companyId: string) {
|
||
return request.get({ url: `/web/admin/insurance-companies/${companyId}/project-prices` })
|
||
}
|
||
|
||
export function fetchCreateInsuranceProjectPrice(companyId: string, data: Record<string, any>) {
|
||
return request.post({ url: `/web/admin/insurance-companies/${companyId}/project-prices`, params: data })
|
||
}
|
||
|
||
export function fetchUpdateInsuranceProjectPrice(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/insurance-project-prices/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteInsuranceProjectPrice(id: string) {
|
||
return request.del({ url: `/web/admin/insurance-project-prices/${id}` })
|
||
}
|
||
|
||
// ============ 储存证管理 ============
|
||
|
||
export function fetchStorageCertList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
makeStatus?: string
|
||
}) {
|
||
return request.get({ url: '/web/admin/storage-certs', params })
|
||
}
|
||
|
||
// ============ 满月待办管理 ============
|
||
|
||
export function fetchFullmoonTodoList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
todoStatus?: string
|
||
}) {
|
||
return request.get({ url: '/web/admin/fullmoon-todos', params })
|
||
}
|
||
|
||
export function fetchUpdateFullmoonTodoInsurance(protocolId: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/fullmoon-todos/${protocolId}/insurance`, params: data })
|
||
}
|