import { request } from '@/service/request';

/**
 * 员工列表-积分统计
 */
export function fetchGetUserList(params: any) {
  return request<Api.government.userList[]>({
    url: '/smqjh-system/api/v1/members/enterprise/enterpriseUserList',
    method: 'get',
    params
  });
}

/**
 * 新增员工
 */
export function fetchAddUser(data: any) {
  return request({
    url: '/smqjh-system/api/v1/members/enterprise',
    method: 'POST',
    data
  });
}

/**
 * 修改员工
 */
export function fetchEditUser(data: any) {
  return request({
    url: '/smqjh-system/api/v1/members/enterprise',
    method: 'PUT',
    data
  });
}

/**
 * 删除员工
 */
export function fetchDeleteUser(id: number) {
  return request({
    url: `/smqjh-system/api/v1/members/enterprise/deleteUserById/${id}`,
    method: 'DELETE'
  });
}

/**
 * 导入员工
 * @param data
 * @returns
 */
export function fetchExportUser(data: { file: File }) {
  return request({
    url: '/smqjh-system/api/v1/members/enterprise/uploadExcelGoods',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

/**
 * 导入记录
 */

export function fetchGetImportRecordList() {
  return request<Api.government.importRecordList[]>({
    url: '/smqjh-system/api/v1/members/enterprise/enterpriseUserLogList',
    method: 'get'
  });
}
/**
 * 修改员工状态
 */
export function fetchEditUserStatus(data: any) {
  return request({
    url: '/smqjh-system/api/v1/members/enterprise/updateMemberStatus',
    method: 'PUT',
    data
  });
}
