lookcommunitymember.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <style>
  45. tbody tr td{
  46. position: relative;
  47. }
  48. tbody tr .icow-weibiaoti--{
  49. visibility: hidden;
  50. display: inline-block;
  51. color: #fff;
  52. height:18px;
  53. width:18px;
  54. background: #e0e0e0;
  55. text-align: center;
  56. line-height: 18px;
  57. vertical-align: middle;
  58. }
  59. tbody tr:hover .icow-weibiaoti--{
  60. visibility: visible;
  61. }
  62. tbody tr .icow-weibiaoti--.hidden{
  63. visibility: hidden !important;
  64. }
  65. .full .icow-weibiaoti--{
  66. margin-left:10px;
  67. }
  68. .full>span{
  69. display: -webkit-box;
  70. display: -webkit-flex;
  71. display: -ms-flexbox;
  72. display: flex;
  73. vertical-align: middle;
  74. align-items: center;
  75. }
  76. tbody tr .label{
  77. margin: 5px 0;
  78. }
  79. .goods_attribute a{
  80. cursor: pointer;
  81. }
  82. .newgoodsflag{
  83. width: 22px;height: 16px;
  84. background-color: #ff0000;
  85. color: #fff;
  86. text-align: center;
  87. position: absolute;
  88. bottom: 70px;
  89. left: 57px;
  90. font-size: 12px;
  91. }
  92. .a{cursor: pointer;}
  93. .img-40 {
  94. width: 40px;
  95. height: 40px;
  96. }
  97. .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect{
  98. width:auto!important;
  99. }
  100. </style>
  101. </head>
  102. <body layadmin-themealias="default">
  103. <table id="demo" lay-filter="test"></table>
  104. <div class="layui-fluid">
  105. <div class="layui-card">
  106. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">核销人员列表</span></div>
  107. <div class="layui-card-body" style="padding:15px;">
  108. <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
  109. <input type="hidden" name="c" value="communityhead" />
  110. <input type="hidden" name="a" value="lookcommunitymember" />
  111. <input type="hidden" name="id" value="{$community_id}" />
  112. <div class="layui-form-item">
  113. <div class="layui-inline">
  114. <div class="layui-input-inline" >
  115. <input type="text" class="layui-input" name="keyword" value="{$keyword}" placeholder="会员名称"/>
  116. </div>
  117. <div class="layui-input-inline">
  118. <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
  119. </div>
  120. </div>
  121. </div>
  122. </form>
  123. <form action="" class="layui-form" lay-filter="example" method="post" >
  124. <div class="row">
  125. <div class="col-md-12">
  126. <div class="page-table-header">
  127. <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
  128. <span class="pull-right">
  129. <a href="{:U('communityhead/addcommunitymember', array('community_id' =>$community_id, 'ok' => 1))}" class="layui-btn layui-btn-xs layui-btn-sm"><i class="fa fa-plus"></i> 添加核销会员</a>
  130. </span>
  131. <div class="btn-group">
  132. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('communityhead/agent_check_communitymember',array('state'=>1))}" data-confirm='确认要启用?'>
  133. 启用
  134. </button>
  135. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('communityhead/agent_check_communitymember',array('state'=>0))}" data-confirm='确认要禁用?'>
  136. 禁用
  137. </button>
  138. </div>
  139. </div>
  140. <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
  141. <thead>
  142. <tr>
  143. <th style="width:25px;"></th>
  144. <th style="width:60px;">ID</th>
  145. <th style="">会员名称</th>
  146. <th style="">状态</th>
  147. <th style="">核销数量</th>
  148. <th style="">备注</th>
  149. <th style="width:300px;">操作</th>
  150. </tr>
  151. </thead>
  152. <tbody>
  153. <?php foreach( $list as $row ){ ?>
  154. <tr>
  155. <td style="position: relative; ">
  156. <input type='checkbox' name="item_checkbox" class="checkone" lay-skin="primary" value="{$row['id']}"/>
  157. </td>
  158. <td>
  159. {$row['id']}
  160. </td>
  161. <td>
  162. {$row['username']}
  163. </td>
  164. <td>
  165. <input type="checkbox" name="" lay-filter="statewsitch" data-href="{:U('communityhead/agent_check_communitymember',array('id'=>$row['id']))}" <?php if( $row['state']==1){ ?>checked<?php }else{ ?><?php } ?> lay-skin="switch" lay-text="启用|禁用">
  166. </td>
  167. <td>
  168. {$row['he_count']}
  169. </td>
  170. <td>
  171. {$row['remark']}
  172. </td>
  173. <td>
  174. <div class="btn-group">
  175. <a class="layui-btn layui-btn-xs" href="{:U('communityhead/look_piup_record',array('member_id' => $row['member_id'] , 'ok' => 1));}">
  176. 查看核销记录
  177. </a>
  178. <a class='layui-btn layui-btn-xs deldom' href="javascript:;" data-href="{:U('communityhead/deletecommunitymember',array('id' => $row['id'] , 'ok' => 1))}" data-confirm='确认要删除吗?'>
  179. 删除
  180. </a>
  181. </div>
  182. </td>
  183. </tr>
  184. <?php } ?>
  185. </tbody>
  186. <tfoot>
  187. <tr>
  188. <td colspan="5">
  189. <div class="page-table-header">
  190. <input type="checkbox" name="checkall" lay-skin="primary" lay-filter="checkboxall">
  191. <div class="btn-group">
  192. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('communityhead/agent_check_communitymember',array('state'=>1))}" data-confirm='确认要启用?'>
  193. 启用
  194. </button>
  195. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('communityhead/agent_check_communitymember',array('state'=>0))}" data-confirm='确认要禁用?'>
  196. 禁用
  197. </button>
  198. </div>
  199. </div>
  200. </td>
  201. <td colspan="8" style="text-align: right">
  202. {$pager}
  203. </td>
  204. </tr>
  205. </tfoot>
  206. </table>
  207. </div>
  208. </div>
  209. </form>
  210. </div>
  211. </div>
  212. </div>
  213. <script src="/layuiadmin/layui/layui.js"></script>
  214. <script>
  215. layui.config({
  216. base: '/layuiadmin/' //静态资源所在路径
  217. }).extend({
  218. index: 'lib/index' //主入口模块
  219. }).use('index');
  220. </script>
  221. <script>
  222. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  223. var layer = layui.layer;
  224. var $;
  225. layui.use(['jquery', 'layer','form'], function(){
  226. $ = layui.$;
  227. var form = layui.form;
  228. $('.deldom').click(function(){
  229. var s_url = $(this).attr('data-href');
  230. layer.confirm($(this).attr('data-confirm'), function(index){
  231. $.ajax({
  232. url:s_url,
  233. type:'post',
  234. dataType:'json',
  235. success:function(info){
  236. if(info.status == 0)
  237. {
  238. layer.msg(info.result.message,{icon: 1,time: 2000});
  239. }else if(info.status == 1){
  240. var go_url = location.href;
  241. if( info.result.hasOwnProperty("url") )
  242. {
  243. go_url = info.result.url;
  244. }
  245. layer.msg('操作成功',{time: 1000,
  246. end:function(){
  247. location.href = info.result.url;
  248. }
  249. });
  250. }
  251. }
  252. })
  253. });
  254. })
  255. $('.btn-operation').click(function(){
  256. var ids_arr = [];
  257. var obj = $(this);
  258. var s_toggle = $(this).attr('data-toggle');
  259. var s_url = $(this).attr('data-href');
  260. $("input[name=item_checkbox]").each(function() {
  261. if( $(this).prop('checked') )
  262. {
  263. ids_arr.push( $(this).val() );
  264. }
  265. })
  266. if(ids_arr.length < 1)
  267. {
  268. layer.msg('请选择要操作的内容');
  269. }else{
  270. var can_sub = true;
  271. if( s_toggle == 'batch-remove' )
  272. {
  273. can_sub = false;
  274. layer.confirm($(obj).attr('data-confirm'), function(index){
  275. $.ajax({
  276. url:s_url,
  277. type:'post',
  278. dataType:'json',
  279. data:{ids:ids_arr},
  280. success:function(info){
  281. if(info.status == 0)
  282. {
  283. layer.msg(info.result.message,{icon: 1,time: 2000});
  284. }else if(info.status == 1){
  285. var go_url = location.href;
  286. if( info.result.hasOwnProperty("url") )
  287. {
  288. go_url = info.result.url;
  289. }
  290. layer.msg('操作成功',{time: 1000,
  291. end:function(){
  292. location.href = info.result.url;
  293. }
  294. });
  295. }
  296. }
  297. })
  298. });
  299. }else{
  300. $.ajax({
  301. url:s_url,
  302. type:'post',
  303. dataType:'json',
  304. data:{ids:ids_arr},
  305. success:function(info){
  306. if(info.status == 0)
  307. {
  308. layer.msg(info.result.message,{icon: 1,time: 2000});
  309. }else if(info.status == 1){
  310. var go_url = location.href;
  311. if( info.result.hasOwnProperty("url") )
  312. {
  313. go_url = info.result.url;
  314. }
  315. layer.msg('操作成功',{time: 1000,
  316. end:function(){
  317. location.href = info.result.url;
  318. }
  319. });
  320. }
  321. }
  322. })
  323. }
  324. }
  325. })
  326. form.on('switch(restwsitch)', function(data){
  327. var s_url = $(this).attr('data-href')
  328. var rest = 1;
  329. if(data.elem.checked)
  330. {
  331. rest = 1;
  332. }else{
  333. rest = 0;
  334. }
  335. $.ajax({
  336. url:s_url,
  337. type:'post',
  338. dataType:'json',
  339. data:{rest:rest},
  340. success:function(info){
  341. if(info.status == 0)
  342. {
  343. layer.msg(info.result.message,{icon: 1,time: 2000});
  344. }else if(info.status == 1){
  345. var go_url = location.href;
  346. if( info.result.hasOwnProperty("url") )
  347. {
  348. go_url = info.result.url;
  349. }
  350. layer.msg('操作成功',{time: 1000,
  351. end:function(){
  352. location.href = info.result.url;
  353. }
  354. });
  355. }
  356. }
  357. })
  358. });
  359. form.on('switch(enablewsitch)', function(data){
  360. var s_url = $(this).attr('data-href')
  361. var enable = 1;
  362. if(data.elem.checked)
  363. {
  364. enable = 1;
  365. }else{
  366. enable = 0;
  367. }
  368. $.ajax({
  369. url:s_url,
  370. type:'post',
  371. dataType:'json',
  372. data:{enable:enable},
  373. success:function(info){
  374. if(info.status == 0)
  375. {
  376. layer.msg(info.result.message,{icon: 1,time: 2000});
  377. }else if(info.status == 1){
  378. var go_url = location.href;
  379. if( info.result.hasOwnProperty("url") )
  380. {
  381. go_url = info.result.url;
  382. }
  383. layer.msg('操作成功',{time: 1000,
  384. end:function(){
  385. location.href = info.result.url;
  386. }
  387. });
  388. }
  389. }
  390. })
  391. });
  392. form.on('switch(statewsitch)', function(data){
  393. var s_url = $(this).attr('data-href')
  394. var state = 1;
  395. if(data.elem.checked)
  396. {
  397. state = 1;
  398. }else{
  399. state = 0;
  400. }
  401. $.ajax({
  402. url:s_url,
  403. type:'post',
  404. dataType:'json',
  405. data:{state:state},
  406. success:function(info){
  407. if(info.status == 0)
  408. {
  409. layer.msg(info.result.message,{icon: 1,time: 2000});
  410. }else if(info.status == 1){
  411. var go_url = location.href;
  412. if( info.result.hasOwnProperty("url") )
  413. {
  414. go_url = info.result.url;
  415. }
  416. layer.msg('操作成功',{time: 1000,
  417. end:function(){
  418. location.href = info.result.url;
  419. }
  420. });
  421. }
  422. }
  423. })
  424. });
  425. form.on('checkbox(checkboxall)', function(data){
  426. if(data.elem.checked)
  427. {
  428. $("input[name=item_checkbox]").each(function() {
  429. $(this).prop("checked", true);
  430. });
  431. $("input[name=checkall]").each(function() {
  432. $(this).prop("checked", true);
  433. });
  434. }else{
  435. $("input[name=item_checkbox]").each(function() {
  436. $(this).prop("checked", false);
  437. });
  438. $("input[name=checkall]").each(function() {
  439. $(this).prop("checked", false);
  440. });
  441. }
  442. form.render('checkbox');
  443. });
  444. //监听提交
  445. form.on('submit(formDemo)', function(data){
  446. $.ajax({
  447. url: data.form.action,
  448. type: data.form.method,
  449. data: data.field,
  450. dataType:'json',
  451. success: function (info) {
  452. if(info.status == 0)
  453. {
  454. layer.msg(info.result.message,{icon: 1,time: 2000});
  455. }else if(info.status == 1){
  456. var go_url = location.href;
  457. if( info.result.hasOwnProperty("url") )
  458. {
  459. go_url = info.result.url;
  460. }
  461. layer.msg('操作成功',{time: 1000,
  462. end:function(){
  463. location.href = info.result.url;
  464. }
  465. });
  466. }
  467. }
  468. });
  469. return false;
  470. });
  471. })
  472. </script>
  473. </body>