import createAxios from '@/utils/request'

import { SUPERVISION_BOOT } from '@/utils/constantRequest'

const MAPPING_PATH = SUPERVISION_BOOT + '/deVReport'

/**
 * 提交技术监督计划表单数据
 */
export const addPlanFormData = (data: any) => {
    return createAxios({
        url: '/supervision-boot/superPlan/addPlan',
        method: 'POST',
        data: data
    })
}

//重新发起技术监督计划表单数据
export const updatePlanFormData = (data: any) => {
    return createAxios({
        url: '/supervision-boot/superPlan/update',
        method: 'POST',
        data: data
    })
}

//取消发起技术监督计划表单数据
export const cancelPlanFormData = (data: any) => {
    return createAxios({
        url: '/supervision-boot/superPlan/cancel',
        method: 'POST',
        data: data
    })
}


/**
 * 根据当前登陆用户的部门id查询人员
 */
export const getUserByDeptId = (data: any) => {
    return createAxios({
        url: '/user-boot/user/getUserListByDeptId',
        method: 'GET',
        params: data
    })
}

// 提交审核
export const planDetailsAudit = (obj: any) => {
    let form = new FormData()
    form.append('id', obj.id)
    return createAxios({
        url:'/supervision-boot/superPlan/initiateAudit',
        method: 'POST',
        data:form
    })
}

// 发起告警单
export const sendAlarm = (obj: any) => {
    return createAxios({
        url:'/supervision-boot/superPlan/initiateWarningLeaflet',
        method: 'GET',
        params:obj
    })
}

/**
 * 根据id获取监督计划详情
 */
export const getPlanDetailsById = (obj: any) => {
    let form = new FormData()
    form.append('id', obj.id)
    return createAxios({
        url:'/supervision-boot/superPlan/getDetail',
        method: 'POST',
        data:form
    })
}



/**
 * 提交技术监督计划实施问题表单数据
 */
export const addPlanProblemFormData = (data: any) => {
    return createAxios({
        url: '/supervision-boot/superProblem/addProblem',
        method: 'POST',
        data: data
    })
}
