back.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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('add')}?type=1" data-title="新增" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>
  8. </div>
  9. <div class="col-xs-9" style="text-align: right;">
  10. <form class="form-inline" id="form-search" action="{:url('back')}">
  11. <div class="input-group">
  12. <input type="text" class="form-control" name="title" placeholder="编号">
  13. </div>
  14. <div class="input-group">
  15. <span class="input-group-btn">
  16. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  17. </span>
  18. <span class="input-group-btn">
  19. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  20. </span>
  21. </div>
  22. </form>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="ibox-content">
  27. <div class="jqGrid_wrapper">
  28. <table id="table" style="border-collapse: collapse"></table>
  29. <div id="pager"></div>
  30. </div>
  31. </div>
  32. </div>
  33. {/block}
  34. {block name="script"}
  35. <script>
  36. $(function () {
  37. $(window).bind("resize",function(){
  38. var width=$(".jqGrid_wrapper").width();
  39. $("#table").setGridWidth(width);
  40. });
  41. $.jgrid.defaults.styleUI="Bootstrap";
  42. $("#table").jqGrid({
  43. url:"{:url('back')}",
  44. datatype: "json",
  45. colModel:[
  46. {label:'单号',name:'sn',index:'sn', width:80,sortable: false},
  47. {label:'操作人',name:'userName',index:'userName', width:60,sortable: false},
  48. {label:'日期',name:'create_time',index:'create_time', width:60,sortable: false},
  49. {label:'调拨人',name:'name',index:'name', width:60,sortable: false},
  50. {label:'调拨项目',name:'orgName',index:'orgName', width:60,sortable: false},
  51. {label:'联系电话',name:'phone',index:'phone', width:60,sortable: false},
  52. {label:'状态',name:'statusName',index:'statusName', width:40,sortable: false},
  53. {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
  54. var info_url = "{:url('info',[],'')}/id/"+c.id;
  55. var cancel_url = "{:url('cancel',[],'')}/id/"+c.id;
  56. var btn= '<a url="'+info_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-success" title="详情">详情</span></a>';
  57. if(c.status==0){
  58. btn += '&nbsp;<a href="'+cancel_url+'" class="confirm ajax-get" data-confirm="确定要取消此记录吗?" data-table="1"><span class="label label-danger" title="取消调拨">取消</span></a>';
  59. }
  60. return btn;
  61. }},
  62. ],
  63. rowNum:10,
  64. rowList:[10,20,30,50,100],
  65. pager: '#pager',
  66. sortname: 'id',
  67. viewrecords: true,
  68. autowidth:true,
  69. mtype: 'post',
  70. height: 'auto',
  71. emptyrecords: "暂无数据",
  72. sortorder: "desc",
  73. caption:"{$meta_title}",
  74. loadComplete: function (xhr) {
  75. if(xhr.code==0){
  76. layer.msg(xhr.msg);
  77. return false;
  78. }
  79. },
  80. });
  81. });
  82. </script>
  83. {/block}