import request from '@/utils/request';

/**
 * 查询量具送检信息
 */
export async function processById(params) {
  console.log('---parmas--parmas-----------');
  console.log(params);
  const res = await request.get(`/eam/planmaintenance/processById`, { params });
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

// 提交日志-处理流程
export async function surrender(data) {
  const res = await request.post('/eom/planTool/surrender', data);
  if (res.data.code == 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}

// 个人日志列表
export async function getList(params) {
  const res = await request.get('/eom/planToolLog/list', { params });
  if (res.data.code == 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}

// 我的工单统计
export async function statistics(params) {
  const res = await request.get('/eam/PdaWorkOrder/statistics', { params });
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
