Index.cshtml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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>
  19. <div class="ibox-content">
  20. <!-- search star -->
  21. @using (Ajax.BeginForm("Index", null, new AjaxOptions() { }, new { @id = "form1", @class = "form-horizontal", @method = "get" }))
  22. {
  23. <div class="panel panel-default">
  24. <div class="panel-heading">
  25. <h3 class="panel-title">查询条件</h3>
  26. </div>
  27. <div class="panel-body">
  28. <div class="clearfix f-hafl">
  29. <div class="row">
  30. <div class="col-xs-6 col-sm-5">
  31. <label class="col-lg-0 control-label" style="float:left;">起始时间:</label>
  32. <div class="col-lg-6 col-sm-9">
  33. @Html.TextBox("startdate", ViewData["startdate"], new { @class = "form-control", @placeholder = "请输入查询开始时间", @readonly = "readonly" })
  34. </div>
  35. </div>
  36. <div class="col-xs-6 col-sm-5">
  37. <label class="col-lg-0 control-label" style="float:left;">结束时间:</label>
  38. <div class="col-lg-6 col-sm-9">
  39. @Html.TextBox("enddate", ViewData["enddate"], new { @class = "form-control", @placeholder = "请输入查询结束时间", @readonly = "readonly" })
  40. </div>
  41. </div>
  42. <div class="col-xs-2 col-sm-1 text-center">
  43. <button type="button" onclick="submit()" class="btn btn-primary btn-sm active"><i class="im-search"></i>&nbsp;&nbsp;搜 索</button>
  44. @*<a class="btn btn-primary btn-sm active" id="OutExport" action="OutExport"><i class="im-pencil2"></i>&nbsp;&nbsp;导 出</a>*@
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <!-- search end -->
  51. <div id="example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  52. <table id="example" class="table table-striped table-bordered table-hover dataTables-example dataTable" cellspacing="0" width="100%">
  53. <thead>
  54. <tr>
  55. <th>报警类型</th>
  56. <th>报警提示</th>
  57. @*<th style="width: 100px !important">创建者</th>*@
  58. <th style="width: 170px !important">报警时间</th>
  59. </tr>
  60. </thead>
  61. <tbody>
  62. @if (Model != null)
  63. {
  64. foreach (var item in Model.List)
  65. {
  66. <tr>
  67. @*<td class="tn"><input name="checkbox_name" type="checkbox" value="@item.ID"></td>*@
  68. <td>@item.Title</td>
  69. <td>@item.Content</td>
  70. @*<td>@item.Add_Name</td>*@
  71. <td>@(Convert.ToDateTime(item.Add_Time).ToString("yyyy-MM-dd HH:mm:ss"))</td>
  72. @*<td><a href="javascript:carview('@item.CarId')" listaction="detail">查看</a></td>*@
  73. </tr>
  74. }
  75. }
  76. </tbody>
  77. </table>
  78. <!-- page -->
  79. <div class="bottom">
  80. @if (Model != null)
  81. {
  82. <div class="dataTables_info" id="example_info" Post="status" aria-live="polite">显示第 @Model.BeginPage 至 @Model.EndPage 项结果,共 @Model.Count 项</div>
  83. <div class="dataTables_length" id="example_length">
  84. <label>
  85. 显示
  86. <select name="example_length" onchange="submit()" aria-controls="example" class="form-control input-sm">
  87. <option value="10" @(Model.PageSize == 10 ? "selected" : "")>10</option>
  88. <option value="25" @(Model.PageSize == 25 ? "selected" : "")>25</option>
  89. <option value="50" @(Model.PageSize == 50 ? "selected" : "")>50</option>
  90. <option value="100" @(Model.PageSize == 100 ? "selected" : "")>100</option>
  91. </select> 项结果
  92. </label>
  93. </div>
  94. @CommonHtmlHelper.PaginationPager(Model.Index, Model.PageSize, Model.Count, 7, Model.Url);
  95. }
  96. <div class="clear"></div>
  97. </div>
  98. <!-- page -->
  99. </div>
  100. }
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <!-- table end -->
  106. @section scripts{
  107. <link href="~/Content/js/laydate/theme/default/laydate.css" rel="stylesheet" />
  108. <link href="~/Content/js/layui/css/layui.css" rel="stylesheet" />
  109. <script src="~/Content/js/layui/layui.js"></script>
  110. <script src="~/Content/js/laydate/laydate.js"></script>
  111. <script>
  112. layui.use('laydate', function () {
  113. var laydate = layui.laydate;
  114. //日期时间选择器
  115. laydate.render({
  116. elem: '#startdate'
  117. , type: 'datetime'
  118. });
  119. //日期时间选择器
  120. laydate.render({
  121. elem: '#enddate'
  122. , type: 'datetime'
  123. });
  124. });
  125. </script>
  126. <script type="text/javascript">
  127. //点击修改
  128. function modify(n) {
  129. dig.addModel('添加/编辑车型', '/Sys/Car/Detail/' + n, 700, 280, function () {
  130. if (this.returnValue == 'yes') {
  131. location.reload();
  132. }
  133. });
  134. }
  135. function carview(n) {
  136. dig.addModel('查看/车辆信息', '/Sys/car/carmap/' + n, 700, 800, function () {
  137. if (this.returnValue == 'yes') {
  138. location.reload();
  139. }
  140. });
  141. }
  142. $(function () {
  143. $('.select2').select2();
  144. //添加
  145. $('#insert').click(function () {
  146. dig.addModel('添加/编辑车型', '/Sys/Car/Detail', 700, 500, function () {
  147. if (this.returnValue == 'yes') {
  148. location.reload();
  149. }
  150. });
  151. });
  152. //修改
  153. $('#modify').click(function () {
  154. var vals = '';
  155. var num = 0;
  156. $('input[name="checkbox_name"]:checked').each(function () {
  157. vals = $(this).val();
  158. num++;
  159. });
  160. if (!vals) {
  161. dig.alertError("提示", "对不起,请选中您要操作的记录!");
  162. return;
  163. }
  164. if (num > 1) {
  165. dig.alertError("提示", "对不起,每次只能修改一条记录!");
  166. return;
  167. }
  168. dig.addModel('添加/编辑车型', '/Sys/Car/Detail/' + vals, 600, 280, function () {
  169. if (this.returnValue == 'yes') {
  170. location.reload();
  171. }
  172. });
  173. });
  174. });
  175. </script>
  176. }