@extends('admin/layout') <style> .alert { /*margin-bottom: 5px !important;*/ } </style> @section('content') <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-content"> <form class="form-horizontal"> <div class="form-group"> <label class="col-sm-2 control-label"> {{--检查项--}} {{--<br/>--}} {{--<small class="text-navy">自定义样式</small>--}} </label> <div class="col-sm-6"> <div class="checkbox i-checks"> <label> <input type="checkbox" title="" id="toggle"> <span style="font-weight: bold">全选/反选[只能全选反选拥有权限的选项]</span></label> </div> @php $checkItemScopes=$siteProcess->process->check_item_scopes??[]; $checkItems = $siteProcess->check_items??[]; @endphp @foreach($checkItemScopes as $item) {{--检测每个检查项的权限--}} @php $for=\App\Libs\Helps::hasCheckItemsFor($item['for']??[]) @endphp <div class="checkbox i-checks"> <label> <input type="checkbox" value="{{$item['inx']}}" title="" @if(!$for) disabled @endif @if(in_array($item['inx'],$checkItems)) checked @endif name="checkItems"> <i></i>{{$item['inx']}}. {{$item['val']}} @if(!$for) <span class="red">[无权限]</span> @endif</label> @if(!empty($item['remark'])) <div class="alert alert-info" style="margin-left: 19px"> {!! $item['remark']??'' !!} </div> @endif </div> @endforeach </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-8"> @if($siteProcess->active==2) <button class="btn btn-sm btn-primary" type="button" onclick="units.save()">提交 </button> @endif <button class="btn btn-sm btn-white closeLayer" type="button">取消</button> </div> </div> </form> </div> </div> </div> </div> </div> </body> @endsection @section('footer') <script src="{{asset('js/plugins/iCheck/icheck.min.js')}}"></script> <script> $(function () { $(".i-checks").iCheck({ checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green" }); }); var units = { save: function () { var checkItems = []; $("[name=checkItems]:checked").each(function () { checkItems.push($(this).val()); }); if (checkItems.length < 1) { layer.alert('请选择检查项再进行提交', {icon: 5}); return; } var config = { url: '/admin/process/check-item/' + "{{$siteProcess->id}}", type: 'post', data: {checkItems: checkItems} }; config.success = function (result) { layer.msg(result.message, {icon: 6, time: 1500}, function () { parent.window.location.reload(); tips.closeParentLayer(); }); }; tips.ajax(config); } }; $("#toggle").on('ifChecked', function (event) { $("[name=checkItems]:not(:disabled)").iCheck('check'); }).on('ifUnchecked', function () { $("[name=checkItems]:not(:disabled)").iCheck('uncheck'); }); </script> @endsection