selfIndex.html 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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:'source_type_text',index:'source_type_text',width:60,sortable: true},
  58. {label:'联系方式',name:'mobile',index:'mobile',width:60,sortable: true},
  59. {label:'状态',name:'order_mode_text',index:'order_mode_text',width:60,sortable: true,formatter:function (a, b, c) {
  60. return '<span style="color: '+c.order_mode_color+'">'+a+'</span>'
  61. }},
  62. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  63. var detail_url = "{:url('detail',[],'')}/id/"+c.id;
  64. var cancel_url = "{:url('cancel',[],'')}/id/"+c.id;
  65. var btn = '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  66. if(c.order_mode==1){
  67. btn += '<a href="'+cancel_url+'" class="confirm ajax-get" data-confirm="确定要取消吗?" data-table="1"><span class="label label-danger" title="取消">取消</span></a>';
  68. }
  69. return btn;
  70. }},
  71. ],
  72. rowNum:10,
  73. rowList:[10,20,30,50,100],
  74. pager: '#pager',
  75. sortname: 'id',
  76. viewrecords: true,
  77. autowidth:true,
  78. mtype: 'post',
  79. height: 'auto',
  80. emptyrecords: "暂无数据",
  81. sortorder: "desc",
  82. caption:"{$m_name}订单列表",
  83. loadComplete: function (xhr) {
  84. if(xhr.code==0){
  85. layer.msg(xhr.msg);
  86. return false;
  87. }
  88. },
  89. });
  90. });
  91. </script>
  92. {/block}