import request from "@/utils/request";
// 创建WMS 品质管理-检验项管理
export function createMaterialItem(data) {
  return request({
    url: "/rtkqms/material-item/create",
    method: "post",
    data: data,
  });
}
// 完成检验
// /wms/incoming-receipt-inspection/create
export function finishMaterialItem(data) {
  return request({
    url: "/rtkqms/incoming-receipt-inspection/submit",
    method: "post",
    data: data,
  });
}
//
export function modifyMaterialItem(data) {
  return request({
    url: "/rtkqms/material-item-detail-temp/modify-material-item",
    method: "post",
    data: data,
  });
}

// 更新WMS 品质管理-检验项管理
export function updateMaterialItem(data) {
  return request({
    url: "/rtkqms/material-item/update",
    method: "put",
    data: data,
  });
}

// iqc一键检验
export function updateAllInspect(data) {
  return request({
    url: "/rtkqms/material-item-result/updateAll",
    method: "put",
    data: data,
  });
}

// 删除WMS 品质管理-检验项管理
export function deleteMaterialItem(id) {
  return request({
    url: "/rtkqms/material-item/delete?id=" + id,
    method: "delete",
  });
}
// 获得WMS 品质管理-iqc检验项分页
export function getMaterialItemiqcPage(query) {
  return request({
    url: "/rtkqms/material-item/iqcPage",
    method: "get",
    params: query,
  });
}
// 获得WMS 品质管理-物料检验方案分页
export function getMaterialItemPage(query) {
  return request({
    url: "/rtkqms/material-item-result/page",
    method: "get",
    params: query,
  });
}
// 检验结果分页
export function getMaterialPage(query) {
  return request({
    url: "/rtkqms/material-item/page",
    method: "get",
    params: query,
  });
}
// 模糊查询检验方案list
export function getPageLike(data) {
  return request({
    url: "/rtkqms/inspection-item/list-like",
    method: "post",
    data: data,
  });
}

// 创建iqc检验方案主
export function createMaterialItemMaster(data) {
  return request({
    url: "/rtkqms/material-item-master/create",
    method: "post",
    data: data,
  });
}

// 更新iqc检验方案主
export function updateMaterialItemMaster(data) {
  return request({
    url: "/rtkqms/material-item-master/update",
    method: "put",
    data: data,
  });
}

// 删除iqc检验方案主
export function deleteMaterialItemMaster(id) {
  return request({
    url: "/rtkqms/material-item-master/delete?id=" + id,
    method: "delete",
  });
}

// 获得iqc检验方案主
export function getMaterialItemMaster(id) {
  return request({
    url: "/rtkqms/material-item-master/get?id=" + id,
    method: "get",
  });
}

// 获得iqc检验方案主分页
export function getMaterialItemMasterPage(query) {
  return request({
    url: "/rtkqms/material-item-master/page",
    method: "get",
    params: query,
  });
}

// 导出iqc检验方案主 Excel
export function exportMaterialItemMasterExcel(query) {
  return request({
    url: "/rtkqms/material-item-master/export-excel",
    method: "get",
    params: query,
    responseType: "blob",
  });
}

//更新检验方案主从明细
export function updateAllMaterialItem(data) {
  return request({
    url: "/rtkqms/material-item-master/updateAll",
    method: "put",
    data: data,
  });
}

// 检验方案提交/审核
export function updateAllMaterialCase(data) {
  return request({
    url: "/rtkqms/material-item-master/updateAuditStatus",
    method: "put",
    data: data,
  });
}
