0
0

delay.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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('delay',['mode'=>$mode])}">
  8. <div class="input-group">
  9. <select name="status" class="form-control">
  10. <option value="">选择状态</option>
  11. <option value="0">待审核</option>
  12. <option value="1">已同意</option>
  13. <option value="2">已拒绝</option>
  14. <option value="3">已取消</option>
  15. </select>
  16. </div>
  17. <div class="input-group">
  18. <span class="input-group-btn">
  19. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  20. </span> &nbsp;
  21. <span class="input-group-btn">
  22. <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  23. </span>
  24. </div>
  25. </form>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="ibox-content">
  30. <div class="jqGrid_wrapper">
  31. <table id="table" style="border-collapse: collapse"></table>
  32. <div id="pager"></div>
  33. </div>
  34. </div>
  35. </div>
  36. {/block}
  37. {block name="script"}
  38. <script>
  39. $(function () {
  40. $(window).bind("resize",function(){
  41. var width=$(".jqGrid_wrapper").width();
  42. $("#table").setGridWidth(width);
  43. });
  44. $.jgrid.defaults.styleUI="Bootstrap";
  45. $("#table").jqGrid({
  46. url:"{:url('delay',['mode'=>$mode])}",
  47. datatype: "json",
  48. colModel:[
  49. {label:'编号',name:'id',index:'id', width:30,sortable: false},
  50. {label:'申请人',name:'uname',index:'uname', width:60,sortable: false},
  51. {label:'任务名称',name:'task_title',index:'task_title', width:80,sortable: false},
  52. {label:'延期时间',name:'end_time',index:'end_time', width:70,sortable: false},
  53. {label:'原因',name:'reason',index:'reason', width:70,sortable: false},
  54. {label:'状态',name:'status',index:'status',width:50,editable: false,sortable: false,formatter:function (a,b,c){
  55. if(a==0){
  56. return '<span class="text-primary" title="待审核">待审核</span>';
  57. }else if(a==1) {
  58. return '<span class="text-success" title="已同意">已同意</span>';
  59. }else if(a==2){
  60. return '<span class="text-danger" title="已拒绝">已拒绝</span>';
  61. }else if(a==3){
  62. return '<span class="text-muted" title="已取消">已取消</span>';
  63. }
  64. }},
  65. {label:'申请日期',name:'create_time',index:'create_time', width:80,sortable: false},
  66. {label:'审核人',name:'deal_user',index:'deal_user', width:60,sortable: false},
  67. {label:'审核人意见',name:'remark',index:'remark', width:60,sortable: false},
  68. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  69. var dealurl = "{:url('deal',[],'')}/id/"+c.id;
  70. var btn = '';
  71. if(c.status == 0){
  72. btn+= '<a url="'+dealurl+'" href="javascript:;" data-title="审核" onclick="layer_open(this,1)"><span class="label label-primary" title="审核">审核</span></a>&nbsp;';
  73. }
  74. return btn;
  75. }},
  76. ],
  77. rowNum:10,
  78. rowList:[10,20,30,50,100],
  79. pager: '#pager',
  80. sortname: 'id',
  81. viewrecords: true,
  82. autowidth:true,
  83. mtype: 'post',
  84. height: 'auto',
  85. emptyrecords: "暂无数据",
  86. sortorder: "desc",
  87. caption:"计划延期管理",
  88. multiselect: false,//可多选
  89. loadComplete: function (xhr) {
  90. if(xhr.code==0){
  91. layer.msg(xhr.msg);
  92. return false;
  93. }
  94. },
  95. });
  96. $('#js').click(function () {
  97. var rowIds = jQuery("#table").jqGrid('getGridParam', 'selarrrow'); //获取勾选记录的ID
  98. if(rowIds.length <=0){
  99. updateAlert('请选择计划','alert-danger');
  100. setTimeout(function(){
  101. $('#top-alert').find('button').click();
  102. },1500);
  103. return;
  104. }
  105. // $.post('{:url("byIdSDel")}',{ids:rowIds},function (res) {
  106. // if(res.code==0){
  107. // updateAlert(res.msg,'alert-danger');
  108. // setTimeout(function(){
  109. // $('#top-alert').find('button').click();
  110. // },1500);
  111. // }else {
  112. // updateAlert(res.data.msg,'alert-success');
  113. // if(res.data.code==0){
  114. // $("#table").trigger("reloadGrid");
  115. // }else {
  116. // setTimeout(function(){
  117. // $('#top-alert').find('button').click();
  118. // $("#table").trigger("reloadGrid");
  119. // },1500);
  120. // }
  121. //
  122. // }
  123. // })
  124. })
  125. });
  126. </script>
  127. <script>
  128. //日期时间选择器
  129. laydate.render({
  130. elem: '#month',
  131. type: 'month',
  132. trigger: 'click' ,
  133. format:'yyyyMM',
  134. theme:'#148d8f'
  135. });
  136. </script>
  137. {/block}
  138. tml>