<!--#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端用户管理----用户查询-->
|