Index.cshtml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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 CommonToolHelper;
  9. @model PageInfo<COM_FLOWINFO>
  10. <!-- table star -->
  11. <div class="row col-lg-12">
  12. <div class="wrapper wrapper-content animated fadeInUp">
  13. <div class="ibox">
  14. <div class="ibox-title">
  15. <h5>自定义流程管理</h5>
  16. <div class="ibox-tools rboor">
  17. <a class="btn btn-primary btn-xs p310" id="insert" action="add"><i class="im-plus"></i> 添加新流程</a>
  18. <a class="btn btn-primary btn-xs p310" id="modify" action="edit"><i class="im-pencil2"></i> 编辑</a>
  19. <a class="btn btn-primary btn-xs p310" id="delete" action="remove"><i class="im-remove4"></i> 删除</a>
  20. </div>
  21. </div>
  22. <div class="ibox-content">
  23. <!-- search star -->
  24. @using (Ajax.BeginForm("Index", null, new AjaxOptions() { }, new { @id = "form1", @class = "form-horizontal", @method = "get" }))
  25. {
  26. <div class="form-horizontal clearfix">
  27. <div class="col-lg-4 col-sm-4" style="float:right;">
  28. <div class="form-group">
  29. <div class="col-lg-12 col-sm-12 input-group">
  30. @Html.TextBox("Search", null, new { @class = "input-sm form-control", @placeholder = "请输入查询关键词" })
  31. <span class="input-group-btn">
  32. <button type="button" onclick="submit()" class="btn btn-sm btn-primary"> 搜索</button>
  33. </span>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <!-- search end -->
  39. <div id="example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  40. <table id="example" class="table table-striped table-bordered table-hover dataTables-example dataTable" cellspacing="0" width="100%">
  41. <thead>
  42. <tr>
  43. <th class="tn" style="width: 40px !important"><input name="checkall" id="checkall" type="checkbox" value=""></th>
  44. <th style="width:120px !important;">流程编号</th>
  45. <th style="width:200px !important;">流程名称</th>
  46. <th>表单路径</th>
  47. <th>展示路径</th>
  48. <th width="200px">创建时间</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. @{foreach (var item in Model.List)
  53. {
  54. <tr>
  55. <td class="tn"><input name="checkbox_name" type="checkbox" value="@item.ID"></td>
  56. <td>
  57. @item.FLOWNO
  58. </td>
  59. <td>
  60. <a href="javascript:modify('@item.ID')" listaction="detail"> @item.REMARK</a>
  61. </td>
  62. <td>@item.PATH</td>
  63. <td>@item.SHOW</td>
  64. <td>@item.CREATETIME</td>
  65. </tr>
  66. }
  67. }
  68. </tbody>
  69. </table>
  70. <!-- page -->
  71. <div class="bottom">
  72. <div class="dataTables_info" id="example_info" post="status" aria-live="polite">显示第 @Model.BeginPage 至 @Model.EndPage 项结果,共 @Model.Count 项</div>
  73. <div class="dataTables_length" id="example_length">
  74. <label>
  75. 显示
  76. <select name="example_length" onchange="submit()" aria-controls="example" class="form-control input-sm">
  77. <option value="10" @(Model.PageSize == 10 ? "selected" : "")>10</option>
  78. <option value="25" @(Model.PageSize == 25 ? "selected" : "")>25</option>
  79. <option value="50" @(Model.PageSize == 50 ? "selected" : "")>50</option>
  80. <option value="100" @(Model.PageSize == 100 ? "selected" : "")>100</option>
  81. </select> 项结果
  82. </label>
  83. </div>
  84. @CommonHtmlHelper.PaginationPager(Model.Index, Model.PageSize, Model.Count, 7, Model.Url)
  85. <div class="clear"></div>
  86. </div>
  87. <!-- page -->
  88. </div>
  89. }
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <!-- table end -->
  95. @section scripts{
  96. <script type="text/javascript">
  97. //点击修改
  98. function modify(n) {
  99. dig.addModel('添加/编辑流程', '/Com/FlowInfo/Detail/' + n, 700, 370, function () {
  100. if (this.returnValue == 'yes') {
  101. location.reload();
  102. }
  103. });
  104. }
  105. $(function () {
  106. //添加
  107. $('#insert').click(function () {
  108. dig.addModel('添加/编辑流程', '/Com/FlowInfo/Detail', 700, 370, function () {
  109. if (this.returnValue == 'yes') {
  110. location.reload();
  111. }
  112. });
  113. });
  114. //修改
  115. $('#modify').click(function () {
  116. var vals = '';
  117. var num = 0;
  118. $('input[name="checkbox_name"]:checked').each(function () {
  119. vals = $(this).val();
  120. num++;
  121. });
  122. if (!vals) {
  123. dig.alertError("提示", "对不起,请选中您要操作的记录!");
  124. return;
  125. }
  126. if (num > 1) {
  127. dig.alertError("提示", "对不起,每次只能修改一条记录!");
  128. return;
  129. }
  130. dig.addModel('添加/编辑编码', '/Com/FlowInfo/Detail' + vals, 700, 370, function () {
  131. if (this.returnValue == 'yes') {
  132. location.reload();
  133. }
  134. });
  135. });
  136. });
  137. </script>
  138. }