conveystatus.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="row">
  6. <div class="col-xs-12" style="text-align: right;">
  7. <form class="form-inline" id="form-search" action="{:url('conveystatus',[],'')}">
  8. <div class="input-group">
  9. <input type="text" class="form-control" name="real_name" placeholder="运送员">
  10. </div>
  11. <div class="input-group">
  12. <span class="input-group-btn">
  13. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  14. </span> &nbsp;
  15. <span class="input-group-btn">
  16. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  17. </span>
  18. </div>
  19. </form>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="ibox-content">
  24. <div class="jqGrid_wrapper">
  25. <table id="table" style="border-collapse: collapse"></table>
  26. <div id="pager"></div>
  27. </div>
  28. </div>
  29. </div>
  30. {/block}
  31. {block name="script"}
  32. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  33. <script>
  34. $(function () {
  35. laydate.render({
  36. elem: '#start',
  37. trigger: 'click' ,
  38. theme: '#148d8f'
  39. });
  40. laydate.render({
  41. elem: '#end',
  42. trigger: 'click' ,
  43. theme: '#148d8f'
  44. });
  45. $(window).bind("resize",function(){
  46. var width=$(".jqGrid_wrapper").width();
  47. $("#table").setGridWidth(width);
  48. });
  49. $.jgrid.defaults.styleUI="Bootstrap";
  50. $("#table").jqGrid({
  51. url:"{:url('conveystatus',['id'=>$id],'')}",
  52. datatype: "json",
  53. colModel:[
  54. {label:'运送员名称',name:'real_name',index:'real_name', width:50,sortable: false},
  55. {label:'今日送达次数',name:'nums',index:'nums',width:40,editable: false,sortable: false},
  56. {label:'上次位置',name:'title',index:'title',width:50,sortable: true},
  57. {label:'上次修改时间',name:'addr_time',index:'addr_time',width:60,sortable: true},
  58. {label:'驻守状态',name:'stationtxt',index:'stationtxt',width:40,sortable: false,formatter: function (a, b, c) {
  59. var station = "{:url('station',[],'')}/id/"+c.id;
  60. var btn = '';
  61. if(c.station==0){
  62. btn+= '<a href="'+station+'" class=" ajax-get" data-table="1"><span class="label label-danger" title="取消驻守">取消驻守</span></a>';
  63. }else{
  64. btn+= '<a href="'+station+'" class=" ajax-get" data-table="1"><span class="label label-primary" title="驻守">驻守</span></a>';
  65. }
  66. return btn;
  67. }},
  68. {label:'状态',name:'worktxt',index:'worktxt',width:40,sortable: false,formatter: function (a, b, c) {
  69. var btn = '';
  70. var work_url = "{:url('work',[],'')}/id/"+c.id;
  71. if(c.work==0){
  72. btn+= '<a href="'+work_url+'" class=" ajax-get" data-table="1"><span class="label label-danger" title="下班">下班</span></a>&nbsp;';
  73. }else{
  74. btn+= '<a href="'+work_url+'" class=" ajax-get" data-table="1"><span class="label label-primary" title="上班">上班</span></a>&nbsp;';
  75. }
  76. return btn;
  77. }},
  78. ],
  79. rowNum:10,
  80. rowList:[10,20,30,50,100],
  81. pager: '#pager',
  82. sortname: 'id',
  83. viewrecords: true,
  84. autowidth:true,
  85. mtype: 'post',
  86. height: 'auto',
  87. emptyrecords: "暂无数据",
  88. sortorder: "desc",
  89. caption:"运送员列表",
  90. loadComplete: function (xhr) {
  91. if(xhr.code==0){
  92. layer.msg(xhr.msg);
  93. return false;
  94. }
  95. },
  96. });
  97. });
  98. </script>
  99. {/block}