selfIndex.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. <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-9" style="text-align: right;">
  10. <form class="form-inline" id="form-search" action="{:url('selfIndex')}?mode={$mode}">
  11. <div class="input-group">
  12. <input type="text" class="form-control" name="sn" placeholder="订单编号">
  13. </div>
  14. <div class="input-group">
  15. <select name="order_mode" class="form-control">
  16. <option value="">选择状态</option>
  17. {foreach $order_mode_list as $k=>$v}
  18. <option value="{$v['id']}">{$v['in_content']}</option>
  19. {/foreach}
  20. </select>
  21. </div>
  22. <div class="input-group">
  23. <span class="input-group-btn">
  24. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  25. </span> &nbsp;
  26. <span class="input-group-btn">
  27. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  28. </span>
  29. </div>
  30. </form>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="ibox-content">
  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>
  44. $(function () {
  45. $(window).bind("resize",function(){
  46. var width=$(".jqGrid_wrapper").width();
  47. $("#table").setGridWidth(width);
  48. });
  49. $.jgrid.defaults.styleUI="Bootstrap";
  50. $("#table").jqGrid({
  51. url:"{:url('selfIndex')}?mode={$mode}",
  52. datatype: "json",
  53. colModel:[
  54. {label:'编号',name:'sn',index:'sn', width:80,sortable: false},
  55. {label:'申请时间',name:'create_time',index:'create_time',width:50,sortable: true},
  56. {label:'内容',name:'content',index:'content',width:60,sortable: true},
  57. {label:'状态',name:'order_mode_text',index:'order_mode_text',width:60,sortable: true,formatter:function (a, b, c) {
  58. return '<span style="color: '+c.order_mode_color+'">'+a+'</span>'
  59. }},
  60. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  61. var detail_url = "{:url('detail',[],'')}/id/"+c.id;
  62. var cancel_url = "{:url('cancel',[],'')}/id/"+c.id;
  63. var btn = '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  64. if(c.order_mode==1){
  65. btn += '<a href="'+cancel_url+'" class="confirm ajax-get" data-confirm="确定要取消吗?" data-table="1"><span class="label label-danger" title="取消">取消</span></a>';
  66. }
  67. return btn;
  68. }},
  69. ],
  70. rowNum:10,
  71. rowList:[10,20,30,50,100],
  72. pager: '#pager',
  73. sortname: 'id',
  74. viewrecords: true,
  75. autowidth:true,
  76. mtype: 'post',
  77. height: 'auto',
  78. emptyrecords: "暂无数据",
  79. sortorder: "desc",
  80. caption:"{$m_name}订单列表",
  81. loadComplete: function (xhr) {
  82. if(xhr.code==0){
  83. layer.msg(xhr.msg);
  84. return false;
  85. }
  86. },
  87. });
  88. });
  89. </script>
  90. {/block}