import request from '@/utils/request';


// 列表

export async function getList (data) {
    const res = await request.post(`/qms/quality_plan/page` , data);
    if (res.data.code == 0) {
      return res.data.data;
    }
    return Promise.reject(new Error(res.data.message));
  }

// 新增
export async function save(data) {
  const res = await request.post(`/qms/quality_plan/save`, data);
  if (res.data.code == 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}

// 编辑
export async function update(data) {
  const res = await request.post(`/qms/quality_plan/update`, data);
  if (res.data.code == 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}
// 下发
export async function planIssued(data) {
  const res = await request.post(`/qms/quality_plan/plan_issued`, data);
  if (res.data.code == 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}





// 删除
export async function removeItem(data) {
  const res = await request.delete('/qms/quality_plan/delete', {
    data
  });
  if (res.data.code == 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}
