selfIndex3.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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-1">
  7. <a href="javascript:;" url="{:url('selfAdd',[],'')}/mode/{$mode}" data-title="创建{$m_name}订单" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">创建{$m_name}订单</a>
  8. </div>
  9. <div class="col-xs-6">
  10. {if $tsDh}
  11. <span style="color: red;font-size: 20px;font-weight: bold;float: right;line-height: 30px">{$tsDh}</span>
  12. {/if}
  13. </div>
  14. <div class="col-xs-5" style="text-align: right;">
  15. <form class="form-inline" id="form-search" action="{:url('selfIndex')}?mode={$mode}">
  16. <div class="input-group">
  17. <input type="text" class="form-control" name="sn" placeholder="订单编号">
  18. </div>
  19. <div class="input-group">
  20. <select name="order_mode" class="form-control">
  21. <option value="">选择状态</option>
  22. {foreach $order_mode_list as $k=>$v}
  23. <option value="{$v['id']}">{$v['in_content']}</option>
  24. {/foreach}
  25. </select>
  26. </div>
  27. <div class="input-group">
  28. <span class="input-group-btn">
  29. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  30. </span> &nbsp;
  31. <span class="input-group-btn">
  32. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  33. </span>
  34. </div>
  35. </form>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="ibox-content">
  40. <div class="jqGrid_wrapper">
  41. <table id="table" style="border-collapse: collapse"></table>
  42. <div id="pager"></div>
  43. </div>
  44. </div>
  45. </div>
  46. {/block}
  47. {block name="script"}
  48. <script>
  49. $(function () {
  50. $(window).bind("resize",function(){
  51. var width=$(".jqGrid_wrapper").width();
  52. $("#table").setGridWidth(width);
  53. });
  54. $.jgrid.defaults.styleUI="Bootstrap";
  55. $("#table").jqGrid({
  56. url:"{:url('selfIndex')}?mode={$mode}",
  57. datatype: "json",
  58. colModel:[
  59. {label:'编号',name:'sn',index:'sn', width:80,sortable: false},
  60. {label:'申请时间',name:'create_time',index:'create_time',width:50,sortable: true},
  61. {label:'开始地点',name:'start_name',index:'start_name',width:40,sortable: true},
  62. {label:'结束地点',name:'end_name',index:'end_name',width:40,sortable: true},
  63. {label:'运送类型',name:'type_name',index:'type_name',width:40,sortable: true},
  64. {label:'运送设备',name:'device_name',index:'device_name',width:40,sortable: true},
  65. {label:'内容',name:'content',index:'content',width:60,sortable: true},
  66. {label:'来源',name:'source_type_text',index:'source_type_text',width:60,sortable: true},
  67. {label:'联系方式',name:'mobile',index:'mobile',width:60,sortable: true},
  68. {label:'状态',name:'order_mode_text',index:'order_mode_text',width:60,sortable: true,formatter:function (a, b, c) {
  69. return '<span style="color: '+c.order_mode_color+'">'+a+'</span>'
  70. }},
  71. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  72. var detail_url = "{:url('detail',[],'')}/id/"+c.id;
  73. var cancel_url = "{:url('cancel',[],'')}/id/"+c.id;
  74. //var btn = '<a href="'+detail_url+'" ><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  75. var btn = '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  76. if(c.order_mode==1){
  77. btn += '<a href="'+cancel_url+'" class="confirm ajax-get" data-confirm="确定要取消吗?" data-table="1"><span class="label label-danger" title="取消">取消</span></a>';
  78. }
  79. return btn;
  80. }},
  81. ],
  82. rowNum:10,
  83. rowList:[10,20,30,50,100],
  84. pager: '#pager',
  85. sortname: 'id',
  86. viewrecords: true,
  87. autowidth:true,
  88. mtype: 'post',
  89. height: 'auto',
  90. emptyrecords: "暂无数据",
  91. sortorder: "desc",
  92. caption:"{$m_name}订单列表",
  93. loadComplete: function (xhr) {
  94. if(xhr.code==0){
  95. layer.msg(xhr.msg);
  96. return false;
  97. }
  98. },
  99. });
  100. });
  101. </script>
  102. {/block}