提交 e3b8052a authored 作者: chengye's avatar chengye

添加抄表单删除功能

上级 9d106335
......@@ -86,7 +86,7 @@
</script>
<script type="text/html" id="barDemo">
{{# if(d.status == 1){ }}
<a title="删除" class="layui-btn layui-btn-sm layui-btn-danger layui-btn-disabled" href="/useage/del/{{d.id}}">删除</a>
<a title="删除" class="layui-btn layui-btn-sm layui-btn-danger layui-btn-disabled" lay-event="del">删除</a>
{{# } }}
</script>
<script>
......@@ -103,27 +103,32 @@
elem:'#date_start',
trigger:'click',
})
});
function del(obj,id){
layer.confirm('确认要删除吗?',function(index){
$.ajax({
url: '/useage/del',
method: "POST",
data: {id:id},
dataType: "json",
success: function (data) {
if(data.status == 1){
layer.msg(data.message,{icon:1,time:1000});
location.reload()
} else {
layer.alert(data.message, {
icon: 5
});
}
}
});
table.on('tool(idTest)', function(obj){
var data = obj.data;
if(obj.event === 'del') {
layer.confirm('确认要删除吗?',function(index){
$.ajax({
url: '/useage/del',
method: "POST",
data: {uid:data.useage_id},
dataType: "json",
success: function (data) {
if(data.status == 1){
layer.msg(data.message,{icon: 6,time: 2000},function(){
obj.del();
layer.close(index);
location.reload()
})
} else {
layer.msg(data.message,{icon: 5,time: 1000 })
}
}
});
});
}
});
}
});
</script>
{/block}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论