/**
 *
 * @author BOGON
 * @version 1.0
 */

var page = {
    save: function (callback) {
        if (!$('#detail').form("validate")) {
            return;
        }
        let postData = $("#detail").serializeJson();
        let load = topWin.layer.load(0);
        $.ajax({
            url: g.ctx + "pc/sys/printTemp/rest/saveOrUpdate",
            contentType: "application/json",
            data: JSON.stringify(postData),
            type: "POST",
            complete: function () {
                topWin.layer.close(load);
            },
            success: function (data) {
                topWin.layer.msg('保存成功', {icon: 1});
                topWin.layer.close(load);
                callback()
            },
            error: function (data) {
                topWin.layer.alert(data.responseJSON.message, {icon: 2});
            }
        });
    }
}
$(function () {
})