12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- {extend name="common/common2" /}
- {block name="main"}
- <link rel="stylesheet" href="/static/bootstrap-multiselect-0.9.15/dist/css/bootstrap-multiselect.css">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <form method="post" action="{:url('refund')}" class="form-horizontal">
- <input type="hidden" name="id" value="{$id|default='0'}">
- <div class="col-sm-12">
- <div class="form-group">
- <label class="control-label">选择日期<span class="text-danger">*</span></label></br>
- {:widget_view('common/multiselect',['name'=>'days','lists' => $days, 'val' => []])}
- </div>
- </div>
- <div class="col-sm-12">
- <div class="form-group">
- <label class="control-label">退餐备注</label></br>
- <textarea name="remark" class="form-control" cols="30" rows="3" ></textarea>
- </div>
- </div>
- <div class="col-sm-12">
- <div class="hr-line-dashed">
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-6 col-sm-offset-2">
- <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script src="/static/bootstrap-multiselect-0.9.15/dist/js/bootstrap-multiselect.js"></script>
- <script>
- $(function () {
- $('#types').multiselect({
- buttonText: function(options, select) {
- if (options.length === 0) {
- return '请选择';
- }
- else if (options.length > 2) {
- return '已选择'+options.length+'项';
- }
- else {
- var labels = [];
- options.each(function() {
- if ($(this).attr('label') !== undefined) {
- labels.push($(this).attr('label'));
- }
- else {
- labels.push($(this).html());
- }
- });
- return labels.join(', ') + '';
- }
- },
- filterPlaceholder: '搜索',
- includeSelectAllOption: true, // 显示全选
- selectAllText: '全选',
- maxHeight: 300,
- // enableClickableOptGroups: true, // 分组可选
- // enableCollapsibleOptGroups: true, // 分组可折叠
- enableFiltering: true, // 开启搜索
- buttonClass: 'btn btn-primary',
- onChange: function(option, checked) {
- console.log(option.length + ' options ' + (checked ? 'selected' : 'deselected'));
- }
- });
- })
- </script>
- {/block}
|