| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- {extend name="layout/content" /}
- {block name="header"}
- <title>编辑冻结</title>
- <link href="__STATIC__/lib/layui_formSelect/formSelects-v4.css" rel="stylesheet" type="text/css">
- <link rel="stylesheet" href="__STATIC__/css/FuzzySearch.css?v={$Think.STATIC_VERSION}">
- <style>
- .layui-form-label {
- width: 180px;
- }
- .select2 + .layui-form-select {
- display: none;
- }
- img#local_preview {
- width: 100px;
- height: 100px;
- }
- .xm-select-parent .xm-form-select dl {
- z-index: 999999;
- }
- .layui-form-item .layui-input-inline {
- width: 210px;
- }
- .layui-form-select dl {
- z-index: 8999999;
- }
- </style>
- {/block}
- {block name="content"}
- <div class="x-body">
- <form class="layui-form" action="{:url('save')}" method="post" id= "myForm"
- enctype="multipart/form-data">
- <div class="layui-form-item">
- <label class="layui-form-label"> <span class="x-red">*</span>游戏:</label>
- <div class="layui-input-inline">
- <select name="game_id" id="game_id" lay-search="true" required="" lay-verify="required">
- {volist name="game_list" id="vo"}
- <option value="{$vo.id}" {if condition="isset($data.game_id) && $data.game_id == $vo.id" }
- selected="selected" {/if} >{$vo.name}</option>
- {/volist}
- </select>
- <!-- <input type="hidden" name="game_id" id="unitInput" autocomplete="off" class="layui-input"-->
- <!-- placeholder="单位">-->
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label"> <span class="x-red">*</span>推广员:</label>
- <div class="layui-input-inline" style="width: 40%">
- <div id="school"></div>
- </div>
- </div>
- <div class="layui-form-item">
- <label for="" class="layui-form-label">操作:</label>
- <div class="layui-input-block">
- <button class="layui-btn" lay-submit type="button" onclick= "submitForm();" lay-filter="formDemo" id="J_submit_btn">提交</button>
- <button type="button" onClick="javascript:history.back(-1);" class="layui-btn layui-btn-primary">返回
- </button>
- </div>
- </div>
- </form>
- </div>
- {/block}
- {block name="footer"}
- <script type="text/javascript" charset="utf-8"
- <script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor/lang/zh-cn/zh-cn.js"></script>
- <script type="text/javascript" charset="utf-8" src="__STATIC__/lib/layui_formSelect/formSelects-v4.min.js"></script>
- <script type="text/javascript" charset="utf-8" src="__STATIC__/js/FuzzySearch.js?v={$Think.STATIC_VERSION}"></script>
- <script type="text/javascript" charset="utf-8" src="__STATIC__/lib/xm-select.js"></script>
- <script type="text/javascript">
- var tagData1 = {:json_encode($channel)}; // 获取到后台给出的数据-PHP写法
- var tagIns1 = xmSelect.render({
- el: '#school', // div的id值
- toolbar: { // 工具条【‘全选’,‘清空’】
- show: true, // 开启工具条
- showIcon: false, // 隐藏工具条的图标
- },
- autoRow: true,
- // tips: '选择校区', // 让默认值不是“请选择”,而是“选择校区”
- filterable: true, // 开启搜索模式,默认按照name进行搜索
- paging: true, // 启用分页
- pageSize: 10, // 每页的数据个数
- data: tagData1,
- prop: { // 也许你的数据库返回的并不是name和value, 也许你提交的时候不止name和value, 怎么办? 自定义就行
- name: 'name',
- value: 'id'
- },
- })
- function validate() {
- var school = tagIns1.getValue('value');
- if(school.length == 0){
- alert('请选择推广员')
- return false ;
- }
- if($('#game_id').val() == 0){
- alert('请选择游戏')
- return false ;
- }
- return true;
- }
- function submitForm() {
- if (validate()) {
- document.getElementById( "myForm" ).submit();
- }
- }
- </script>
- {/block}
|