index.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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('index')}">
  8. <div class="input-group">
  9. <input type="text" class="form-control" name="sn" placeholder="订单号">
  10. </div>
  11. <div class="input-group">
  12. <select name="type" class="form-control">
  13. <option value="">选择支付类型</option>
  14. <option value="1">线下</option>
  15. <option value="2">线上</option>
  16. </select>
  17. </div>
  18. <div class="input-group">
  19. <select name="order_mode" class="form-control">
  20. <option value="">选择状态</option>
  21. <option value="0">待支付</option>
  22. <option value="1">已支付</option>
  23. </select>
  24. </div>
  25. <div class="input-group">
  26. <span class="input-group-btn">
  27. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  28. </span> &nbsp;
  29. <span class="input-group-btn">
  30. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  31. </span>
  32. &nbsp;
  33. </div>
  34. </form>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="ibox-content">
  39. <div class="jqGrid_wrapper">
  40. <table id="table" style="border-collapse: collapse"></table>
  41. <div id="pager"></div>
  42. </div>
  43. </div>
  44. </div>
  45. {/block}
  46. {block name="script"}
  47. <script>
  48. $(function () {
  49. $(window).bind("resize",function(){
  50. var width=$(".jqGrid_wrapper").width();
  51. $("#table").setGridWidth(width);
  52. });
  53. $.jgrid.defaults.styleUI="Bootstrap";
  54. $("#table").jqGrid({
  55. url:"{:url('index')}",
  56. datatype: "json",
  57. colModel:[
  58. {label:'订单号',name:'id',index:'id', width:50,sortable: false},
  59. {label:'金额',name:'money',index:'money',width:50,sortable: false},
  60. {label:'类型',name:'type',index:'type',width:50,sortable: false,formatter:function (a,b,c){
  61. if(a == 1){
  62. return '线下';
  63. } else if(a == 2){
  64. return '线上';
  65. } else{
  66. return '';
  67. }
  68. }},
  69. {label:'状态',name:'status',index:'status',width:50,sortable: false,formatter:function (a,b,c){
  70. if(a == 1){
  71. return '已支付';
  72. } else{
  73. return '待支付';
  74. }
  75. }},
  76. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  77. var btn = '';
  78. var detail_url = "{:url('Orders/detail2',[],'')}/id/"+c.order_id;
  79. btn += '<a href="'+detail_url+'"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  80. if(c.status == 0){
  81. var pay_url = "{:url('pay',[],'')}/id/"+c.id;
  82. btn += '<a url="'+pay_url+'" href="javascript:;" data-title="支付" onclick="layer_open(this,1)"><span class="label label-primary" title="支付">支付</span></a>&nbsp;';
  83. }
  84. return btn;
  85. }},
  86. ],
  87. rowNum:10,
  88. rowList:[10,20,30,50,100],
  89. pager: '#pager',
  90. sortname: 'id',
  91. viewrecords: true,
  92. autowidth:true,
  93. mtype: 'post',
  94. height: 'auto',
  95. emptyrecords: "暂无数据",
  96. sortorder: "desc",
  97. caption:"付费运送记录",
  98. loadComplete: function (xhr) {
  99. if(xhr.code==0){
  100. layer.msg(xhr.msg);
  101. return false;
  102. }
  103. },
  104. });
  105. });
  106. </script>
  107. {/block}