ims-front/src/api/material/mods/apply/getScrapOutById.ts
my_ong df572949f3
Some checks failed
Release / lint (push) Successful in 46s
Release / Release (push) Failing after 58s
sparkles: 报废出库 查询和审核
2025-03-15 12:44:11 +08:00

22 lines
639 B
TypeScript

/**
* @desc 获取报废出库申请单
*/
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
import type { AxiosResponse } from 'axios'
export default async function (
/** 申请单ID */
applyId: number,
success: (data: Array<material.ScrapOutApplyDTO>) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'get',
url: `/scrap-out/${applyId}`,
})
.then((data: AxiosResponse<Array<material.ScrapOutApplyDTO>, unknown>) => {
success(data.data)
})
.catch((error: { code: string; error?: string }) => fail(error))
}