import {ResultInfo} from "@/common/methods/request";

/**
 * 仓库出入库
 * 出入库类型 - 5:采购入库 6:销售出库 7:生产入库 8:生产出库
 */
export function InOutTypeName(type: number): string{
    let result = "--";
    switch (type){
        case 5:
            result = "采购入库"
            break;
        case 6:
            result = "销售出库"
            break;
        case 7:
            result = "生产入库"
            break;
        case 8:
            result = "生产出库"
            break;
    }
    return result
}

/**
 * 是否显示合同信息
 * @param type 出入库类型  生产类型没有和同 则不显示  销售和采购则需要显示
 */
export function isShowContractInfo(type: number): boolean{
    return (type === 5 || type === 6)
}

/**
 * 是否显示审核按钮
 * @param type
 */
export function isShowContractCheck(type: number): boolean{
    return (type === 1)
}

// 提示
export const inventorySign = new Map<number, ResultInfo>([
    [2, ['审核通过成功', '审核失败:']],
    [3, ['审核拒绝成功', '审核失败:']],
    [5, ['撤销成功', '撤销失败:']],
])