This commit is contained in:
2025-03-25 14:15:42 +08:00
parent 7dffc94035
commit da612380e0
845 changed files with 5330 additions and 5153 deletions

View File

@@ -1,6 +1,6 @@
{{template "header"}}
{{template "header" .}}
<div class="layui-row layui-col-space15">
<!-- <div class="layui-row layui-col-space15">
<div class="layui-collapse">
<div class="layui-colla-item">
<div class="layui-colla-title">查询</div>
@@ -82,32 +82,29 @@
</div>
</div>
</div>
</div>
</div> -->
<!-- 工具栏 -->
<script id="toolbar" type="text/html">
{{ genBtn .AuthorizeMenus "add"}}
</script>
<div class="layui-card" style="margin-top: 15px;">
<div class="layui-card-body">
<table id="tablelist" lay-filter="tablelist"></table>
</div>
<div class="layui-panel">
<table id="tablelist" lay-filter="tablelist"></table>
</div>
<script type="text/html" id="actionBox">
{{ genLink .AuthorizeMenus "edit" "chapterlist"}}
{{ genLink .AuthorizeMenus "edit"}}
</script>
{{define "js"}}
<script>
layui.use(['table', 'form', 'jquery', 'laydate', 'dtree', 'util'], function () {
layui.use(['table', 'form', 'jquery', 'laydate', 'util'], function () {
let table = layui.table;
let form = layui.form;
let $ = layui.jquery;
let util = layui.util;
let laydate = layui.laydate;
let dtree = layui.dtree;
/**开始时间 */
laydate.render({
@@ -133,101 +130,96 @@
}
});
loadList();
toolbar();
tableActionTool();
search();
// 加载列表
function loadList() {
table.render({
elem: '#tablelist',
url: "/income/list",
method: "POST",
headers: { 'X-CSRF-Token': $('#csrf_token').val() },
where: getQueryParams(),
height: 'full',
page: true,
cols: [[
{ field: 'id', title: '回款编号', align: 'left', fixed: 'left', width: 100 },
{ field: 'project_name', title: '关联项目', align: 'left', width: 200 },
{ field: 'project_id', title: '项目编号', align: 'left', width: 200 },
{ field: 'budget_name', title: '关联预算', align: 'left', width: 200 },
{ field: 'budget_id', title: '预算编号', align: 'left', width: 200 },
{ field: 'income_type_name', title: '回款类别', align: 'left', width: 100 },
{ field: 'income_at', title: '回款时间', align: 'left', width: 160, templet: function (d) { return !d.income_at ? '' : util.toDateString(d.income_at) } },
{ field: 'amount', title: '回款金额', align: 'left', width: 120 },
{
field: 'status', title: '状态', align: 'center', width: 90, templet: function (row) {
switch (row.status) {
case 0: return '<span style="color:green;">正常</span>';
case -1: return '<span style="color:red;">删除</span>';
default: return '其它';
}
return '';
table.render({
elem: '#tablelist',
url: "/income/list",
method: "POST",
headers: { 'X-CSRF-Token': $('#csrf_token').val() },
where: getQueryParams(),
// height: 'full-100',
height: function () {
return $(window).height() - 22;
},
page: true,
cols: [[
{ field: 'id', title: '回款编号', align: 'left', fixed: 'left', width: 100 },
{ field: 'project_name', title: '关联项目', align: 'left', width: 200 },
{ field: 'project_id', title: '项目编号', align: 'left', width: 200 },
{ field: 'budget_name', title: '关联预算', align: 'left', width: 200 },
{ field: 'budget_id', title: '预算编号', align: 'left', width: 200 },
{ field: 'income_type_name', title: '回款类别', align: 'left', width: 100 },
{ field: 'income_at', title: '回款时间', align: 'left', width: 160, templet: function (d) { return !d.income_at ? '' : util.toDateString(d.income_at) } },
{ field: 'amount', title: '回款金额', align: 'left', width: 120 },
{
field: 'status', title: '状态', align: 'center', width: 90, templet: function (row) {
switch (row.status) {
case 0: return '<span style="color:green;">正常</span>';
case -1: return '<span style="color:red;">删除</span>';
default: return '其它';
}
},
{ field: 'created_at', title: '创建时间', align: 'center', width: 160, templet: function (d) { return !d.created_at ? '' : util.toDateString(d.created_at) } },
{ field: 'created_name', title: '创建人', align: 'center', width: 100 },
{ field: 'updated_at', title: '更新时间', align: 'center', width: 160, templet: function (d) { return !d.updated_at ? '' : util.toDateString(d.updated_at) } },
{ field: 'updated_name', title: '更新人', align: 'center', width: 100 },
{ title: '操作', toolbar: '#actionBox', align: 'center', fixed: 'right', width: 100 },
]],
skin: 'line',
toolbar: '#toolbar',
defaultToolbar: [{
title: '刷新',
layEvent: 'refresh',
icon: 'layui-icon-refresh',
}, 'filter', 'exports'],
request: {
pageName: 'page',
limitName: 'rows'
}
return '';
}
},
{ field: 'created_at', title: '创建时间', align: 'center', width: 160, templet: function (d) { return !d.created_at ? '' : util.toDateString(d.created_at) } },
{ field: 'created_name', title: '创建人', align: 'center', width: 100 },
{ field: 'updated_at', title: '更新时间', align: 'center', width: 160, templet: function (d) { return !d.updated_at ? '' : util.toDateString(d.updated_at) } },
{ field: 'updated_name', title: '更新人', align: 'center', width: 100 },
{ title: '操作', toolbar: '#actionBox', align: 'center', fixed: 'right', width: 100 },
]],
skin: 'line',
toolbar: '#toolbar',
defaultToolbar: [{
title: '刷新',
layEvent: 'refresh',
icon: 'layui-icon-refresh',
}, 'filter', 'exports'],
request: {
pageName: 'page',
limitName: 'rows'
}
});
// 工具栏
table.on('toolbar(tablelist)', function (obj) {
switch (obj.event) {
case 'add': add(); break;
case 'refresh': refresh(); break;
}
});
function add(obj) {
layer.open({
type: 2,
// offset: 'r',
// anim: 'slideLeft',
title: '新增',
shade: 0.1,
area: ['99%', '98%'],
content: "/income/add"
});
}
// 工具栏
function toolbar() {
table.on('toolbar(tablelist)', function (obj) {
switch (obj.event) {
case 'add': add(); break;
case 'refresh': refresh(); break;
}
});
function add(obj) {
layer.open({
type: 2,
title: '新增',
shade: 0.1,
area: ['100%', '100%'],
content: "/income/add"
});
}
function refresh() {
table.reload('tablelist');
}
function refresh() {
table.reload('tablelist');
}
// 表格项操作按钮
function tableActionTool() {
table.on('tool(tablelist)', function (obj) {
switch (obj.event) {
case 'edit': edit(obj); break;
}
});
function edit(obj) {
layer.open({
type: 2,
title: '修改',
shade: 0.1,
area: ['100%', '100%'],
content: "/income/edit?id=" + obj.data['id']
});
table.on('tool(tablelist)', function (obj) {
switch (obj.event) {
case 'edit': edit(obj); break;
}
});
function edit(obj) {
layer.open({
type: 2,
// offset: 'r',
// anim: 'slideLeft',
title: '修改',
shade: 0.1,
area: ['99%', '98%'],
content: "/income/edit?id=" + obj.data['id']
});
}
// 搜索条件