Index.cshtml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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 PageInfo
  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="row col-lg-12">
  28. <div class="wrapper wrapper-content animated fadeInUp">
  29. <div class="ibox">
  30. <div class="ibox-title">
  31. <h5>农机报修列表</h5>
  32. @*<div class="ibox-tools rboor">
  33. <a class="btn btn-primary btn-xs p310" id="insert" action="add"><i class="im-plus"></i> 创建经销商</a>
  34. <a class="btn btn-primary btn-xs p310" id="modify" action="edit"><i class="im-pencil2"></i> 编辑</a>
  35. <a class="btn btn-primary btn-xs p310" id="delete" action="remove"><i class="im-remove4"></i> 删除</a>
  36. </div>*@
  37. </div>
  38. <div class="ibox-content">
  39. <!-- search star -->
  40. @using (Ajax.BeginForm("Index", null, new AjaxOptions() { }, new { @id = "form1", @class = "form-horizontal", @method = "get" }))
  41. {
  42. <div class="form-horizontal clearfix">
  43. <div class="col-lg-4 col-sm-4" style="width: 28%;float:right;">
  44. <div class="form-group">
  45. <div class="col-lg-12 col-sm-12 input-group" style="float:right;">
  46. @Html.TextBox("Search", null, new { @class = "input-sm form-control", @placeholder = "请输入农机名称查询" })
  47. <span class="input-group-btn">
  48. <button type="button" onclick="submit()" class="btn btn-sm btn-primary">搜索</button>
  49. </span>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- search end -->
  55. <div id="example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  56. <table id="example" class="table table-striped table-bordered table-hover dataTables-example dataTable" cellspacing="0" width="100%">
  57. <thead>
  58. <tr>
  59. <th class="tn" style="width: 40px !important"><input name="checkall" id="checkall" type="checkbox" value=""></th>
  60. <th width="10%">报修农机</th>
  61. <th width="15%">IMEI号</th>
  62. <th width="25%">报修电话</th>
  63. <th>报修人</th>
  64. <th>报修时间</th>
  65. <th>操作</th>
  66. </tr>
  67. </thead>
  68. <tbody>
  69. @{
  70. if (Model != null)
  71. {
  72. foreach (var item in Model.List)
  73. {
  74. <tr>
  75. <td class="tn"><input name="checkbox_name" type="checkbox" value="@item.ID"></td>
  76. <td>@item.CODE</td>
  77. <td style="text-align:left">@HttpUtility.HtmlDecode(item.NAME)</td>
  78. <td>@item.Address</td>
  79. <td>@item.CREATEPERID</td>
  80. <td>@item.CREATEDATE</td>
  81. @{ if (item.BUSINESSLEVEL == 1)
  82. {
  83. <td></td>
  84. }
  85. else
  86. {
  87. <td><a href="javascript:carview('@item.ID')" listaction="detail">查看报修详情</a></td>
  88. }
  89. }
  90. </tr>
  91. }
  92. }
  93. }
  94. </tbody>
  95. </table>
  96. <!-- page -->
  97. <div class="bottom">
  98. <div class="dataTables_info" id="example_info" Post="status" aria-live="polite">显示第 @Model.BeginPage 至 @Model.EndPage 项结果,共 @Model.Count 项</div>
  99. <div class="dataTables_length" id="example_length">
  100. <label>
  101. 显示
  102. <select name="example_length" onchange="submit()" aria-controls="example" class="form-control input-sm">
  103. <option value="10" @(Model.PageSize == 10 ? "selected" : "")>10</option>
  104. <option value="25" @(Model.PageSize == 25 ? "selected" : "")>25</option>
  105. <option value="50" @(Model.PageSize == 50 ? "selected" : "")>50</option>
  106. <option value="100" @(Model.PageSize == 100 ? "selected" : "")>100</option>
  107. </select> 项结果
  108. </label>
  109. </div>
  110. @CommonHtmlHelper.PaginationPager(Model.Index, Model.PageSize, Model.Count, 7, Model.Url)
  111. <div class="clear"></div>
  112. </div>
  113. <!-- page -->
  114. </div>
  115. }
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. @section scripts{
  121. <script type="text/javascript">
  122. //查看正在发往的农机
  123. function carview(n) {
  124. dig.addModel('查看/农机', '/Sys/car/DistributorCarList?distributorsid=' + n, 1000, 700, function () {
  125. if (this.returnValue == 'yes') {
  126. location.reload();
  127. }
  128. });
  129. }
  130. //列表增加
  131. $("#insert").click(function () {
  132. dig.addModel("添加/编辑经销商", "/Sys/Department/detail", 700, 800, function () {
  133. if (this.returnValue == 'yes') {
  134. location.reload();
  135. }
  136. });
  137. });
  138. //分配岗位
  139. $('#allocation').click(function () {
  140. dig.addModel('分配岗位', '/Sys/Post/PostCall?dptId=' + $('#dptId').val(), 500, 400, function () {
  141. if (this.returnValue == 'yes') {
  142. location.reload();
  143. }
  144. });
  145. });
  146. //添加子部门
  147. $('#iChild').click(function () {
  148. dig.addModel("添加下级经销商", "/Sys/Department/detail?parentId=" + $('#dptId').val(), 700, 800, function () {
  149. if (this.returnValue == 'yes') {
  150. location.reload();
  151. }
  152. });
  153. });
  154. //列表选择修改
  155. //$('#modify').click(function () {
  156. // dig.addModel("添加/编辑经销商", "/Sys/Department/detail/" + $('#dptId').val(), 700, 300, function () {
  157. // if (this.returnValue == 'yes') {
  158. // location.reload();
  159. // }
  160. // });
  161. //});
  162. //点击修改
  163. function modify(n) {
  164. dig.addModel('添加/编辑车型', '/Sys/Department/Detail/' + n, 700, 800, function () {
  165. if (this.returnValue == 'yes') {
  166. location.reload();
  167. }
  168. });
  169. }
  170. //修改
  171. $('#modify').click(function () {
  172. var vals = '';
  173. var num = 0;
  174. $('input[name="checkbox_name"]:checked').each(function () {
  175. vals = $(this).val();
  176. num++;
  177. });
  178. if (!vals) {
  179. dig.alertError("提示", "对不起,请选中您要操作的记录!");
  180. return;
  181. }
  182. if (num > 1) {
  183. dig.alertError("提示", "对不起,每次只能修改一条记录!");
  184. return;
  185. }
  186. dig.addModel('添加/编辑车型', '/Sys/Department/Detail/' + vals, 700, 800, function () {
  187. if (this.returnValue == 'yes') {
  188. location.reload();
  189. }
  190. });
  191. });
  192. //删除
  193. $('#delete').click(function () {
  194. var vals = $('#dptId').val();
  195. if (vals == '' || vals == ',') {
  196. dig.alertError("提示", "对不起,请选中您要操作的记录!");
  197. return;
  198. }
  199. var msg = "删除记录后不可恢复,您确定吗?";
  200. dig.confirm("删除确认", msg, function () {
  201. $.post('/Sys/Department/Delete', { idList: vals }, function (res) {
  202. if (res.Status == "y") {
  203. dig.alertSuccess('提示', '删除成功', function () {
  204. location.reload();
  205. });
  206. } else {
  207. dig.alertError("提示", res.Msg);
  208. }
  209. }, "json");
  210. });
  211. });
  212. </script>
  213. }