ComplianceServer/oldcode/Core.Web/Views/CmsNews/Index.cshtml

257 lines
9.0 KiB
Plaintext

@using Core.Web.WebHelper
@using Core.Web.Controllers
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<style>
.layui-table-cell {
height: 60px;
}
</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[]
{
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other1, "审批", "layui-btn-danger" ,"",true),
}
})
</div>
<form class="layui-form">
<div id="mytoolbar">
业务部:
<div class="layui-inline">
<div class="layui-inline">
<div id="selectDeptId" style="width: 300px"></div>
</div>
</div>
审核时间:
<div class="layui-inline">
<input class="layui-input" placeholder="开始日" name="txt_starttime" id="start" style="width:120px;">
</div>
<div class="layui-inline">
<input class="layui-input" placeholder="截止日" name="txt_endtime" id="end" style="width:120px;">
</div>
发布状态
<div class="layui-inline">
<select name="txt_Status" style="height:35px;">
<option value="">全部</option>
<option value="1">启用</option>
<option value="0">未启用</option>
</select>
</div>
审批状态:
<div class="layui-inline">
<select name="txt_Checkstatus" style="height:35px;">
<option value="">全部</option>
<option value="10">新增</option>
<option value="20">变更</option>
<option value="40">驳回</option>
<option value="60" selected="selected">提审</option>
<option value="100">通过</option>
<option value="-100">终止</option>
</select>
</div>
关键字:
<div class="layui-inline">
<input type="text" name="txt_Key" class="layui-input">
</div>
驳回理由:
<div class="layui-inline">
<div id="selectChannel" style="width: 200px"></div>
</div>
审核人:
<div class="layui-inline">
<div id="selectOperator" style="width: 300px"></div>
</div>
<div style="float: right;">
<button class="layui-btn layui-btn-normal" style="width:100px;" type="button" id="search" data-type="reload">搜索</button>
<button class="layui-btn layui-btn-normal" style="width: 100px; margin-left: 10px !important;" type="reset" id="reset">重置</button>
</div>
</div>
</form>
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
</div>
<script src="~/Scripts/layui_ext/xm-select/xm-select.js"></script>
<script>
var selectRow = {};
var layer;
var flow;
var accessories = [];
var token;
var table;
var statuss = @Html.Raw(Json.Encode(ViewBag.Status));
layui.use('laydate', function () {
var laydate = layui.laydate;
laydate.render({ elem: '#start' });
laydate.render({ elem: '#end' });
});
layui.use(['table', 'form', 'layer', 'upload', 'laydate', 'flow', 'element'], function () {
flow = layui.flow;
table = layui.table;
var form = layui.form;
form.render('select');
layer = layui.layer;
var upload = layui.upload;
var laydate = layui.laydate;
var element = layui.element;
laydate.render({ elem: '#TimeFrom'});
laydate.render({ elem: '#TimeTo' });
table.render({
id: 'liveAuditList',//列表别名ID
elem: '#tabl1',//表ID
url: '/CmsNews/GetListHtml',
method: 'POST',
cols: [[
{ field: 'Id', title: 'ID', width: 80 }
, { field: 'ctime', title: '时间', width: 180 }
, {
field: 'classtitle', title: '栏目', templet: function (d) {
return "<a href=\"javascript:void(0)\" style=\"color:blue\" onclick=\"openLink('" + d.classid + "')\">" + d.classtitle + "</a>";
}
}
, { field: 'usememo', title: '详细用途', width: 180 }
, { field: 'newstypeName', title: '类型', width: 100 }
, { field: 'DeptName', title: '业务部', width: 180 }
,{
field: 'img', title: '信息', templet: function (d) {
if (d.newstype == 12 || d.newstype == 15) {
return d.others ;
} else if (d.newstype == 3) {
return d.shortessay;
} else {
return d.title == null ? "" : d.title;
}
}
}
, { field: 'statusname', title: '发布状态', width: 150 }
, { field: 'checkStatusName', title: '合规审核', width: 100 }
, { field: 'operation', title: '操作', templet: '#toolbar', width: 100 }
]]
, page: {
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
//,curr: 5 //设定初始在第 5 页
, groups: 5 //只显示 1 个连续页码
}
, where: GetParams("mytoolbar")
});
$('#mytoolbar #search').on('click', function (data) {
table.reload('liveAuditList', {
page: { curr: 1 },
where: GetParams("mytoolbar")
});
});
//监听行按钮事件
table.on('tool(tabl1)', function (obj) {
var id = obj.data.Id;
var layEvent = obj.event;
console.log(obj);
if (layEvent === 'other1') {
ComplianceStatus(id);
}
});
});
var optionsOpertor= {
el: '#selectOperator',
name: 'txt_Eid',//表单的name属性
layVerify: '',
tips: '请选择审核人',
toolbar: {//工具条,全选,清空,反选,自定义
show: true,
list: [
'CLEAR'
]
},
data: []
};
var selectOpertor = xmSelect.render(optionsOpertor);
var allOperator = @Html.Raw(ViewBag.allOperator);
selectOpertor.update({ data: allOperator });
var optionsCompany = {
el: '#selectDeptId',
name: 'txt_DeptId',//表单的name属性
layVerify: '',
tips: '请选择',
toolbar: {//工具条,全选,清空,反选,自定义
show: true,
list: [
'CLEAR'
]
},
data: []
};
var selectCompany = xmSelect.render(optionsCompany);
var allCompany = @Html.Raw(ViewBag.companyList);
selectCompany.update({ data: allCompany });
var optionsChannel = {
el: '#selectChannel',
name: 'txt_reason',//表单的name属性
layVerify: '',
tips: '请选择',
toolbar: {//工具条,全选,清空,反选,自定义
show: true,
list: [
'CLEAR'
]
},
data: []
};
var selectChannel = xmSelect.render(optionsChannel);
var allChannel = @Html.Raw(ViewBag.AllChannel);
selectChannel.update({ data: allChannel });
function ComplianceStatus(id) {
var content = '审批';
winindex = layer.open({
title: content,
type: 2,
content: '/CmsNews/ComplianceStatus?id=' + id,
area: ['95%', '80%']
});
}
function selectReset(value) {
selectChannel.setValue(value);
}
function openLink(id) {
winindex = layer.open({
title: "链接",
type: 2,
content: '/CmsNews/Link?id=' + id,
area: ['90%', '80%']
});
}
function ShowPlayBack(scheduleId) {
var width = $(window).width() * 0.8;
var height = $(window).height() * 0.8;
layer.open({
type: 2,
content: '/LiveAudit/PlayBack?Id=' + scheduleId,
title: "审核管理",
area: [width+'px', height+'px']
});
}
$("#reset").on('click', function (data) {
selectChannel.reset();
allChannel.forEach(function (item) {
item.selected = false;
})
selectChannel = xmSelect.render(optionsChannel);
selectChannel.update({ data: allChannel });
});
function TableReload() {
table.reload('liveAuditList', {
});
}
</script>