import request from "@/utils/request";

// 创建物料附加信息
export function createMaterialAdditional(data) {
  return request({
    url: "/rtkwms/material-additional/create",
    method: "post",
    data: data,
  });
}

// 更新物料附加信息
export function updateMaterialAdditional(data) {
  return request({
    url: "/rtkwms/material-additional/update",
    method: "put",
    data: data,
  });
}

// 删除物料附加信息
export function deleteMaterialAdditional(id) {
  return request({
    url: "/rtkwms/material-additional/delete?id=" + id,
    method: "delete",
  });
}

// 获得物料附加信息
export function getMaterialAdditional(id) {
  return request({
    url: "/rtkwms/material-additional/get?id=" + id,
    method: "get",
  });
}

// 获得物料附加信息分页
export function getMaterialAdditionalPage(query) {
  return request({
    url: "/rtkqms/material-additional/page",
    method: "get",
    params: query,
  });
}

// 导出物料附加信息 Excel
export function exportMaterialAdditionalExcel(query) {
  return request({
    url: "/rtkwms/material-additional/export-excel",
    method: "get",
    params: query,
    responseType: "blob",
  });
}

// 获得待审批物料检验方案明细分页
export function getMaterialItemDetailPage(query) {
  return request({
    url: "/rtkqms/material-item-detail-temp/page",
    method: "get",
    params: query,
  });
}

// 获得已审批物料检验方案明细分页
export function getMaterialItemDetailLogPage(query) {
  return request({
    url: "/rtkqms/material-item-detail-log/page",
    method: "get",
    params: query,
  });
}
// 检验标准审批通过
export function updateAuditPass(query) {
  return request({
    url: "/rtkqms/material-additional/updateAuditPass",
    method: "get",
    params: query,
  });
}
// 检验标准审批不通过
export function updateAuditUnPass(data) {
  return request({
    url: "/rtkqms/material-additional/updateAuditUnPass",
    method: "post",
    data: data,
  });
}
// 新增检验标准
export function createNewInspection(data) {
  return request({
    url: "/rtkqms/material-additional/createNew",
    method: "post",
    data: data,
  });
}

// 获得标准审核审批日志
export function getlastestLogPage(query) {
  return request({
    url: "/rtkqms/material-additional-log/page",
    method: "get",
    params: query,
  });
}

// 判断是否更改检验方案
export function ifChangeMasterAdditional(data) {
  return request({
    url: "/rtkqms/material-additional/ifChangeMaster",
    method: "put",
    data: data,
  });
}

// // 删除未提交的检验标准
// export function deleteMaterialAdditional (id) {
//   return request({
//     url: '/rtkwms/material-additional/delete?id='+id,
//     method: 'delete',
//   })
// }
