@extends('vip.layouts') @section('content')
{{----}} @if(checkRriv('/admin/Notice/addNotice')) @endif @if(checkRriv('/admin/Notice/delete')) @endif
@push('dataTableJS') // var active = { // reload: function(){ // //执行重载 // table.reload('{{ $dataId }}', { // page: { // curr: 1 //重新从第 1 页开始 // } // ,where: { /// title:$("#title").val(), // type:$('#type').val(), // add_startime:$('#add_startime').val(), // add_endtime:$('#add_endtime').val(), // } // }); // } // }; // $('.lay-btn-diy').on('click', function(){ // var type = $(this).data('type'); // active[type] ? active[type].call(this) : ''; // }); $('#sub').on('click', function(){ var title = $('#title').val(); var type = $('#type').val(); $('#layui-form').submit(); return ; if((title == '' || title == null) && (type == '' || type == null) ) { layer.msg('手动搜索时,类型不能为空!', {icon: 6}); // layer.tips('手动搜索时,类型不能为空!','#type',{ // tips: 4 // }); } else { $('#layui-form').submit(); } }); //重置表单 $('.reset').on('click',function(){ $('input').val(''); $('#type').val(''); // var type = $(this).data('type'); // active[type] ? active[type].call(this) : ''; }); //刷新表单 // $('.set').on('click',function(){ // var type = $(this).data('type'); // active[type] ? active[type].call(this) : ''; // }); form.on('switch(openStatus)', function(obj){ var status = 0; if(obj.elem.checked==true){ status =1; } setcolumn('/admin/Notice/activeClose',this.name,status,this.value,obj); console.log(obj); //layer.tips(msg, obj.othis); }); function setcolumn(url,column,value,id,obj){ $.ajax({ url: url+'?'+column+'='+value+'&id='+id, dataType: 'json', type: 'get', success:function(data){ layer.msg(data.msg); if(data.status!=1){ if(value==1){ obj.othis[0].setAttribute("class", "layui-unselect layui-form-switch"); obj.othis[0].innerHTML='开启'; }else{ obj.othis[0].setAttribute("class",'layui-unselect layui-form-switch layui-form-onswitch'); obj.othis[0].innerHTML='禁用'; } } }, error:function(){ } }); } @endpush @include('vip.datatable')
@endsection