Helius
2021-06-16 5728be2af515b2200e782aa201ca5d4d67d9ea47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!--#layout("/common/layout.html",{"jsBase":"/js/admin/setting/itemSetting/"}){ -->
 
<div>
    <div class="layui-form-item" style="margin-top: 20px">
        <button type="button" id="add" class="layui-btn layui-btn-primary">添加</button>
    </div>
</div>
<table id="itemTable" lay-filter="itemTable"></table>
<!--#} -->
<script>
    var index;
    layui.use(['index'], function(){
        index = layui.index
        index.init({'delFlag':0});
    });
 
    // 删除
    var delCuserById = function(id, e){
        layer.confirm('确认要删除吗?', {
            btn : [ '确定', '取消' ]//按钮
        }, function(index) {
            layer.close(index);
 
            $.post(Common.ctxPath+'/admin/setting/item/delItem.json', {'id':id}, function (data) {
                if(data == 0){
                    Common.info('该分类下面有物品,无法删除');
                }else {
                    Common.info('删除成功');
                    $("tr[data-index='" + e + "']").remove();
                }
            });
        });
    };
 
    // 查询子类
    var queryChild = function (id) {
        layer.open({
            type: 2,
            area: ['700px', '450px'],
            fixed: false, //不固定
            maxmin: true,
            content: Common.ctxPath+'/admin/setting/item/child.do?&parentId='+id
        });
    }
    $("#add").click(function () {
        layer.open({
            type: 2,
            area: ['800px', '650px'],
            fixed: false, //不固定
            maxmin: true,
            content: Common.ctxPath+'/admin/setting/item/add.do',
            end: function () {//无论是确认还是取消,只要层被销毁了,end都会执行,不携带任何参数。layer.open关闭事件
                location.reload();  //layer.open关闭刷新
            }
        });
    })
</script>
<!--C端用户管理----用户查询-->