Index.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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/FlowProcess/GetRuntimePageListJson",
  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: ' + (item.isfinish == 4 ? '239px' : '160px') + '; line-height: 38px;margin-top:11px; float: right;">' + (item.isfinish == 4 ? '<a class="btn btn-warning applicationmodel" style="margin-right:4px;" >重新申请</a>' : '') + '<a class="btn btn-success previewmodel" style="margin-right:4px;">进度查看</a><a class="btn btn-danger deletemodel" >流程召回</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.enabledmark == 1) {
  67. if (item.isfinish == 3) {
  68. _listhtml += '<span style="margin-left:5px;" class=\"label label-danger\" data-toggle="tooltip" data-placement="top" title="状态">不通过</span>';
  69. }
  70. else if (item.isfinish == 1) {
  71. _listhtml += '<span style="margin-left:5px;" class=\"label label-success\" data-toggle="tooltip" data-placement="top" title="状态">通过完成</span>';
  72. }
  73. else if (item.isfinish == 0) {
  74. _listhtml += '<span style="margin-left:5px;" class=\"label label-info\" data-toggle="tooltip" data-placement="top" title="状态" >处理中</span>';
  75. }
  76. else if (item.isfinish == 4) {
  77. _listhtml += '<span style="margin-left:5px;" class=\"label label-warning\" data-toggle="tooltip" data-placement="top" title="状态" >被驳回</span>';
  78. }
  79. }
  80. else {
  81. _listhtml += '<span style="margin-left:5px;" class=\"label label-important-learun\" data-toggle="tooltip" data-placement="top" title="状态" >暂停</span>';
  82. }
  83. switch (item.wflevel)
  84. {
  85. case 1:
  86. _listhtml += '<span style="margin-left:5px;" class=\"label label-danger\" data-toggle="tooltip" data-placement="top" title="等级" >重要</span>';
  87. break;
  88. case 2:
  89. _listhtml += '<span style="margin-left:5px;" class=\"label label-success\" data-toggle="tooltip" data-placement="top" title="等级" >普通</span>';
  90. break;
  91. case 3:
  92. _listhtml += '<span style="margin-left:5px;" class=\"label label-warning\" data-toggle="tooltip" data-placement="top" title="等级" >一般</span>';
  93. break;
  94. }
  95. _listhtml += '</div><p>By.' + item.createusername + '-' + item.createdate + ' | 备注:' + item.description + '</p>';
  96. _listhtml += '</div></li>';
  97. var $_listhtml = $(_listhtml);
  98. $_listhtml.find('.previewmodel')[0].processInstanceId = item.id;
  99. $_listhtml.find('.previewmodel')[0].activityId = item.activityid;
  100. $_listhtml.find('.previewmodel')[0].processSchemeId = item.processschemeid;
  101. $_listhtml.find('.previewmodel')[0].processname = item.code + '/' + item.customname;
  102. $_listhtml.find('.deletemodel')[0].processInstanceId = item.id;
  103. $_listhtml.find('.deletemodel')[0].processSchemeId = item.processschemeid;
  104. if ($_listhtml.find('.applicationmodel').length > 0)
  105. {
  106. $_listhtml.find('.applicationmodel')[0].processInstanceId = item.id;
  107. $_listhtml.find('.applicationmodel')[0].activityId = item.activityid;
  108. $_listhtml.find('.applicationmodel')[0].processSchemeId = item.processschemeid;
  109. $_listhtml.find('.applicationmodel')[0].processname = item.code + '/' + item.customname;
  110. }
  111. $flowlist.append($_listhtml);
  112. });
  113. $('[data-toggle="tooltip"]').tooltip();
  114. //进度查看
  115. $('.previewmodel').click(function () {
  116. var $_btn = $(this).context;
  117. var _processInstanceId = $_btn.processInstanceId;
  118. var _processSchemeId = $_btn.processSchemeId;
  119. var _processname = $_btn.processname;
  120. var _activityId = $_btn.activityId;
  121. dialogOpen({
  122. id: "ProcessLookForm",
  123. title: '进度查看【' + _processname + '】',
  124. url: '/FlowManage/FlowMyProcess/ProcessLookForm?processSchemeId=' + _processSchemeId + '&activityId=' + _activityId,
  125. width: "1100px",
  126. height: "700px",
  127. btn:null,
  128. callBack: function (iframeId) {
  129. }
  130. });
  131. });
  132. //流程召回
  133. $('.deletemodel').click(function () {
  134. var $_btn = $(this).context;
  135. var $this = $(this);
  136. var _ProcessInstanceId = $_btn.processInstanceId;
  137. if (_ProcessInstanceId) {
  138. $.ConfirmAjax({
  139. msg: "注:您确定要召回吗?该操作将无法恢复",
  140. url: "../../FlowManage/FlowProcess/DeleteVirtualProcess",
  141. param: { keyValue: _ProcessInstanceId },
  142. success: function (data) {
  143. $("#girdPager").page('remote', '', params);
  144. }
  145. })
  146. } else {
  147. dialogMsg('请选择需要召回的流程!', 0);
  148. }
  149. });
  150. //重新申请
  151. $('.applicationmodel').click(function () {
  152. var $_btn = $(this).context;
  153. var _processInstanceId = $_btn.processInstanceId;
  154. var _processSchemeId = $_btn.processSchemeId;
  155. var _processname = $_btn.processname;
  156. var _activityId = $_btn.activityId;
  157. dialogOpen({
  158. id: "ProcessAgainNewForm",
  159. title: '重新申请【' + _processname + '】',
  160. url: '/FlowManage/FlowMyProcess/ProcessAgainNewForm?keyValue=' + _processInstanceId + '&activityId=' + _activityId,
  161. width: "1100px",
  162. height: "700px",
  163. btn: null,
  164. callBack: function (iframeId) {
  165. }
  166. });
  167. });
  168. },
  169. sortname: "CreateDate desc"
  170. });
  171. //查询事件
  172. $("#btn_Search").click(function () {
  173. var queryJson = { Keyword: $("#txt_Keyword").val() };
  174. params = { queryJson: JSON.stringify(queryJson) };
  175. $("#girdPager").page('remote', 0, params);
  176. });
  177. }
  178. //回调函数
  179. function callBack() {
  180. $("#girdPager").page('remote', '', params);
  181. }
  182. </script>
  183. <div class="titlePanel">
  184. <div class="title-search">
  185. <table>
  186. <tr>
  187. <td>
  188. <div id="SchemeType" class="btn-group">
  189. <a class="btn btn-default dropdown-text" data-toggle="dropdown">选择流程分类</a>
  190. <a class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
  191. <ul class="dropdown-menu"></ul>
  192. </div>
  193. </td>
  194. <td style="padding-left: 5px;">
  195. <input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;" />
  196. </td>
  197. <td style="padding-left: 5px;">
  198. <a id="btn_Search" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
  199. </td>
  200. </tr>
  201. </table>
  202. </div>
  203. <div class="toolbar">
  204. <div class="btn-group">
  205. <a id="lr-replace" class="btn btn-default" onclick="reload();"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
  206. </div>
  207. </div>
  208. </div>
  209. <div class="taskblockPanel">
  210. <div id="taskblock" class="taskblock">
  211. <ul id="flowlist"></ul>
  212. </div>
  213. <div id="girdPager" class="m-pagination"></div>
  214. <div class="no-data"></div>
  215. </div>