Index.cshtml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. @{
  2. ViewBag.Title = "已办流程";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script src="~/Content/scripts/plugins/pagination/jquery.pagination-1.2.7.js"></script>
  6. <link href="~/Content/scripts/plugins/pagination/jquery.pagination.css" rel="stylesheet" />
  7. <script>
  8. var params="";
  9. $(function () {
  10. InitialPage();
  11. GetSchemeType();
  12. GetGrid();
  13. });
  14. //初始化页面
  15. function InitialPage() {
  16. //resize重设(表格、树形)宽高
  17. $(window).resize(function (e) {
  18. window.setTimeout(function () {
  19. $("#taskblock").height($(window).height() - 131);
  20. $("#itemTree").height($(window).height() - 52);
  21. }, 200);
  22. e.stopPropagation();
  23. });
  24. }
  25. //加载树
  26. function GetSchemeType() {
  27. $.SetForm({
  28. url: "../../SystemManage/DataItemDetail/GetDataItemTreeJson",
  29. param: { EnCode: "FlowSort" },
  30. success: function (data) {
  31. $.each(data, function (id, item) {
  32. var row = '<li><a data-value="' + item.id + '">' + item.text + '</a></li>';
  33. $('#SchemeType').find('ul').append(row);
  34. });
  35. $('#SchemeType').find('li>a').click(function () {
  36. var id = $(this).attr('data-value');
  37. var text = $(this).html();
  38. var queryJson = { SchemeType: id };
  39. params = { queryJson: JSON.stringify(queryJson) };
  40. $("#girdPager").page('remote', 0, params);
  41. $('#SchemeType').find('.dropdown-text').html(text);
  42. });
  43. }
  44. })
  45. }
  46. //加载表格
  47. function GetGrid() {
  48. $("#taskblock").height($(window).height() - 131);
  49. $("#girdPager").panginationEx({
  50. url: "../../FlowManage/FlowAferProcessing/GetPageListJson",
  51. success: function (data) {
  52. var $flowlist = $("#flowlist");
  53. $flowlist.html("");
  54. if (data.length > 0) {
  55. $('.no-data').hide();
  56. }
  57. else {
  58. $('.no-data').show();
  59. }
  60. $.each(data, function (i, item) {
  61. var _listhtml = '<li><div style="width: 82px; line-height: 38px;margin-top:11px; float: right;"><a class="btn btn-success previewmodel">查看状态</a></div>';
  62. _listhtml += '<div style="float: left;">';
  63. _listhtml += '<span class="item-text">' + item.code + '/' + item.customname + '</span>';
  64. _listhtml += '<div><span class=\"label label-success-learun\" data-toggle="tooltip" data-placement="top" title="流程分类">' + item.schemetypename + '</span>';
  65. _listhtml += '<span style="margin-left:5px;" class=\"label label-inverse-learun\"data-toggle="tooltip" data-placement="top" title="当前节点">' + item.activityname + '</span>';
  66. if (item.isfinish == 3) {
  67. _listhtml += '<span style="margin-left:5px;" class=\"label label-danger\" data-toggle="tooltip" data-placement="top" title="状态">不通过</span>';
  68. }
  69. else if (item.isfinish == 1) {
  70. _listhtml += '<span style="margin-left:5px;" class=\"label label-success\" data-toggle="tooltip" data-placement="top" title="状态">通过完成</span>';
  71. }
  72. else if (item.isfinish == 0) {
  73. _listhtml += '<span style="margin-left:5px;" class=\"label label-info\" data-toggle="tooltip" data-placement="top" title="状态" >处理中</span>';
  74. }
  75. else if (item.isfinish == 4) {
  76. _listhtml += '<span style="margin-left:5px;" class=\"label label-warning\" data-toggle="tooltip" data-placement="top" title="状态" >被驳回</span>';
  77. }
  78. else if (item.isfinish == 2) {
  79. _listhtml += '<span style="margin-left:5px;" class=\"label label-primary\" data-toggle="tooltip" data-placement="top" title="状态" >被召回</span>';
  80. }
  81. _listhtml += '</div><p>By.' + item.createusername + '-' + item.createdate +' |' + item.content +'</p>';
  82. _listhtml += '</div></li>';
  83. var $_listhtml = $(_listhtml);
  84. $_listhtml.find('.previewmodel')[0].processInstanceId = item.id;
  85. $_listhtml.find('.previewmodel')[0].activityId = item.activityid;
  86. $_listhtml.find('.previewmodel')[0].processSchemeId = item.processschemeid;
  87. $_listhtml.find('.previewmodel')[0].processname = item.name;
  88. $flowlist.append($_listhtml);
  89. });
  90. $('[data-toggle="tooltip"]').tooltip();
  91. //查看进程
  92. $('.previewmodel').click(function () {
  93. var $_btn = $(this).context;
  94. var _processInstanceId = $_btn.processInstanceId;
  95. var _processSchemeId = $_btn.processSchemeId;
  96. var _processname = $_btn.processname;
  97. var _activityId = $_btn.activityId;
  98. dialogOpen({
  99. id: "ProcessLookForm",
  100. title: '查看状态',
  101. url: '/FlowManage/FlowAferProcessing/ProcessLookForm?processSchemeId=' + _processSchemeId + '&activityId=' + _activityId,
  102. width: "1100px",
  103. height: "700px",
  104. btn: null,
  105. callBack: function (iframeId) {
  106. }
  107. });
  108. });
  109. },
  110. sortname: "CreateDate desc"
  111. });
  112. //查询事件
  113. $("#btn_Search").click(function () {
  114. var queryJson = { Keyword: $("#txt_Keyword").val() };
  115. params = { queryJson: JSON.stringify(queryJson) };
  116. $("#girdPager").page('remote', 0, params);
  117. });
  118. }
  119. //回调函数
  120. function callBack() {
  121. $("#girdPager").page('remote', '', params);
  122. }
  123. </script>
  124. <div class="titlePanel">
  125. <div class="title-search">
  126. <table>
  127. <tr>
  128. <td>
  129. <div id="SchemeType" class="btn-group">
  130. <a class="btn btn-default dropdown-text" data-toggle="dropdown">选择流程分类</a>
  131. <a class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
  132. <ul class="dropdown-menu"></ul>
  133. </div>
  134. </td>
  135. <td style="padding-left: 5px;">
  136. <input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;" />
  137. </td>
  138. <td style="padding-left: 5px;">
  139. <a id="btn_Search" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
  140. </td>
  141. </tr>
  142. </table>
  143. </div>
  144. <div class="toolbar">
  145. <div class="btn-group">
  146. <a id="lr-replace" class="btn btn-default" onclick="reload();"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
  147. </div>
  148. </div>
  149. </div>
  150. <div class="taskblockPanel">
  151. <div id="taskblock" class="taskblock" >
  152. <ul id="flowlist"></ul>
  153. </div>
  154. <div id="girdPager" class="m-pagination"></div>
  155. <div class="no-data"></div>
  156. </div>