Index.cshtml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. @{
  2. ViewBag.Title = "经销商负责人";
  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. @using MES.Production.Entity;
  11. @model PageInfo
  12. <!-- table star -->
  13. <div class="row col-lg-12">
  14. <div class="wrapper wrapper-content animated fadeInUp">
  15. <div class="ibox">
  16. <div class="ibox-title">
  17. <h5>负责人产品线管理</h5>
  18. <div class="ibox-tools rboor">
  19. <a class="btn btn-primary btn-xs p310" id="insert" action="add"><i class="im-plus"></i> 添加产品线负责</a>
  20. <a class="btn btn-primary btn-xs p310" id="delete" action="remove"><i class="im-remove4"></i> 删除</a>
  21. </div>
  22. </div>
  23. <div class="ibox-content">
  24. <!-- search star -->
  25. @using (Ajax.BeginForm("Index", null, new AjaxOptions() { }, new { @id = "form1", @class = "form-horizontal", @method = "get" }))
  26. {
  27. <!-- search end -->
  28. <div id="example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  29. <table id="example" class="table table-striped table-bordered table-hover dataTables-example dataTable" cellspacing="0" width="100%">
  30. <thead>
  31. <tr>
  32. <th class="tn" style="width: 40px !important"><input name="checkall" id="checkall" type="checkbox" value=""></th>
  33. <th>用户名</th>
  34. <th>产品线</th>
  35. <th style="width: 100px !important">创建者</th>
  36. <th style="width: 170px !important">创建时间</th>
  37. </tr>
  38. </thead>
  39. <tbody>
  40. @if (Model != null)
  41. {
  42. foreach (var item in Model.List)
  43. {
  44. <tr>
  45. <td class="tn"><input name="checkbox_name" type="checkbox" value="@item.id"></td>
  46. <td style="text-align:left">@item.name</td>
  47. <td>@(item.proudctLine)</td>
  48. <td>@(item.addName)</td>
  49. <td>@item.addTime</td>
  50. </tr>
  51. }
  52. }
  53. </tbody>
  54. </table>
  55. <!-- page -->
  56. <div class="bottom">
  57. @if (Model != null)
  58. {
  59. <div class="dataTables_info" id="example_info" Post="status" aria-live="polite">显示第 @Model.BeginPage 至 @Model.EndPage 项结果,共 @Model.Count 项</div>
  60. <div class="dataTables_length" id="example_length">
  61. <label>
  62. 显示
  63. <select name="example_length" onchange="submit()" aria-controls="example" class="form-control input-sm">
  64. <option value="10" @(Model.PageSize == 10 ? "selected" : "")>10</option>
  65. <option value="25" @(Model.PageSize == 25 ? "selected" : "")>25</option>
  66. <option value="50" @(Model.PageSize == 50 ? "selected" : "")>50</option>
  67. <option value="100" @(Model.PageSize == 100 ? "selected" : "")>100</option>
  68. </select> 项结果
  69. </label>
  70. </div>
  71. CommonHtmlHelper.PaginationPager(Model.Index, Model.PageSize, Model.Count, 7, Model.Url);
  72. }
  73. <div class="clear"></div>
  74. </div>
  75. <!-- page -->
  76. </div>
  77. }
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <!-- table end -->
  83. @section scripts{
  84. <script type="text/javascript">
  85. //点击修改
  86. function modify(n) {
  87. dig.addModel('添加/编辑公告', '/Sys/UserDistributors/Detail/' + n, 700, 600, function () {
  88. if (this.returnValue == 'yes') {
  89. location.reload();
  90. }
  91. });
  92. }
  93. $(function () {
  94. $('.select2').select2();
  95. //添加
  96. $('#insert').click(function () {
  97. dig.addModel('添加/添加产品线负责', '/Sys/UserDistributors/Detail?distributorsid=@ViewData["distributorsid"]', 700, 300, function () {
  98. if (this.returnValue == 'yes') {
  99. location.reload();
  100. }
  101. });
  102. });
  103. //修改
  104. $('#modify').click(function () {
  105. var vals = '';
  106. var num = 0;
  107. $('input[name="checkbox_name"]:checked').each(function () {
  108. vals = $(this).val();
  109. num++;
  110. });
  111. if (!vals) {
  112. dig.alertError("提示", "对不起,请选中您要操作的记录!");
  113. return;
  114. }
  115. if (num > 1) {
  116. dig.alertError("提示", "对不起,每次只能修改一条记录!");
  117. return;
  118. }
  119. dig.addModel('添加/编辑公告', '/Sys/UserDistributors/Detail/' + vals, 700, 600, function () {
  120. if (this.returnValue == 'yes') {
  121. location.reload();
  122. }
  123. });
  124. });
  125. });
  126. </script>
  127. }