import request from '@/utils/request'

// 查询工单任务列表
export function listTask(query) {
    return request({
        url: '/system/task/list',
        method: 'get',
        params: query
    })
}

// 查询工单任务详细
export function getTask(taskId) {
    return request({
        url: '/system/task/' + taskId,
        method: 'get'
    })
}

// 新增工单任务
export function addTask(data) {
    return request({
        url: '/system/task',
        method: 'post',
        data: data
    })
}

// 修改工单任务
export function updateTask(data) {
    return request({
        url: '/system/task',
        method: 'put',
        data: data
    })
}

// 删除工单任务
export function delTask(taskId) {
    return request({
        url: '/system/task/' + taskId,
        method: 'delete'
    })
}

// 派发工单任务
export function distributedTask(data) {
    return request({
        url: "/system/task/distributed",
        method: "post",
        data: data
    });
}

// 驳回工单任务
export function closeTask(data) {
    return request({
        url: "/system/task/close",
        method: "post",
        data: data
    });
}
// 处置工单任务
export function czTask(data) {
    return request({
        url: "/system/task/cz",
        method: "post",
        data: data
    });
}

// 跟踪工单任务
export function gzTask(data) {
    return request({
        url: "/system/task/gz",
        method: "post",
        data: data
    });
}

// 审核工单任务
export function hcTask(data) {
    return request({
        url: "/system/task/hc",
        method: "post",
        data: data
    });
}

// 到达现场
export function ddTask(data) {
    return request({
        url: "/system/tasklog",
        method: "post",
        data: data,
    });
}

export function ddcTask(data) {
    return request({
        url: "/system/tasklog",
        method: "put",
        data: data,
    });
}


export function tasklogs(data) {
  return request({
    url: "/system/tasklog/list",
    method: "get",
    params: data,
  });
}
