Form.cshtml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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/Department/GetOrganizeTreeJson",
  16. description: "==请选择==",
  17. height: "180px",
  18. allowSearch: true
  19. });
  20. //获取表单
  21. if (!!keyValue) {
  22. $.SetForm({
  23. url: "../../BaseManage/Job/GetFormJson",
  24. param: { keyValue: keyValue },
  25. success: function (data) {
  26. $("#form1").SetWebControls(data);
  27. }
  28. });
  29. } else {
  30. $("#OrganizeId").ComboBoxTreeSetValue(organizeId);
  31. }
  32. }
  33. //保存表单
  34. function AcceptClick() {
  35. if (!$('#form1').Validform()) {
  36. return false;
  37. }
  38. var postData = $("#form1").GetWebControls(keyValue);
  39. $.SaveForm({
  40. url: "../../BaseManage/Job/SaveForm?keyValue=" + keyValue,
  41. param: postData,
  42. loading: "正在保存数据...",
  43. success: function () {
  44. $.currentIframe().$("#gridTable").trigger("reloadGrid");
  45. }
  46. })
  47. }
  48. </script>
  49. <div style="margin-left: 10px; margin-top: 20px; margin-right: 30px;">
  50. <table class="form">
  51. <tr>
  52. <th class="formTitle">所在部门<font face="宋体">*</font></th>
  53. <td class="formValue">
  54. <div id="OrganizeId" type="selectTree" class="ui-select" isvalid="yes" checkexpession="NotNull">
  55. </div>
  56. </td>
  57. </tr>
  58. <tr>
  59. <td class="formTitle">职位编号<font face="宋体">*</font></td>
  60. <td class="formValue">
  61. <input id="EnCode" type="text" class="form-control" onblur="$.ExistField(this.id,'../../BaseManage/Job/ExistEnCode')" placeholder="请输入编号" isvalid="yes" checkexpession="NotNull" />
  62. </td>
  63. </tr>
  64. <tr>
  65. <td class="formTitle">职位名称<font face="宋体">*</font></td>
  66. <td class="formValue">
  67. <input id="FullName" type="text" class="form-control" onblur="$.ExistField(this.id,'../../BaseManage/Job/ExistFullName')" placeholder="请输入名称" isvalid="yes" checkexpession="NotNull" />
  68. </td>
  69. </tr>
  70. <tr>
  71. <th class="formTitle" style="height: 37px;"></th>
  72. <td class="formValue">
  73. <div class="checkbox">
  74. <label>
  75. <input id="EnabledMark" type="checkbox" checked="checked" />
  76. 有效
  77. </label>
  78. </div>
  79. </td>
  80. </tr>
  81. <tr>
  82. <th class="formTitle" valign="top" style="padding-top: 4px;">职位描述
  83. </th>
  84. <td class="formValue">
  85. <textarea id="Description" class="form-control" style="height: 70px;"></textarea>
  86. </td>
  87. </tr>
  88. </table>
  89. </div>