Form.cshtml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. @{
  2. ViewBag.Title = "角色成员";
  3. Layout = "~/Views/Shared/_LayoutIndex.cshtml";
  4. }
  5. <script>
  6. var keyValue = request('keyValue');
  7. $(function () {
  8. InitialPage();
  9. GetMember();
  10. });
  11. //初始化页面
  12. function InitialPage() {
  13. //layout布局
  14. $('#layout').layout({
  15. applyDemoStyles: true,
  16. west__size: 260,
  17. spacing_open: 0,
  18. onresize: function () {
  19. $(window).resize()
  20. }
  21. });
  22. $(".center-Panel").height($(window).height() - 40)
  23. $(".west-Panel").height($(window).height());
  24. //被委托人
  25. $("#ToUserId").ComboBoxTree({
  26. url: "../../BaseManage/User/GetTreeJson",
  27. description: "==请选择==",
  28. height: "348px",
  29. allowSearch: true
  30. });
  31. if (!!keyValue)
  32. {
  33. //获取表单
  34. $.SetForm({
  35. url: "../../FlowManage/FlowDelegate/GetRuleEntityJson",
  36. param: { keyValue: keyValue },
  37. success: function (data) {
  38. $("#ruleinfo").SetWebControls(data);
  39. }
  40. });
  41. }
  42. }
  43. //加载成员
  44. function GetMember() {
  45. $.ajax({
  46. url: "../../FlowManage/FlowDelegate/GetSchemeInfoList?ruleId=" + keyValue,
  47. type: "get",
  48. dataType: "json",
  49. async: false,
  50. success: function (data) {
  51. var _html = "";
  52. $.each(data, function (i,row) {
  53. var imgName = "Scheme.png";
  54. var active = "";
  55. if (row.ischecked == 1) {
  56. active = "active";
  57. }
  58. _html += '<div class="card-box shcemeinfocheck ' + active + '">';
  59. _html += ' <div class="card-box-img">';
  60. _html += ' <img src="/Content/images/filetype/' + imgName + '" />';
  61. _html += ' </div>';
  62. _html += ' <div id="' + row.id + '" class="card-box-content">';
  63. _html += ' <p>编号:' + row.schemecode + '</p>';
  64. _html += ' <p>名称:' + row.schemename + '</p>';
  65. _html += ' <p>类别:' + row.schemetypename + '</p>';
  66. _html += ' </div><i></i>';
  67. _html += '</div>';
  68. });
  69. $(".gridPanel").html(_html);
  70. $(".card-box").click(function () {
  71. if (!$(this).hasClass("active")) {
  72. $(this).addClass("active")
  73. } else {
  74. $(this).removeClass("active")
  75. }
  76. })
  77. Loading(false);
  78. }, beforeSend: function () {
  79. Loading(true);
  80. }
  81. });
  82. //模糊查询模板(注:这个方法是理由jquery查询)
  83. $("#txt_TreeKeyword").keyup(function () {
  84. var value = $(this).val();
  85. if (value != "") {
  86. window.setTimeout(function () {
  87. $(".shcemeinfocheck")
  88. .hide()
  89. .filter(":contains('" + (value) + "')")
  90. .show();
  91. }, 200);
  92. } else {
  93. $(".shcemeinfocheck").show();
  94. }
  95. }).keyup();
  96. }
  97. //保存表单
  98. function AcceptClick() {
  99. if (!$('#ruleinfo').Validform()) {
  100. return false;
  101. }
  102. var _schemeInfoIds = [];
  103. $('.gridPanel .active .card-box-content').each(function () {
  104. _schemeInfoIds.push($(this).attr('id'));
  105. });
  106. var postData = $("#ruleinfo").GetWebControls();
  107. postData["ToUserName"] = $('#ToUserId').attr('data-text');
  108. $.SaveForm({
  109. url: "../../FlowManage/FlowDelegate/SaveDelegateRule",
  110. param: { keyValue: keyValue, rlueStr: JSON.stringify(postData), shcemeInfoIds: String(_schemeInfoIds) },
  111. loading: "正在保存委托规则...",
  112. success: function () {
  113. $.currentIframe().$("#gridTable").trigger("reloadGrid");
  114. }
  115. })
  116. }
  117. </script>
  118. <div class="ui-layout" id="layout" style="height: 100%; width: 100%;">
  119. <div class="ui-layout-west">
  120. <div class="west-Panel" style="margin: 0px; border-top: none; border-left: none; border-bottom: none;">
  121. <div style="color:#9f9f9f;padding-top:5px; padding-bottom:5px;padding-left:8px;"><i style="padding-right:5px;" class="fa fa-info-circle"></i><span>填写内容,选择右侧工作流模板</span></div>
  122. <table class="form" id="ruleinfo">
  123. <tr>
  124. <th class="formTitle">被委托人<font face="宋体">*</font></th>
  125. <td class="formValue">
  126. <div id="ToUserId" type="selectTree" class="ui-select" isvalid="yes" checkexpession="NotNull">
  127. </div>
  128. </td>
  129. </tr>
  130. <tr>
  131. <td class="formTitle">开始时间<font face="宋体">*</font></td>
  132. <td class="formValue">
  133. <input id="BeginDate" readonly type="text" class="form-control input-datepicker" isvalid="yes" checkexpession="NotNull" onfocus="WdatePicker({ minDate: '%y-%M-%d' })">
  134. </td>
  135. </tr>
  136. <tr>
  137. <td class="formTitle">结束时间<font face="宋体">*</font></td>
  138. <td class="formValue">
  139. <input id="EndDate" readonly type="text" class="form-control input-datepicker" isvalid="yes" checkexpession="NotNull" onfocus="WdatePicker({ minDate: '%y-%M-%d' })">
  140. </td>
  141. </tr>
  142. <tr>
  143. <th class="formTitle" valign="top" style="padding-top: 4px;">
  144. 委托理由
  145. </th>
  146. </tr>
  147. <tr>
  148. <td class="formValue" colspan="2">
  149. <textarea id="Description" class="form-control" style="height: 267px;"></textarea>
  150. </td>
  151. </tr>
  152. </table>
  153. </div>
  154. </div>
  155. <div class="ui-layout-center">
  156. <div class="treesearch">
  157. <input id="txt_TreeKeyword" type="text" class="form-control" style="border-top: none;" placeholder="请输入要查询关键字" />
  158. <span id="btn_TreeSearch" class="input-query" title="Search"><i class="fa fa-search"></i></span>
  159. </div>
  160. <div class="center-Panel" style="margin: 0px; border-right: none; border-left: none; border-bottom: none; background-color: #fff; overflow: auto; padding-bottom: 10px;">
  161. <div class="gridPanel">
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <style>
  167. .form .formTitle {
  168. width:65px;
  169. }
  170. .card-box-img {
  171. line-height:initial;
  172. }
  173. .card-box-img img {
  174. width: 59px;
  175. height: 58px;
  176. border-radius: 0px;
  177. margin-left:0px;
  178. }
  179. </style>