0
0

index.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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')}" 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('index')}">
  11. <div class="input-group">
  12. <select name="enable" class="form-control">
  13. <option value="">选择状态</option>
  14. <option value="0">盘库中</option>
  15. <option value="1">已完成</option>
  16. </select>
  17. </div>
  18. <div class="input-group">
  19. <span class="input-group-btn">
  20. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  21. </span>&nbsp;
  22. <span class="input-group-btn">
  23. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  24. </span>
  25. </div>
  26. </form>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="ibox-content">
  31. <div class="jqGrid_wrapper">
  32. <table id="table" style="border-collapse: collapse"></table>
  33. <div id="pager"></div>
  34. </div>
  35. </div>
  36. </div>
  37. {/block}
  38. {block name="script"}
  39. <script>
  40. $(function () {
  41. $(window).bind("resize",function(){
  42. var width=$(".jqGrid_wrapper").width();
  43. $("#table").setGridWidth(width);
  44. });
  45. $.jgrid.defaults.styleUI="Bootstrap";
  46. $("#table").jqGrid({
  47. url:"{:url('index')}",
  48. datatype: "json",
  49. colModel:[
  50. {label:'盘库人',name:'userName',index:'userName', width:60,sortable: false},
  51. {label:'盘库备注',name:'remark',index:'remark', width:80,sortable: false},
  52. {label:'盘库状态',name:'status',index:'status', width:60,sortable: false,formatter: function (a, b, c) {
  53. if(a == 0){
  54. return '盘库中';
  55. }else{
  56. return '已完成';
  57. }
  58. }},
  59. {label:'盘点开始时间',name:'create_time',index:'create_time', width:80,sortable: false},
  60. {label:'盘点结束时间',name:'finish_time',index:'finish_time', width:80,sortable: false},
  61. {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
  62. var info_url = "{:url('info',[],'')}/id/"+c.id;
  63. var delurl = "{:url('del',[],'')}/id/"+c.id;
  64. var furl = "{:url('finish',[],'')}/id/"+c.id;
  65. var btn = '';
  66. btn+= '<a url="'+info_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-success" title="详情">详情</span></a>&nbsp;';
  67. if(c.status == 0){
  68. btn += '<a href="'+furl+'" class="confirm ajax-get" data-confirm="确定要完成此盘库记录吗?" data-table="1"><span class="label label-warning" title="完成">完成</span></a>&nbsp;';
  69. }
  70. btn += '<a {if !btnAuth(session("user_auth.id"),"MateCheck/del")} style="display:none"{/if} href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  71. return btn;
  72. }},
  73. ],
  74. rowNum:10,
  75. rowList:[10,20,30,50,100],
  76. pager: '#pager',
  77. sortname: 'id',
  78. viewrecords: true,
  79. autowidth:true,
  80. mtype: 'post',
  81. height: 'auto',
  82. emptyrecords: "暂无数据",
  83. sortorder: "desc",
  84. caption:"{$meta_title}",
  85. loadComplete: function (xhr) {
  86. if(xhr.code==0){
  87. layer.msg(xhr.msg);
  88. return false;
  89. }
  90. },
  91. });
  92. });
  93. </script>
  94. {/block}