import request from '@/utils/request';

export async function getPage(data) {
  const res = await request.get('/mes/disposeorder/page', {
    params: data
  });
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}


// 获取列表
export async function getMaterialList(data) {
  const res = await request.get(`/main/category/getList`, {
    params: data
  });
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}


// 新建副产品处置

export async function listDisposeBy(data) {
  const res = await request.post(`/mes/disposeorder/listDisposeByWorkOrderIds`,data);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}



// 新建副产品回收
export async function disposeSave(data) {
  const res = await request.post(`/mes/disposeorder/save`,data);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}






