0
0

record.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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-9">
  7. <form class="form-inline" id="form-search" action="{:url('record',['id'=>$id])}">
  8. <div class="input-group" style="width: 200px">
  9. <span class="input-group-addon">开始时间</span>
  10. <input class="form-control dialog-datetime" id="startTime" name="start" type="text" data-date-format="yyyy-mm-dd" value="{$start}" placeholder="" readonly/>
  11. </div>
  12. <div class="input-group" style="width: 200px">
  13. <span class="input-group-addon">结束时间</span>
  14. <input class="form-control dialog-datetime" id="endTime" name="end" type="text" data-date-format="yyyy-mm-dd" value="{$end}" placeholder="" readonly/>
  15. </div>
  16. <div class="input-group">
  17. <span class="input-group-btn">
  18. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  19. </span> &nbsp;
  20. <span class="input-group-btn">
  21. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  22. </span>
  23. </div>
  24. </form>
  25. </div>
  26. <div class="col-xs-3" style="text-align: right;">
  27. <div class="ibox-tools">
  28. <a href="{:url('index')}" class="toback">返回上一页</a>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="ibox-content">
  34. <div class="jqGrid_wrapper">
  35. <table id="table" style="border-collapse: collapse"></table>
  36. <div id="pager"></div>
  37. </div>
  38. </div>
  39. </div>
  40. {/block}
  41. {block name="script"}
  42. <script src="/static/layDate-v5.0.9/laydate.js"></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('record',['id'=>$id])}",
  52. datatype: "json",
  53. colModel:[
  54. {label:'提交人',name:'user_name',index:'user_name',width:60,editable: false,sortable: false},
  55. {label:'总分',name:'score1',index:'score1',width:40,sortable: true},
  56. {label:'得分',name:'score2',index:'score2',width:40,sortable: true},
  57. {label:'扣分',name:'score',index:'score',width:40,sortable: true},
  58. {label:'项目',name:'org_name',index:'org_name',width:40,sortable: true},
  59. {label:'提交时间',name:'create_time',index:'create_time',width:40,sortable: true},
  60. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  61. var record_detail_url = "{:url('recordDetail',[],'')}/id/"+c.id;
  62. var record_del_url = "{:url('recordDel',[],'')}/id/"+c.id;
  63. var btn = '<a href="'+record_detail_url+'" ><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  64. btn += '<a href="'+record_del_url+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  65. return btn;
  66. }},
  67. ],
  68. rowNum:10,
  69. rowList:[10,20,30,50,100],
  70. pager: '#pager',
  71. sortname: 'sort',
  72. viewrecords: true,
  73. autowidth:true,
  74. mtype: 'post',
  75. height: 'auto',
  76. emptyrecords: "暂无数据",
  77. sortorder: "asc",
  78. caption:"品质督察记录",
  79. loadComplete: function (xhr) {
  80. if(xhr.code==0){
  81. layer.msg(xhr.msg);
  82. return false;
  83. }
  84. },
  85. });
  86. });
  87. laydate.render({
  88. elem: '#startTime',
  89. trigger: 'click',
  90. theme: '#6eb7ff'
  91. });
  92. laydate.render({
  93. elem: '#endTime',
  94. trigger: 'click',
  95. theme: '#6eb7ff'
  96. });
  97. </script>
  98. {/block}