import axios from '@/common/services/axios-instance'

class AuditProjectService {

    // 项目启动前校验是否有变更申请单
    checkBeforeStartProject(id) {
        return axios({
            url: `api/xcoa-mobile/v1/iamauditproject/checkBeforeStartProject?id=` + id,
        })
    }

    // 分配项目组长配置
    assignTeamLeader(id, codes, names) {
        return axios({
            url: encodeURI(`api/xcoa-mobile/v1/iamauditproject/assignTeamLeader?id=` + id + `&codes=` + codes + '&names=' + names),
        })
    }

    // 设定查阅范围
    assignReadAuthority(id, codes, names) {
        return axios({
            url: encodeURI(`api/xcoa-mobile/v1/iamauditproject/assignReadAuthority?id=` + id + `&codes=` + codes + '&names=' + names),
        })
    }

    // 关闭项目前的校验
    checkBeforeCloseProject(id) {
        return axios({
            url: `api/xcoa-mobile/v1/iamauditproject/checkBeforeCloseProject?id=` + id,
        })
    }

    // 项目归档操作
    projectArchive(id) {
        return axios({
            url: `api/xcoa-mobile/v1/iamauditproject/projectArchive?id=` + id,
        })
    }

    // 校验权限
    checkPermission() {
        return axios({
            url: `api/xcoa-mobile/v1/iamauditproject/checkHierarchicalPermission`,
        })
    }
}

export default new AuditProjectService()
