distribulist.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  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="distribulist" />
  111. <div class="layui-form-item">
  112. <div class="layui-inline">
  113. <span class="layui-input-inline">
  114. <select name='searchtime' class='form-control' style="width:100px;padding:0 5px;" id="searchtime">
  115. <option value=''>不按时间</option>
  116. <option value='create_time' <?php if( $_GPC['searchtime']=='create_time' ){ ?>selected<?php } ?>>申请时间</option>
  117. </select>
  118. </span>
  119. <div class="layui-input-inline" style="width:280px;">
  120. {:tpl_form_field_daterange('time', array( 'starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime) ,'sm'=>true, 'placeholder'=>'申请时间'),true);}
  121. </div>
  122. <div class="layui-input-inline" >
  123. <select name='comsiss_state' class='layui-input layui-unselect' style="width:80px;" >
  124. <option value=''>状态</option>
  125. <option value='0' <?php if( $comsiss_state =='0'){ ?>selected<?php } ?>>未审核</option>
  126. <option value='1' <?php if( $comsiss_state =='1'){ ?>selected<?php } ?>>已审核</option>
  127. <option value='2' <?php if( $comsiss_state =='2'){ ?>selected<?php } ?>>拒绝通过</option>
  128. </select>
  129. </div>
  130. <div class="layui-input-inline" >
  131. <input type="text" class="layui-input" name="keyword" value="{$keyword}" placeholder="申请订单id"/>
  132. </div>
  133. <div class="layui-input-inline">
  134. <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
  135. <button type="submit" name="export" value="1" class="btn btn-success layui-btn layui-btn-sm">导出</button>
  136. </div>
  137. </div>
  138. </div>
  139. </form>
  140. <form action="" class="layui-form" lay-filter="example" method="post" >
  141. <div class="row">
  142. <div class="col-md-12">
  143. <div class="page-table-header">
  144. <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
  145. <div class="btn-group">
  146. <button class='btn btn-default btn-sm btn-op btn-operation' type="button" data-toggle='batch' data-href="{:U('communityhead/agent_check_apply',array('state'=>1))}" data-confirm='确认要审核通过,已打款?'>
  147. 审核通过
  148. </button>
  149. <button class='btn btn-default btn-sm btn-op btn-operation' type="button" data-toggle='batch' data-href="{:U('communityhead/agent_check_apply',array('state'=>2))}" data-confirm='确认要拒绝通过?'>
  150. 拒绝通过
  151. </button>
  152. </div>
  153. </div>
  154. <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
  155. <thead>
  156. <tr>
  157. <th style="width:25px;"></th>
  158. <th style="width:60px;">ID</th>
  159. <th style="">小区名称</th>
  160. <th style="width: 150px;">团长</th>
  161. <th style="">联系方式</th>
  162. <th style="">打款银行</br>打款账户</br>真实姓名</th>
  163. <th style=''>申请提现金额</br>手续费</br>到账金额</th>
  164. <th style="">申请时间</br>审核时间</th>
  165. <th style='width:170px;'>状态</th>
  166. <th style="width: 300px;text-align: center;">操作</th>
  167. </tr>
  168. </tr>
  169. </thead>
  170. <tbody>
  171. <?php foreach( $list as $row ){ ?>
  172. <tr>
  173. <td style="position: relative; ">
  174. <input type='checkbox' name="item_checkbox" class="checkone" lay-skin="primary" value="{$row['id']}"/>
  175. </td>
  176. <td>
  177. {$row['id']}
  178. </td>
  179. <td>
  180. {$row['community_head']['community_name']}
  181. </td>
  182. <td style="overflow: visible">
  183. {$row['community_head']['head_name']}
  184. </td>
  185. <td>
  186. {$row['community_head']['head_mobile']}
  187. </td>
  188. <td>
  189. <?php if($row['type'] > 0){ ?>
  190. <?php if( $row['type'] == 1 ){ ?>
  191. 会员余额
  192. <?php }else if($row['type'] == 2){ ?>
  193. 微信零钱<br/>
  194. 真实姓名:<br/>
  195. <a href='javascript:;' data-toggle='ajaxEdit' data-href="{:U('distribution/changename',array('type'=>'bankusername','id'=>$row['id']))}" >
  196. <text class='text-primary'>{$row['bankusername']}</text>
  197. </a>
  198. <?php }else if($row['type'] == 3){ ?>
  199. 支付宝<br/>
  200. <text class='text-primary'>真实姓名:{$row['bankusername']}</text><br/>
  201. <text class='text-danger'>{$row['bankaccount']}</text>
  202. <?php }else if($row['type'] == 4){ ?>
  203. 银行卡<br/>
  204. <text class='text-primary'>开户行:{$row['bankname']}</text><br/>
  205. <text class='text-danger'>卡号:{$row['bankaccount']}</text><br/>
  206. <text class='text-danger'>持卡人姓名:{$row['bankusername']}</text>
  207. <?php } ?>
  208. <?php }else{ ?>
  209. {$row['community_head_commiss']['bankname']}<br/>
  210. <text class='text-primary'>{$row['community_head_commiss']['bankaccount']}</text><br/>
  211. <text class='text-danger'>{$row['community_head_commiss']['bankusername']}</text>
  212. <?php } ?>
  213. </td>
  214. <td>
  215. {$row['money']}<br/><text class='text-primary'>{$row['service_charge']}</text><br/>
  216. <text class='text-danger'><?php echo $row['money']-$row['service_charge'];?></text>
  217. </td>
  218. <td>{:date("Y-m-d",$row['addtime'])}<br/>{:date("H:i:s",$row['addtime'])}
  219. <br/>
  220. <?php if( !empty($row['shentime'])){ ?>
  221. {:date("Y-m-d",$row['shentime'])}<br/>{:date("H:i:s",$row['shentime'])}
  222. <?php } ?>
  223. </td>
  224. <td>
  225. <?php if( $row[state] ==2 ){ ?>
  226. 已拒绝
  227. <?php }elseif( $row[state] ==1 ){ ?>
  228. <text class='text-danger'>已打款</text>
  229. <?php }else{ ?>
  230. <input type="checkbox" name="" lay-filter="statewsitch" data-href="{:U('communityhead/agent_check_apply',array('id'=>$row['id']))}" <?php if( $row[state]==1){ ?>checked<?php }else{ ?><?php } ?> lay-skin="switch" lay-text="已审核|未审核">
  231. <input type="checkbox" name="" lay-filter="statewsitchunable" data-href="{:U('communityhead/agent_check_apply',array('id'=>$row['id']))}" <?php if( $row['state']==1 ){ ?>checked<?php } ?> lay-skin="switch" lay-text="已拒绝|点击拒绝审核">
  232. <?php } ?>
  233. <br/>
  234. </td>
  235. <td style="overflow:visible;text-align: center;">
  236. <div class="btn-group">
  237. <a class="btn btn-op " href="{:U('order/index',array('headid' => $row['head_id']));}" >
  238. 推广订单
  239. </a>
  240. <a class="btn btn-op " href="{:U('communityhead/goodslist',array('head_id' => $row['head_id']));}">
  241. 查看在售商品
  242. </a>
  243. </div>
  244. </td>
  245. </tr>
  246. <?php } ?>
  247. </tbody>
  248. <tfoot>
  249. <tr>
  250. <td colspan="5">
  251. <div class="page-table-header">
  252. <input type="checkbox" name="checkall" lay-skin="primary" lay-filter="checkboxall">
  253. <div class="btn-group">
  254. <button class='btn btn-default btn-sm btn-op btn-operation' type="button" data-toggle='batch' data-href="{:U('communityhead/agent_check_apply',array('state'=>1))}" data-confirm='确认要审核通过,已打款?'>
  255. 审核通过
  256. </button>
  257. <button class='btn btn-default btn-sm btn-op btn-operation' type="button" data-toggle='batch' data-href="{:U('communityhead/agent_check_apply',array('state'=>2))}" data-confirm='确认要拒绝通过?'>
  258. 拒绝通过
  259. </button>
  260. </div>
  261. </div>
  262. </td>
  263. <td colspan="4" style="text-align: right">
  264. {$pager}
  265. </td>
  266. </tr>
  267. </tfoot>
  268. </table>
  269. </div>
  270. </div>
  271. </form>
  272. </div>
  273. </div>
  274. </div>
  275. <script src="/layuiadmin/layui/layui.js"></script>
  276. <script>
  277. layui.config({
  278. base: '/layuiadmin/' //静态资源所在路径
  279. }).extend({
  280. index: 'lib/index' //主入口模块
  281. }).use('index');
  282. </script>
  283. <script>
  284. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  285. var layer = layui.layer;
  286. var $;
  287. layui.use(['jquery', 'layer','form'], function(){
  288. $ = layui.$;
  289. var form = layui.form;
  290. $('.deldom').click(function(){
  291. var s_url = $(this).attr('data-href');
  292. layer.confirm($(this).attr('data-confirm'), function(index){
  293. $.ajax({
  294. url:s_url,
  295. type:'post',
  296. dataType:'json',
  297. success:function(info){
  298. if(info.status == 0)
  299. {
  300. layer.msg(info.result.message,{icon: 1,time: 2000});
  301. }else if(info.status == 1){
  302. var go_url = location.href;
  303. if( info.result.hasOwnProperty("url") )
  304. {
  305. go_url = info.result.url;
  306. }
  307. layer.msg('操作成功',{time: 1000,
  308. end:function(){
  309. location.href = info.result.url;
  310. }
  311. });
  312. }
  313. }
  314. })
  315. });
  316. })
  317. $(document).on("click", '[data-toggle="ajaxEdit"]', function(e) {
  318. var obj = $(this),
  319. url = obj.data('href') || obj.attr('href'),
  320. data = obj.data('set') || {},
  321. html = $.trim(obj.text()),
  322. required = obj.data('required') || true,
  323. edit = obj.data('edit') || 'input';
  324. var oldval = $.trim($(this).text());
  325. e.preventDefault();
  326. submit = function() {
  327. e.preventDefault();
  328. var val = $.trim(input.val());
  329. if (required) {
  330. if (val == '') {
  331. layer.msg(tip.lang.empty);
  332. return
  333. }
  334. }
  335. if (val == html) {
  336. input.remove(), obj.html(val).show();
  337. return
  338. }
  339. if (url) {
  340. $.post(url, {
  341. value: val
  342. }, function(ret) {
  343. ret = eval("(" + ret + ")");
  344. if (ret.status == 1) {
  345. obj.html(val).show()
  346. } else {
  347. layer.msg(ret.result.message, ret.result.url)
  348. }
  349. input.remove()
  350. }).fail(function() {
  351. input.remove(), layer.msg(tip.lang.exception)
  352. })
  353. } else {
  354. input.remove();
  355. obj.html(val).show()
  356. }
  357. obj.trigger('valueChange', [val, oldval])
  358. }, obj.hide().html('<i class="fa fa-spinner fa-spin"></i>');
  359. var input = $('<input type="text" class="form-control input-sm" style="width: 80%;display: inline;" />');
  360. if (edit == 'textarea') {
  361. input = $('<textarea type="text" class="form-control" style="resize:none" rows=3 ></textarea>')
  362. }
  363. obj.after(input);
  364. input.val(html).select().blur(function() {
  365. submit(input)
  366. }).keypress(function(e) {
  367. if (e.which == 13) {
  368. submit(input)
  369. }
  370. })
  371. })
  372. $('.btn-operation').click(function(){
  373. var ids_arr = [];
  374. var obj = $(this);
  375. var s_toggle = $(this).attr('data-toggle');
  376. var s_url = $(this).attr('data-href');
  377. $("input[name=item_checkbox]").each(function() {
  378. if( $(this).prop('checked') )
  379. {
  380. ids_arr.push( $(this).val() );
  381. }
  382. })
  383. if(ids_arr.length < 1)
  384. {
  385. layer.msg('请选择要操作的内容');
  386. }else{
  387. var can_sub = true;
  388. if( s_toggle == 'batch-remove' )
  389. {
  390. can_sub = false;
  391. layer.confirm($(obj).attr('data-confirm'), function(index){
  392. $.ajax({
  393. url:s_url,
  394. type:'post',
  395. dataType:'json',
  396. data:{ids:ids_arr},
  397. success:function(info){
  398. if(info.status == 0)
  399. {
  400. layer.msg(info.result.message,{icon: 1,time: 2000});
  401. }else if(info.status == 1){
  402. var go_url = location.href;
  403. if( info.result.hasOwnProperty("url") )
  404. {
  405. go_url = info.result.url;
  406. }
  407. layer.msg('操作成功',{time: 1000,
  408. end:function(){
  409. location.href = info.result.url;
  410. }
  411. });
  412. }
  413. }
  414. })
  415. });
  416. }else{
  417. $.ajax({
  418. url:s_url,
  419. type:'post',
  420. dataType:'json',
  421. data:{ids:ids_arr},
  422. success:function(info){
  423. if(info.status == 0)
  424. {
  425. layer.msg(info.result.message,{icon: 1,time: 2000});
  426. }else if(info.status == 1){
  427. var go_url = location.href;
  428. if( info.result.hasOwnProperty("url") )
  429. {
  430. go_url = info.result.url;
  431. }
  432. layer.msg('操作成功',{time: 1000,
  433. end:function(){
  434. location.href = info.result.url;
  435. }
  436. });
  437. }
  438. }
  439. })
  440. }
  441. }
  442. })
  443. form.on('switch(restwsitch)', function(data){
  444. var s_url = $(this).attr('data-href')
  445. var rest = 1;
  446. if(data.elem.checked)
  447. {
  448. rest = 1;
  449. }else{
  450. rest = 0;
  451. }
  452. $.ajax({
  453. url:s_url,
  454. type:'post',
  455. dataType:'json',
  456. data:{rest:rest},
  457. success:function(info){
  458. if(info.status == 0)
  459. {
  460. layer.msg(info.result.message,{icon: 1,time: 2000});
  461. }else if(info.status == 1){
  462. var go_url = location.href;
  463. if( info.result.hasOwnProperty("url") )
  464. {
  465. go_url = info.result.url;
  466. }
  467. layer.msg('操作成功',{time: 1000,
  468. end:function(){
  469. location.href = info.result.url;
  470. }
  471. });
  472. }
  473. }
  474. })
  475. });
  476. form.on('switch(enablewsitch)', function(data){
  477. var s_url = $(this).attr('data-href')
  478. var enable = 1;
  479. if(data.elem.checked)
  480. {
  481. enable = 1;
  482. }else{
  483. enable = 0;
  484. }
  485. $.ajax({
  486. url:s_url,
  487. type:'post',
  488. dataType:'json',
  489. data:{enable:enable},
  490. success:function(info){
  491. if(info.status == 0)
  492. {
  493. layer.msg(info.result.message,{icon: 1,time: 2000});
  494. }else if(info.status == 1){
  495. var go_url = location.href;
  496. if( info.result.hasOwnProperty("url") )
  497. {
  498. go_url = info.result.url;
  499. }
  500. layer.msg('操作成功',{time: 1000,
  501. end:function(){
  502. location.href = info.result.url;
  503. }
  504. });
  505. }
  506. }
  507. })
  508. });
  509. form.on('switch(statewsitchunable)', function(data){
  510. var s_url = $(this).attr('data-href')
  511. var state = 0;
  512. if(data.elem.checked)
  513. {
  514. state = 2;
  515. }
  516. $.ajax({
  517. url:s_url,
  518. type:'post',
  519. dataType:'json',
  520. data:{state:state},
  521. success:function(info){
  522. if(info.status == 0)
  523. {
  524. layer.msg(info.result.message,{icon: 1,time: 2000});
  525. }else if(info.status == 1){
  526. var go_url = location.href;
  527. if( info.result.hasOwnProperty("url") )
  528. {
  529. go_url = info.result.url;
  530. }
  531. layer.msg('操作成功',{time: 1000,
  532. end:function(){
  533. location.href = info.result.url;
  534. }
  535. });
  536. }
  537. }
  538. })
  539. });
  540. form.on('switch(statewsitch)', function(data){
  541. var loadingIndex = layer.load();
  542. var s_url = $(this).attr('data-href')
  543. var state = 1;
  544. if(data.elem.checked)
  545. {
  546. state = 1;
  547. }else{
  548. state = 0;
  549. }
  550. $.ajax({
  551. url:s_url,
  552. type:'post',
  553. dataType:'json',
  554. data:{state:state},
  555. success:function(info){
  556. if(info.status == 0)
  557. {
  558. layer.msg(info.result.msg,{icon: 1,time: 2000,
  559. end:function(){
  560. location.href = location.href;
  561. }});
  562. layer.close(loadingIndex);
  563. }else if(info.status == 1){
  564. var go_url = location.href;
  565. if( info.result.hasOwnProperty("url") )
  566. {
  567. go_url = info.result.url;
  568. }
  569. layer.msg('操作成功',{time: 1000,
  570. end:function(){
  571. location.href = info.result.url;
  572. }
  573. });
  574. }
  575. }
  576. })
  577. });
  578. form.on('checkbox(checkboxall)', function(data){
  579. if(data.elem.checked)
  580. {
  581. $("input[name=item_checkbox]").each(function() {
  582. $(this).prop("checked", true);
  583. });
  584. $("input[name=checkall]").each(function() {
  585. $(this).prop("checked", true);
  586. });
  587. }else{
  588. $("input[name=item_checkbox]").each(function() {
  589. $(this).prop("checked", false);
  590. });
  591. $("input[name=checkall]").each(function() {
  592. $(this).prop("checked", false);
  593. });
  594. }
  595. form.render('checkbox');
  596. });
  597. //监听提交
  598. form.on('submit(formDemo)', function(data){
  599. $.ajax({
  600. url: data.form.action,
  601. type: data.form.method,
  602. data: data.field,
  603. dataType:'json',
  604. success: function (info) {
  605. if(info.status == 0)
  606. {
  607. layer.msg(info.result.message,{icon: 1,time: 2000});
  608. }else if(info.status == 1){
  609. var go_url = location.href;
  610. if( info.result.hasOwnProperty("url") )
  611. {
  612. go_url = info.result.url;
  613. }
  614. layer.msg('操作成功',{time: 1000,
  615. end:function(){
  616. location.href = info.result.url;
  617. }
  618. });
  619. }
  620. }
  621. });
  622. return false;
  623. });
  624. })
  625. </script>
  626. </body>