selfIndex1.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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('selfAdd',[],'')}/mode/{$mode}" data-title="创建{$m_name}订单" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">创建{$m_name}订单</a>
  8. </div>
  9. <div class="col-xs-9" style="text-align: right;">
  10. <form class="form-inline" id="form-search" action="{:url('selfIndex')}?mode={$mode}">
  11. <div class="input-group">
  12. <input type="text" class="form-control" name="sn" placeholder="订单编号">
  13. </div>
  14. <div class="input-group">
  15. <select name="order_mode" class="form-control">
  16. <option value="">选择状态</option>
  17. {foreach $order_mode_list as $k=>$v}
  18. <option value="{$v['id']}">{$v['in_content']}</option>
  19. {/foreach}
  20. </select>
  21. </div>
  22. <div class="input-group">
  23. <span class="input-group-btn">
  24. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  25. </span> &nbsp;
  26. <span class="input-group-btn">
  27. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  28. </span>
  29. </div>
  30. </form>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="ibox-content">
  35. <div class="jqGrid_wrapper">
  36. <table id="table" style="border-collapse: collapse"></table>
  37. <div id="pager"></div>
  38. </div>
  39. </div>
  40. </div>
  41. {/block}
  42. {block name="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('selfIndex')}?mode={$mode}",
  52. datatype: "json",
  53. colModel:[
  54. {label:'编号',name:'sn',index:'sn', width:80,sortable: false},
  55. {label:'申请时间',name:'create_time',index:'create_time',width:50,sortable: true},
  56. {label:'内容',name:'content',index:'content',width:60,sortable: true},
  57. {label:'报修类型',name:'order_type',index:'order_type',width:60,sortable: true},
  58. {label:'紧急程度',name:'repair_priority',index:'repair_priority',width:60,sortable: true},
  59. {label:'状态',name:'order_mode_text',index:'order_mode_text',width:60,sortable: true,formatter:function (a, b, c) {
  60. return '<span style="color: '+c.order_mode_color+'">'+a+'</span>'
  61. }},
  62. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  63. var detail_url = "{:url('detail',[],'')}/id/"+c.id;
  64. var cancel_url = "{:url('cancel',[],'')}/id/"+c.id;
  65. // var btn = '<a href="'+detail_url+'" ><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  66. var btn = '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  67. if(c.order_mode==1){
  68. btn += '<a href="'+cancel_url+'" class="confirm ajax-get" data-confirm="确定要取消吗?" data-table="1"><span class="label label-danger" title="取消">取消</span></a>';
  69. }
  70. return btn;
  71. }},
  72. ],
  73. rowNum:10,
  74. rowList:[10,20,30,50,100],
  75. pager: '#pager',
  76. sortname: 'id',
  77. viewrecords: true,
  78. autowidth:true,
  79. mtype: 'post',
  80. height: 'auto',
  81. emptyrecords: "暂无数据",
  82. sortorder: "desc",
  83. caption:"{$m_name}订单列表",
  84. loadComplete: function (xhr) {
  85. if(xhr.code==0){
  86. layer.msg(xhr.msg);
  87. return false;
  88. }
  89. },
  90. });
  91. });
  92. </script>
  93. {/block}