import request from '@/utils/request';

/**
 * 准入列表
 */
interface getPageData {
  pageNo: number;
  pageSize: number;
  parentCode?: string;
}
export const getPage = (data: getPageData) => request.post('/coscoAccessWork/getPage', { data});
 /**
 * 评审修改时用的详情页
 */
 interface reviewInfoData {
  id: string;
  userId?: string;
 }
 export const reviewInfo = (params: reviewInfoData) => request.get(`/coscoAccessWork/reviewInfo`, { params });

/**
 * 上传文件
 * @param file 上传的文件对象
 * @returns 上传结果
 */
export const uploadFile = async (file: File) => {
  const formData = new FormData();
  formData.append('file', file);

  return request('/fileConfig/files/upload', {
      method: 'POST',
      data: formData,
     
  });
};
/**
 * 供应商准入管理详情
 */
export const coscoAccessWork = (id: string) => request.get(`/coscoAccessWork/${id}`);
/**
 * 组员评审
 */
export interface updateData {
  accessWorkId: string;
  coscoAccessUserItemList: CoscoAccessUserItemList[];
  [property: string]: any;
}

export interface CoscoAccessUserItemList {
  coscoAccessTtemAttachments: CoscoAccessTtemAttachments;
  id: number;
  remark: string;
  reviewResult: number;
  [property: string]: any;
}

export interface CoscoAccessTtemAttachments {
  accessWorkId: string;
  fileName: string;
  filePath: string;
  fileSize: string;
  fileType: string;
  fileUrl: string;
  [property: string]: any;
}
export const update = (data: updateData) => request.post('/coscoAccessWork/update', { data });


 
 