Agricultural.cshtml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. 
  2. @{
  3. ViewBag.Title = "Agricultural";
  4. Layout = "~/Views/Shared/_Layout.cshtml";
  5. }
  6. @using MES.Production.Service;
  7. @using Central.Control.Domain;
  8. @using Ant.Service.Common;
  9. @using Ant.Service.Common.Enums;
  10. @using CommonToolHelper;
  11. @using MES.Production.Entity;
  12. @model PageInfo
  13. <!-- table star -->
  14. <div class="row col-lg-12">
  15. <div class="wrapper wrapper-content animated fadeInUp">
  16. <div class="ibox">
  17. <div class="ibox-title">
  18. <h5>农机手管理</h5>
  19. <div class="ibox-tools rboor">
  20. <a class="btn btn-primary btn-xs p310" id="modify" action="edit"><i class="im-pencil2"></i> 编辑</a>
  21. <a class="btn btn-primary btn-xs p310" id="delete" action="remove"><i class="im-remove4"></i> 删除</a>
  22. </div>
  23. </div>
  24. <div class="ibox-content">
  25. <!-- search star -->
  26. @using (Ajax.BeginForm("Agricultural", null, new AjaxOptions() { }, new { @id = "form1", @class = "form-horizontal", @method = "get" }))
  27. {
  28. <div class="form-horizontal clearfix">
  29. <div class="col-lg-4 col-sm-4" style="float:right;">
  30. <div class="form-group">
  31. <div class="col-lg-12 col-sm-12 input-group" style="width:60%; float:right;">
  32. @Html.TextBox("Search", null, new { @class = "input-sm form-control", @placeholder = "请输入查询手机号" })
  33. <span class="input-group-btn">
  34. <button type="button" onclick="submit()" class="btn btn-sm btn-primary">搜索</button>
  35. </span>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <!-- search end -->
  41. <div id="example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  42. <table id="example" class="table table-striped table-bordered table-hover dataTables-example dataTable" cellspacing="0" width="100%">
  43. <thead>
  44. <tr>
  45. <th class="tn" style="width: 40px !important"><input name="checkall" id="checkall" type="checkbox" value=""></th>
  46. <th style="width: 100px !important">用户名</th>
  47. <th>手机号</th>
  48. <th>用户车辆</th>
  49. <th style="width: 170px !important">创建时间</th>
  50. <th>操作</th>
  51. </tr>
  52. </thead>
  53. <tbody>
  54. @{foreach (var item in Model.List)
  55. {
  56. <tr>
  57. <td class="tn"><input name="checkbox_name" type="checkbox" value="@item.ID"></td>
  58. <td>@item.ACCOUNT</td>
  59. <td>@item.PHONE</td>
  60. <td>@item.CarNum</td>
  61. <td>@item.CREATEDATE</td>
  62. <td><a href="javascript:carview('@item.ID')" listaction="detail">查看</a></td>
  63. </tr>
  64. }
  65. }
  66. </tbody>
  67. </table>
  68. <!-- page -->
  69. <div class="bottom">
  70. @if (Model != null)
  71. {
  72. <div class="dataTables_info" id="example_info" Post="status" aria-live="polite">显示第 @Model.BeginPage 至 @Model.EndPage 项结果,共 @Model.Count 项</div>
  73. }
  74. <div class="dataTables_length" id="example_length">
  75. <label>
  76. 显示
  77. <select name="example_length" onchange="submit()" aria-controls="example" class="form-control input-sm">
  78. <option value="10" @(Model.PageSize == 10 ? "selected" : "")>10</option>
  79. <option value="25" @(Model.PageSize == 25 ? "selected" : "")>25</option>
  80. <option value="50" @(Model.PageSize == 50 ? "selected" : "")>50</option>
  81. <option value="100" @(Model.PageSize == 100 ? "selected" : "")>100</option>
  82. </select> 项结果
  83. </label>
  84. </div>
  85. @if (Model != null)
  86. {
  87. CommonHtmlHelper.PaginationPager(Model.Index, Model.PageSize, Model.Count, 7, Model.Url);
  88. }
  89. <div class="clear"></div>
  90. </div>
  91. <!-- page -->
  92. </div>
  93. }
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <!-- table end -->
  99. @section scripts{
  100. <script type="text/javascript">
  101. //点击修改
  102. //function modify(n) {
  103. // dig.addModel('添加/编辑车型', '/Sys/Car/Detail/' + n, 700, 280, function () {
  104. // if (this.returnValue == 'yes') {
  105. // location.reload();
  106. // }
  107. // });
  108. //}
  109. function carview(n) {
  110. dig.addModel('查看/车辆信息', '/Sys/car/CarList?userid=' + n, 1000, 600, function () {
  111. if (this.returnValue == 'yes') {
  112. location.reload();
  113. }
  114. });
  115. }
  116. $(function () {
  117. $('.select2').select2();
  118. //添加
  119. $('#insert').click(function () {
  120. dig.addModel('添加/编辑车型', '/Sys/Car/Detail', 700, 500, function () {
  121. if (this.returnValue == 'yes') {
  122. location.reload();
  123. }
  124. });
  125. });
  126. //修改
  127. $('#modify').click(function () {
  128. var vals = '';
  129. var num = 0;
  130. $('input[name="checkbox_name"]:checked').each(function () {
  131. vals = $(this).val();
  132. num++;
  133. });
  134. if (!vals) {
  135. dig.alertError("提示", "对不起,请选中您要操作的记录!");
  136. return;
  137. }
  138. if (num > 1) {
  139. dig.alertError("提示", "对不起,每次只能修改一条记录!");
  140. return;
  141. }
  142. dig.addModel('添加/编辑车型', '/Sys/Car/Detail/' + vals, 600, 280, function () {
  143. if (this.returnValue == 'yes') {
  144. location.reload();
  145. }
  146. });
  147. });
  148. });
  149. </script>
  150. }