import request from '@/utils/request';

/**
 * 列表
 */
 export async function getList (data) {
    const res = await request.post('/aps/productionplan/page', data);
    if (res.data.code == 0) {
      return res.data.data;
    }
    return Promise.reject(new Error(res.data.message));
  }
// aps生产计划获取产品的多个bom版本
export async function bomListByPlan(params) {
  const res = await request.get(
    `/main/bomCategory/bomListByPlan`, { params }
  );
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
// 根据bom 获取工艺路线

export async function bomRoutingList(id) {
  const res = await request.get(`/main/bomCategory/bomRoutingList/${id}`);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
//工艺路线工序实例-分页
export async function taskinstanceList (data) {
  const res = await request.post(
    '/main/producerouting/taskinstance/page',
    data
  );
  if (res.data.code == 0) {
    return res.data.data;
  }
}
