get.html 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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('get')}">
  8. <div class="input-group">
  9. <input type="text" class="form-control" name="title" placeholder="单号">
  10. </div>
  11. <div class="input-group">
  12. <span class="input-group-btn">
  13. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  14. </span>
  15. <span class="input-group-btn">
  16. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  17. </span>
  18. </div>
  19. </form>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="ibox-content">
  24. <div class="jqGrid_wrapper">
  25. <table id="table" style="border-collapse: collapse"></table>
  26. <div id="pager"></div>
  27. </div>
  28. </div>
  29. </div>
  30. {/block}
  31. {block name="script"}
  32. <script>
  33. $(function () {
  34. $(window).bind("resize",function(){
  35. var width=$(".jqGrid_wrapper").width();
  36. $("#table").setGridWidth(width);
  37. });
  38. $.jgrid.defaults.styleUI="Bootstrap";
  39. $("#table").jqGrid({
  40. url:"{:url('get')}",
  41. datatype: "json",
  42. colModel:[
  43. {label:'单号',name:'sn',index:'sn', width:80,sortable: false},
  44. {label:'领取人',name:'userName',index:'userName', width:60,sortable: false},
  45. {label:'状态',width:30,sortable: false,formatter: function (a, b, c) {
  46. if(c.status == 0){
  47. return '审核中';
  48. }else if(c.status == 1){
  49. return '同意';
  50. }else if(c.status == 2){
  51. return '拒绝';
  52. }
  53. }},
  54. {label:'申请日期',name:'create_time',index:'create_time', width:60,sortable: false},
  55. {label:'审批人',name:'approverName',index:'approverName', width:80,sortable: false},
  56. {label:'审批日期',name:'approver_time',index:'approver_time', width:60,sortable: false},
  57. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  58. var check_url = "{:url('check',[],'')}/id/"+c.id;
  59. var detail_url = "{:url('detail',[],'')}/id/"+c.id;
  60. var btn = '';
  61. if(c.status == 0){
  62. btn += '<a url="'+check_url+'" href="javascript:;" data-title="审核" onclick="layer_open(this,1)" data-width="400px" data-height="300px"><span class="label label-warning" title="审核">审核</span></a>&nbsp;';
  63. btn += '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-success" title="详情">详情</span></a>';
  64. }else {
  65. var btn = '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-success" 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:"{$meta_title}",
  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}