Index.cshtml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. @using MES.Production.Service;
  2. @using Central.Control.Domain;
  3. @using Ant.Service.Common;
  4. @using CommonToolHelper;
  5. @{
  6. ViewBag.Title = "经销商信息";
  7. Layout = "~/Views/Shared/_Layout.cshtml";
  8. }
  9. @model Central.Control.Domain.SYS_DISTRIBUTORS
  10. <style>
  11. body {
  12. height: auto;
  13. }
  14. .pad {
  15. margin: 10px 20px 10px 0px;
  16. }
  17. .tab-pane .form-group .under {
  18. border-bottom: 1px solid #ccc;
  19. min-height: 18px;
  20. float: left;
  21. margin-top: 7px;
  22. }
  23. .tab-pane .form-group .col-sm-1 {
  24. width: 15%;
  25. }
  26. </style>
  27. <div class="pad">
  28. <!-- head star -->
  29. <div class="tnav row wrapper border-bottom white-bg page-heading" style="margin: 5px 0px !important">
  30. <div class="col-sm-3">
  31. <h2 class="fl">经销商信息</h2>
  32. </div>
  33. <div class="col-sm-9">
  34. <div class="ibox-tools rboor" style="margin-top: 15px !important;">
  35. <a class="btn btn-primary btn-xs p310" id="insert" action="add"><i class="im-plus"></i> 创建新经销商</a>
  36. @{
  37. if (Model.ID != null)
  38. {
  39. <a class="btn btn-primary btn-xs p310" id="iChild" action="addchild"><i class="im-arrow-right"></i> 创建下级经销商</a>
  40. <a class="btn btn-primary btn-xs p310" id="allocation" action="allocation"><i class="im-road"></i> 分配岗位</a>
  41. <a class="btn btn-primary btn-xs p310" id="modify" action="edit"><i class="im-pencil2"></i> 编辑</a>
  42. <a class="btn btn-primary btn-xs p310" id="deletes" action="remove"><i class="im-remove4"></i> 删除</a>
  43. }
  44. }
  45. </div>
  46. </div>
  47. </div>
  48. <!-- head end -->
  49. <!-- form star -->
  50. <div class="row white-bg animated fadeInRight">
  51. <div class="wrapper-content">
  52. <form class="form-horizontal mform tip-wal">
  53. <div class="panel-body">
  54. <div class="tab-content">
  55. <div id="tab-1" class="tab-pane active">
  56. <div class="form-group">
  57. <label class="col-sm-1 control-label">经销商编号</label>
  58. <label class="col-sm-10 under">
  59. @Html.Hidden("dptId", Model.ID)@Model.CODE
  60. </label>
  61. </div>
  62. <div class="form-group">
  63. <label class="col-sm-1 control-label">经销商名称</label>
  64. <label class="col-sm-10 under"> @Model.NAME</label>
  65. </div>
  66. <div class="form-group">
  67. <label class="col-sm-1 control-label">经销商级别</label>
  68. <label class="col-sm-10 under">@Model.BUSINESSLEVEL</label>
  69. </div>
  70. <div class="form-group">
  71. <label class="col-sm-1 control-label">经销商排序值</label>
  72. <label class="col-sm-10 under">
  73. @Model.SHOWORDER
  74. </label>
  75. </div>
  76. <div class="form-group">
  77. <label class="col-sm-1 control-label">创建时间</label>
  78. <label class="col-sm-10 under">
  79. @Model.CREATEDATE
  80. </label>
  81. </div>
  82. <div class="form-group">
  83. <label class="col-sm-1 control-label">创建时间</label>
  84. <label class="col-sm-10 under">
  85. @Model.CREATEDATE
  86. </label>
  87. </div>
  88. @{
  89. var postlist = ViewData["postInfo"] as List<SYS_POST>;
  90. var userlist = ViewData["userInfo"] as dynamic;
  91. if (postlist != null && postlist.Count > 0)
  92. {
  93. foreach (var item in postlist)
  94. {
  95. <div class="form-group">
  96. <label class="col-sm-1 control-label">@item.POSTNAME</label>
  97. <label class="col-sm-10 under">
  98. @{
  99. if (userlist != null)
  100. {
  101. string name = string.Empty;
  102. foreach (var user in userlist)
  103. {
  104. if (user.POSTID == item.ID)
  105. {
  106. name += user.NAME + ",";
  107. }
  108. }
  109. @Html.Raw(name.TrimEnd(','))
  110. }
  111. }
  112. </label>
  113. </div>
  114. }
  115. }
  116. }
  117. </div>
  118. </div>
  119. </div>
  120. </form>
  121. </div>
  122. </div>
  123. <!-- form end -->
  124. </div>
  125. @section scripts{
  126. <script type="text/javascript">
  127. //列表增加
  128. $("#insert").click(function () {
  129. dig.addModel("添加/编辑经销商", "/Sys/Department/detail", 700, 800, function () {
  130. if (this.returnValue == 'yes') {
  131. location.reload();
  132. }
  133. });
  134. });
  135. //分配岗位
  136. $('#allocation').click(function () {
  137. dig.addModel('分配岗位', '/Sys/Post/PostCall?dptId=' + $('#dptId').val(), 500, 400, function () {
  138. if (this.returnValue == 'yes') {
  139. location.reload();
  140. }
  141. });
  142. });
  143. //添加子部门
  144. $('#iChild').click(function () {
  145. dig.addModel("添加下级经销商", "/Sys/Department/detail?parentId=" + $('#dptId').val(), 700, 300, function () {
  146. if (this.returnValue == 'yes') {
  147. location.reload();
  148. }
  149. });
  150. });
  151. //列表选择修改
  152. $('#modify').click(function () {
  153. dig.addModel("添加/编辑经销商", "/Sys/Department/detail/" + $('#dptId').val(), 700, 800, function () {
  154. if (this.returnValue == 'yes') {
  155. location.reload();
  156. }
  157. });
  158. });
  159. //删除
  160. $('#deletes').click(function () {
  161. var vals = $('#dptId').val();
  162. if (vals == '' || vals == ',') {
  163. dig.alertError("提示", "对不起,请选中您要操作的记录!");
  164. return;
  165. }
  166. var msg = "删除记录后不可恢复,您确定吗?";
  167. dig.confirm("删除确认", msg, function () {
  168. $.post('/Sys/Department/Delete', { idList: vals }, function (res) {
  169. if (res.Status == "y") {
  170. dig.alertSuccess('提示', '删除成功', function () {
  171. location.reload();
  172. });
  173. } else {
  174. dig.alertError("提示", res.Msg);
  175. }
  176. }, "json");
  177. });
  178. });
  179. </script>
  180. }