/** ================================= 管理 - 财务审核 ================================**/
import { getUserId } from '@/services/bus/account';
import { commonSearch_go } from "@/services/go";
import {
    QryBussinessFpRsp,
    QryBussinessKxRsp,
    QueryBusinessFpReq,
    QueryBusinessKxReq
} from "@/services/go/ermcp/finance-review/interface";
import {getUserAccountType} from "@/services/bus/user";

/**
 * 查询财务管理(款项)(对应菜单:财务管理/款项) /Ermcp/QueryBusinessKx
 * @param req.QueryBusinessKxReq  // 用户ID (必填)
 * @constructor
 */
export function QueryBusinessKx(req: QueryBusinessKxReq): Promise<QryBussinessKxRsp[]> {
    const param = {
        UserId: getUserId(),
        usertype: getUserAccountType()
    }
    Object.assign(param, req)
    return commonSearch_go('/Ermcp/QueryBusinessKx', param).catch((err) => {
        throw new Error(`财务管理-款项: ${err}`);
    });
}

/**
 * 查询财务管理(发票)(对应菜单:财务管理/发票) /Ermcp/QueryBusinessFp
 * @param req.UserId  // 用户ID (必填)
 * @constructor
 */
export function QueryBusinessFp(req: QueryBusinessFpReq): Promise<QryBussinessFpRsp[]> {
    const param = {
        UserId: getUserId(),
        usertype: getUserAccountType()
    }
    Object.assign(param, req)
    return commonSearch_go('/Ermcp/QueryBusinessFp', param).catch((err) => {
        throw new Error(`财务管理-发票: ${err}`);
    });
}