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


// 领料保存
export async function batchSave(params) {
  const data = await postJ(
   Vue.prototype.apiUrl  + `/pda/mes/pickorder/batchSave`, params, true,
  );
  if (data.code == 0) {
    return data.data;
  }
  return Promise.reject(data.message);
}


// 统计领料数量
export async function pickStatistics(params) {
  const data = await post(
   Vue.prototype.apiUrl  + `/pda/mes/workorder/pickStatistics`, params, true,
  );
  if (data.code == 0) {
    return data.data;
  }
  return Promise.reject(data.message);
}


// 领料单详细信息
export async function pickDetails(params) {
  const data = await postJ(
   Vue.prototype.apiUrl  + `/pda/mes/pickorder/list`, params, true,
  );
  if (data.code == 0) {
    return data.data;
  }
  return Promise.reject(data.message);
}

// pda领料出库单
export async function pickOutInOrder(params) {
  const data = await postJ(
   Vue.prototype.apiUrl  + `/pda/mes/pickorder/pickOutInOrder`, params, true,
  );
  if (data.code == 0) {
    return data.data;
  }
  return Promise.reject(data.message);
}
