(function(){
    X.pageLogic['datacheck_preser'] = {
        init : function(parms){
            var me = this;
            this.parms = parms;
            this.callback = parms.callback;
            var check = parms.data;
            if(check.modeltitle){
                $('.datacheck_preser-save-title').val(check.modeltitle);
            }
            $(document).off('click','.datacheck_preser-but-qd').on('click','.datacheck_preser-but-qd',function(){
                if($('.datacheck_preser-save-title').val() == ""){
                    layer.msg('名称不能为空');
                    return;
                }
                var data = {
                    check:check,
                    title: $('.datacheck_preser-save-title').val()
                }
                
                X.api('check_data/save','post',data,function(d){
                    if(d == true){
                        layer.closeAll();
                        layer.msg('保存成功');
                    }
                })
            });

            $(document).off('click','.datacheck_preser-but-qx').on('click','.datacheck_preser-but-qx',function(){
                layer.closeAll();
            });
        }
    };
})();