index.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. {if $import_id > 0}
  6. <div class="row">
  7. <div class="col-xs-10">
  8. <span>名称:{$importInfo['title']}</span></br>
  9. <span>成功数量:{$importInfo['success']}</span></br>
  10. <span>导入类型:{$importInfo['type']==1?'资源列表导入':($importInfo['type']==2?'业主列表导入':'绑定车辆列表导入')}
  11. </span></br>
  12. <span>状态:{$importInfo['status']==0?'正常':'已撤回'}</span></br>
  13. {if $importInfo['status']==1}
  14. <span>撤回时间:{$importInfo['withdraw_time']}</span></br>
  15. {/if}
  16. <span>导入时间:{$importInfo['create_time']}</span>
  17. </div>
  18. </div>
  19. {else}
  20. <div class="row">
  21. <div class="col-xs-1">
  22. <a href="javascript:;" url="{:url('add')}" data-title="新增{$m_name}" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>
  23. </div>
  24. <div class="col-xs-11" style="text-align: right;">
  25. <form class="form-inline" id="form-search" action="{:url('index')}">
  26. <div class="input-group">
  27. <input type="text" class="form-control" name="plate_num" placeholder="车牌号">
  28. </div>
  29. <div class="input-group">
  30. <input type="text" class="form-control" name="name" placeholder="车主姓名">
  31. </div>
  32. <div class="input-group">
  33. <input type="text" class="form-control" name="tcw_title" placeholder="停车位">
  34. </div>
  35. <div class="input-group">
  36. <span class="input-group-btn">
  37. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  38. </span> &nbsp;
  39. <span class="input-group-btn">
  40. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  41. </span>&nbsp;
  42. <span class="input-group-btn">
  43. <button class="btn-sm btn-primary" data-url="{:url('import')}" type="button" id ="upload" ><i class="fa fa-upload"></i></button>
  44. </span>
  45. </div>
  46. </form>
  47. </div>
  48. </div>
  49. {/if}
  50. </div>
  51. <div class="ibox-content">
  52. <div class="jqGrid_wrapper">
  53. <table id="table" style="border-collapse: collapse"></table>
  54. <div id="pager"></div>
  55. </div>
  56. </div>
  57. </div>
  58. {/block}
  59. {block name="script"}
  60. <script>
  61. $(function () {
  62. $(window).bind("resize",function(){
  63. var width=$(".jqGrid_wrapper").width();
  64. $("#table").setGridWidth(width);
  65. });
  66. $.jgrid.defaults.styleUI="Bootstrap";
  67. $("#table").jqGrid({
  68. url:"{:url('index',[],'')}/import_id/{$import_id}",
  69. datatype: "json",
  70. colModel:[
  71. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  72. {label:'小区',name:'xq_title',index:'xq_title',width:60,editable: false,sortable: false},
  73. {label:'停车位',name:'tcw_title',index:'tcw_title',width:40,editable: false,sortable: false},
  74. {label:'品牌及类型',name:'brand',index:'brand',width:40,editable: false,sortable: false},
  75. {label:'车牌号',name:'plate_num',index:'plate_num',width:60,editable: false,sortable: false},
  76. {label:'车主',name:'name',index:'name',width:60,editable: false,sortable: false},
  77. {label:'车主电话',name:'phone',index:'phone',width:40,editable: false,sortable: false},
  78. {label:'状态',name:'enable',index:'enable',width:40,editable: false,sortable: false,formatter:function (a,b,c){
  79. if(!c.is_show_option){
  80. if(a == 0){
  81. return '禁用';
  82. } else{
  83. return '启用';
  84. }
  85. }else {
  86. if(a == 0){
  87. var url = "{:url('changeField',[],'')}/fn/enable/fv/1/id/"+c.id;
  88. return '<a href="'+url+'" class="ajax-get" data-table="1"><span class="label label-danger" title="禁用">禁用</span></a>';
  89. } else{
  90. var url = "{:url('changeField',[],'')}/fn/enable/fv/0/id/"+c.id;
  91. return '<a href="'+url+'" class="ajax-get" data-table="1"><span class="label label-primary" title="正常">正常</span></a>';
  92. }
  93. }
  94. }},
  95. {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
  96. if(!c.is_show_option){
  97. btn = '';
  98. }else {
  99. var editurl = "{:url('add',[],'')}/id/" + c.id;
  100. var delurl = "{:url('del',[],'')}/id/" + c.id;
  101. var btn = '<a url="' + editurl + '" href="javascript:;" data-title="编辑{$m_name}" onclick="layer_open(this,1)"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;';
  102. btn += '<a href="' + delurl + '" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  103. }
  104. return btn;
  105. }},
  106. ],
  107. rowNum:10,
  108. rowList:[10,20,30,50,100],
  109. pager: '#pager',
  110. sortname: 'id',
  111. viewrecords: true,
  112. autowidth:true,
  113. mtype: 'post',
  114. height: 'auto',
  115. emptyrecords: "暂无数据",
  116. sortorder: "asc",
  117. caption:"{$m_name}列表",
  118. loadComplete: function (xhr) {
  119. if(xhr.code==0){
  120. layer.msg(xhr.msg);
  121. return false;
  122. }
  123. },
  124. });
  125. });
  126. </script>
  127. {/block}