import { postJ, post, get } from "@/utils/request";
import Vue from "vue";

// 报工  工单信息
export async function getByIdReport(id, taskId) {
  const data = await get(
   Vue.prototype.apiUrl  + `/pda/mes/workorder/getByIdReport/${id}/${taskId}`,
  );
  if (data.code == 0) {
    return data.data;
  }
  return Promise.reject(data.message);
}

// 报工-pad扫码切换工单

export async function getByCodeReport(code, taskId) {
  const data = await get(
   Vue.prototype.apiUrl  + `/pda/mes/workorder/getByCodeReport/${code}/${taskId}`,
  );
  if (data.code == 0) {
    return data.data;
  }
  return Promise.reject(data.message);
}



export async function jobSave(params) {
  const data = await postJ(
   Vue.prototype.apiUrl  + `/pda/mes/workreport/save`, params, true,
  );
  if (data.code == 0) {
    return data.data;
  }
  return Promise.reject(data.message);
}


