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

/**
 * 计划类型 - 1:采购 -1:销售
 * @param contracttype 返回计划类型
 */
export function getPlanContractType(contracttype: number): string{
    let result = "--";
    switch (contracttype) {
        case 1:
            result = "采购";
            break
        case -1:
            result = "销售";
            break
    }
    return result
}

/**
 * 获取计划状态名称
 * @param hedgeplanstatus //0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
 */
export function getPlanStatusName(hedgeplanstatus: number): string{
    let result = "--";
    switch (hedgeplanstatus) {
        case 0:
            result = "未提交";
            break
        case 1:
            result = "待审核";
            break
        case 2:
            result = "执行中";
            break
        case 3:
            result = "正常完结";
            break
        case 4:
            result = "审核拒绝";
            break
        case 5:
            result = "异常完结";
            break
        case 6:
            result = "已撤回";
            break
    }
    return result
}

/************** 接口相关提示 **************** /
 *
 */
// 操作类型-1:保存草稿2:提交申请3:删除4审核通过5审核拒绝
export const hedgePlanSign = new Map<number, ResultInfo>([
    [1, ['保存草稿成功', '保存草稿失败:']],
    [2, ['提交申请成功', '提交申请失败:']],
    [3, ['删除成功', '删除失败:']],
    [4, ['审核通过', '审核失败:']],
    [5, ['审核拒绝成功', '审核拒绝失败:']],

])

export const deletePlanSign = new Map<number, ResultInfo>([
    [5, ['撤销成功', '撤销失败:']],
])
