import request from '../util/request.js';

// 查询还料区货位状态
export function getLocatorStatus() {
    return request({
        url: '/api/LocatorResource/queryBlankAreaStatus',
        method: 'get',
    });
}

// 查询不在库的料车
export function getNoInStorageTruck(no) {
    return request({
        url: '/api/TruckResource/queryNoInStorageTruck?no=' + no,
        method: 'get',
    });
}

// 根据还料货位和料车编号生成归还单和调度任务
export function generateTaskByBlankNo(params) {
    return request({
        url: '/api/SchedulingTasksResource/generateTaskByBlankNo',
        method: 'post',
        data: params,
    });
}

// 查询送料区货位状态
export function getLocatorFeedAreaStatus() {
    return request({
        url: '/api/LocatorResource/queryFeedAreaStatus',
        method: 'get',
    });
}

// 取走送料区料车
export function takeAwaySkip(positionNo) {
    return request({
        url: '/api/LocatorResource/takeAwaySkip?positionNo=' + positionNo,
        method: 'get',
    });
}

// 查询异常停泊区货位状态
export function getLocatorAbnormalAreaStatus() {
    const warehouseId = localStorage.getItem('#warehouseId');
    return request({
        url: '/api/LocatorResource/queryBlankAbnormalParkStatus?warehouseId=' + warehouseId,
        method: 'get',
    });
}

// 取走异常停泊区的料车
export function takeAwayAbnormalCar(params) {
    return request({
        url: '/api/LocatorResource/takeAwayAbnormalCar',
        method: 'post',
        data: params,
    });
}

// 查询工装设备
export function findDeviceByCondition(params) {
    return request({
        url: '/api/InventoryResource/findDeviceByCondition',
        method: 'post',
        data: params,
    });
}