import request from "@/utils/request";
import settings from "@/settings";
import { message } from "ant-design-vue";
import { Header } from "ant-design-vue/lib/layout/layout";

const systemPrefix = settings.systemPrefix;
// 查询机构层级列表
export function queryDepartLevelDefData(param) {
    return request(`${systemPrefix}/im/dhc/sys/automake/system/department/param/departlevelListController.do`, {
        method: 'post',
        data: param,
        requestType: 'form'
    });
}

export function getDepartLevelInfoList(param) {
    return request(`${systemPrefix}/automake/controller/system/department/param/QueryDepartLevelInfoController.do`, {
        method: 'post',
        data: param,
        requestType: 'form',
        headers: {
            "X-Requested-With": "XMLHttpRequest"
        }
    });
}

export function queryDepartLevelInfoData(param) {
    return request(`${systemPrefix}/automake/controller/system/department/param/QueryDepartLevelInfoController.do`, {
        method: 'post',
        data: param,
        requestType: 'form',
        headers: {
            "X-Requested-With": "XMLHttpRequest"
        }
    });
}

export function validateRecord(param) {
    return request(`${systemPrefix}/financemanage/validateRecord.do`, {
        method: 'post',
        data: param,
        requestType: 'form',
        headers: {
            "X-Requested-With": "XMLHttpRequest"
        }
    });
}

export function insertDepartLevelInfoData(param) {
    return request(`${systemPrefix}/im/dhc/sys/automake/system/department/param/departlevelInsertController.do`, {
        method: 'post',
        data: param,
        requestType: 'form',
        headers: { "X-Requested-With": "XMLHttpRequest" }
    });
}

export function updateDepartLevelInfoData(param) {
    return request(`${systemPrefix}/automake/controller/system/department/param/departlevelModifyController.do`, {
        method: 'post',
        data: param,
        requestType: 'form',
        headers: { "X-Requested-With": "XMLHttpRequest" }
    });
}

export function changeUseYn(param) {
    return request(`${systemPrefix}/im/dhc/sys/automake/system/department/param/departlevelListChangeStsController.do`, {
        method: 'post',
        data: param,
        requestType: 'form',
        headers: { "X-Requested-With": "XMLHttpRequest" }
    });
}


export function getTabKeyRule(param) {
    return request(`${systemPrefix}/system/select/options/getTabKeyRule.do`, {
        method: 'post',
        data: param,
        requestType: 'form'
    });
}

export function searchCurrency(param) {
    return request(`${systemPrefix}/system/select/options/getTabKeyRule.do`, {
        method: 'post',
        data: param,
        requestType: 'form'
    });
}
export function getRelationInfoNoOptions(params) {
    return request(`${systemPrefix}/system/select/options/relationInfoNo.do`, {
        method: 'post',
        data: params,
        requestType: 'form',
    })
}

export function reportTreeDataController(params) {
    return request(`${systemPrefix}/im/dhc/sys/automake/system/department/ReportTreeDataController.do`, {
        method: 'post',
        data: params,
        requestType: 'form',

    })
}

export function searchTreePanelDataByNodeI(params) {
    return request(`${systemPrefix}/system/common/action/searchTreePanelDataByNodeId`, {
        method: 'post',
        data: params,
        requestType: 'form',
    })
}

export function searchReport(params) {
    return request(`${systemPrefix}/im/dhc/zz/automake/zzmanage/reporformula_manager/ReadyReportDataController.do`, {
        method: 'post',
        data: params,
        requestType: 'form',
    })
}

export function searchReportResult(params) {
    return request(`${systemPrefix}/report/query/zz/ywzkb`, {
        method: 'post',
        data: params,
        headers: { "X-Requested-With": "XMLHttpRequest" }
        // headers: {
        //     'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
        //     'Content-Type': 'application/x-www-form-urlencoded',
        //     'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2'
        // }
    })

}
