178 lines
4.1 KiB
HTML
178 lines
4.1 KiB
HTML
{extend name="common/base"/}
|
|
<!-- 主体 -->
|
|
{block name="body"}
|
|
|
|
<div class="p-3">
|
|
<form class="layui-form gg-form-bar border-t border-x">
|
|
<div class="layui-input-inline" style="width:300px;">
|
|
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
|
|
</div>
|
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
|
|
</form>
|
|
<table class="layui-hide" id="supply_team" lay-filter="supply_team"></table>
|
|
</div>
|
|
|
|
<script type="text/html" id="toolbarDemo">
|
|
<div class="layui-btn-container">
|
|
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加供应链分组">+ 添加供应链分组</span>
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/html" id="barDemo">
|
|
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
|
|
</script>
|
|
|
|
{/block}
|
|
<!-- /主体 -->
|
|
|
|
<!-- 脚本 -->
|
|
{block name="script"}
|
|
<script>
|
|
const moduleInit = ['tool'];
|
|
function gouguInit() {
|
|
var table = layui.table,tool = layui.tool, form = layui.form;
|
|
layui.pageTable = table.render({
|
|
elem: '#supply_team',
|
|
title: '供应链分组',
|
|
toolbar: '#toolbarDemo',
|
|
url: '/admin/supply_team/datalist',
|
|
page: true,
|
|
limit: 20,
|
|
cellMinWidth: 300,
|
|
cols: [
|
|
[
|
|
{
|
|
fixed: 'left',
|
|
field: 'id',
|
|
title: '编号',
|
|
align: 'center',
|
|
width: 80
|
|
},{
|
|
field: 'name',
|
|
title: '分组名称',
|
|
align: 'center',
|
|
width: 100
|
|
},{
|
|
field: 'supply_level_id',
|
|
title: '分佣等级',
|
|
align: 'center',
|
|
width: 300,
|
|
templet: function (d)
|
|
{
|
|
return d.level.name + ',分佣比例:' + d.level.rate + '%';
|
|
}
|
|
},{
|
|
field: 'user',
|
|
title: '后台负责人',
|
|
align: 'center',
|
|
// width: 100,
|
|
templet: function (d)
|
|
{
|
|
return d.userMsg.name + ',手机号:' + d.user.phone;
|
|
}
|
|
},{
|
|
field: 'auth_range',
|
|
title: '权限',
|
|
align: 'center',
|
|
width: 100
|
|
},{
|
|
field: 'parent_code',
|
|
title: '市/区县/镇/村',
|
|
align: 'center',
|
|
width: 100
|
|
},{
|
|
field: 'address',
|
|
title: '市/区县/镇/村',
|
|
align: 'center',
|
|
width: 100
|
|
},{
|
|
field: 'brokerage',
|
|
title: '分佣金额',
|
|
align: 'center',
|
|
width: 100
|
|
},{
|
|
field: 'free_brokerage',
|
|
title: '冻结金额',
|
|
align: 'center',
|
|
width: 100
|
|
},{
|
|
field: 'withdraw_brokerage',
|
|
title: '已提现金额',
|
|
align: 'center',
|
|
width: 100
|
|
|
|
},{
|
|
|
|
field: 'lng',
|
|
title: '经度',
|
|
align: 'center',
|
|
width: 100
|
|
},{
|
|
field: 'lat',
|
|
title: '维度',
|
|
align: 'center',
|
|
width: 100
|
|
},
|
|
{
|
|
fixed: 'right',
|
|
field: 'right',
|
|
title: '操作',
|
|
toolbar: '#barDemo',
|
|
width: 136,
|
|
align: 'center'
|
|
}
|
|
]
|
|
]
|
|
});
|
|
|
|
//监听表头工具栏事件
|
|
table.on('toolbar(supply_team)', function(obj){
|
|
if (obj.event === 'add') {
|
|
tool.side("/admin/supply_team/add");
|
|
return false;
|
|
}
|
|
});
|
|
|
|
//监听表格行工具事件
|
|
table.on('tool(supply_team)', function(obj) {
|
|
var data = obj.data;
|
|
if (obj.event === 'read') {
|
|
tool.side('/admin/supply_team/read?id='+obj.data.id);
|
|
}
|
|
else if (obj.event === 'edit') {
|
|
tool.side('/admin/supply_team/edit?id='+obj.data.id);
|
|
}
|
|
else if (obj.event === 'del') {
|
|
layer.confirm('确定要删除该记录吗?', {
|
|
icon: 3,
|
|
title: '提示'
|
|
}, function(index) {
|
|
let callback = function (e) {
|
|
layer.msg(e.msg);
|
|
if (e.code == 0) {
|
|
obj.del();
|
|
}
|
|
}
|
|
tool.delete("/admin/supply_team/del", { id: data.id }, callback);
|
|
layer.close(index);
|
|
});
|
|
}
|
|
return false;
|
|
});
|
|
|
|
//监听搜索提交
|
|
form.on('submit(searchform)', function(data) {
|
|
layui.pageTable.reload({
|
|
where: {
|
|
keywords: data.field.keywords
|
|
},
|
|
page: {
|
|
curr: 1
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
}
|
|
</script>
|
|
{/block}
|
|
<!-- /脚本 --> |