ProcessDesignate.cshtml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. @{
  2. ViewBag.Title = "流程指派";
  3. Layout = "~/Views/Shared/_FlowForm.cshtml";
  4. }
  5. <script>
  6. var keyValue = request('keyValue');
  7. $(function () {
  8. initialPage();
  9. })
  10. //初始化页面
  11. function initialPage() {
  12. $('.standtabborder').height($(window).height()-44);
  13. $('#DesignateMemberlist').height($(window).height() - 54);
  14. $('#Treebackground').height($(window).height() - 44);
  15. initSchemeAuthorize();
  16. //获取表单
  17. if (!!keyValue) {
  18. $.SetForm({
  19. url: "../../FlowManage/FlowProcess/GetProcessInstanceJson",
  20. param: { keyValue: keyValue },
  21. success: function (data) {
  22. console.log(data);
  23. if (data.MakerList != "")
  24. {
  25. setSchemeAuthorize(data.MakerList.split(","));
  26. }
  27. //setSchemeAuthorize(data.schemeinfo.AuthorizeType, data.authorize);
  28. }
  29. });
  30. }
  31. }
  32. function initSchemeAuthorize() {
  33. GetTree('Role');
  34. GetTree('Post');
  35. GetTree('UserGroup');
  36. GetTree('User');
  37. $('input[name="AuthorizeType"]').click(function () {
  38. var _value = $(this).val();
  39. if (_value == "0") {
  40. $("#Treebackground").show();
  41. }
  42. else {
  43. $("#Treebackground").hide();
  44. }
  45. });
  46. }
  47. function bindingSchemeAuthorize(flag) {
  48. }
  49. function setSchemeAuthorize(data) {
  50. $('#ShcemeAuthorize1').trigger("click");
  51. console.log(data);
  52. $.each(data, function (i, item) {
  53. $("#Role").setCheckedNodeOne(item);
  54. $("#Post").setCheckedNodeOne(item);
  55. $("#UserGroup").setCheckedNodeOne(item);
  56. $("#User").setCheckedNodeOne(item);
  57. });
  58. }
  59. function GetTree(type) {
  60. $.SetForm({
  61. url: "../../FlowManage/FlowDesign/Get" + type + "CheckTreeJson",
  62. success: function (data) {
  63. var item = {
  64. height: $(window).height() - 44,
  65. showcheck: true,
  66. data: data,
  67. oncheckboxclick: function (item, et, s) {
  68. var $item = $("#" + item.mytype + "Div");
  69. if (et == 1) {
  70. var mytype = "";
  71. var _html = "";
  72. var _title = '';
  73. switch (item.mytype) {
  74. case "Role":
  75. mytype = "角色";
  76. break;
  77. case "Post":
  78. mytype = "岗位";
  79. break;
  80. case "UserGroup":
  81. mytype = "用户组";
  82. break;
  83. case "User":
  84. mytype = "用户";
  85. break;
  86. }
  87. _html += '<div id="' + item.id + '" data-value="' + item.mytype + '" class="card-box shcemeinfocheck active">';
  88. _html += ' <div class="card-box-img">';
  89. _html += ' <img src="/Content/images/UserCard03.png" />';
  90. _html += ' </div>';
  91. _html += ' <div class="card-box-content">';
  92. _html += ' <p>名称:' + item.text + '</p>';
  93. _html += ' <p>类别:' + mytype + '</p>';
  94. _html += ' </div><i></i>';
  95. _html += '</div>';
  96. $item.append(_html);
  97. $item.show();
  98. $(".card-box").click(function () {
  99. $(this).remove();
  100. $('#' + $(this).attr('data-value')).setNoCheckedNodes($(this).attr('id'));
  101. if ($item.find('.card-box-img').length == 0) {
  102. $item.hide();
  103. }
  104. })
  105. }
  106. else if (et == 0) {
  107. $item.find('#' + item.id).remove();
  108. if ($item.find('.card-box-img').length == 0) {
  109. $item.hide();
  110. }
  111. }
  112. }
  113. };
  114. $("#" + type).treeview(item);
  115. }
  116. });
  117. }
  118. //保存表单
  119. function AcceptClick() {
  120. var _value = $('input[name="AuthorizeType"]:checked').val();
  121. var makeLists = "";
  122. if (_value == "1") {
  123. var _roleData = $("#Role").getCheckedAllNodes();
  124. var _postData = $("#Post").getCheckedAllNodes();
  125. var _userGroupData = $("#UserGroup").getCheckedAllNodes();
  126. var _userData = $("#User").getCheckedAllNodes();
  127. _roleData.push.apply(_roleData, _postData);
  128. _roleData.push.apply(_roleData, _userGroupData);
  129. _roleData.push.apply(_roleData, _userData);
  130. makeLists = String(_roleData);
  131. if (makeLists == "") {
  132. if (!flag) {
  133. dialogTop("请选择指定成员", "error");
  134. }
  135. return false;
  136. }
  137. }
  138. $.SaveForm({
  139. url: "../../FlowManage/FlowProcess/DesignateProcess",
  140. param: { processId: keyValue, makeLists: makeLists },
  141. loading: "正在保存指派人员...",
  142. success: function () {
  143. $.currentIframe().$("#gridTable").trigger("reloadGrid");
  144. }
  145. })
  146. }
  147. </script>
  148. <div>
  149. <div class="bottomline">
  150. <div class="rdio rdio-color_a"><input name="AuthorizeType" value="0" id="ShcemeAuthorize0" type="radio" checked /><label for="ShcemeAuthorize0">所有成员</label></div>
  151. <div class="rdio rdio-color_a"><input name="AuthorizeType" value="1" id="ShcemeAuthorize1" type="radio" /><label for="ShcemeAuthorize1">指定成员</label></div>
  152. </div>
  153. <div id="DesignateMember">
  154. <div class="standtabborder">
  155. <div class="standtab standtabactived" onclick="$.standTabchange(this, 'Role')">
  156. 角色
  157. </div>
  158. <div class="standtab " onclick="$.standTabchange(this, 'Post')">
  159. 岗位
  160. </div>
  161. <div class="standtab " onclick="$.standTabchange(this, 'UserGroup')">
  162. 用户组
  163. </div>
  164. <div class="standtab " onclick="$.standTabchange(this, 'User')">
  165. 用户
  166. </div>
  167. </div>
  168. <div id="Role" class="standtab-pane"></div>
  169. <div id="Post" style="display: none;" class="standtab-pane"></div>
  170. <div id="UserGroup" style="display: none;" class="standtab-pane"></div>
  171. <div id="User" style="display: none;" class="standtab-pane"></div>
  172. <div id="DesignateMemberlist" style="margin: 0px; border-right: none; border-left: none; border-bottom: none; background-color: #fff; overflow: auto; padding-bottom: 10px;">
  173. <div id="RoleDiv" class="SchemeAuthorizePanel">
  174. <div class="flow-portal-panel-title"><i class="fa fa-paw"></i>&nbsp;&nbsp;角色</div>
  175. </div>
  176. <div id="PostDiv" class="SchemeAuthorizePanel">
  177. <div class="flow-portal-panel-title"><i class="fa fa-graduation-cap"></i>&nbsp;&nbsp;岗位</div>
  178. </div>
  179. <div id="UserGroupDiv" class="SchemeAuthorizePanel">
  180. <div class="flow-portal-panel-title"><i class="fa fa-group"></i>&nbsp;&nbsp;用户组</div>
  181. </div>
  182. <div id="UserDiv" class="SchemeAuthorizePanel">
  183. <div class="flow-portal-panel-title"><i class="fa fa-user"></i>&nbsp;&nbsp;用户</div>
  184. </div>
  185. </div>
  186. <div id="Treebackground" style="position: fixed; top: 44px; left: 0px; z-index: 2; width: 1100px; height: 528px; background: #000; filter: alpha(opacity=10); opacity: 0.1;"></div>
  187. </div>
  188. </div>
  189. <style>
  190. .standtab-pane {
  191. width: 224px;
  192. border-right: 1px solid #ccc;
  193. float: left;
  194. }
  195. .SchemeAuthorizePanel {
  196. width: 828px;
  197. float: left;
  198. display: none;
  199. }
  200. .card-box.active {
  201. background: url(../../Content/Images/item_close.png) right top no-repeat !important;
  202. }
  203. </style>