import requestCode from "@/utils/requestCode"
import requestOld from "@/utils/requestOld"

// 获取日常巡检表列表
export async function handleGetPATROLList(params: any) {
    const data = await requestOld(`/Examine/GetPATROLList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}


// 获得区域列表
export async function handleGetSERVERPARTTYPEList(params: any) {
    const data = await requestOld(`/BasicConfig/GetSERVERPARTTYPEList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}

// 同步日常巡检
export async function handleSynchroPATROL(params: any) {
    const data = await requestOld(`/Examine/SynchroPATROL`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data
}

// 获取服务区信息
export async function handleGetServerpartTree(params: any) {
    const data = await requestOld(`/BaseInfo/GetServerpartTree`, {
        method: 'GET',
        params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}

// 同步巡检整改通知表
export async function handleSynchroRECTIFICATION(params: any) {
    const data = await requestOld(`/Examine/SynchroRECTIFICATION`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data
}

// 获取巡检整改通知表列表
export async function handleGetRECTIFICATIONList(params: any) {
    const data = await requestOld(`/Examine/GetRECTIFICATIONList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}

// 获取服务区方位的方法
export async function handleGetSERVERPARTDetail(params: any) {
    const data = await requestOld(`/BaseInfo/GetSERVERPARTDetail`, {
        method: 'GET',
        params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data
}

//  获取巡查安全问题列表
export async function handlGetPatrolSecurityList(params: any) {
    const data = await requestOld(`/Examine/GetPatrolSecurityList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}


// 拿到当前服务区的 分类定级
export async function handlGetSPCONTRIBUTIONList(params: any) {
    const data = await requestOld(`/Analysis/GetSPCONTRIBUTIONList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}


// 租金测算的同步接口
export async function handlSynchroRENTCALCULATION(params: any) {
    const data = await requestOld(`/Analysis/SynchroRENTCALCULATION`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data
}


// 租金测算的列表接口
export async function handlGetRENTCALCULATIONList(params: any) {
    const data = await requestOld(`/Analysis/GetRENTCALCULATIONList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}


// 拿到服务区合同列表
export async function handlGetREGISTERCOMPACTList(params: any) {
    const data = await requestOld(`/Compact/GetREGISTERCOMPACTList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}

// 根据合同获取提成比例列表 的列表
export async function handlGetPERCENTAGEOFCOMMISSIONList(params: any) {
    const data = await requestOld(`/Compact/GetPERCENTAGEOFCOMMISSIONList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}

// 获取营收和车流的 用来租金测算的基础数据
export async function handlGetMonthAnalysis(params: any) {
    const data = await requestCode(`/BigData/GetMonthAnalysis`, {
        method: 'GET',
        params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}

// 租金测算的列表接口
export async function handlGetDeleteRENTCALCULATION(params: any) {
    const data = await requestOld(`/Analysis/DeleteRENTCALCULATION`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data
}


// 删除巡检记录
export async function handlDeletePATROL(params: any) {
    const data = await requestOld(`/Examine/DeletePATROL`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data
}


// 获取巡检整改通知表明细
export async function handlGetRECTIFICATIONDetail(params: any) {
    const data = await requestOld(`/Examine/GetRECTIFICATIONDetail`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data
}
