
// 入库单状态
export const orderInEnum = {
    creat: {
        value: 0,
        label: '待入库',
        color: 'info'
    },
    running: {
        value: 1,
        label: '正在入库',
        color: 'primary'
    },
    finish: {
        value: 2,
        label: '绑定成功',
        color: 'success'
    },
    error: {
        value: 9,
        label: '执行异常',
        color: 'danger'
    }
}

export function  formatterOrderInEnum(value) {
    switch (parseInt(value)){
        case orderInEnum.creat.value:
            return {label: orderInEnum.creat.label, type: orderInEnum.creat.color};
        case orderInEnum.running.value:
            return {label: orderInEnum.running.label, type: orderInEnum.running.color};
        case orderInEnum.finish.value:
            return {label: orderInEnum.finish.label, type: orderInEnum.finish.color};
        case orderInEnum.error.value:
            return {label: orderInEnum.error.label, type: orderInEnum.error.color};
        default:
            return {label: `未知类型：${value}`, type: 'danger'};
    }
}