Index.cshtml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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 class="ibox-tools rboor">
  19. <a class="btn btn-primary btn-xs p310" id="insert" action="add"><i class="im-plus"></i> 创建新农机</a>
  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("Index", null, new AjaxOptions() { }, new { @id = "form1", @class = "form-horizontal", @method = "get" }))
  27. {
  28. <div class="form-horizontal clearfix">
  29. <div class="col-lg-2 col-sm-3 pl0" style="width:70%;float:left;">
  30. <div class="form-group">
  31. <label class="control-label" style="float:left;">经销商:</label>
  32. <div class="col-lg-8 col-sm-7" style="width:28% !important;">
  33. <select id="FK_DPTID" name="FK_DPTID" class="form-control select2" onchange="submit()">
  34. <option value="" @(ViewData["dptid"] == null ? "selected=\"selected\"" : "")>--请选择--</option>
  35. @{
  36. var department = ViewData["Department"] as dynamic;
  37. foreach (var item in department)
  38. {
  39. <option value="@item.ID" @(ViewData["dptid"] != null && ViewData["dptid"].ToString() != "" && ViewData["dptid"].ToString() == item.ID ? "selected" : "")>@CommonHtmlHelper.RtfTextToHtml(item.NAME)</option>
  40. }
  41. }
  42. </select>
  43. </div>
  44. <label class="control-label" style="float:left;">农机状态:</label>
  45. <div class="col-lg-4 col-sm-7" style="width:15% !important;">
  46. <select name="CarSate" id="CarSate" class="form-control" datatype="*" nullmsg="请选择状态" onchange="submit()">
  47. <option value="-1" selected>请选择</option>
  48. @{
  49. var level = ViewData["levels"] as List<SYS_CODE>;
  50. if (level != null && level.Count > 0)
  51. {
  52. foreach (var item in level)
  53. {
  54. <option value="@item.CODEVALUE" @(ViewData["CarSate"] != null && ViewData["CarSate"].ToString() != "" && ViewData["CarSate"].ToString() == item.CODEVALUE ? "selected" : "")>@item.NAMETEXT</option>
  55. }
  56. }
  57. }
  58. </select>
  59. </div>
  60. <label class="control-label" style="float:left;">农机类型:</label>
  61. <div class="col-lg-4 col-sm-7" style="width:15% !important;">
  62. <select name="LeaseStatus" id="LeaseStatus" class="form-control" datatype="*" nullmsg="请选择车辆类型" onchange="submit()">
  63. <option value="">请选择</option>
  64. @{
  65. var cartype = ViewData["cartype"] as List<SYS_CODE>;
  66. if (cartype != null && cartype.Count > 0)
  67. {
  68. foreach (var item in cartype)
  69. {
  70. <option value="@item.CODEVALUE" @(ViewData["typecar"] != null && ViewData["typecar"].ToString() != "" && ViewData["typecar"].ToString() == item.CODEVALUE ? "selected" : "")>@item.NAMETEXT</option>
  71. }
  72. }
  73. }
  74. </select>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="col-lg-4 col-sm-4" style="width: 28%;float:right;">
  79. <div class="form-group">
  80. <div class="col-lg-12 col-sm-12 input-group" style="float:right;">
  81. @Html.TextBox("Search", null, new { @class = "input-sm form-control", @placeholder = "请输入农机名称查询" })
  82. <span class="input-group-btn">
  83. <button type="button" onclick="submit()" class="btn btn-sm btn-primary">搜索</button>
  84. </span>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <!-- search end -->
  90. <div id="example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  91. <table id="example" class="table table-striped table-bordered table-hover dataTables-example dataTable" cellspacing="0" width="100%">
  92. <thead>
  93. <tr>
  94. <th class="tn" style="width: 5% !important"><input name="checkall" id="checkall" type="checkbox" value=""></th>
  95. <th>IMEI号</th>
  96. <th>条码</th>
  97. <th>农机名称</th>
  98. <th>农机型号</th>
  99. <th>所属经销商</th>
  100. <th>农机状态</th>
  101. @*<th style="width: 100px !important">是否绑定</th>*@
  102. <th>操作</th>
  103. </tr>
  104. </thead>
  105. <tbody>
  106. @{foreach (var item in Model.List)
  107. {
  108. <tr>
  109. <td class="tn"><input name="checkbox_name" type="checkbox" value="@item.ID"></td>
  110. <td>
  111. @item.CarID
  112. </td>
  113. <td>@item.carBar</td>
  114. <td>@item.CarName</td>
  115. <td>@item.CarModel</td>
  116. <td>@item.DistributorsName</td>
  117. @{
  118. switch ((int)item.CarSate)
  119. {
  120. case 1:
  121. {
  122. <td>已绑定</td>;
  123. }
  124. break;
  125. case 2:
  126. {
  127. <td>已出库</td>
  128. }
  129. break;
  130. case 3:
  131. {
  132. <td>在途中</td>
  133. }
  134. break;
  135. case 4:
  136. {
  137. <td>已入库</td>
  138. }
  139. break;
  140. case 5:
  141. {
  142. <td>已销售</td>
  143. }
  144. break;
  145. case 6:
  146. {
  147. <td>退货中</td>
  148. }
  149. break;
  150. case 7:
  151. {
  152. <td>调拨中</td>
  153. }
  154. break;
  155. case 8:
  156. {
  157. <td>返厂中</td>
  158. }
  159. break;
  160. default:
  161. {
  162. <td>初始值</td>
  163. }
  164. break;
  165. }
  166. }
  167. @*<td>@item.lang</td>*@
  168. @{
  169. if (item.CarSate > 0)
  170. {
  171. <td><a href="javascript:carview('@item.CarID')" listaction="detail">查看农机信息</a></td>
  172. }
  173. else
  174. {
  175. <td></td>
  176. }
  177. }
  178. </tr>
  179. }
  180. }
  181. </tbody>
  182. </table>
  183. <!-- page -->
  184. <div class="bottom">
  185. @if (Model != null)
  186. {
  187. <div class="dataTables_info" id="example_info" Post="status" aria-live="polite">显示第 @Model.BeginPage 至 @Model.EndPage 项结果,共 @Model.Count 项</div>
  188. <div class="dataTables_length" id="example_length">
  189. <label>
  190. 显示
  191. <select name="example_length" onchange="submit()" aria-controls="example" class="form-control input-sm">
  192. <option value="10" @(Model.PageSize == 10 ? "selected" : "")>10</option>
  193. <option value="25" @(Model.PageSize == 25 ? "selected" : "")>25</option>
  194. <option value="50" @(Model.PageSize == 50 ? "selected" : "")>50</option>
  195. <option value="100" @(Model.PageSize == 100 ? "selected" : "")>100</option>
  196. </select> 项结果
  197. </label>
  198. </div>
  199. @CommonHtmlHelper.PaginationPager(Model.Index, Model.PageSize, Model.Count, 7, Model.Url);
  200. }
  201. <div class="clear"></div>
  202. </div>
  203. <!-- page -->
  204. </div>
  205. }
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. <!-- table end -->
  211. @section scripts{
  212. <script type="text/javascript">
  213. //点击修改
  214. function modify(n) {
  215. dig.addModel('添加/编辑农机', '/Sys/Car/Detail/' + n, 700, 500, function () {
  216. if (this.returnValue == 'yes') {
  217. location.reload();
  218. }
  219. });
  220. }
  221. function carview(n) {
  222. dig.addModel('查看/农机信息', '/Sys/car/carmap/' + n, 700, 800, function () {
  223. if (this.returnValue == 'yes') {
  224. location.reload();
  225. }
  226. });
  227. }
  228. $(function () {
  229. $('.select2').select2();
  230. $("example").colResizable();
  231. //添加
  232. $('#insert').click(function () {
  233. dig.addModel('添加/编辑农机', '/Sys/Car/Detail', 700, 500, function () {
  234. if (this.returnValue == 'yes') {
  235. location.reload();
  236. }
  237. });
  238. });
  239. //修改
  240. $('#modify').click(function () {
  241. var vals = '';
  242. var num = 0;
  243. $('input[name="checkbox_name"]:checked').each(function () {
  244. vals = $(this).val();
  245. num++;
  246. });
  247. if (!vals) {
  248. dig.alertError("提示", "对不起,请选中您要操作的记录!");
  249. return;
  250. }
  251. if (num > 1) {
  252. dig.alertError("提示", "对不起,每次只能修改一条记录!");
  253. return;
  254. }
  255. dig.addModel('添加/编辑农机', '/Sys/Car/Detail/' + vals, 600, 280, function () {
  256. if (this.returnValue == 'yes') {
  257. location.reload();
  258. }
  259. });
  260. });
  261. });
  262. </script>
  263. }