You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

168 lines
6.9 KiB

  1. @{
  2. ViewBag.Title = "Form";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script>
  6. var keyValue = "SYS";
  7. $(function () {
  8. initControl();
  9. if (!!keyValue) {
  10. $.ajax({
  11. url: "/SystemManage/User/GetFormJson",
  12. data: { keyValue: keyValue },
  13. dataType: "json",
  14. async: false,
  15. success: function (data) {
  16. $("#form1").formSerialize(data);
  17. $("#F_UserPassword").val("******").attr('disabled', 'disabled');
  18. }
  19. });
  20. }
  21. });
  22. function initControl() {
  23. $("#F_Gender").bindSelect()
  24. $("#F_IsAdministrator").bindSelect()
  25. $("#F_EnabledMark").bindSelect()
  26. $("#F_OrganizeId").bindSelect({
  27. url: "/SystemManage/Organize/GetTreeSelectJson"
  28. });
  29. $("#F_DepartmentId").bindSelect({
  30. url: "/SystemManage/Organize/GetTreeSelectJson",
  31. });
  32. $("#F_RoleId").bindSelect({
  33. url: "/SystemManage/Role/GetGridJson",
  34. id: "F_Id",
  35. text: "F_FullName"
  36. });
  37. $("#F_DutyId").bindSelect({
  38. url: "/SystemManage/Duty/GetGridJson",
  39. id: "F_Id",
  40. text: "F_FullName"
  41. });
  42. $("#F_Location").bindSelect({
  43. url: "/SystemManage/User/GetWorkPoint",
  44. id: "WorkPointCode",
  45. text: "WorkPointName"
  46. });
  47. $("#F_RoleId").change(function () {
  48. var location = $("#F_RoleId").val();
  49. if (location != "供应商") {
  50. $("#th_VenCode").hide();
  51. $("#td_VenCode").hide();
  52. }
  53. else {
  54. $("#th_VenCode").show();
  55. $("#td_VenCode").show();
  56. }
  57. });
  58. }
  59. function submitForm() {
  60. if (!$('#form1').formValid()) {
  61. return false;
  62. }
  63. $.submitForm({
  64. url: "/SystemManage/User/SubmitForm?keyValue=" + keyValue,
  65. param: $("#form1").formSerialize(),
  66. success: function () {
  67. $.currentWindow().$("#gridList").trigger("reloadGrid");
  68. }
  69. })
  70. }
  71. function btn_revisepassword() {
  72. var keyValue = "SYS";
  73. var Account = $("#F_Account").val();
  74. var RealName = $("#F_RealName").val();
  75. $.modalOpen({
  76. id: "RevisePassword",
  77. title: '重置密码',
  78. url: '/SystemManage/User/RevisePassword?keyValue=' + keyValue + "&account=" + escape(Account) + '&realName=' + escape(RealName),
  79. width: "450px",
  80. height: "260px",
  81. callBack: function (iframeId) {
  82. top.frames[iframeId].submitForm();
  83. }
  84. });
  85. }
  86. </script>
  87. <form id="form1">
  88. <div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
  89. <div style="padding-top: 20px; margin-right: 30px;">
  90. <table class="form">
  91. <tr>
  92. <th class="formTitle" valign="top">
  93. </th>
  94. <td class="formValue" colspan="3">
  95. <a id="NF-revisepassword" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_revisepassword()"><i class="fa fa-key"></i>密码重置</a>
  96. </td>
  97. </tr>
  98. <tr>
  99. <th class="formTitle">账户</th>
  100. <td class="formValue">
  101. <input id="F_Account" name="F_Account" type="text" disabled="disabled" class="form-control required" placeholder="请输入账户" />
  102. </td>
  103. <th class="formTitle">密码</th>
  104. <td class="formValue">
  105. <input id="F_UserPassword" name="F_UserPassword" type="password" disabled="disabled" class="form-control required" placeholder="请输入密码" />
  106. </td>
  107. </tr>
  108. <tr>
  109. <th class="formTitle">姓名</th>
  110. <td class="formValue">
  111. <input id="F_RealName" name="F_RealName" type="text" disabled="disabled" class="form-control required" placeholder="请输入姓名" />
  112. </td>
  113. <th class="formTitle">角色</th>
  114. <td class="formValue">
  115. <select id="F_RoleId" name="F_RoleId" disabled="disabled" class="form-control required">
  116. <option value="">==请选择==</option>
  117. </select>
  118. </td>
  119. </tr>
  120. <tr>
  121. <th class="formTitle">手机</th>
  122. <td class="formValue">
  123. <input id="F_MobilePhone" name="F_MobilePhone" type="text" disabled="disabled" class="form-control" />
  124. </td>
  125. <th class="formTitle">邮箱</th>
  126. <td class="formValue">
  127. <input id="F_Email" name="F_Email" type="text" disabled="disabled" class="form-control" />
  128. </td>
  129. </tr>
  130. <tr>
  131. <th class="formTitle">类型</th>
  132. <td class="formValue">
  133. <select id="F_IsAdministrator" name="F_IsAdministrator" disabled="disabled" class="form-control">
  134. <option value="false">普通用户</option>
  135. <option value="true">系统管理员</option>
  136. </select>
  137. </td>
  138. <th class="formTitle">允许登录</th>
  139. <td class="formValue">
  140. <select id="F_EnabledMark" name="F_EnabledMark" disabled="disabled" class="form-control">
  141. <option value="true">是</option>
  142. <option value="false">否</option>
  143. </select>
  144. </td>
  145. </tr>
  146. <tr>
  147. <th class="formTitle">站点</th>
  148. <td class="formValue">
  149. <input id="F_Location" name="F_Location" type="text" disabled="disabled" class="form-control" />
  150. </td>
  151. <th id="th_VenCode" class="formTitle">供应商编码</th>
  152. <td id="td_VenCode">
  153. <input id="F_VenCode" name="F_VenCode" type="text" class="form-control" />
  154. </td>
  155. </tr>
  156. <tr>
  157. <th class="formTitle" valign="top" style="padding-top: 5px;">
  158. 备注
  159. </th>
  160. <td class="formValue" colspan="3">
  161. <textarea id="F_Description" name="F_Description" disabled="disabled" class="form-control" style="height: 60px;"></textarea>
  162. </td>
  163. </tr>
  164. </table>
  165. </div>
  166. </div>
  167. </form>