index.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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-3">
  7. </div>
  8. <div class="col-xs-12" style="text-align: right;">
  9. <form class="form-inline" id="form-search" action="{:url('index')}">
  10. <div class="input-group">
  11. <input type="text" class="form-control" style="width: 180px;" name="order_sn" placeholder="订单号">
  12. </div>
  13. <div class="input-group">
  14. <input type="text" class="form-control" style="width: 150px;" name="name" placeholder="收货人姓名">
  15. </div>
  16. <div class="input-group">
  17. <select name="status" class="form-control">
  18. <option value="">选择状态</option>
  19. <option value="0">未支付</option>
  20. <option value="1">已支付</option>
  21. <option value="3">已取消</option>
  22. <option value="4">已退款</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>
  29. <span class="input-group-btn">
  30. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  31. </span>
  32. </div>
  33. </form>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="ibox-content">
  38. <div class="jqGrid_wrapper">
  39. <table id="table" style="border-collapse: collapse"></table>
  40. <div id="pager"></div>
  41. </div>
  42. </div>
  43. </div>
  44. {/block}
  45. {block name="script"}
  46. <script>
  47. $(function () {
  48. $(window).bind("resize",function(){
  49. var width=$(".jqGrid_wrapper").width();
  50. $("#table").setGridWidth(width);
  51. });
  52. $.jgrid.defaults.styleUI="Bootstrap";
  53. $("#table").jqGrid({
  54. url:"{:url('index')}",
  55. datatype: "json",
  56. colModel:[
  57. {label:'#',name:'id',index:'id', width:30,sortable: false},
  58. {label:'订单号',name:'order_sn',index:'order_sn', width:80,sortable: false},
  59. {label:'订单金额',name:'amount',index:'amount', width:40,sortable: false},
  60. {label:'收货人',name:'name',index:'name', width:60,sortable: false},
  61. {label:'联系方式',name:'phone',index:'phone', width:60,sortable: false},
  62. {label:'创建时间',name:'create_time',index:'create_time', width:70,sortable: false},
  63. {label:'支付状态',name:'status',status:'type',width:40,editable: false,sortable: false,formatter:function (a,b,c){
  64. if(a == 0){
  65. return '<span title="未支付">未支付</span>';
  66. }
  67. if(a == 1){
  68. return '<span title="已支付">已支付</span>';
  69. }
  70. if(a == 2){
  71. return '<span title="已完成">已完成</span>';
  72. }
  73. if(a == 3){
  74. return '<span title="已取消">已取消</span>';
  75. }
  76. if(a == 4){
  77. return '<span title="已退款">已退款</span>';
  78. }
  79. }},
  80. {label:'是否送货',name:'delivery_type',status:'delivery_type',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  81. if(a == 0){
  82. return '<span title="否">否</span>';
  83. }
  84. if(a == 1){
  85. return '<span title="是">是</span>';
  86. }
  87. }},
  88. {label:'送货时间',name:'delivery_date',status:'delivery_date',width:70,editable: false,sortable: false,formatter:function (a,b,c){
  89. if(a == null){
  90. return '<span title="无">无</span>';
  91. }else {
  92. return '<span title="'+a+'">'+a+'</span>';
  93. }
  94. }},
  95. {label:'操作',width:40,sortable: false,formatter: function (a, b, c) {
  96. var detailsurl = "{:url('details',[],'')}/id/"+c.id;
  97. var btn = '<a href="'+detailsurl+'"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  98. return btn;
  99. }},
  100. ],
  101. rowNum:10,
  102. rowList:[10,20,30,50,100],
  103. pager: '#pager',
  104. sortname: 'id',
  105. viewrecords: true,
  106. autowidth:true,
  107. mtype: 'post',
  108. height: 'auto',
  109. emptyrecords: "暂无数据",
  110. sortorder: "desc",
  111. caption:"{$meta_title}",
  112. loadComplete: function (xhr) {
  113. if(xhr.code==0){
  114. layer.msg(xhr.msg);
  115. return false;
  116. }
  117. },
  118. });
  119. });
  120. </script>
  121. {/block}