newProductApply.ts 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import { get, post, put, del } from '@/utils/request';
  2. export interface NewProductApplyQuery {
  3. page?: number;
  4. pageSize?: number;
  5. productName?: string;
  6. barcode?: string;
  7. status?: number;
  8. applicantId?: number;
  9. }
  10. export interface NewProductApplyItem {
  11. id?: number;
  12. productName: string;
  13. barcode: string;
  14. category?: string;
  15. brand?: string;
  16. specification?: string;
  17. unit?: string;
  18. price?: number;
  19. costPrice?: number;
  20. images?: string;
  21. description?: string;
  22. productType?: number;
  23. standard?: number;
  24. stickerNum?: string;
  25. length?: number;
  26. width?: number;
  27. height?: number;
  28. exhibitHeight?: number;
  29. columns?: number;
  30. numbers?: number;
  31. reason?: string;
  32. status?: number;
  33. applicantId?: number;
  34. applicantName?: string;
  35. applyTime?: string;
  36. auditStatus?: number;
  37. auditRemark?: string;
  38. }
  39. export interface NewProductApplyStatistics {
  40. total: number;
  41. pending: number;
  42. approved: number;
  43. rejected: number;
  44. }
  45. export interface NewProductApplyListResponse {
  46. list: NewProductApplyItem[];
  47. total: number;
  48. pageSize: number;
  49. currentPage: number;
  50. }
  51. export async function getNewProductApplyList(params: NewProductApplyQuery = {}): Promise<NewProductApplyListResponse> {
  52. return get('/new-product-apply/list', params);
  53. }
  54. export async function getNewProductApplyById(id: number): Promise<NewProductApplyItem> {
  55. return get(`/new-product-apply/${id}`);
  56. }
  57. export async function getNewProductApplyStatistics(): Promise<NewProductApplyStatistics> {
  58. return get('/new-product-apply/statistics');
  59. }
  60. export async function submitNewProductApply(data: NewProductApplyItem): Promise<any> {
  61. return post('/new-product-apply/submit', data);
  62. }
  63. export async function saveNewProductApplyDraft(data: NewProductApplyItem): Promise<any> {
  64. return post('/new-product-apply/save-draft', data);
  65. }
  66. export async function updateNewProductApply(id: number, data: NewProductApplyItem): Promise<any> {
  67. return put(`/new-product-apply/${id}`, data);
  68. }
  69. export async function deleteNewProductApply(id: number): Promise<any> {
  70. return del(`/new-product-apply/${id}`);
  71. }
  72. export async function checkBarcode(barcode: string): Promise<any> {
  73. return get('/new-product-apply/check-barcode', { barcode });
  74. }