Index.cshtml 11 KB

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