newProductApply.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { http } from "@/utils/http";
  2. type Result = {
  3. code: number;
  4. message: string;
  5. data?: any;
  6. };
  7. type ResultTable = {
  8. code: number;
  9. message: string;
  10. data?: {
  11. list: Array<any>;
  12. total: number;
  13. pageSize: number;
  14. currentPage: number;
  15. };
  16. };
  17. export const getNewProductApplyList = (params: {
  18. page?: number;
  19. pageSize?: number;
  20. productName?: string;
  21. barcode?: string;
  22. status?: number;
  23. applicantId?: number;
  24. }) => {
  25. return http.request<ResultTable>("get", "/new-product-apply/list", { params });
  26. };
  27. export const getNewProductApplyById = (id: number) => {
  28. return http.request<Result>("get", `/new-product-apply/${id}`);
  29. };
  30. export const getNewProductApplyStatistics = () => {
  31. return http.request<Result>("get", "/new-product-apply/statistics");
  32. };
  33. export const submitNewProductApply = (data: any) => {
  34. return http.request<Result>("post", "/new-product-apply/submit", { data });
  35. };
  36. export const saveNewProductApplyDraft = (data: any) => {
  37. return http.request<Result>("post", "/new-product-apply/save-draft", { data });
  38. };
  39. export const updateNewProductApply = (id: number, data: any) => {
  40. return http.request<Result>("put", `/new-product-apply/${id}`, { data });
  41. };
  42. export const deleteNewProductApply = (id: number) => {
  43. return http.request<Result>("delete", `/new-product-apply/${id}`);
  44. };
  45. export const checkBarcode = (barcode: string) => {
  46. return http.request<Result>(
  47. "get",
  48. `/new-product-apply/check-barcode?barcode=${barcode}`
  49. );
  50. };