You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

268 lines
9.6 KiB

<#include "../../_include/_t.ftl"/>
<!DOCTYPE html>
<html>
<head>
<title></title>
<#include "../../_include/_h.ftl"/>
<#include "../../_include/_l.ftl"/>
<#include "../../_include/_j.ftl"/>
<#include "../../_include/_z.ftl"/>
<#include "../../_include/_p.ftl"/>
<#include "../../_include/_c_1.ftl"/>
</head>
<body class="layui-layout-body">
<div class="">
<div class="layui-body">
<div class="page_content_noside">
<div id="notice_1_01_div" class="layui-show">
<div class="page_tools">
<div class="layui-input-inline" style="width:130px;">
<input class="layui-input" type="text" value="${.now?string('yyyy-MM')}-01" id="notice1_beginTime" placeholder="开始时间" readonly="true" autocomplete="off"/>
</div>
<div class="layui-input-inline" style="width:130px;">
<input class="layui-input" type="text" value="${.now?string('yyyy-MM-dd')}" id="notice1_endTime" placeholder="结束时间" readonly="true" autocomplete="off"/>
</div>
<div class="layui-inline layui-form" style="width:200px;">
<select id="notice1_timet" lay-filter="notice1_timet_filter">
<option value="0">今天</option>
<option value="1" selected>当前月(截止至今天)</option>
<option value="2">上一月</option>
<option value="3">自定义</option>
</select>
</div>
<div class="layui-inline layui-form" style="width:100px;">
<select id="notice1_nbCls" lay-filter="notice1_nbCls_filter">
<option value="">全部</option>
<option value="1">会议通告</option>
<option value="2">奖惩通告</option>
<option value="3">活动通告</option>
<option value="4">其它</option>
</select>
</div>
<button id="notice1_queryBtn" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe615;</i>查询</button>
<button id="notice1_resetBtn" class="layui-btn"><i class="layui-icon">&#xe666;</i>重置</button>
</div>
<table id="notice1_dataTable" lay-filter="notice1_dataTable_filter" lay-size="sm"></table>
</div>
</div>
</div>
</div>
<!--详情页面-->
<div id="notice1_detailWin" class="page_win page_win_hide">
<form class="layui-form">
<div class="layui-form-item">
<label class="layui-form-label">通告类型:</label>
<div class="layui-form-mid"><span id="notice1_detail_nbCls"></span></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">内容描述:</label>
<div class="layui-form-mid"><textarea id="notice1_detail_nbConts" disabled="disabled" style="width:366px;resize:none;height:150px;margin-top:2px;border:none;"></textarea></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">相关附件:</label>
<div class="layui-form-mid" style="width:366px;" id="notice1_detailWin_files"></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">通告类别:</label>
<div class="layui-form-mid" id="notice1_detail_nbType"></div>
</div>
</form>
</div>
<script type="text/javascript">
layuiplus.on_w_1(function(){
layuiplus.init(1);
//定义窗口变量
var notice1_detailWin = null;
//时间选择的select监听
form.on("select(notice1_timet_filter)",function(data){
var begin = $("#notice1_beginTime");
var end = $("#notice1_endTime");
if(data.value == "0"){
begin.val("${.now?string('yyyy-MM-dd')}");
end.val("${.now?string('yyyy-MM-dd')}");
}
if(data.value == "1"){
var date = new Date("${.now?string('yyyy-MM-dd')}");
var year = date.getFullYear()+"";
var month = date.getMonth()+1+"";
if(month.length == 1){
month = "0" + month;
}
begin.val(year+"-"+month+"-01");
end.val("${.now?string('yyyy-MM-dd')}");
}
if(data.value == "2"){
var date = new Date("${.now?string('yyyy-MM-dd')}");
var year = date.getFullYear();
var month = date.getMonth();
var firstDate = new Date(year,month-1,1);
var datetime = firstDate.getFullYear()
+ "-"// "年"
+ ((firstDate.getMonth()+1)>=10?(firstDate.getMonth() + 1):"0"+(firstDate.getMonth()+1))
+ "-"// "月"
+ (firstDate.getDate()<10?"0"+firstDate.getDate():firstDate.getDate());
begin.val(datetime);
var day = new Date(year,month,0).getDate();
var lastDate = new Date(year,month-1,day);
datetime = lastDate.getFullYear()
+ "-"// "年"
+ ((lastDate.getMonth()+1)>=10?(lastDate.getMonth() + 1):"0"+(lastDate.getMonth()+1))
+ "-"// "月"
+ (lastDate.getDate()<10?"0"+lastDate.getDate():lastDate.getDate());
end.val(datetime);
}
if(data.value == "3"){
begin.val("");
end.val("");
}
});
//查询按钮
$("#notice1_queryBtn").click(function(){
var begin = $("#notice1_beginTime");
if(begin.val() == ""){
layer.tips("请选择起始时间","#notice1_beginTime",{tips:3});
return false;
}
var end = $("#notice1_endTime");
if(end.val() == ""){
layer.tips("请选择结束时间","#notice1_endTime",{tips:3});
return false;
}
notice1_dataTable.reload({
where:{
beginTime:$("#notice1_beginTime").val(),
endTime:$("#notice1_endTime").val(),
nbCls:$("#notice1_nbCls").val(),
baseId:"${manager_user['baseId']}"
}
});
});
//重置按钮
$("#notice1_resetBtn").click(function(){
$("#notice1_timet").val("1");
var date = new Date("${.now?string('yyyy-MM-dd')}");
var year = date.getFullYear()+"";
var month = date.getMonth()+1+"";
if(month.length == 1){
month = "0" + month;
}
$("#notice1_beginTime").val(year+"-"+month+"-01");
$("#notice1_endTime").val("${.now?string('yyyy-MM-dd')}");
$("#notice1_nbCls").val(""),
form.render();
notice1_dataTable.reload({
where:{
beginTime:$("#notice1_beginTime").val(),
endTime:$("#notice1_endTime").val(),
baseId:"${manager_user['baseId']}"
}
});
});
//数据表格notice1_dataTable
var notice1_dataTable = table.render({
elem:"#notice1_dataTable",
url:"${ctx}/work/notice/notice1/noticeBase/list",
where:{
beginTime:$("#notice1_beginTime").val(),
endTime:$("#notice1_endTime").val(),
baseId:"${manager_user['baseId']}"
},
method:"get",
cols:[[
{field:"nbOk",title:"发布时间",align:"center",unresize:true,width:400,templet:function(d){
if(d.nbOk != null) return d.nbOk;
return "-";
}},
{field:"nbCls",title:"分类",align:"center",unresize:true,width:200,templet:function(d){
if(d.nbCls == "1") return "会议通告";
if(d.nbCls == "2") return "奖惩通告";
if(d.nbCls == "3") return "活动通告";
if(d.nbCls == "4") return "其他";
return "";
}},
{field:"nbCls",title:"类别",align:"center",unresize:true,width:200,templet:function(d){
if(d.nbType == "0") return "派发公告";
if(d.nbType == "1") return "公共通告";
return "";
}},
{field:"nbConts",title:"内容",unresize:true,width:800},
{title:"操作 ",unresize:true,align:"center",templet:function(d){
var opt = "<a title=\"查看\" style=\"cursor: pointer;\" lay-event=\"opt_detail\"><img src=\"${ctx}/style/cls1/img/tztg-icon1.png\" onmouseover=\"this.src='${ctx}/style/cls1/img/tztg-icon1h.png'\" onmouseout=\"this.src='${ctx}/style/cls1/img/tztg-icon1.png'\"></a>&nbsp;&nbsp;";
return opt;
}}
]],
height: $(document).height() - $('#notice1_dataTable').offset().top - 20,
text:{none:"暂无数据,您可以更改查询时间段进行查询"},
page:{
layout:["prev","page","next","skip","count","limit"],
limits:[10,20,30],
theme: '#1E9FFF'
}
});
//数据表格notice1_dataTable每行数据操作监听
table.on("tool(notice1_dataTable_filter)",function(row){//row.data row.event
if(row.event == "opt_detail"){
notice1_detailWin = layer.open({
id:"notice1_detailWin_id",
type:1,
title:"<i class=\"icon_detail\"></i>通知公告详情",
shade:0.3,
area:["600px","600px"],
resize:false,
content:$("#notice1_detailWin"),
success:function(){
$.ajax({
type:"get",
url:"${ctx}/work/notice/notice1/noticeBase/get",
data:{id:row.data.id},
dataType:"json",
success:function(data){
var _base = data.base;
switch(_base.nbCls){
case "1":$("#notice1_detail_nbCls").html("会议通告");
break;
case "2":$("#notice1_detail_nbCls").html("奖惩通告");
break;
case "3":$("#notice1_detail_nbCls").html("活动通告");
break;
case "4":$("#notice1_detail_nbCls").html("其它");
break;
default:$("#notice1_detail_nbCls").html("-");
}
$("#notice1_detail_nbConts").val(_base.nbConts);
var _files = data.files;
if(_files.length == 0){
$("#notice1_detailWin_files").html("无");
}else{
var _html = "";
$.each(_files,function(){
_html += "<p id=\"pnf_"+$(this).get(0).id+"\"><a href=\"${ctx}/work/notice/notice1/noticeFiles/down?fileName="+$(this).get(0).fname+"&fileNew="+$(this).get(0).fnew+"\" title=\"点击下载\">"+$(this).get(0).fname+"</a></p>";
});
$("#notice1_detailWin_files").html(_html);
}
//处理接收单位的逻辑
if(_base.nbType == 0){
$("#notice1_detail_nbType").html("指定单位通告");
}else{
$("#notice1_detail_nbType").html("公共通告");
}
}
});
}
});
}
});
//日期input
ldate.render({
elem:"#notice1_beginTime"
});
ldate.render({
elem:"#notice1_endTime"
});
});
</script>
</body>
</html>