index.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .av{
  5. background-color: #23c6c8 !important;
  6. border-color: #23c6c8 !important;
  7. }
  8. .btn-sm{
  9. color: #ffffff !important;
  10. }
  11. .pr{
  12. background-color: #23c6c8 !important;
  13. border-color: #23c6c8 !important;
  14. }
  15. </style>
  16. <div class="ibox">
  17. <div class="ibox-content">
  18. <div class="tab-content" style="text-align: right;">
  19. <form action="{:url('index')}" id="form-search" method="GET" class="form-inline">
  20. <div class="input-group">
  21. <input type="text" class="form-control" name="sn" placeholder="单号">
  22. </div>
  23. <div class="input-group">
  24. <span class="input-group-btn">
  25. <button class="btn-sm btn-primary" id ="search-btn" type="button" ><i class="fa fa-search"></i></button>
  26. </span> &nbsp;
  27. <span class="input-group-btn">
  28. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  29. </span>
  30. </div>
  31. </form>
  32. </div>
  33. </div>
  34. <div class="ibox-content" id="printer">
  35. <div class="jqGrid_wrapper">
  36. <table id="table" style="border-collapse: collapse"></table>
  37. <div id="pager"></div>
  38. </div>
  39. </div>
  40. </div>
  41. {/block}
  42. {block name="script"}
  43. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  44. <script src="/static/browser.js"></script>
  45. <script src="/static/jquery.jqprint-0.3.js"></script>
  46. <script>
  47. laydate.render({
  48. elem: '#date',
  49. //设置开始日期、日期日期的 input 选择器
  50. //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  51. trigger: 'click' ,
  52. theme: '#6eb7ff'
  53. });
  54. function load_index(self,key){
  55. $(self).addClass('active').siblings().removeClass('active')
  56. $("#is_spot").val(key);
  57. $("#search-btn").click();
  58. }
  59. function load_index1(self,key){
  60. $(self).addClass('av').siblings().removeClass('av')
  61. $("#is_ok").val(key);
  62. $("#search-btn").click();
  63. }
  64. $('#down').click(function () {
  65. var url = "{:url('export')}";
  66. var param = $('#form-search').serialize();
  67. window.location.href = url+'?ex_type=1'+param;
  68. })
  69. $('#down1').click(function () {
  70. var url = "{:url('export')}";
  71. var param = $('#form-search').serialize();
  72. window.location.href = url+'?ex_type=2'+param;
  73. })
  74. $(function () {
  75. $(window).bind("resize",function(){
  76. var width=$(".jqGrid_wrapper").width();
  77. $("#table").setGridWidth(width);
  78. });
  79. $.jgrid.defaults.styleUI="Bootstrap";
  80. $("#table").jqGrid({
  81. url:"{:url('index')}",
  82. datatype: "json",
  83. colModel:[
  84. // {label:'编号',name:'refuse_id',index:'refuse_id',width:100,editable: false,sortable: false,formatter:function (a,b,c){
  85. // return '<span style="background-color: black;color: white" class="label">#'+a+'</span>'
  86. // }},
  87. {label:'订单号/状态',name:'status_txt',index:'status_txt',width:200,editable: false,sortable: false,formatter:function (a,b,c){
  88. return a;
  89. }},
  90. {label:'总价¥',name:'price',index:'price',width:100,sortable: false},
  91. {label:'下单人',name:'name',index:'name',width:200,editable: false,sortable: false,formatter:function (a,b,c){
  92. return ''+c.name+'<br />'+c.mobile+'<br />'+c.address+''
  93. }},
  94. {label:'备注',name:'remark',index:'remark',width:120,sortable: false},
  95. // {label:'购买物品',name:'item',index:'item',width:260,editable: false,sortable: false,formatter:function (a,b,c){
  96. // return a;
  97. // }},
  98. {label:'退单物品',name:'item_refuse',index:'item_refuse',width:260,editable: false,sortable: false,formatter:function (a,b,c){
  99. return a;
  100. }},
  101. {label:'下单/退单/审批时间',name:'name',index:'name',width:260,editable: false,sortable: false,formatter:function (a,b,c){
  102. return '下单:'+c.pay_time+'<br />退单:'+c.create_time+'<br />审批:'+c.op_time+''
  103. }},
  104. {label:'操作',width:100,sortable: false,formatter: function (a, b, c) {
  105. var editurl = "{:url('option',[],'')}/id/"+c.refuse_id;
  106. var delurl = "{:url('del',[],'')}/id/"+c.id;
  107. var btn = '';
  108. if(c.status==4){
  109. btn+= '<a url="'+editurl+'" href="javascript:;" data-title="审核退单申请" onclick="layer_open(this,1)"><span class="label label-primary" title="审核退单申请">审核</span></a>';
  110. }
  111. return btn;
  112. }},
  113. ],
  114. rowNum:10,
  115. rowList:[10,20,30,50,100],
  116. pager: '#pager',
  117. sortname: 'id',
  118. viewrecords: true,
  119. autowidth:true,
  120. autoScroll: false,
  121. shrinkToFit: true,
  122. mtype: 'post',
  123. height: 'auto',
  124. emptyrecords: "暂无数据",
  125. sortorder: "desc",
  126. caption:"退单列表",
  127. loadComplete: function (xhr) {
  128. if(xhr.code==0){
  129. layer.msg(xhr.msg);
  130. return false;
  131. }
  132. },
  133. });
  134. /*固定表头及侧边*/
  135. $("#table").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "auto" });
  136. $("#table").jqGrid('setFrozenColumns');
  137. });
  138. </script>
  139. {/block}