| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 | {extend name="common/common2" /}{block name="main"}<div class="row">    <div class="col-sm-12">        <div class="ibox float-e-margins">            <div class="ibox-content">                <form method="post" action="{:url('add')}" class="form-horizontal">                    <input type="hidden" name="id" value="{$info['id']|default='0'}">                    <div class="panel-body" style="min-height: 150px">                        <div class="form-group">                            <label class="col-sm-2 control-label">负责人<span style="color: red">*</span></label>                            <div class="col-sm-6">                                {:widget('common/select',['name'=>'user','lists'=>$userList,'value'=>isset($info)?$info.user:''])}                            </div>                        </div>                        <div class="form-group">                            <label class="col-sm-2 control-label">负责部门<span style="color: red">*</span></label>                            <div class="col-sm-6">                                {:widget('common/multiselect2',['name'=>'dep','lists'=>$depList,'val'=>isset($info)?$info.dep:[]])}                            </div>                        </div>                    </div>                    <div class="hr-line-dashed"></div>                    <div class="form-group" style="margin: 0 auto">                        <div class="col-sm-6 col-sm-offset-2">                            <button class="btn btn-primary ajax-post" data-layer_c="1" target-form="form-horizontal" type="submit">确 定</button>                            <button  class="btn cancel-btn btn-default" type="button">取 消</button>                        </div>                    </div>                </form>            </div>        </div>    </div></div>{/block}{block name="script"}<script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script><script>    $(document).ready(function(){    });    laydate.render({        elem: '#date',        type:'date',        trigger: 'click' ,        theme: '#337ab7',    });    function checkAll() {        var checkbox=document.getElementById('allInput');//获取div        var checked=checkbox.getElementsByTagName('input');//获取div下的input        var allCheck=document.getElementById('all');//获取div        var allChecked=allCheck.getElementsByTagName('input');//获取div下的input        for(i=0;i<checked.length;i++){            if(checked[i].className=='check'){                checked[i].checked = allChecked[0].checked;            }        }    }    $(function () {        var checkbox=document.getElementById('allInput');//获取div        var checked=checkbox.getElementsByTagName('input');//获取div下的input        $(document).on('click','.check',function () {            var all = false;            var count = 0;            for(i=0;i<checked.length;i++){                if(checked[i].className=='check'){                    if(checked[i].checked){                        all = true;                        count++;                    }                }            }            var allCheck=document.getElementById('all');//获取div            var allChecked=allCheck.getElementsByTagName('input');//获取div下的input            if(!all){                for(i=0;i<allChecked.length;i++){                    allChecked[i].checked = false;                }            }            if(all && parseInt(count)*2===checked.length){                for(i=0;i<allChecked.length;i++){                    allChecked[i].checked = true;                }            }            if(all && parseInt(count)*2!==checked.length){                for(i=0;i<allChecked.length;i++){                    allChecked[i].checked = false;                }            }        })    })</script>{/block}
 |