import request from '@/utils/request';


// 选择工艺路线
export async function routeList(params) {
  const res = await request.get('/main/producerouting/page', { params });
  if (res.data.code == 0) {
    return res.data.data;
  }
}
// 工序
export async function getProduceTaskList(params) {
  const res = await request.post('/main/producerouting/taskinstance/page',params);
  if (res.data.code == 0) {
    return res.data.data;
  }
}

/**
 * 生产计划
 */
 export async function getPlanList (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));
}

/**
 * 生产订单
 */
 export async function workOrder(params) {
  const res = await request.post('/aps/workorder/page', params);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 生产工单
 */
 export async function produceOrder (params) {
  const res = await request.post('/mes/workorder/page', params);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
/**
 * 入库申请
 */
export async function warehousing (data) {
  const res = await request.get('/mes/applystorage/page', {
    params: data
  });
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}