190 lines
6.5 KiB
Plaintext
190 lines
6.5 KiB
Plaintext
@using CRM.Core.Model.Entity
|
|
@using Core.Web.WebHelper
|
|
@{
|
|
/**/
|
|
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Layout.cshtml";
|
|
}
|
|
<style>
|
|
.hidden {
|
|
display: none;
|
|
}
|
|
</style>
|
|
<div class="x-body">
|
|
<div class="layui-btn-group" style="padding-bottom:10px;">
|
|
@Html.Action("ToolBar", "Home",
|
|
new
|
|
{
|
|
area = "",
|
|
rightcode = (ViewBag.rightCode as string),
|
|
otherToolBars = new ToolBar[]
|
|
{
|
|
|
|
}
|
|
})
|
|
</div>
|
|
<form id="mytoolbar">
|
|
参数组:
|
|
<div class="layui-inline">
|
|
<select name="txt_GroupId" id="txt_GroupId" class="layui-input" style="width:120px;">
|
|
|
|
</select>
|
|
</div>
|
|
参数键:
|
|
<div class="layui-inline">
|
|
<input type="text" name="txt_PARAKEY" placeholder="请输入" autocomplete="off" class="layui-input" style="width:150px;">
|
|
</div>
|
|
参数名:
|
|
<div class="layui-inline">
|
|
<input type="text" name="txt_PARANAME" placeholder="请输入" autocomplete="off" class="layui-input" style="width:120px;">
|
|
</div>
|
|
<button class="layui-btn" type="button" id="search" data-type="reload">搜索</button>
|
|
<button class="layui-btn layui-btn-reset" id="reset" type="reset">清空</button>
|
|
</form>
|
|
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
|
|
|
|
</div>
|
|
<script>
|
|
var selectRow = {};
|
|
var table;
|
|
|
|
|
|
layui.use(['table', 'form'], function () {
|
|
table = layui.table;
|
|
var form = layui.form;
|
|
|
|
var param2 = GetParams("mytoolbar");
|
|
table.render({
|
|
id: 'testReload',//列表别名ID
|
|
elem: '#tabl1',//表ID
|
|
url: '/SysParamKey/PageList',
|
|
method: 'POST',
|
|
even: true, //开启隔行背景
|
|
cols: [[
|
|
{ field: 'PARAKEY', title: '参数键' },
|
|
{ field: 'PARANAME', title: '参数名' },
|
|
{ field: 'GROUPID', title: '参数组' },
|
|
{ field: 'PARAVALUE', title: '参数值' },
|
|
{ field: 'PARATYPE', title: '参数类型' },
|
|
{ field: 'DEPTCDOE', title: '营业部' },
|
|
{ field: 'REMARK', title: '备注' },
|
|
{ field: 'CTIME', title: '创建时间' },
|
|
{ field: 'CREATEUSER', title: '创建人' },
|
|
{ field: 'UTIME', title: '修改时间'},
|
|
{ field: 'UPDATEUSER', title: '修改人' }
|
|
|
|
]]
|
|
,
|
|
done: function (res, curr, count) {
|
|
console.log(res);
|
|
$('th').each(function (i) {
|
|
|
|
})
|
|
|
|
},
|
|
page: {
|
|
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
|
|
, groups: 5 //只显示 1 个连续页码
|
|
|
|
}
|
|
, where: param2
|
|
});
|
|
//查询
|
|
$('#mytoolbar #search').on('click', function (data) {
|
|
var param = GetParams("mytoolbar");
|
|
console.log(param);
|
|
table.reload('testReload', {
|
|
page: {
|
|
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'],
|
|
curr: 1 //重新从第 1 页开始
|
|
},
|
|
where: param
|
|
});
|
|
});
|
|
|
|
//参数分组
|
|
$.ajax({
|
|
type: "Post",
|
|
url: 'GetParamGroup',
|
|
dataType: "json",
|
|
contentType: "application/json",
|
|
success: function (da) {
|
|
if (da.s) {
|
|
console.log(da);
|
|
$("#txt_GroupId").append(new Option('--请选择--', ''));
|
|
$.each(da.d, function (i, j) {
|
|
$("#txt_GroupId").append(new Option(j.value, j.key));
|
|
});
|
|
form.render("select");
|
|
}
|
|
},
|
|
error: function () {
|
|
layer.msg('失败!', { icon: 2 });
|
|
}
|
|
});
|
|
//监听行单击事件
|
|
table.on('row(tabl1)', function (obj) {
|
|
var data = obj.data;
|
|
//console.log(data);
|
|
//标注选中样式
|
|
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
|
|
|
|
selectRow = data;
|
|
});
|
|
|
|
|
|
|
|
//点击事件
|
|
var active = {
|
|
add: function () {
|
|
layer.open({
|
|
title: '添加系统参数',
|
|
type: 2,
|
|
content: 'Add',
|
|
area: ['1150px', '600px']
|
|
});
|
|
},
|
|
edit: function () {
|
|
if (selectRow.PARAKEY === "undefined" || selectRow.PARAKEY == null) {
|
|
layer.alert("请先选中一条记录!", { title: '提示' });
|
|
return;
|
|
}
|
|
layer.open({
|
|
title: '编辑系统参数',
|
|
type: 2,
|
|
content: 'Edit?paramkey=' + selectRow.PARAKEY,
|
|
area: ['1150px', '600px']
|
|
});
|
|
},
|
|
delete: function () {
|
|
if (selectRow.PARAKEY === "undefined" || selectRow.PARAKEY == null) {
|
|
layer.alert("请先选中一条记录!", { title: '提示' });
|
|
return;
|
|
}
|
|
layer.confirm('你确定要删除这条记录吗?', { icon: 3, title: '提示' }, function (index) {
|
|
$.post('Delete', { paramkey: selectRow.PARAKEY }, function (msg) {
|
|
if (msg.s) {
|
|
layer.alert("操作成功!", {
|
|
yes: function () {
|
|
window.location.reload();
|
|
}
|
|
})
|
|
}
|
|
else {
|
|
layer.alert(msg.m, {
|
|
yes: function () {
|
|
window.location.reload();
|
|
}
|
|
})
|
|
}
|
|
});
|
|
});
|
|
}
|
|
};
|
|
$('.layui-btn-group .layui-btn').on('click', function () {
|
|
var othis = $(this), method = othis.data('method');
|
|
active[method] ? active[method].call(this, othis) : '';
|
|
});
|
|
});
|
|
</script> |