import { getUserId } from '@/services/bus/account';
import { commonSearch_go } from '@/services/go';
import { Ermcp3AreaStockApply, QueryAreaStockApplyReq } from '@/services/go/ermcp/inventory-review/interface';
import {getUserAccountType} from "@/services/bus/user";

/** ================================= 管理 - 库存审核 ================================**/
/**
 * 查询库存申请(出入库记录|库存审核)  /Ermcp3/QueryAreaStockApply  (这个审核和库存管理 - 申请记录) 调用的是同一个接口
 * @param QueryAreaStockApplyReq
 * @constructor
 */
export function QueryAreaStockApply(req: QueryAreaStockApplyReq): Promise<Ermcp3AreaStockApply[]> {
    const param = {
        userid: getUserId(),
        usertype: getUserAccountType()
    }
    Object.assign(param, req)
    return commonSearch_go('/Ermcp3/QueryAreaStockApply', param).catch((err) => {
        throw new Error(`查询库存申请: ${err}`);
    });
}
