81 lines
1.6 KiB
TypeScript
81 lines
1.6 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
type PageList<T> = {
|
|
list: T[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
totalPages: number
|
|
}
|
|
|
|
export type QcThirdPartyItem = {
|
|
id: string
|
|
companyId: string
|
|
companyName?: string
|
|
itemCode: string
|
|
itemName: string
|
|
feeAmount: number
|
|
status: string
|
|
orderNum: number
|
|
remark?: string
|
|
createTime?: string
|
|
updateTime?: string
|
|
}
|
|
|
|
export function fetchQcThirdPartyItemList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
status?: string
|
|
companyId?: string
|
|
}) {
|
|
return request.get<PageList<QcThirdPartyItem>>({
|
|
url: '/web/admin/qc-third-party-items',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchQcThirdPartyItemsActive(companyId?: string) {
|
|
return request.get<QcThirdPartyItem[]>({
|
|
url: '/web/admin/qc-third-party-items/active',
|
|
params: companyId ? { companyId } : undefined
|
|
})
|
|
}
|
|
|
|
export function fetchCreateQcThirdPartyItem(data: {
|
|
companyId: string
|
|
itemCode: string
|
|
itemName: string
|
|
feeAmount: number
|
|
status?: string
|
|
orderNum?: number
|
|
remark?: string
|
|
}) {
|
|
return request.post<QcThirdPartyItem>({
|
|
url: '/web/admin/qc-third-party-items',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchUpdateQcThirdPartyItem(
|
|
id: string,
|
|
data: Partial<{
|
|
companyId: string
|
|
itemCode: string
|
|
itemName: string
|
|
feeAmount: number
|
|
status: string
|
|
orderNum: number
|
|
remark: string
|
|
}>
|
|
) {
|
|
return request.put<QcThirdPartyItem>({
|
|
url: `/web/admin/qc-third-party-items/${id}`,
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchDeleteQcThirdPartyItem(id: string) {
|
|
return request.del({ url: `/web/admin/qc-third-party-items/${id}` })
|
|
}
|