index.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. <select name="cate_id" class="form-control">
  10. <option value="">选择分类</option>
  11. {foreach $cate as $k=>$v}
  12. <option value="{$v.id}">{$v.title}</option>
  13. {/foreach}
  14. </select>
  15. </div>
  16. <div class="input-group">
  17. <input type="text" id="date" readonly class="form-control" name="begin" placeholder="开始日期">
  18. </div>
  19. <div class="input-group">
  20. <input type="text" id="date1" readonly class="form-control" name="end" placeholder="结束日期">
  21. </div>
  22. <div class="input-group">
  23. <input type="text" class="form-control" style="width: 180px;" name="order_sn" placeholder="订单号">
  24. </div>
  25. <div class="input-group">
  26. <select name="status" class="form-control">
  27. <option value="">选择状态</option>
  28. {foreach $status as $k=>$v}
  29. <option value="{$k}">{$v}</option>
  30. {/foreach}
  31. </select>
  32. </div>
  33. <div class="input-group">
  34. <span class="input-group-btn">
  35. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  36. </span>
  37. <span class="input-group-btn">
  38. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  39. </span>
  40. </div>
  41. </form>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="ibox-content">
  46. <div class="jqGrid_wrapper">
  47. <table id="table" style="border-collapse: collapse"></table>
  48. <div id="pager"></div>
  49. </div>
  50. </div>
  51. </div>
  52. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  53. {/block}
  54. {block name="script"}
  55. <script>
  56. laydate.render({
  57. elem: '#date',
  58. //设置开始日期、日期日期的 input 选择器
  59. //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  60. trigger: 'click' ,
  61. theme: '#ffaa2d'
  62. });
  63. laydate.render({
  64. elem: '#date1',
  65. //设置开始日期、日期日期的 input 选择器
  66. //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  67. trigger: 'click' ,
  68. theme: '#ffaa2d'
  69. });
  70. $(function () {
  71. $(window).bind("resize",function(){
  72. var width=$(".jqGrid_wrapper").width();
  73. $("#table").setGridWidth(width);
  74. });
  75. $.jgrid.defaults.styleUI="Bootstrap";
  76. $("#table").jqGrid({
  77. url:"{:url('index')}",
  78. datatype: "json",
  79. colModel:[
  80. {label:'#',name:'id',index:'id', width:30,sortable: false},
  81. {label:'订单号',name:'order_sn',index:'order_sn', width:80,sortable: false},
  82. {label:'申请退款金额',name:'amount',index:'amount', width:80,sortable: false},
  83. {label:'实际退款金额',name:'money',index:'money', width:80,sortable: false},
  84. {label:'申请人',name:'user_name',index:'userName', width:80,sortable: false},
  85. {label:'商品',name:'goods_name',index:'goods_name', width:80,sortable: false},
  86. {label:'数量',name:'num',index:'num', width:80,sortable: false},
  87. {label:'申请原因',name:'reason',index:'reason', width:80,sortable: false},
  88. {label:'备注',name:'remark',index:'remark', width:80,sortable: false},
  89. {label:'状态',name:'status_name',index:'status_name',width:80,editable: false,sortable: false,formatter:function (a,b,c){
  90. return '<span title="'+a+'">'+a+'</span>';
  91. }},
  92. {label:'时间',name:'create_time',index:'create_time', width:120,sortable: false},
  93. {label:'操作',width:100,sortable: false,formatter: function (a, b, c) {
  94. var detailsurl = "{:url('details',[],'')}/id/"+c.order_id+'/goodsId/'+c.goods_id;
  95. var option = "{:url('option',[],'')}/id/"+c.id;
  96. var btn = '<a data-title="详情" onclick="layer_open(this,1)" href="javascript:;" url="'+detailsurl+'"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  97. if(c.status==0){
  98. btn+= '<a data-title="审核" onclick="layer_open(this,1)" href="javascript:;" url="'+option+'"><span class="label label-success" title="审核">审核</span></a>&nbsp;';
  99. }
  100. return btn;
  101. }},
  102. ],
  103. rowNum:10,
  104. rowList:[10,20,30,50,100],
  105. pager: '#pager',
  106. sortname: 'id',
  107. viewrecords: true,
  108. autowidth:true,
  109. mtype: 'post',
  110. height: 'auto',
  111. emptyrecords: "暂无数据",
  112. sortorder: "desc",
  113. caption:"{$meta_title}",
  114. loadComplete: function (xhr) {
  115. if(xhr.code==0){
  116. layer.msg(xhr.msg);
  117. return false;
  118. }
  119. },
  120. });
  121. });
  122. </script>
  123. {/block}