import request from '@/utils/request';

// 通过方案ids获取质检项
export async function getQualityTemplateByIds(data) {
  const res = await request.post(
    `/qms/qualitytemplate/getQualityTemplateByIds`,
    data
  );
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

// 列表

export async function getList(data) {
  let par = new URLSearchParams(data);
  const res = await request.get(`/qms/qualitytemplate/page?` + par, {});
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function getWarehouseList(data) {
  const res = await request.post(`/wms/warehouse/select/warehouseList`, {
    params: { status: 1 }
  });
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
