Detail.cshtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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("Save", 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. <select id="postid" name="postid" class="input-sm form-control input-s-sm inline">
  46. <option value="" @(ViewData["postid"] == null ? "selected=\"selected\"" : "")>--请选择--</option>
  47. @{ var post = ViewData["postType"] as List<SYS_ROLE>;
  48. foreach (var item in post)
  49. {
  50. <option value="@item.ID" @(Model.USERTYPE != null && Model.USERTYPE == Convert.ToInt32(item.ID) ? "selected" : "")>@item.ROLENAME</option>
  51. }
  52. }
  53. </select>
  54. </div>
  55. </div>
  56. @*<div class="form-group">
  57. <label class="col-lg-3 control-label">所属经销商:</label>
  58. <div class="col-lg-8">
  59. <select id="DPTID" name="DPTID" class="form-control select2">
  60. <option value="" @(string.IsNullOrEmpty(Model.DPTID) ? "selected" : "")>--请选择--</option>
  61. @{
  62. foreach (var item in ViewBag.dpt)
  63. {
  64. <option value="@item.id" @(Model.DPTID == @item.id ? "selected" : "")>@CommonHtmlHelper.RtfTextToHtml(item.name)</option>
  65. }
  66. }
  67. </select>
  68. </div>
  69. </div>*@
  70. <div class="clearfix f-hafl">
  71. <div class="col-hafl">
  72. <div class="form-group">
  73. <label class="col-lg-3 control-label">登录账号:</label>
  74. <div class="col-lg-8">
  75. @Html.HiddenFor(p => p.ID)
  76. @Html.TextBoxFor(p => p.ACCOUNT, new { @class = "form-control", @id = "account", @placeholder = "请输入登录账号", @datatype = "*", @nullmsg = "请输入登录账号!", @errormsg = "请输入登录账号!" })
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="col-lg-3 control-label">手机号:</label>
  81. <div class="col-lg-8">
  82. @Html.TextBoxFor(p => p.PHONE, new
  83. {
  84. @class = "form-control",
  85. @datatype = "n",
  86. @nullmsg = "请输入手机号",
  87. @placeholder = "请输入手机号",
  88. @errormsg = "手机号格式无效"
  89. })
  90. </div>
  91. </div>
  92. </div>
  93. <div class="col-hafl">
  94. <div class="form-group">
  95. <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">用户姓名:</label>
  96. <div class="col-lg-8">
  97. @Html.TextBoxFor(p => p.NAME, new { @class = "form-control", @placeholder = "请输入用户姓名", @datatype = "*1-10", @nullmsg = "请输入用户姓名" })
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">属性:</label>
  102. <div class="col-lg-8" style="text-align:left;">
  103. <label class="checkbox-inline">
  104. <input type="checkbox" class="i-check" id="iscanlogin" name="iscanlogin" @(Model.ISCANLOGIN != false ? "checked" : "") />是否锁定
  105. </label>
  106. </div>
  107. </div>
  108. @*<div class="form-group">
  109. <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">密码:</label>
  110. <div class="col-lg-8">
  111. @Html.TextBoxFor(p => p.WORKNUMBER, new
  112. {
  113. @class = "form-control",
  114. @datatype = "*",
  115. @type = "password",
  116. @nullmsg = "请输入用户密码",
  117. @placeholder = "请输入用户密码",
  118. @errormsg = "请输入有效的用户密码"
  119. })
  120. </div>
  121. </div>*@
  122. @*<div class="form-group">
  123. <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">员工级别:</label>
  124. <div class="col-lg-8">
  125. <select name="LEVELS" id="LEVELS" class="form-control" datatype="*" nullmsg="请选择员工级别">
  126. <option value="">请选择</option>
  127. @{
  128. var level = ViewData["levels"] as List<SYS_CODE>;
  129. if (level != null && level.Count > 0)
  130. {
  131. foreach (var item in level)
  132. {
  133. <option value="@item.CODEVALUE" @(!string.IsNullOrEmpty(Model.LEVELS) && Model.LEVELS == item.CODEVALUE ? "selected" : "")>@item.NAMETEXT</option>
  134. }
  135. }
  136. }
  137. </select>
  138. </div>
  139. </div>*@
  140. </div>
  141. </div>
  142. @*<div class="form-group">
  143. <label class="col-lg-3 control-label">兼职经销商:</label>
  144. <div class="col-lg-8">
  145. @{ var dptlist = ViewData["dptlist"] as List<SYS_DISTRIBUTORS>;
  146. var dptname = string.Empty;
  147. var dptid = string.Empty;
  148. if (dptlist != null && dptlist.Count > 0)
  149. {
  150. dptname = dptlist.Aggregate(string.Empty, (current, t) => current + t.NAME + ",").TrimEnd(',');
  151. dptid = dptlist.Aggregate(string.Empty, (current, t) => current + t.ID + ",").TrimEnd(',');
  152. }
  153. }
  154. <span id="dpt" class="form-control" style="padding:8px 5px; font-size:14px;overflow:hidden;">
  155. @dptname
  156. </span>
  157. @Html.Hidden("hiddpt", dptid)
  158. <button class="changeicon" id="changeDpt" type="button">
  159. 选择
  160. </button>
  161. </div>
  162. </div>*@
  163. <div class="hr-line-dashed" style="margin:0;">
  164. <div class="form-group m20">
  165. <div class="col-sm-2 col-sm-offset-2">
  166. <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
  167. <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="im-undo2"></i> 取消返回</button>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. }
  176. @section scripts{
  177. <script type="text/javascript">
  178. $(function () {
  179. $('.form-horizontal').initValidform();
  180. $('.select2').select2();
  181. //分配部门
  182. $('#changeDpt').click(function () {
  183. var vals = $('#hiddpt').val();
  184. top.dialog({
  185. url: '/Sys/Department/GetSelectDpt',
  186. title: '选择经销商',
  187. width: 450,
  188. height: 500,
  189. data: vals, // 给 iframe 的数据
  190. onclose: function () {
  191. if (this.returnValue != 'no') {
  192. $('#hiddpt').val(this.returnValue.split('|')[0]);
  193. $('#dpt').html(this.returnValue.split('|')[1]);
  194. //清理岗位
  195. $('#hidpost').val('');
  196. $('#post').html('');
  197. }
  198. },
  199. oniframeload: function () {
  200. }
  201. }).showModal();
  202. return false;
  203. });
  204. //分配岗位
  205. $('#changePost').click(function () {
  206. var dptid = $('#DPTID').val() + ',' + $('#hiddpt').val();
  207. if ($('#DPTID').val() == '' && $('#hiddpt').val() == '') {
  208. dig.alertError('提示', '请选择部门后再选择岗位');
  209. return;
  210. }
  211. var vals = $('#hidpost').val();
  212. top.dialog({
  213. url: '/Sys/Post/PostUser?dptid=' + dptid,
  214. title: '分配岗位',
  215. width: 500,
  216. height: 500,
  217. data: vals, // 给 iframe 的数据
  218. onclose: function () {
  219. if (this.returnValue != 'no') {
  220. $('#hidpost').val(this.returnValue.split('|')[0]);
  221. $('#post').html(this.returnValue.split('|')[1]);
  222. }
  223. },
  224. oniframeload: function () {
  225. }
  226. }).showModal();
  227. return false;
  228. });
  229. });
  230. </script>
  231. }