//退款单辅助程序
var RefundOrderHelper = (function () {
    var f = {
        getCloseStateName: function (jRefundOrder) {
            var state = jRefundOrder.close_state;
            if(state == "notyet") {
                return "待审批";
            }
            if(state == "refunding") {
                return "退款中";
            }
            if(state == "completed") {
                return "已完成";
            }
            if(state == "closed") {
                return "已取消";
            }
            return "";
        },
        addProcessLog: function (jRefundOrder, userId, userName, memo) {
            var process_memos = jRefundOrder.process_memos;
            if (!process_memos) {
                process_memos = [];
                jRefundOrder.process_memos = process_memos;
            }
            process_memos.push({
                time: new Date().getTime(),
                userId: userId,
                userName: userName,
                memo: memo
            });
        }
    }
    return f;
})();

