import request from '@/utils/request';



// 报工-pad获取工单信息
export async function listByIdsReport(data) {
    const res = await request.post(`/mes/workorder/listByIdsReport`, data);
    if (res.data.code == 0) {
      return res.data.data;
    }
    return Promise.reject(new Error(res.data.message));
  }
  
 


  // 根据工单id获取工序列表
  export async function getTaskInstanceList(id) {
    const res = await request.get(`/pda/mes/workorder/getTaskInstanceById/${id}`);
    if (res.data.code == 0) {
      return res.data.data;
    }
    return Promise.reject(new Error(res.data.message));
  }
  

// 根据工单工序取计算参数
  export async function getComputeParam(workOrderId, taskId) {
    const res = await request.get(`/mes/computeparam/getComputeParam/${workOrderId}/${taskId}`);
    if (res.data.code == 0) {
      return res.data.data;
    }
    return Promise.reject(new Error(res.data.message));
  }


  //工序计算列表
export async function saveParam(data) {
  const res = await request.post(`/mes/computeparam/save`, data);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}


  


// pda常规质检-批量报工型取样
  export async function sample(data) {
    const res = await request.post(`/mes/workorder/sample`, data);
    if (res.data.code == 0) {
      return res.data.data;
    }
    return Promise.reject(new Error(res.data.message));
  }
  
  
    
