Form.cshtml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. @{
  2. ViewBag.Title = "角色管理";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script>
  6. var keyValue = request('keyValue');
  7. var organizeId = request('organizeId');
  8. $(function () {
  9. initControl();
  10. })
  11. //初始化控件
  12. function initControl() {
  13. //所在公司
  14. $("#OrganizeId").ComboBoxTree({
  15. url: "../../BaseManage/Organize/GetTreeJson",
  16. description: "==请选择==",
  17. height: "200px"
  18. });
  19. //获取表单
  20. if (!!keyValue) {
  21. $.SetForm({
  22. url: "../../BaseManage/Role/GetFormJson",
  23. param: { keyValue: keyValue },
  24. success: function (data) {
  25. $("#form1").SetWebControls(data);
  26. }
  27. });
  28. }
  29. }
  30. //保存表单
  31. function AcceptClick() {
  32. if (!$('#form1').Validform()) {
  33. return false;
  34. }
  35. var postData = $("#form1").GetWebControls(keyValue);
  36. $.SaveForm({
  37. url: "../../BaseManage/Role/SaveForm?keyValue=" + keyValue,
  38. param: postData,
  39. loading: "正在保存数据...",
  40. success: function () {
  41. $.currentIframe().$("#gridTable").trigger("reloadGrid");
  42. }
  43. })
  44. }
  45. </script>
  46. <div style="margin-left: 10px; margin-top: 20px; margin-right: 30px;">
  47. <table class="form">
  48. <tr>
  49. <th class="formTitle">所在公司<font face="宋体">*</font></th>
  50. <td class="formValue">
  51. <div id="OrganizeId" type="selectTree" class="ui-select" isvalid="yes" checkexpession="NotNull">
  52. </div>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td class="formTitle">角色编号<font face="宋体">*</font></td>
  57. <td class="formValue">
  58. <input id="EnCode" type="text" onblur="$.ExistField(this.id,'../../BaseManage/Role/ExistEnCode')" class="form-control" placeholder="请输入编号" isvalid="yes" checkexpession="NotNull" />
  59. </td>
  60. </tr>
  61. <tr>
  62. <td class="formTitle">角色名称<font face="宋体">*</font></td>
  63. <td class="formValue">
  64. <input id="FullName" type="text" onblur="$.ExistField(this.id,'../../BaseManage/Role/ExistFullName')" class="form-control" placeholder="请输入名称" isvalid="yes" checkexpession="NotNull" />
  65. </td>
  66. </tr>
  67. <tr>
  68. <th class="formTitle" style="height: 37px;"></th>
  69. <td class="formValue">
  70. <div class="checkbox">
  71. <label>
  72. <input id="IsPublic" type="checkbox" />
  73. 公共
  74. </label>
  75. <label>
  76. <input id="EnabledMark" type="checkbox" checked="checked" />
  77. 有效
  78. </label>
  79. </div>
  80. </td>
  81. </tr>
  82. <tr>
  83. <th class="formTitle" valign="top" style="padding-top: 4px;">角色描述
  84. </th>
  85. <td class="formValue">
  86. <textarea id="Description" class="form-control" style="height: 70px;"></textarea>
  87. </td>
  88. </tr>
  89. </table>
  90. </div>