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

// 查询维保项目部门关系列表
export function listMaintenanceProjectDept(query) {
    return request({
        url: '/tongzhou/maintenanceProjectDept/maintenanceProjectDept/list',
        method: 'get',
        params: query
    })
}

// 查询维保项目部门关系详细
export function getMaintenanceProjectDept(maintenanceProjectDeptId) {
    return request({
        url: '/tongzhou/maintenanceProjectDept/maintenanceProjectDept/' + maintenanceProjectDeptId,
        method: 'get'
    })
}

// 新增维保项目部门关系
export function addMaintenanceProjectDept(data) {
    return request({
        url: '/tongzhou/maintenanceProjectDept/maintenanceProjectDept',
        method: 'post',
        data: data
    })
}

// 修改维保项目部门关系
export function updateMaintenanceProjectDept(data) {
    return request({
        url: '/tongzhou/maintenanceProjectDept/maintenanceProjectDept',
        method: 'put',
        data: data
    })
}

// 删除维保项目部门关系
export function delMaintenanceProjectDept(maintenanceProjectDeptId) {
    return request({
        url: '/tongzhou/maintenanceProjectDept/maintenanceProjectDept/' + maintenanceProjectDeptId,
        method: 'delete'
    })
}

// 导出维保项目部门关系
export function downloadMaintenanceProjectDept(data) {
    download(
        '/tongzhou/maintenanceProjectDept/maintenanceProjectDept/export',
        data,
        `maintenanceProjectDept_${new Date().getTime()}.xlsx`)
}


export function updateMaintenanceProjectDepType(data) {
    return request({
        url: '/tongzhou/maintenanceProjectDept/maintenanceProjectDept/updateMaintenanceProjectDept',
        method: 'post',
        data: data
    })
}