import request from "@/utils/request";

// 获得剥离力数据
export function getPeelingList(query) {
  return request({
    url: "/rtkwms/f/list",
    method: "get",
    params: query,
  });
}
// 获得WMS 品质管理-Iqc检验项分页--待检验
export function getFqcInspectionPage(query) {
  return request({
    url: "/rtkqms/material-item/fqcInspectionPage",
    method: "get",
    params: query,
  });
}

// 获得WMS 品质管理-iqc检验项分页--已检验
export function getReceiptInspectionPage(query) {
  return request({
    url: "/rtkwms/incoming-receipt-inspection/page",
    method: "get",
    params: query,
  });
}

// 获取iqc检验执行查询分页接口
export function getIqcInspectionPage(query) {
  return request({
    url: "/rtkqms/incoming-receipt-inspection/iqcPage",
    method: "get",
    params: query,
  });
}
// 获得WMS IQC检验项
export function getIqcInspect(id) {
  return request({
    url: "/rtkqms/material-item-result/get?id=" + id,
    method: "get",
  });
}
// 更新iqc检验项
export function updateIqcMaterialItem(data) {
  return request({
    url: "/rtkqms/material-item-result/update",
    method: "put",
    data: data,
  });
}

// 创建检验项实测值
export function createMaterialItemActual(data) {
  return request({
    url: "/rtkqms/material-item-actual/create",
    method: "post",
    data: data,
  });
}
// 检验执行前置校验
export function createMaterialItemResult(data) {
  return request({
    url: "/rtkqms/material-item-result/create",
    method: "post",
    data: data,
  });
}

// 更新检验项实测值
export function updateMaterialItemActual(data) {
  return request({
    url: "/rtkqms/material-item-actual/update",
    method: "put",
    data: data,
  });
}

// 删除检验项实测值
export function deleteMaterialItemActual(id) {
  return request({
    url: "/rtkqms/material-item-actual/delete?id=" + id,
    method: "delete",
  });
}

// 获得检验项实测值
export function getMaterialItemActual(id) {
  return request({
    url: "/rtkqms/material-item-actual/get?id=" + id,
    method: "get",
  });
}

// 获得检验项实测值分页
export function getMaterialItemActualPage(query) {
  return request({
    url: "/rtkqms/material-item-actual/page",
    method: "get",
    params: query,
  });
}
// 导出检验项实测值 Excel
export function exportMaterialItemActualExcel(query) {
  return request({
    url: "/rtkqms/material-item-actual/export-excel",
    method: "get",
    params: query,
    responseType: "blob",
  });
}
// iqc重新检验
export function updateReinspection(data) {
  return request({
    url: "/rtkqms/material-item-result/reinspection",
    method: "put",
    data: data,
  });
}

// 获得修改检验标准分页
export function getUpdateMaterialItemDetailPage(query) {
  return request({
    url: "/rtkqms/material-item-detail/page",
    method: "get",
    params: query,
  });
}
// 新增修改检验标准分页
export function getMaterialAdditionPageNew(data) {
  return request({
    url: "/rtkqms/material-additional/pageNew",
    method: "post",
    data: data,
  });
}

// 保存检验标准修改
export function updateBatchInspection(data) {
  return request({
    // url: '/rtkqms/material-item-detail/updateBatch',
    url: "/rtkqms/material-additional/updateNew",
    method: "put",
    data: data,
  });
}
// 提交检验标准修改
export function pushToVerifyInspection(data) {
  return request({
    // url: '/rtkqms/material-item-detail/pushToVerify',
    url: "/rtkqms/material-additional/pushToVerify",
    method: "put",
    data: data,
  });
}

// 获取工序下拉列表
export function getProcessPage(query) {
  return request({
    url: "/mes/process-base/page",
    method: "get",
    params: query,
  });
}

// 提交检验标准修改
export function updateByCheckCategory(data) {
  return request({
    // url: '/rtkqms/material-item-detail/pushToVerify',
    url: "/rtkqms/material-item-result/updateByCheckCategory",
    method: "put",
    data: data,
  });
}

// 删除检验项
export function deleteInspection(id) {
  return request({
    url: "/rtkqms/incoming-receipt-inspection/delete?id=" + id,
    method: "delete",
  });
}

// 检验文件上传
export function createFileUpload(data) {
  return request({
    url: "/rtkwms/ipqc-result-file/create",
    method: "post",
    data: data,
  });
}

// 获得下载文件
export function getURL(query) {
  return request({
    url: "/rtkwms/ipqc-result-file/getFileByProcessNo",
    method: "get",
    params: query,
  });
}

// 保存实测值
export function updateAllForPCInspect(data) {
  return request({
    // url: '/rtkqms/material-item-detail/updateBatch',
    url: "/rtkqms/material-item-result/updateAllForPC",
    method: "put",
    data: data,
  });
}

// 判断实测值是否合格
export function updateRowForPCIsQualified(data) {
  return request({
    url: "/rtkqms/material-item-result/updateRowForPC",
    method: "put",
    data: data,
  });
}

// 获取供应商附件
export function getSupplierFileByMaterialLots(query) {
  return request({
    url: "/rtkwms/delivery-notice-master/getFileByMaterialLots",
    method: "get",
    params: query,
  });
}

// 获得二次元数据
export function getElementMeasure(query) {
  return request({
    url: "/rtkwms/quadratic-element-measure/get",
    method: "get",
    params: query,
  });
}

// 回退到未提交
export function inspectionReBack(query) {
  return request({
    url: "/rtkqms/incoming-receipt-inspection/reBack",
    method: "get",
    params: query,
  });
}
// 导出质检结果 Excel
export function exportQualityInspectionResults(query) {
  return request({
    url: "/rtkqms/incoming-receipt-inspection/iqcPageExport",
    method: "get",
    params: query,
    responseType: "blob",
  });
}
// 上传列表附件
export function createAttachmentUpload(data) {
  return request({
    url: "/rtkqms/material-item-result/update",
    method: "put",
    data: data,
  });
}

// 附件
export function getIqcInspectionDataDetailForPda(query) {
  return request({
    url: "/rtkqms/incoming-receipt-inspection/iqcInspectionDataDetailForPda",
    method: "get",
    params: query,
  });
}
