主要功能:
1、页面初加载时展示全部数据,默认选中选项为【不限】
2、点击【档案分类】动态加载【公文类别】的不同选项
3、查询框输入点击搜索可查询【文号/编号】和标题
4、点击叉号选出改选项框,并且相对应的下方分类恢复选中为【不限】
5、通过点击不同的时间段选项,赋值到日期选择框中,并加载上方的选择框,来实现联动
6、自行选择日期,日期选项选中【自定义】,点击日期触发查询
<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/RenShiGongZiMuBan.master" AutoEventWireup="true" CodeFile="DangAnJianSuo.aspx.cs" Inherits="Filemanagement_DangAnJianSuo" %><asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="Server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="Server"><style type="text/css">.bgColor {/*//background-color:#1199C4;//color: #4598d2;*/color: #1199C4;border: thin solid #1199C4;border-radius: 11%;border-image-width: 8px;padding: 3px 6px 3px 6px;}.ClickValue {display: inline-block;float: left;}.InputValue {display: inline-block;float: left;}.InputK {float: left;list-style: none;border: 1px solid #1199C4;border-radius: 5%;margin-left: 15px;padding: -8px 8px -8px 8px;}.ClickDiv {margin-left: 45px;display: inline-block;}.CheckValue {float: left;list-style: none;border: 1px solid #1199C4;border-radius: 5%;margin-left: 15px;padding: 7px 8px 7px 8px;}.CheckedTitle {color: red;}.DisplayLi {display: none;}.BiaoTi {height: 33px;width: 245px;margin-right: 10px;border: none;/*//去除边框;*/}.layui-table-cell {/*附件自动换行*/height:auto !important;white-space: normal;font-size:12px;line-height: 22px;word-break: break-all;word-wrap:break-word;}.fa-download {/*color:-webkit-link;*/color: blue;}</style><html xmlns="/1999/xhtml"><head id="Head1" runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title></title><link href="../js/DangAnJianSuoJs/css/search.css" rel="stylesheet" /><link href="../js/DangAnJianSuoJs/css/layui.css" rel="stylesheet" /></head><body><div class="layui-form" style="padding-top: 10px"><div class="ClickDiv" id="ClickDiv"><ul id="ClickValue" class="ClickValue"></ul><ul id="InputValue" class="InputValue"></ul></div><div class="usteel-content w"><div class="usteel-condition" id="usteel-condition"><div class="selector"><div class="usteel-search" id="GongWenJianSuo"><div class="sl-key"><strong class="">档案分类:</strong></div><div class="sl-value"><div class="sl-v-list"><ul id="GongWenJianSuo_ui"><li><a href="javascript:;" class="GongWenJianSuo"><span class="" onclick="aClick(event)">不限</span></a></li><li><a href="javascript:;" class="GongWenJianSuo"><span class="" onclick="aClick(event)">集团通知</span></a></li><li><a href="javascript:;" class="GongWenJianSuo"><span class="" onclick="aClick(event)">红头文件</span></a></li><li><a href="javascript:;" class="GongWenJianSuo"><span class="" onclick="aClick(event)">会议纪要</span></a></li><li><a href="javascript:;" class="GongWenJianSuo"><span class="" onclick="aClick(event)">外部文件</span></a></li><li><a href="javascript:;" class="GongWenJianSuo"><span class="" onclick="aClick(event)">报表传送</span></a></li><li><a href="javascript:;" class="GongWenJianSuo"><span class="" onclick="aClick(event)">管理制度</span></a></li></ul></div></div></div><div class="usteel-search" id="FenLei"><div class="sl-key"><strong class="">公文类别:</strong></div><div class="sl-value"><div class="sl-v-list"><ul id="FenLei_ui"><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">不限</span></a></li><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">党委会文件</span></a></li><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">办公会文件</span></a></li><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">行政类</span></a></li><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">党务类</span></a></li><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">财务类</span></a></li><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">财务分析类</span></a></li><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">生产类</span></a></li><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">固定资产类</span></a></li><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">公司级</span></a></li><li class=""><a href="javascript:;" class="FenLei"><span class="" onclick="aClick(event)">部门级</span></a></li></ul></div></div></div><div class="usteel-search" id="ShiJian"><div class="sl-key"><strong class="">时间:</strong></div><div class="sl-value"><div class="sl-v-list"><ul id="ShiJian_ui"><li><a href="javascript:;" class="ShiJian"><span class="" onclick="aClick(event)">不限</span></a></li><li><a href="javascript:;" class="ShiJian"><span class="" onclick="aClick(event)">近一周</span></a></li><li><a href="javascript:;" class="ShiJian"><span class="" onclick="aClick(event)">近一个月</span></a></li><li><a href="javascript:;" class="ShiJian"><span class="" onclick="aClick(event)">近三个月</span></a></li><li><a href="javascript:;" class="ShiJian"><span class="" onclick="aClick(event)">近半年</span></a></li><li><a href="javascript:;" class="ShiJian"><span class="" onclick="aClick(event)">近一年</span></a></li><li><a href="javascript:;" class="ShiJian"><span class="">自定义</span></a></li><li><div class="layui-input-inline" style="width: 400px;"><input type="text" class="layui-input" id="fqrqS" name="fqrqS" style="width: 100px; height: 30px; display: inline;" autocomplete="off">至<input type="text" class="layui-input" id="fqrqE" name="fqrqE" style="width: 100px; height: 30px; display: inline;" autocomplete="off"></div></li></ul></div></div></div><%-- <div class="search-bottom display-flex"><p><span>标题:</span><input type="number" name="BiaoTi" id="BiaoTi" value="" /></p><p class="display-flex"><a href="JavaScript:;" class="_reset">重置</a><a href="JavaScript:;" class="_search">搜索</a></p></div>--%></div></div><div><table class="layui-hide" id="btable" lay-filter="btable"></table></div></div></div></body><script type="text/javascript">function OpenLiuCheng(d) {var addLink = d.SEQUENCENO;var OBJECTID = d.LCID;if ('' == addLink || null == addLink || undefined == addLink) {return '';}if (addLink.length > 0) {return "<a style='color:#3296fa' target='_blank' href='/Portal/InstanceSheets.html?InstanceId=" + d.LCID + "' >" + d.SEQUENCENO + "</a>";}}$(function () {var root = document.getElementById("usteel-condition").getElementsByTagName("span");//获取id为usteel-condition标签下面的所有a标签for (var i = 0; i < root.length; i++) {//每次页面一加载时,默认选项为不限if (root[i].innerText == '不限') {root[i].className = 'bgColor';}}//上方选择值得展示也要为不限var Checked = fe().substring(0, fe().length - 1);var CheckedGruop = Checked.split(';');var str = "";for (i = 0; i < CheckedGruop.length; i++) {var CheckedArry = CheckedGruop[i];//var CheckedArrySp = CheckedArry.split('/')[0];var str_before = CheckedArry.split('/')[0];//获取某个字符之前的字符var str_after = CheckedArry.split('/')[1];//获取某个字符之后的字符str += "<li class='CheckValue'><span class='text'>" + str_before + "<span class='CheckedTitle'>" + str_after + " </span></span> <a href='javascript:;' onclick='ChaHao(event)'><i class='ChaHao'><img src='../image/叉号 (1).png' /></i></a></li>";}//拼接出选中值得格式展示在上方var innerstr = "<li class='InputK'><span class='text' style='margin-left: 10px;'>查询:</span><input name='BiaoTi' id='BiaoTi' class='BiaoTi' value='' /><a href='JavaScript:;' class='_search' style='margin-right: 10px;' onclick='Search(event)'>搜索</a ><a href='JavaScript:;' class='_reset' style='margin-right: 10px;' onclick='Reset(event)'>重置 </a></li>";//document.getElementById("ClickValue").innerHTML = str;document.getElementById("InputValue").innerHTML = innerstr;//点击的查询条件var value = fes();var GongWenJianSuo = value[0];var FenLei = value[1];var ShiJian = value[2];//输入框的查询条件var BiaoTi = document.getElementById("BiaoTi").value;QueryFun(GongWenJianSuo, FenLei, ShiJian, BiaoTi);});function QueryFun(GongWenJianSuo, FenLei, ShiJian, BiaoTi) {layui.use(['form', 'table', 'layedit', 'laydate'], function () {form = layui.form,table = layui.table,laydate = layui.laydate;//执行一个laydate实例laydate.render({elem: '#fqrqS', //指定元素done: function (res, curr, count) {var root = document.getElementById("ShiJian_ui").getElementsByTagName("span");//获取id为usteel-condition标签下面的所有a标签for (var i = 0; i < root.length; i++) {//每次页面一加载时,默认选项为不限root[i].className = '';if (root[i].innerText == '自定义') {root[i].className = 'bgColor';}}ShuaXinXuanXiang();}});laydate.render({elem: '#fqrqE', //指定元素done: function (res, curr, count) {var root = document.getElementById("ShiJian_ui").getElementsByTagName("span");//获取id为usteel-condition标签下面的所有a标签for (var i = 0; i < root.length; i++) {//每次页面一加载时,默认选项为不限root[i].className = '';if (root[i].innerText == '自定义') {root[i].className = 'bgColor';}}ShuaXinXuanXiang();}});var initParam = tableQueryParam();table.render({elem: '#btable',url: '/Portal/DangAnJianSuo/GetDangAnJianSuoData',id: "btable",page: true,limit: 30,//每页默认显示的数量where: { GongWenJianSuo: GongWenJianSuo, FenLei: FenLei, ShiJian: ShiJian, BiaoTi: BiaoTi },cols:[[{ field: 'xuhao', title: '序号', align: "center", templet: '#xuhao', width: '5%' },{ field: 'CODENAME', title: '档案分类', align: "center", width: '10%' },//hide:true 隐藏列{ field: 'WENHAO', title: '文号/编号', align: "center", width: '15%' },{ field: 'BIAOTI', title: '标题', align: "center" , width: '20%'},{field: 'FJ', title: '附件', align: "center"//, templet: function (d) {//return " <a href='' class='background' target='_blank' style='color:#f67d06;'>{{ d.FJ }}</a>"//}},{ field: 'CDATE', title: '创建时间', align: "center", width: '7%' },{ field: 'SEQUENCENO', title: '流水号', align: "center", width: '9%', templet: OpenLiuCheng },{ field: 'STATENAME', title: '流程状态', align: "center", width: '7%' }]],done: function (res, curr, count) {}});});}//搜索按钮function Search(event) {var BiaoTi = document.getElementById("BiaoTi").value;var Checked = fe().substring(0, fe().length - 1);var CheckedGruop = Checked.split(';');//点击的查询条件var value = fes();var GongWenJianSuo = value[0];var FenLei = value[1];var ShiJian = value[2];//输入框的查询条件QueryFun(GongWenJianSuo, FenLei, ShiJian, BiaoTi);}//重置按钮function Reset(event) {document.getElementById("BiaoTi").value = "";//清空搜索框//上方选项组合下方选项都恢复成默认var root = document.getElementById("usteel-condition").getElementsByTagName("span");//获取id为usteel-condition标签下面的所有a标签for (var i = 0; i < root.length; i++) {//每次页面一加载时,默认选项为不限if (root[i].className == 'bgColor') {root[i].className = '';//把原来选中的的选项清空}if (root[i].innerText == '不限') {root[i].className = 'bgColor';}}//上方选择值得展示也要为不限$('#fqrqS').val("");$('#fqrqE').val("");var Checked = fe().substring(0, fe().length - 1);var CheckedGruop = Checked.split(';');var str = "";for (i = 0; i < CheckedGruop.length; i++) {var CheckedArry = CheckedGruop[i];//var CheckedArrySp = CheckedArry.split('/')[0];var str_before = CheckedArry.split('/')[0];//获取某个字符之前的字符var str_after = CheckedArry.split('/')[1];//获取某个字符之后的字符str += "<li class='CheckValue'><span class='text'>" + str_before + "<span class='CheckedTitle'>" + str_after + " </span></span> <a href='javascript:;' onclick='ChaHao(event)'><i class='ChaHao'><img src='../image/叉号 (1).png' /></i></a></li>";}//拼接出选中值得格式展示在上方var innerstr = "<li class='InputK'><span class='text' style='margin-left: 10px;'>查询:</span><input name='BiaoTi' id='BiaoTi' class='BiaoTi' value='' /><a href='JavaScript:;' class='_reset' style='margin-right: 10px;' onclick='Reset(event)'>重置 </a><a href='JavaScript:;' class='_search' style='margin-right: 10px;' onclick='Search(event)'>搜索</a ></li>";document.getElementById("ClickValue").innerHTML = "";document.getElementById("InputValue").innerHTML = innerstr;//点击的查询条件var value = fes();var GongWenJianSuo = value[0];var FenLei = value[1];var ShiJian = value[2];//输入框的查询条件var BiaoTi = document.getElementById("BiaoTi").value;QueryFun(GongWenJianSuo, FenLei, ShiJian, BiaoTi);}//点击选项组的叉号触发function ChaHao(event) {var tag = event.srcElement || event.target;//找到被点击的元素var father = tag.parentNode.parentNode.className //上方的选中组在选中时 就把id给附上了,后期好取这个id来判断到是哪一行,来把这一行选中的取消设置成不限var root = document.getElementById(father).getElementsByTagName("span");for (var i = 0; i < root.length; i++) {if (root[i].className == 'bgColor') {root[i].className = '';//把原来选中的的选项清空}if (root[i].innerText == '不限') {root[i].className = 'bgColor';}}ShuaXinXuanXiang();}//点击选项触发function aClick(event) {var tag = event.srcElement || event.target;//找到被点击的元素var father = tag.parentNode.text;//被点击元素的值var fatherDivID = tag.parentNode.parentNode.parentNode.id;//a标签上级ui标签的ID//遍历fatherDivID下面的所有a标签,将各个a标签的className属性清空 if (fatherDivID == "GongWenJianSuo_ui") {//若点击的是第一行,那么则获取第二行下所有的li,根据所选项来隐藏第二行展示的值var root = document.getElementById("FenLei_ui").getElementsByTagName("li");//当再次点击时发生变化,要清空第二行的选项for (var i = 0; i < root.length; i++) {root[i].className = "";}if (father == "外部文件")//{clearn();for (var i = 0; i < root.length; i++) {if (root[i].innerText != '不限' && root[i].innerText != '行政类' && root[i].innerText != '党务类') {root[i].className = "DisplayLi";}}}else if (father == "报表传送")//{clearn();for (var i = 0; i < root.length; i++) {if (root[i].innerText != '不限' && root[i].innerText != '财务类' && root[i].innerText != '财务分析类' && root[i].innerText != '生产类' && root[i].innerText != '固定资产类') {root[i].className = "DisplayLi";}}}else if (father == "会议纪要")//{clearn();for (var i = 0; i < root.length; i++) {if (root[i].innerText != '不限' && root[i].innerText != '党委会文件' && root[i].innerText != '办公会文件') {root[i].className = "DisplayLi";}}}else if (father == "管理制度")//{clearn();for (var i = 0; i < root.length; i++) {if (root[i].innerText != '不限' && root[i].innerText != '公司级' && root[i].innerText != '部门级') {root[i].className = "DisplayLi";}}}else if (father == "不限")//{for (var i = 0; i < root.length; i++) {root[i].className = "不限";}}else {for (var i = 0; i < root.length; i++) {if (root[i].innerText != '不限') {root[i].className = "DisplayLi";}}clearn();}}for (var i = 0; i < document.getElementById(fatherDivID).getElementsByTagName("a").length; i++) {document.getElementById(fatherDivID).getElementsByTagName("span")[i].className = "";}//为事件源tag对象添加className样式tag.className = 'bgColor';//添加到上方的div中ShuaXinXuanXiang();}//遍历所有a标签,根据a标签的className不同来获取用户选中的类型function fe() {var result = ""//选中的值var fenlei = "";var Cvalue = "";var root = document.getElementById("usteel-condition").getElementsByTagName("span");//获取id为usteel-condition标签下面的所有a标签for (var i = 0; i < root.length; i++) {if (root[i].className == 'bgColor') {if (root[i].parentNode.className == 'ShiJian') {fenlei = "时间:";Cvalue = timeZhuanHuan(root[i].innerHTML);}if (root[i].parentNode.className == 'FenLei') {fenlei = "公文类别:";Cvalue = root[i].innerHTML;}if (root[i].parentNode.className == 'GongWenJianSuo') {fenlei = "档案分类:";Cvalue = root[i].innerHTML;}result += root[i].parentNode.parentNode.parentNode.id + '+' + fenlei + '/' + Cvalue + ';';}}return result;}function fes() {var result = ""//选中的值var ShiJian = "";var FenLei = "";var GongWenJianSuo = "";var arrayObj = new Array();var root = document.getElementById("usteel-condition").getElementsByTagName("span");//获取id为usteel-condition标签下面的所有a标签for (var i = 0; i < root.length; i++) {if (root[i].className == 'bgColor') {if (root[i].parentNode.className == 'ShiJian') {ShiJian = timeZhuanHuan(root[i].innerHTML);}if (root[i].parentNode.className == 'FenLei') {FenLei = root[i].innerHTML;}if (root[i].parentNode.className == 'GongWenJianSuo') {GongWenJianSuo = root[i].innerHTML;}}}return [GongWenJianSuo, FenLei, ShiJian];}function clearn() {//清除这一行原先选中的值并且重新恢复默认值为不限var rootBuXian = document.getElementById("FenLei_ui").getElementsByTagName("span");for (var i = 0; i < rootBuXian.length; i++) {rootBuXian[i].className = "";if (rootBuXian[i].innerText == '不限') {rootBuXian[i].className = "bgColor";}}}function ShuaXinXuanXiang() {var Checked = fe().substring(0, fe().length - 1);var CheckedGruop = Checked.split(';');var str = "";for (i = 0; i < CheckedGruop.length; i++) {var CheckedArry = CheckedGruop[i];var CheckedArryui_id = CheckedArry.split('+')[0];var CheckedArryValue = CheckedArry.split('+')[1];var str_before = CheckedArryValue.split('/')[0];//获取某个字符之前的字符var str_after = CheckedArryValue.split('/')[1];//获取某个字符之后的字符if (CheckedArryui_id == "ShiJian_ui")//如果为时间的话,把值拿出来,截取开,复制到日期选择框{var root = document.getElementById("ShiJian_ui").getElementsByTagName("span");//获取id为usteel-condition标签下面的所有a标签for (var i = 0; i < root.length; i++) {if (root[i].innerText != '自定义' && root[i].className == 'bgColor') {var str_time = str_after.split('~')[0];//获取某个字符之前的字符var end_time = str_after.split('~')[1];//获取某个字符之后的字符$('#fqrqS').val(str_time);$('#fqrqE').val(end_time);}}}if (CheckedArryui_id == "ShiJian_ui" && str_after == "不限") {$('#fqrqS').val("");$('#fqrqE').val("");}if (str_after != "不限") {str += "<li class='CheckValue'><span class='text'>" + str_before + "<span class='CheckedTitle'>" + str_after + " </span></span> <a href='javascript:;' onclick='ChaHao(event)' class='" + CheckedArryui_id + "'><i class='ChaHao'><img src='../image/叉号 (1).png' /></i></a></li>";}}document.getElementById("ClickValue").innerHTML = str;var BiaoTi = document.getElementById("BiaoTi").value;//出发查询条件var value = fes();var GongWenJianSuo = value[0];var FenLei = value[1];//var ShiJian = value[2];var str_time = $('#fqrqS').val();var end_time = $('#fqrqE').val();var ShiJian = str_time + "~" + end_time;QueryFun(GongWenJianSuo, FenLei, ShiJian, BiaoTi);}function getNowFormatDate() {var date = new Date();var seperator1 = "-";var year = date.getFullYear();var month = date.getMonth() + 1;var strDate = date.getDate();if (month >= 1 && month <= 9) {month = "0" + month;}if (strDate >= 0 && strDate <= 9) {strDate = "0" + strDate;}var currentdate = year + seperator1 + month + seperator1 + strDate;return currentdate;}function dateChange(num, date) {if (!date) {date = new Date();//没有传入值时,默认是当前日期date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();}date += " 00:00:00";//设置为当天凌晨12点date = Date.parse(new Date(date)) / 1000;//转换为时间戳date += (86400) * num;//修改后的时间戳var newDate = new Date(parseInt(date) * 1000);//转换为时间var year = newDate.getFullYear();var month = newDate.getMonth() + 1;var strDate = newDate.getDate();if (month >= 1 && month <= 9) {month = "0" + month;}if (strDate >= 0 && strDate <= 9) {strDate = "0" + strDate;}return year + '-' + month + '-' + strDate;}function timeZhuanHuan(code) {var Cvalue;if (code == "近一周") {var endtime = dateChange(-7, getNowFormatDate())Cvalue = endtime + "~" + getNowFormatDate();}else if (code == "近一个月") {var endtime = dateChange(-30, getNowFormatDate())Cvalue = endtime + "~" + getNowFormatDate();}else if (code == "近三个月") {var endtime = dateChange(-90, getNowFormatDate())Cvalue = endtime + "~" + getNowFormatDate();}else if (code == "近半年") {var endtime = dateChange(-120, getNowFormatDate())Cvalue = endtime + "~" + getNowFormatDate();}else if (code == "近一年") {var endtime = dateChange(-365, getNowFormatDate())Cvalue = endtime + "~" + getNowFormatDate();}else if (code == "自定义") {var str_time = $('#fqrqS').val();var end_time = $('#fqrqE').val();Cvalue = str_time + "~" + end_time;}else {Cvalue = "不限"}return Cvalue;}</script><script type="text/html" id="xuhao">{{d.LAY_TABLE_INDEX+1}}</script></html></asp:Content>
//后台代码using Jelly.Controllers;using Jelly.DALS;using Newtonsoft.Json;using Newtonsoft.Json.Linq;using OThinker.H3.Portal;using System;using System.Collections;using System.Collections.Generic;using ponentModel;using System.Data;using System.IO;using System.Linq;using ;using .Http;using System.Reflection;using System.Text;using System.Web;using System.Web.Mvc;public class DangAnJianSuoController : Crm_BaseController{public ActionResult GetDangAnJianSuoData(string GongWenJianSuo, string FenLei, string ShiJian, string BiaoTi, int limit = 99999, int page = 1){string sqlwhere = "where 1=1 and CDATE>='-10-26' ";//'if (!string.IsNullOrWhiteSpace(GongWenJianSuo) && GongWenJianSuo != "不限"){if (GongWenJianSuo == "管理制度"){GongWenJianSuo = "制度";}sqlwhere += " and codeName like'%" + GongWenJianSuo + "%'";}if (!string.IsNullOrWhiteSpace(FenLei) && FenLei != "不限"){if ( FenLei == "管理制度"){FenLei = "制度";}sqlwhere += " and codeName like'%" + FenLei + "%'";}if (!string.IsNullOrWhiteSpace(ShiJian) && ShiJian != "不限"){string[] time = ShiJian.Split('~');string timeStar = time[0];string timeEnd = time[1];if (!string.IsNullOrWhiteSpace(timeStar)){sqlwhere += " and CDATE >='" + timeStar + "'";}if (!string.IsNullOrWhiteSpace(timeEnd)){sqlwhere += " and CDATE <='" + timeEnd + "'";}}if (!string.IsNullOrEmpty(BiaoTi)){sqlwhere += " and( BIAOTI like'%" + BiaoTi + "%' or wenhao like '%" + BiaoTi + "%')";}string sbsql = @"select * from (SELECT to_char('外部文件'||'-'||U.ENUMVALUE) as codeName,i.OBJECTID,i.WJMC BIAOTI,b.sequenceno,to_char(i.CREATEDTIME,'yyyy-mm-dd') as CDATE,'FUJIAN' as FJ ,b.objectid lcid,case when b.state=2 then '进行中' else '已结束' end STATENAME,to_char(i.wenhao) as wenhaoFROM i_wlwjian i left join OT_ENUMERABLEMETADATA u on i.wdlx=u.codeleft join OT_USER w on i.CREATEDBY=w.objectid left join ot_instancecontext b on i.objectid=b.bizobjectidwhere b.state in(4,2) --union allselect to_char('红头文件') as codeName, t.OBJECTID,t.WJMC BIAOTI,b.sequenceno,to_char(t.MODIFIEDTIME,'yyyy-mm-dd') CDATE ,'fj' as FJ,b.objectid lcid,case when b.state=2 then '进行中' else '已结束' end STATENAME,'无' as wenhaofrom i_htwj t left join OT_InstanceContext b on t.ObjectID=b.BizObjectIdwhere b.State in(4,2) --union allselect to_char('集团通知') as codeName, t.OBJECTID,t.biaoti,b.sequenceno,to_char(t.MODIFIEDTIME,'yyyy-mm-dd') CDATE ,'fujin' as FJ,b.objectid lcid,case when b.state=2 then '进行中' else '已结束' end STATENAME,'无' as wenhaofrom i_tzgg tleft join OT_InstanceContext b on t.ObjectID=b.BizObjectId where b.State in(4,2) --union allSELECT to_char('报表传送'||'-'||u.ENUMVALUE) as codeName, i.OBJECTID,i.bt biaoti,b.sequenceno,to_char(i.CREATEDTIME,'yyyy-mm-dd') as CDATE,'fj' as FJ,b.objectid lcid,case when b.state=2 then '进行中' else '已结束' end STATENAME,'无' as wenhaoFROM i_bbcs i left join OT_ENUMERABLEMETADATA u on i.bblx=u.codeleft join OT_USER w on i.CREATEDBY=w.objectidleft join ot_instancecontext b on i.objectid=b.bizobjectid where b.state in(4,2) --union allselect to_char('会议纪要'||'-'||h.wjlx) as codeName, h.OBJECTID,h.wjmc biaoti,i.sequenceno,to_char(h.fqsj,'yyyy-MM-dd') CDATE,to_char('fj'||','||'fqrcl') as FJ,i.objectid lcid,case when i.state=2 then '进行中' else '已结束' end STATENAME,'无' as wenhaofrom i_hyjysplc h left join ot_user u on u.objectid=h.fqrleft join ot_instancecontext i on i.bizobjectid=h.objectid where i.state in(4,2) --union allselect codeName,OBJECTID,zdmc as biaoti,sequenceno,CDATE,FJ,lcid,STATENAME,wenhao from (select * from (select to_char('公司级制度'||'-'||a.FQBM) as codeName,a.OBJECTID,b.sequenceno,to_char(a.createdtime,'YYYY-MM-DD') CDATE,to_char('fujian2') as FJ,b.objectid lcid,case when b.state=2 then '进行中' else '已结束' end STATENAME,to_char(a.zdbh) as wenhao,a.zdmc,substr(a.zdbh,0,10) bh,substr(a.zdbh,12,15) nf,case z.ckzt when 1 then '已读' else '*未读' end as ckzt,z.zdid from I_gsjzdsp aleft join OT_InstanceContext b on a.ObjectID=b.BizObjectId left join (select zdid,ckzt from i_zdckzt where filetype=1 group by zdid,ckzt) z on z.zdid=a.objectid where b.State in(4,2) and a.fbfs!='zdfb002' and a.zdbh like 'JZ/QG%' and a.zdckqx=1 and a.zdjb='zdjb001') where nf= ( select max(nf2) from (select substr(a2.zdbh,12,15) nf2,substr(a2.zdbh,0,10) bh2 from I_gsjzdsp a2 left join OT_InstanceContext b2 on a2.ObjectID=b2.BizObjectId where b2.State=4 and a2.fbfs!='zdfb002' and a2.zdjb='zdjb001') q where bh=bh2and nf= ( select max(nf3) from (select substr(a3.zdbh,12,15) nf3,substr(a3.zdbh,0,10) bh3,a3.zdmc mc3 from I_gsjzdsp a3 left join OT_InstanceContext b3 on a3.ObjectID=b3.BizObjectId where b3.State=4 and a3.fbfs!='zdfb002' and a3.zdjb='zdjb001' ) q where zdmc=mc3 )))--union allselect to_char('部门级制度'||'-'||a.FQBM) as codeName,a.OBJECTID,a.ZDMC as biaoti,b.sequenceno,to_char(a.createdtime,'YYYY-MM-DD') CDATE,to_char('fujian2') as FJ,b.objectid lcid,case when b.state=2 then '进行中' else '已结束' end STATENAME,to_char(a.zdbh) as wenhaofrom I_gsjzdsp aleft join OT_InstanceContext b on a.ObjectID=b.BizObjectIdwhere b.State in(4,2)and a.zdbh like 'JZ/GZ%') " + sqlwhere + " order by CDATE desc,CODENAME asc ";DataTable dt = CommonFunction.ExecuteTableSql(sbsql.ToString());var total = dt.Rows.Count;int startIndex = (this.layPage - 1) * this.layPageSize < 0 ? 0 : (this.layPage - 1) * this.layPageSize;int endIndex = this.layPage * this.layPageSize >= total ? total : this.layPage * this.layPageSize;List<Dictionary<string, object>> lists = new List<Dictionary<string, object>>();for (int i = startIndex; i < endIndex; i++){Dictionary<string, object> list = new Dictionary<string, object>();foreach (DataColumn dc in dt.Columns){if (dc.ColumnName == "FJ"){string codeName = "";string LiuChengBianMa = "";string FJInfo = "";if (dt.Rows[i]["codeName"].ToString().Contains("外部文件")){codeName = "fjsc";LiuChengBianMa = "wlwjian";FJInfo = cattachment.GetLibraryList(codeName, LiuChengBianMa, dt.Rows[i]["OBJECTID"].ToString());}if (dt.Rows[i]["codeName"].ToString().Contains("红头文件")){codeName = "pdf";LiuChengBianMa = "htwj";FJInfo = cattachment.GetLibraryList(codeName, LiuChengBianMa, dt.Rows[i]["OBJECTID"].ToString());}if (dt.Rows[i]["codeName"].ToString().Contains("集团通知")){codeName = "fujin";LiuChengBianMa = "tzgg";FJInfo = cattachment.GetLibraryList(codeName, LiuChengBianMa, dt.Rows[i]["OBJECTID"].ToString());}if (dt.Rows[i]["codeName"].ToString().Contains("报表传送")){codeName = "fj";LiuChengBianMa = "bbcs";FJInfo = cattachment.GetLibraryList(codeName, LiuChengBianMa, dt.Rows[i]["OBJECTID"].ToString());}if (dt.Rows[i]["codeName"].ToString().Contains("公司级制度")){codeName = "fujian2";LiuChengBianMa = "gsjzdsp";FJInfo = cattachment.GetLibraryList(codeName, LiuChengBianMa, dt.Rows[i]["OBJECTID"].ToString());}if (dt.Rows[i]["codeName"].ToString().Contains("部门级制度")){codeName = "fujian2";LiuChengBianMa = "gsjzdsp";FJInfo = cattachment.GetLibraryList(codeName, LiuChengBianMa, dt.Rows[i]["OBJECTID"].ToString());}//会议纪要流程特殊处理:同一个流程要合并显示多个附件字段if (dt.Rows[i]["codeName"].ToString().Contains("会议纪要")){codeName = "'fj','fqrcl'";LiuChengBianMa = "hyjysplc";FJInfo = cattachment.GetLibraryListAll(codeName, LiuChengBianMa, dt.Rows[i]["OBJECTID"].ToString());}list.Add(dc.ColumnName, FJInfo);}else{list.Add(dc.ColumnName, dt.Rows[i][dc]);}}lists.Add(list);}var gridData = new AjaxResult { code = 0, msg = "", count = total, data = lists };return Content(Newtonsoft.Json.JsonConvert.SerializeObject(gridData));}public string SortName{get { return Request.Params["sortname"]; }}public string SortOrder{get { return Request.Params["sortorder"]; }}public int CurrentPage{get { return Convert.ToInt32(Request.Params["page"]); }}public int PageSize{get { return Convert.ToInt32(Request.Params["pagesize"]); }}public int layPage{get { return Convert.ToInt32(Request.Params["page"]); }}public int layPageSize{get { return Convert.ToInt32(Request.Params["limit"]); }}protected int rowindex;protected string rid;public int intversion;public string strxmh;public CustomAttachment cattachment = new CustomAttachment();}
页面样式引用
如果觉得《仿购物商城-多级菜单搜索-搜索联动》对你有帮助,请点赞、收藏,并留下你的观点哦!