import { request } from '@/utils/request'

export interface AssingWork {
    id:number,
    processId:number,
    processName:number,
    userId:string,
    quantity:number,
    rework:number,
    reworkNum:number,
    completeQuantity:number,
    completedTime:Date,
    createTime:Date,
    createBy:number,
    status:number,
    reason:string,
    pauseTime:Date,
    assingStatus:number,
    assingCode:string,
    parentId:number,
    reworkSort:number,
    workshopId:number,
    sectionId:number,
    deviceId:number,
    traceId:number,
    qcNum:number
}


//派工列表
export function disworlist(params:any) {
    return request({ 
        url: `/mes/dispatch/list`, 
        method: 'get',
        params
    })
}

//修改派工
export function editdiswor(data:any) {
    return request({ 
        url: `/mes/dispatch`, 
        method: 'put',
        data 
    })
}


//改派(转移)
export function transfer(data:any) {
    return request({ 
        url: `/mes/dispatch/transfer`, 
        method: 'put',
        data 
    })
}

//暂停/恢复
export function pauseresume(data:any) {
    return request({ 
        url: `/mes/dispatch/pause_resume`, 
        method: 'put',
        data 
    })
}

//我的派工任务
export function mytasks(params:{page:number,pageSize:number,processName:string}) {
    return request({ 
        url: `/mes/dispatch/my-tasks`, 
        method: 'get',
        params
    })
}

//派工数据统计
export function workload(params?:any) {
    return request({ 
        url: `/mes/dispatch/workload`, 
        method: 'get',
        params
    })
}

//报检
export function inspectio(data:any) {
    return request({ 
        url: `/mes/dispatch/qc`, 
        method: 'post',
        data 
    })
}


//派工数据详情
export function info(id:number) {
    return request({ 
        url: `/mes/dispatch/${id}`, 
        method: 'get',
    })
}
