UserDetail.cshtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. @{
  2. ViewBag.Title = "Detail";
  3. Layout = "~/Views/Shared/_Layout.cshtml";
  4. }
  5. @using MES.Production.Service;
  6. @using Central.Control.Domain;
  7. @using Ant.Service.Common;
  8. @using Ant.Service.Common.Enums;
  9. @using CommonToolHelper;
  10. @model SYS_USER
  11. <style>
  12. body {
  13. background-color: white;
  14. }
  15. .changeicon {
  16. float: right;
  17. margin-right: -15px;
  18. position: absolute;
  19. right: -7px;
  20. top: 0px;
  21. border: none;
  22. background-color: #18a689;
  23. color: #FFFFFF;
  24. line-height: 33px;
  25. height: 33px;
  26. }
  27. </style>
  28. @using (Ajax.BeginForm("UserSave", null, new AjaxOptions()
  29. {
  30. HttpMethod = "Post",
  31. OnBegin = "SubAjax.Loading",
  32. OnComplete = "SubAjax.Complate",
  33. OnFailure = "SubAjax.Failure",
  34. OnSuccess = "SubAjax.Success"
  35. },
  36. new { @class = "form-horizontal dig-from", @role = "form" }))
  37. {
  38. <div class="wrapper-content">
  39. <div class="panel-body" style="padding-top:0px;">
  40. <div class="tab-content">
  41. <div id="tab-1" class="tab-pane active">
  42. <div class="form-group">
  43. <label class="col-lg-3 control-label">选择角色:</label>
  44. <div class="col-lg-8">
  45. @Html.Hidden("userpostid", ViewData["postid"])
  46. <select id="postid" name="postid" disabled="disabled" class="input-sm form-control input-s-sm inline">
  47. <option value="" @(ViewData["postid"] == null ? "selected=\"selected\"" : "")>--请选择--</option>
  48. @{ var post = ViewData["postType"] as List<SYS_CODE>;
  49. foreach (var item in post)
  50. {
  51. <option value="@item.CODEVALUE" @(Model.USERTYPE != null && Model.USERTYPE == Convert.ToInt32(item.CODEVALUE) ? "selected" : "")>@item.NAMETEXT</option>
  52. }
  53. }
  54. </select>
  55. </div>
  56. </div>
  57. @*<div class="form-group">
  58. <label class="col-lg-3 control-label">所属经销商:</label>
  59. <div class="col-lg-8">
  60. <select id="DPTID" name="DPTID" class="form-control select2">
  61. <option value="" @(string.IsNullOrEmpty(Model.DPTID) ? "selected" : "")>--请选择--</option>
  62. @{
  63. foreach (var item in ViewBag.dpt)
  64. {
  65. <option value="@item.id" @(Model.DPTID == @item.id ? "selected" : "")>@CommonHtmlHelper.RtfTextToHtml(item.name)</option>
  66. }
  67. }
  68. </select>
  69. </div>
  70. </div>*@
  71. <div class="clearfix f-hafl">
  72. <div class="col-hafl">
  73. @*<div class="form-group">
  74. <label class="col-lg-3 control-label">登录账号:</label>
  75. <div class="col-lg-8">
  76. @Html.HiddenFor(p => p.ID)
  77. @Html.TextBoxFor(p => p.ACCOUNT, new { @class = "form-control", @id = "account", @placeholder = "请输入登录账号", @datatype = "*", @nullmsg = "请输入登录账号!", @errormsg = "请输入登录账号!" })
  78. </div>
  79. </div>*@
  80. <div class="form-group">
  81. <label class="col-lg-3 control-label">手机号:</label>
  82. <div class="col-lg-8">
  83. @Html.HiddenFor(p => p.ID)
  84. @Html.TextBoxFor(p => p.PHONE, new
  85. {
  86. @class = "form-control",
  87. @datatype = "n11-11",
  88. @nullmsg = "请输入手机号",
  89. @placeholder = "请输入手机号",
  90. @errormsg = "手机号只能输入数字"
  91. })
  92. </div>
  93. </div>
  94. </div>
  95. <div class="col-hafl">
  96. <div class="form-group">
  97. <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">用户姓名:</label>
  98. <div class="col-lg-8">
  99. @Html.TextBoxFor(p => p.NAME, new { @class = "form-control", @placeholder = "请输入用户姓名", @datatype = "*1-10", @nullmsg = "请输入用户姓名" })
  100. </div>
  101. </div>
  102. @*<div class="form-group">
  103. <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">属性:</label>
  104. <div class="col-lg-8" style="text-align:left;">
  105. <label class="checkbox-inline">
  106. <input type="checkbox" class="i-check" id="iscanlogin" name="iscanlogin" @(Model.ISCANLOGIN != false ? "checked" : "") />是否锁定
  107. </label>
  108. </div>
  109. </div>*@
  110. @*<div class="form-group">
  111. <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">密码:</label>
  112. <div class="col-lg-8">
  113. @Html.TextBoxFor(p => p.WORKNUMBER, new
  114. {
  115. @class = "form-control",
  116. @datatype = "*",
  117. @type = "password",
  118. @nullmsg = "请输入用户密码",
  119. @placeholder = "请输入用户密码",
  120. @errormsg = "请输入有效的用户密码"
  121. })
  122. </div>
  123. </div>*@
  124. @*<div class="form-group">
  125. <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">员工级别:</label>
  126. <div class="col-lg-8">
  127. <select name="LEVELS" id="LEVELS" class="form-control" datatype="*" nullmsg="请选择员工级别">
  128. <option value="">请选择</option>
  129. @{
  130. var level = ViewData["levels"] as List<SYS_CODE>;
  131. if (level != null && level.Count > 0)
  132. {
  133. foreach (var item in level)
  134. {
  135. <option value="@item.CODEVALUE" @(!string.IsNullOrEmpty(Model.LEVELS) && Model.LEVELS == item.CODEVALUE ? "selected" : "")>@item.NAMETEXT</option>
  136. }
  137. }
  138. }
  139. </select>
  140. </div>
  141. </div>*@
  142. </div>
  143. </div>
  144. @*<div class="form-group">
  145. <label class="col-lg-3 control-label">兼职经销商:</label>
  146. <div class="col-lg-8">
  147. @{ var dptlist = ViewData["dptlist"] as List<SYS_DISTRIBUTORS>;
  148. var dptname = string.Empty;
  149. var dptid = string.Empty;
  150. if (dptlist != null && dptlist.Count > 0)
  151. {
  152. dptname = dptlist.Aggregate(string.Empty, (current, t) => current + t.NAME + ",").TrimEnd(',');
  153. dptid = dptlist.Aggregate(string.Empty, (current, t) => current + t.ID + ",").TrimEnd(',');
  154. }
  155. }
  156. <span id="dpt" class="form-control" style="padding:8px 5px; font-size:14px;overflow:hidden;">
  157. @dptname
  158. </span>
  159. @Html.Hidden("hiddpt", dptid)
  160. <button class="changeicon" id="changeDpt" type="button">
  161. 选择
  162. </button>
  163. </div>
  164. </div>*@
  165. <div class="hr-line-dashed" style="margin:0;">
  166. <div class="form-group m20">
  167. <div class="col-sm-2 col-sm-offset-2">
  168. <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
  169. <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="im-undo2"></i> 取消返回</button>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. }
  178. @section scripts{
  179. <script type="text/javascript">
  180. $(function () {
  181. $('.form-horizontal').initValidform();
  182. $('.select2').select2();
  183. //分配部门
  184. $('#changeDpt').click(function () {
  185. var vals = $('#hiddpt').val();
  186. top.dialog({
  187. url: '/Sys/Department/GetSelectDpt',
  188. title: '选择经销商',
  189. width: 450,
  190. height: 500,
  191. data: vals, // 给 iframe 的数据
  192. onclose: function () {
  193. if (this.returnValue != 'no') {
  194. $('#hiddpt').val(this.returnValue.split('|')[0]);
  195. $('#dpt').html(this.returnValue.split('|')[1]);
  196. //清理岗位
  197. $('#hidpost').val('');
  198. $('#post').html('');
  199. }
  200. },
  201. oniframeload: function () {
  202. }
  203. }).showModal();
  204. return false;
  205. });
  206. //分配岗位
  207. $('#changePost').click(function () {
  208. var dptid = $('#DPTID').val() + ',' + $('#hiddpt').val();
  209. if ($('#DPTID').val() == '' && $('#hiddpt').val() == '') {
  210. dig.alertError('提示', '请选择部门后再选择岗位');
  211. return;
  212. }
  213. var vals = $('#hidpost').val();
  214. top.dialog({
  215. url: '/Sys/Post/PostUser?dptid=' + dptid,
  216. title: '分配岗位',
  217. width: 500,
  218. height: 500,
  219. data: vals, // 给 iframe 的数据
  220. onclose: function () {
  221. if (this.returnValue != 'no') {
  222. $('#hidpost').val(this.returnValue.split('|')[0]);
  223. $('#post').html(this.returnValue.split('|')[1]);
  224. }
  225. },
  226. oniframeload: function () {
  227. }
  228. }).showModal();
  229. return false;
  230. });
  231. });
  232. </script>
  233. }