汇总近期业务改动:催缴菜单与后端、样本信息快捷登记与进度、运费关联、客户档案扩展、协议优惠/期次与押金划转,并同步 SQL 迁移与管理端页面收敛。 Co-authored-by: Cursor <cursoragent@cursor.com>
2446 lines
70 KiB
TypeScript
2446 lines
70 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(params?: { roleName?: string }) {
|
||
return request.get<Array<{ label: string; value: string }>>({
|
||
url: '/web/admin/users/options',
|
||
params
|
||
})
|
||
}
|
||
|
||
/** 流程设计器:角色下拉选项(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
|
||
roleName?: 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
|
||
supervisorUserId?: string
|
||
email?: string
|
||
phoneNo?: string
|
||
hireDate?: string
|
||
probationMonths?: number | null
|
||
lastWorkDay?: 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
|
||
supervisorUserId: string
|
||
email: string
|
||
phoneNo: string
|
||
hireDate: string | null
|
||
probationMonths: number | null
|
||
lastWorkDay: string | null
|
||
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<{ tempPassword: string }>({
|
||
url: `/web/admin/users/${id}/reset-password`,
|
||
showSuccessMessage: false
|
||
})
|
||
}
|
||
|
||
/** 上传用户头像,返回存储后的 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
|
||
leaderUserId?: 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
|
||
leaderUserId: 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
|
||
siteImage?: 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
|
||
siteImage: 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 fetchPostBoundRoleIds(postId: string) {
|
||
return request.get<{ roleIds: string[] }>({ url: `/web/admin/posts/${postId}/roles` })
|
||
}
|
||
|
||
export function fetchUpdatePostBoundRoles(postId: string, roleIds: string[]) {
|
||
return request.put({
|
||
url: `/web/admin/posts/${postId}/roles`,
|
||
params: { roleIds },
|
||
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
|
||
createTimeStart?: string
|
||
createTimeEnd?: 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 fetchCustomerRelations(id: string) {
|
||
return request.get<Api.BizCustomer.CustomerRelations>({
|
||
url: `/web/admin/customers/${id}/relations`
|
||
})
|
||
}
|
||
|
||
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
|
||
typeLogo?: string
|
||
storageYears?: number | null
|
||
storagePrice?: number | null
|
||
sampleCodeFilter?: string
|
||
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
|
||
typeLogo: string
|
||
storageYears: number | null
|
||
storagePrice: number | null
|
||
sampleCodeFilter: string
|
||
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 fetchSearchCollectionHospitals(params: { keyword: string; limit?: number }) {
|
||
return request.get<{ list: Api.BizCollectionHospital.HospitalItem[] }>({
|
||
url: '/web/admin/collection-hospitals/search',
|
||
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 fetchRegionStaffList(
|
||
regionId: string,
|
||
params?: { page?: number; pageSize?: number }
|
||
) {
|
||
return request.get<PageResult<Api.BizCollectionRegionStaff.StaffItem>>({
|
||
url: `/web/admin/collection-regions/${regionId}/staff`,
|
||
params
|
||
})
|
||
}
|
||
export function fetchRegionsByStaffUser(userId: string) {
|
||
return request.get<{ list: { id: string; regionName: string }[] }>({
|
||
url: `/web/admin/collection-regions/by-staff-user/${userId}`
|
||
})
|
||
}
|
||
export function fetchCreateRegionStaff(
|
||
regionId: string,
|
||
data: { userId: string; isLeader?: boolean; orderNum?: number; remark?: string }
|
||
) {
|
||
return request.post({ url: `/web/admin/collection-regions/${regionId}/staff`, params: data })
|
||
}
|
||
export function fetchUpdateRegionStaff(
|
||
regionId: string,
|
||
staffId: string,
|
||
data: Partial<{ isLeader: boolean; orderNum: number; remark: string }>
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/collection-regions/${regionId}/staff/${staffId}`,
|
||
params: data
|
||
})
|
||
}
|
||
export function fetchDeleteRegionStaff(regionId: string, staffId: string) {
|
||
return request.del({ url: `/web/admin/collection-regions/${regionId}/staff/${staffId}` })
|
||
}
|
||
|
||
export function fetchCollectionProtocolNoList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
issuedUserId?: 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
|
||
issuedUserId?: string | null
|
||
issuedUserName?: string | null
|
||
issuedTime?: string | null
|
||
}) {
|
||
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
|
||
issuedUserId: string | null
|
||
issuedUserName: string | null
|
||
issuedTime: string | null
|
||
}>
|
||
) {
|
||
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
|
||
sampleCodeType?: string
|
||
codeFilter?: string
|
||
issuedUserId?: string
|
||
}) {
|
||
return request.get<PageResult<Api.BizSampleCode.SampleCodeItem>>({
|
||
url: '/web/admin/sample-codes',
|
||
params
|
||
})
|
||
}
|
||
export function fetchCreateSampleCode(data: {
|
||
sampleCode: string
|
||
sampleCodeType?: string
|
||
issued?: number
|
||
issuedUserId?: string | null
|
||
issuedUserName?: string | null
|
||
issuedTime?: string
|
||
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
|
||
issuedUserId: string | null
|
||
issuedUserName: string | null
|
||
issuedTime: string
|
||
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
|
||
expressLogo?: 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
|
||
expressLogo: 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 fetchUvDisinfectLogList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
cleanRoomId?: string
|
||
keyword?: string
|
||
}) {
|
||
return request.get({ url: '/web/admin/clean-room-uv-disinfect-logs', params })
|
||
}
|
||
|
||
export function fetchCreateUvDisinfectLog(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/clean-room-uv-disinfect-logs', params: data })
|
||
}
|
||
|
||
export function fetchUpdateUvDisinfectLog(id: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/clean-room-uv-disinfect-logs/${id}`, params: data })
|
||
}
|
||
|
||
export function fetchDeleteUvDisinfectLog(id: string) {
|
||
return request.del({ url: `/web/admin/clean-room-uv-disinfect-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 fetchBatchCreateStorageFacilities(data: {
|
||
parentId?: string
|
||
namePrefix?: string
|
||
nameSuffix?: string
|
||
startNum: number
|
||
endNum: number
|
||
padWidth?: number
|
||
codePrefix?: string
|
||
codeSuffix?: string
|
||
nodeType?: string
|
||
isLeaf?: number
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/storage-facilities/batch', 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; availableOnly?: boolean }) {
|
||
return request.get({ url: '/web/admin/storage-facility-slots', params })
|
||
}
|
||
|
||
export function fetchStorageSlotStats() {
|
||
return request.get<
|
||
Array<{ facilityNodeId: string; total: number; occupied: number; empty: number }>
|
||
>({ url: '/web/admin/storage-facility-slots/stats' })
|
||
}
|
||
|
||
export function fetchStorageSlotSelectOptions(params?: {
|
||
keyword?: string
|
||
availableOnly?: boolean
|
||
includeSlotIds?: string
|
||
page?: number
|
||
pageSize?: number
|
||
}) {
|
||
return request.get<{
|
||
list: Array<{ id: string; name: string; fullSlotCode?: string; slotCode?: string }>
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}>({
|
||
url: '/web/admin/storage-facility-slots/select-options',
|
||
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 fetchClearStorageSlots(data: { facilityNodeId: string }) {
|
||
return request.post({ url: '/web/admin/storage-facility-slots/clear', params: data })
|
||
}
|
||
|
||
export function fetchInsertStorageSlotRow(data: {
|
||
facilityNodeId: string
|
||
afterRowNum: number
|
||
cols: number
|
||
codePrefix?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/storage-facility-slots/insert-row', 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 fetchSlotOccupancies(params: {
|
||
slotId: string
|
||
occupancyStatus?: string
|
||
itemType?: string
|
||
page?: number
|
||
pageSize?: number
|
||
}) {
|
||
return request.get({ url: '/web/admin/storage-slot-occupancies', params })
|
||
}
|
||
|
||
export function fetchSlotOccupancyHistory(params?: {
|
||
slotId?: string
|
||
facilityNodeId?: string
|
||
itemType?: string
|
||
startDate?: string
|
||
endDate?: string
|
||
page?: number
|
||
pageSize?: number
|
||
}) {
|
||
return request.get({ url: '/web/admin/storage-slot-occupancies/history', params })
|
||
}
|
||
|
||
export function fetchCreateOccupancy(data: {
|
||
slotId: string
|
||
itemType?: string
|
||
itemCode: string
|
||
itemName: string
|
||
itemSource?: string
|
||
remark?: string
|
||
}) {
|
||
return request.post({ url: '/web/admin/storage-slot-occupancies', params: data })
|
||
}
|
||
|
||
export function fetchRemoveOccupancy(id: string) {
|
||
return request.put({ url: `/web/admin/storage-slot-occupancies/${id}/remove` })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 展馆预约
|
||
// ---------------------------------------------------------------------------
|
||
|
||
export function fetchExhibitionAppointmentList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
visitDateStart?: string
|
||
visitDateEnd?: 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
|
||
status?: 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
|
||
status?: 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
|
||
storageInDateStart?: string
|
||
storageInDateEnd?: string
|
||
}) {
|
||
return request.get({ url: '/web/admin/storage-certs', params })
|
||
}
|
||
|
||
// ============ 满月待办管理 ============
|
||
|
||
export function fetchFullmoonTodoList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
todoStatus?: string
|
||
fullmoonDateStart?: string
|
||
fullmoonDateEnd?: 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 })
|
||
}
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// 渠道服务购买订单
|
||
// ---------------------------------------------------------------------------
|
||
|
||
/** 渠道服务订单列表 */
|
||
export function fetchChannelServiceOrderList(params?: Record<string, any>) {
|
||
return request.get({ url: '/web/admin/channel-service-orders', params })
|
||
}
|
||
|
||
/** 渠道服务订单详情 */
|
||
export function fetchChannelServiceOrderDetail(orderId: string) {
|
||
return request.get({ url: `/web/admin/channel-service-orders/${orderId}` })
|
||
}
|
||
|
||
/** 创建渠道服务订单 */
|
||
export function fetchCreateChannelServiceOrder(data: Record<string, any>) {
|
||
return request.post({ url: '/web/admin/channel-service-orders', params: data })
|
||
}
|
||
|
||
/** 更新渠道服务订单 */
|
||
export function fetchUpdateChannelServiceOrder(orderId: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/channel-service-orders/${orderId}`, params: data })
|
||
}
|
||
|
||
/** 删除渠道服务订单 */
|
||
export function fetchDeleteChannelServiceOrder(orderId: string) {
|
||
return request.del({ url: `/web/admin/channel-service-orders/${orderId}` })
|
||
}
|
||
|
||
/** 发起财务确认(市场人员提交备注与凭证) */
|
||
export function fetchSubmitServiceOrderFinanceConfirm(orderId: string, data: Record<string, any>) {
|
||
return request.post({
|
||
url: `/web/admin/channel-service-orders/${orderId}/submit-finance-confirm`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
/** 财务确认收款 */
|
||
export function fetchConfirmServiceOrderReceipt(orderId: string, data: Record<string, any>) {
|
||
return request.post({
|
||
url: `/web/admin/channel-service-orders/${orderId}/confirm-receipt`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
/** 提交退款 */
|
||
export function fetchSubmitServiceOrderRefund(orderId: string, data: Record<string, any>) {
|
||
return request.post({
|
||
url: `/web/admin/channel-service-orders/${orderId}/submit-refund`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
/** 确认退款 */
|
||
export function fetchConfirmServiceOrderRefund(orderId: string, data: Record<string, any>) {
|
||
return request.post({
|
||
url: `/web/admin/channel-service-orders/${orderId}/confirm-refund`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
/** 作废订单 */
|
||
export function fetchVoidServiceOrder(orderId: string) {
|
||
return request.put({ url: `/web/admin/channel-service-orders/${orderId}/void` })
|
||
}
|
||
|
||
/** 渠道账户 */
|
||
export function fetchChannelAccount(channelId: string) {
|
||
return request.get({ url: `/web/admin/channels/${channelId}/account` })
|
||
}
|
||
|
||
/** 渠道产品份数 */
|
||
export function fetchChannelProductQuotas(channelId: string) {
|
||
return request.get({ url: `/web/admin/channels/${channelId}/product-quotas` })
|
||
}
|
||
|
||
// ========== 渠道服务订单操作流水 ==========
|
||
|
||
/** 流水列表 */
|
||
export function fetchServiceOrderTxnList(params?: Record<string, any>) {
|
||
return request.get({ url: '/web/admin/channel-service-order-txns', params })
|
||
}
|
||
|
||
/** 流水详情 */
|
||
export function fetchServiceOrderTxnDetail(txnId: string) {
|
||
return request.get({ url: `/web/admin/channel-service-order-txns/${txnId}` })
|
||
}
|
||
|
||
/** 发起充值 */
|
||
export function fetchCreateRechargeTxn(orderId: string, data: Record<string, any>) {
|
||
return request.post({
|
||
url: `/web/admin/channel-service-orders/${orderId}/recharge`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
/** 申请退款 */
|
||
export function fetchCreateRefundTxn(orderId: string, data: Record<string, any>) {
|
||
return request.post({ url: `/web/admin/channel-service-orders/${orderId}/refund`, params: data })
|
||
}
|
||
|
||
/** 购买产品 */
|
||
export function fetchCreatePurchaseTxn(orderId: string, data: Record<string, any>) {
|
||
return request.post({
|
||
url: `/web/admin/channel-service-orders/${orderId}/purchase`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
/** 退订产品 */
|
||
export function fetchCreateUnsubscribeTxn(orderId: string, data: Record<string, any>) {
|
||
return request.post({
|
||
url: `/web/admin/channel-service-orders/${orderId}/unsubscribe`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
/** 更新待生效流水 */
|
||
export function fetchUpdateServiceOrderTxn(txnId: string, data: Record<string, any>) {
|
||
return request.put({ url: `/web/admin/channel-service-order-txns/${txnId}`, params: data })
|
||
}
|
||
|
||
/** 流水发起财务确认 */
|
||
export function fetchSubmitTxnFinance(txnId: string, data: Record<string, any>) {
|
||
return request.post({
|
||
url: `/web/admin/channel-service-order-txns/${txnId}/submit-finance`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
/** 流水财务确认 */
|
||
export function fetchConfirmTxn(txnId: string, data: Record<string, any>) {
|
||
return request.post({
|
||
url: `/web/admin/channel-service-order-txns/${txnId}/confirm`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
/** 作废流水 */
|
||
export function fetchVoidTxn(txnId: string) {
|
||
return request.put({ url: `/web/admin/channel-service-order-txns/${txnId}/void` })
|
||
}
|
||
|
||
// ==================== 中试服务申请单 ====================
|
||
|
||
export function fetchPilotApplicationList(params: any) {
|
||
return request.get({ url: '/web/admin/pilot-application/list', params })
|
||
}
|
||
export function fetchPilotApplicationDetail(params: any) {
|
||
return request.get({ url: '/web/admin/pilot-application/detail', params })
|
||
}
|
||
export function createPilotApplication(data: any) {
|
||
return request.post({ url: '/web/admin/pilot-application/create', params: data })
|
||
}
|
||
export function updatePilotApplication(data: any) {
|
||
return request.put({ url: '/web/admin/pilot-application/update', params: data })
|
||
}
|
||
export function deletePilotApplication(data: any) {
|
||
return request.del({ url: '/web/admin/pilot-application/delete', data })
|
||
}
|
||
export function startPilotApplication(data: any) {
|
||
return request.post({ url: '/web/admin/pilot-application/start', params: data })
|
||
}
|
||
export function completePilotApplication(data: any) {
|
||
return request.post({ url: '/web/admin/pilot-application/complete', params: data })
|
||
}
|
||
export function voidPilotApplication(data: any) {
|
||
return request.post({ url: '/web/admin/pilot-application/void', params: data })
|
||
}
|
||
export function savePilotApplication(data: any) {
|
||
return request.post({ url: '/web/admin/pilot-application/save', params: data })
|
||
}
|
||
export function createBasicExperimentSaleSchedules(
|
||
applicationId: string,
|
||
data: { productLines: any[] }
|
||
) {
|
||
return request.post({
|
||
url: `/web/admin/pilot-application/${applicationId}/sale-schedules`,
|
||
params: data
|
||
})
|
||
}
|
||
|
||
// 患者信息
|
||
export function fetchPilotPatient(params: any) {
|
||
return request.get({ url: '/web/admin/pilot-patient/detail', params })
|
||
}
|
||
export function savePilotPatient(data: any) {
|
||
return request.post({ url: '/web/admin/pilot-patient/save', params: data })
|
||
}
|
||
|
||
// 输注方案
|
||
export function fetchPilotInfusionPlanList(params: any) {
|
||
return request.get({ url: '/web/admin/pilot-infusion-plan/list', params })
|
||
}
|
||
export function createPilotInfusionPlan(data: any) {
|
||
return request.post({ url: '/web/admin/pilot-infusion-plan/create', params: data })
|
||
}
|
||
export function updatePilotInfusionPlan(data: any) {
|
||
return request.put({ url: '/web/admin/pilot-infusion-plan/update', params: data })
|
||
}
|
||
export function deletePilotInfusionPlan(data: any) {
|
||
return request.del({ url: '/web/admin/pilot-infusion-plan/delete', data })
|
||
}
|
||
|
||
// 输注计划
|
||
export function fetchPilotInfusionScheduleList(params: any) {
|
||
return request.get({ url: '/web/admin/pilot-infusion-schedule/list', params })
|
||
}
|
||
export function autoGenerateSchedules(data: any) {
|
||
return request.post({ url: '/web/admin/pilot-infusion-schedule/auto-generate', params: data })
|
||
}
|
||
export function updatePilotInfusionSchedule(data: any) {
|
||
return request.put({ url: '/web/admin/pilot-infusion-schedule/update', params: data })
|
||
}
|
||
export function deletePilotInfusionSchedule(data: any) {
|
||
return request.del({ url: '/web/admin/pilot-infusion-schedule/delete', data })
|
||
}
|
||
export function markScheduleComplete(data: any) {
|
||
return request.post({ url: '/web/admin/pilot-infusion-schedule/mark-complete', params: data })
|
||
}
|
||
|
||
// ========== 中试服务 - 体检管理 ==========
|
||
export const fetchPilotCheckupDetail = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-checkup/detail', params })
|
||
|
||
export const savePilotCheckup = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-checkup/save', params: data })
|
||
|
||
export const deletePilotCheckup = (data: any) =>
|
||
request.del({ url: '/web/admin/pilot-checkup/delete', data })
|
||
|
||
export const markPilotCheckupChecked = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-checkup/mark-checked', params: data })
|
||
|
||
export const settlePilotCheckupFee = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-checkup/settle-fee', params: data })
|
||
|
||
export const fetchPilotCheckupReserveItems = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-checkup/reserve-items', params })
|
||
|
||
export const savePilotCheckupReserveItems = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-checkup/reserve-items/save', params: data })
|
||
|
||
export const deletePilotCheckupReserveItem = (data: any) =>
|
||
request.del({ url: '/web/admin/pilot-checkup/reserve-item/delete', data })
|
||
|
||
export const fetchPilotCheckupActualItems = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-checkup/actual-items', params })
|
||
|
||
export const savePilotCheckupActualItems = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-checkup/actual-items/save', params: data })
|
||
|
||
export const deletePilotCheckupActualItem = (data: any) =>
|
||
request.del({ url: '/web/admin/pilot-checkup/actual-item/delete', data })
|
||
|
||
// 体检记录分页列表
|
||
export const fetchPilotCheckupList = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-checkup/list', params })
|
||
|
||
// 待登记体检的患者列表
|
||
export const fetchPilotCheckupPendingPatients = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-checkup/pending-patients', params })
|
||
|
||
// 批量创建体检记录
|
||
export const batchSavePilotCheckup = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-checkup/batch-save', params: data })
|
||
|
||
// ========== 中试服务 - 交付管理 ==========
|
||
export const fetchPilotDeliveryDetail = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-delivery/detail', params })
|
||
|
||
export const fetchPilotDeliveryListByApplication = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-delivery/list-by-application', params })
|
||
|
||
export const createPilotDelivery = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-delivery/create', params: data })
|
||
|
||
export const deletePilotDelivery = (data: any) =>
|
||
request.del({ url: '/web/admin/pilot-delivery/delete', data })
|
||
|
||
export const fetchPilotDeliveryMaterials = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-delivery/materials', params })
|
||
|
||
export const savePilotDeliveryMaterials = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-delivery/materials/save', params: data })
|
||
|
||
export const fetchPilotDeliveryMethod = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-delivery/method', params })
|
||
|
||
export const savePilotDeliveryMethod = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-delivery/method/save', params: data })
|
||
|
||
// ========== 中试服务 - 出库联动 ==========
|
||
export const createOutboundProductionWorkOrder = (data: any) =>
|
||
request.post({
|
||
url: '/web/admin/pilot-infusion-schedule/create-production-work-order',
|
||
params: data
|
||
})
|
||
|
||
export const createOutboundQcWorkOrder = (data: any) =>
|
||
request.post({
|
||
url: '/web/admin/pilot-infusion-schedule/create-qc-work-order',
|
||
params: data
|
||
})
|
||
|
||
// ========== 中试服务 - 应用确认 ==========
|
||
export const createInfusionConfirm = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-infusion-confirm/create', params: data })
|
||
|
||
export const fetchInfusionConfirmList = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-infusion-confirm/list', params })
|
||
|
||
export const getInfusionConfirmDetail = (params: any) =>
|
||
request.get({ url: '/web/admin/pilot-infusion-confirm/detail', params })
|
||
|
||
export const confirmInfusion = (data: any) =>
|
||
request.post({ url: '/web/admin/pilot-infusion-confirm/confirm', params: data })
|
||
|
||
export const updateInfusionConfirm = (data: any) =>
|
||
request.put({ url: '/web/admin/pilot-infusion-confirm/update', params: data })
|
||
|
||
export const deleteInfusionConfirm = (data: any) =>
|
||
request.del({ url: '/web/admin/pilot-infusion-confirm/delete', data })
|
||
|
||
// ========== 中试服务 - 输注计划管理 ==========
|
||
export function fetchInfusionScheduleMgmtList(params: any) {
|
||
return request.get({ url: '/web/admin/pilot-infusion-schedule-mgmt/list', params })
|
||
}
|
||
export function fetchInfusionScheduleMgmtDetail(params: { scheduleId: string } | { id: string }) {
|
||
const scheduleId =
|
||
'scheduleId' in params && params.scheduleId
|
||
? params.scheduleId
|
||
: 'id' in params
|
||
? params.id
|
||
: ''
|
||
return request.get({
|
||
url: '/web/admin/pilot-infusion-schedule-mgmt/detail',
|
||
params: { scheduleId }
|
||
})
|
||
}
|
||
export function updateInfusionScheduleStatus(data: {
|
||
scheduleId?: string
|
||
id?: string
|
||
infusionStatus: string
|
||
cancelReason?: string
|
||
}) {
|
||
const scheduleId = data.scheduleId || data.id || ''
|
||
return request.put({
|
||
url: '/web/admin/pilot-infusion-schedule-mgmt/update-status',
|
||
data: {
|
||
scheduleId,
|
||
infusionStatus: data.infusionStatus,
|
||
cancelReason: data.cancelReason
|
||
}
|
||
})
|
||
}
|
||
export function updateInfusionScheduleQcStatus(data: {
|
||
scheduleId?: string
|
||
id?: string
|
||
qcStatus: string
|
||
}) {
|
||
const scheduleId = data.scheduleId || data.id || ''
|
||
return request.put({
|
||
url: '/web/admin/pilot-infusion-schedule-mgmt/update-qc-status',
|
||
data: {
|
||
scheduleId,
|
||
qcStatus: data.qcStatus
|
||
}
|
||
})
|
||
}
|
||
export function updateInfusionScheduleMgmt(data: any) {
|
||
return request.put({
|
||
url: '/web/admin/pilot-infusion-schedule-mgmt/update',
|
||
data
|
||
})
|
||
}
|