import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { OrdersQuery } from "./types";

//首页涉及相关api（获取未完成任务、扫码开工）
/**
 * 获取未完成任务
 *
 * @param data
 */
export function getOrders(data: any) {
  return request(
    {
      url: "/api/v1/plan/workOrder/taskPage",
      method: "post",
      data: data,
    },
    { loadingKey: "getProcessOrders" }
  );
}

/**
 * 扫码开工
 *
 * @param data
 */
export function getScan(data: any) {
  return request({
    url: "/api/v1/process/info/scan",
    method: "post",
    data: data,
  });
}
// 流程叫料
export function callItems(data: any) {
  return request(
    {
      url: "/api/v1/process/vehicleOperation/callItems",
      method: "post",
      data: data,
    },
    { loadingKey: "callItems" }
  );
}
// 设备点检列表查询
export function checkList() {
  return request({
    url: "/api/v1/process/equit/checkList",
    method: "get",
  });
}

// 设备点检提交
export function maintenanceCheck(data: any) {
  return request({
    url: "/api/v1/process/equit/maintenanceCheck",
    method: "post",
    data: data,
  });
}

export function querySeqInfo(workOrderCode: string,seqNo: string) {
    return request({
        url: "/api/v1/plan/seq/query/" + workOrderCode + "/" + seqNo,
        method: "get",
    });
}
export function saveSeqInfo(data: any) {
    return request({
        url: "/api/v1/plan/seq/update",
        method: "post",
        data: data,
    });
}

