index.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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" style="text-align: left">
  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="xq_title" placeholder="小区">
  28. </div>
  29. <div class="input-group">
  30. <input type="text" class="form-control" name="title" placeholder="名称">
  31. </div>
  32. <div class="input-group">
  33. <input type="text" class="form-control" name="name" placeholder="业主">
  34. </div>
  35. <div class="input-group">
  36. <input type="text" class="form-control" name="card" placeholder="身份证">
  37. </div>
  38. <div class="input-group">
  39. <select name="enable" class="form-control">
  40. <option value="">选择状态</option>
  41. <option value="0">禁用</option>
  42. <option value="1">正常</option>
  43. </select>
  44. </div>
  45. <div class="input-group">
  46. <select name="cate" class="form-control">
  47. <option value="">资源属性</option>
  48. <option value="1">住房</option>
  49. <option value="2">商铺</option>
  50. <option value="3">营业房</option>
  51. <option value="4">储藏室</option>
  52. <option value="5">停车位</option>
  53. </select>
  54. </div>
  55. <div class="input-group">
  56. <select name="c_type" class="form-control">
  57. <option value="">类型</option>
  58. {foreach $cType as $k=>$v}
  59. <option value="{$v['id']}">{$v['name']}</option>
  60. {/foreach}
  61. </select>
  62. </div>
  63. </br>
  64. </br>
  65. <div class="input-group">
  66. <span class="input-group-btn">
  67. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  68. </span> &nbsp;
  69. <span class="input-group-btn">
  70. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  71. </span>&nbsp;
  72. <span class="input-group-btn">
  73. <button class="btn-sm btn-primary" data-url="{:url('import')}" type="button" id ="upload" ><i class="fa fa-upload"></i></button>
  74. </span>
  75. </div>
  76. </form>
  77. </div>
  78. </div>
  79. {/if}
  80. </div>
  81. <div class="ibox-content">
  82. <div class="jqGrid_wrapper">
  83. <table id="table" style="border-collapse: collapse"></table>
  84. <div id="pager"></div>
  85. </div>
  86. </div>
  87. </div>
  88. {/block}
  89. {block name="script"}
  90. <script>
  91. $(function () {
  92. $(window).bind("resize",function(){
  93. var width=$(".jqGrid_wrapper").width();
  94. $("#table").setGridWidth(width);
  95. });
  96. $.jgrid.defaults.styleUI="Bootstrap";
  97. $("#table").jqGrid({
  98. url:"{:url('index',[],'')}/import_id/{$import_id}",
  99. datatype: "json",
  100. colModel:[
  101. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  102. {label:'小区',name:'xq_title',index:'xq_title',width:60,editable: false,sortable: false},
  103. {label:'名称',name:'title',index:'title',width:60,editable: false,sortable: false},
  104. {label:'面积(m²)',name:'area',index:'area',width:40,editable: false,sortable: false},
  105. {label:'资源属性',name:'cate_name',index:'cate_name',width:60,editable: false,sortable: false},
  106. {label:'类型',name:'c_type_name',index:'c_type_name',width:60,editable: false,sortable: false},
  107. {label:'业主',name:'name',index:'name',width:40,editable: false,sortable: false},
  108. {label:'手机号',name:'phone',index:'phone',width:60,editable: false,sortable: false},
  109. {label:'身份证',name:'card',index:'card',width:60,editable: false,sortable: false},
  110. {label:'状态',name:'enable',index:'enable',width:40,editable: false,sortable: false,formatter:function (a,b,c){
  111. if(!c.is_show_option){
  112. if(a == 0){
  113. return '禁用';
  114. } else{
  115. return '启用';
  116. }
  117. }else {
  118. if(a == 0){
  119. var url = "{:url('changeField',[],'')}/fn/enable/fv/1/id/"+c.id;
  120. return '<a href="'+url+'" class="ajax-get" data-table="1"><span class="label label-danger" title="禁用">禁用</span></a>';
  121. } else{
  122. var url = "{:url('changeField',[],'')}/fn/enable/fv/0/id/"+c.id;
  123. return '<a href="'+url+'" class="ajax-get" data-table="1"><span class="label label-primary" title="正常">正常</span></a>';
  124. }
  125. }
  126. }},
  127. {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
  128. if(!c.is_show_option){
  129. btn = '';
  130. }else {
  131. var editurl = "{:url('add',[],'')}/id/"+c.id;
  132. var delurl = "{:url('del',[],'')}/id/"+c.id;
  133. 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;';
  134. btn += '<a href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  135. }
  136. return btn;
  137. }},
  138. ],
  139. rowNum:10,
  140. rowList:[10,20,30,50,100],
  141. pager: '#pager',
  142. sortname: 'id',
  143. viewrecords: true,
  144. autowidth:true,
  145. mtype: 'post',
  146. height: 'auto',
  147. emptyrecords: "暂无数据",
  148. sortorder: "desc",
  149. caption:"{$m_name}列表",
  150. loadComplete: function (xhr) {
  151. if(xhr.code==0){
  152. layer.msg(xhr.msg);
  153. return false;
  154. }
  155. },
  156. });
  157. });
  158. </script>
  159. {/block}