index.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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-3">
  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-9" 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="name" placeholder="姓名">
  28. </div>
  29. <div class="input-group">
  30. <input type="text" class="form-control" name="phone" placeholder="电话">
  31. </div>
  32. <div class="input-group">
  33. <input type="text" class="form-control" name="card" placeholder="身份证">
  34. </div>
  35. <div class="input-group">
  36. <select name="enable" class="form-control">
  37. <option value="">选择状态</option>
  38. <option value="0">禁用</option>
  39. <option value="1">正常</option>
  40. </select>
  41. </div>
  42. <div class="input-group">
  43. <span class="input-group-btn">
  44. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  45. </span> &nbsp;
  46. <span class="input-group-btn">
  47. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  48. </span>&nbsp;
  49. <span class="input-group-btn">
  50. <button class="btn-sm btn-primary" data-url="{:url('import')}" type="button" id ="upload" ><i class="fa fa-upload"></i></button>
  51. </span>
  52. </div>
  53. </form>
  54. </div>
  55. </div>
  56. {/if}
  57. </div>
  58. <div class="ibox-content">
  59. <div class="jqGrid_wrapper">
  60. <table id="table" style="border-collapse: collapse"></table>
  61. <div id="pager"></div>
  62. </div>
  63. </div>
  64. </div>
  65. {/block}
  66. {block name="script"}
  67. <script>
  68. $(function () {
  69. $(window).bind("resize",function(){
  70. var width=$(".jqGrid_wrapper").width();
  71. $("#table").setGridWidth(width);
  72. });
  73. $.jgrid.defaults.styleUI="Bootstrap";
  74. $("#table").jqGrid({
  75. url:"{:url('index',[],'')}/import_id/{$import_id}",
  76. datatype: "json",
  77. colModel:[
  78. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  79. {label:'姓名',name:'name',index:'name',width:80,editable: false,sortable: false},
  80. {label:'手机',name:'phone',index:'phone',width:80,editable: false,sortable: false},
  81. {label:'身份证',name:'card',index:'card',width:80,editable: false,sortable: false},
  82. {label:'预付款',name:'money',index:'money',width:40,editable: false,sortable: false},
  83. {label:'类型',name:'type',index:'type',width:60,editable: false,sortable: false,formatter:function (a,b,c){
  84. if(a == 1){
  85. return '住户';
  86. } else{
  87. return '租户';
  88. }
  89. }},
  90. {label:'状态',name:'enable',index:'enable',width:40,editable: false,sortable: false,formatter:function (a,b,c){
  91. if(!c.is_show_option){
  92. if(a == 0){
  93. return '禁用';
  94. } else{
  95. return '启用';
  96. }
  97. }else {
  98. if(a == 0){
  99. var url = "{:url('changeField',[],'')}/fn/enable/fv/1/id/"+c.id;
  100. return '<a href="'+url+'" class="ajax-get" data-table="1"><span class="label label-danger" title="禁用">禁用</span></a>';
  101. } else{
  102. var url = "{:url('changeField',[],'')}/fn/enable/fv/0/id/"+c.id;
  103. return '<a href="'+url+'" class="ajax-get" data-table="1"><span class="label label-primary" title="正常">正常</span></a>';
  104. }
  105. }
  106. }},
  107. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  108. if(!c.is_show_option){
  109. btn = '';
  110. }else {
  111. var editurl = "{:url('add',[],'')}/id/" + c.id;
  112. var delurl = "{:url('del',[],'')}/id/" + c.id;
  113. 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;';
  114. btn += '<a href="' + delurl + '" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  115. }
  116. return btn;
  117. }},
  118. ],
  119. rowNum:10,
  120. rowList:[10,20,30,50,100],
  121. pager: '#pager',
  122. sortname: 'id',
  123. viewrecords: true,
  124. autowidth:true,
  125. mtype: 'post',
  126. height: 'auto',
  127. emptyrecords: "暂无数据",
  128. sortorder: "desc",
  129. caption:"{$m_name}列表",
  130. loadComplete: function (xhr) {
  131. if(xhr.code==0){
  132. layer.msg(xhr.msg);
  133. return false;
  134. }
  135. },
  136. });
  137. });
  138. </script>
  139. {/block}