orderaftersales.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  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?v=32" 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">售后订单管理
  107. </span>
  108. </div>
  109. <div class="layui-tab layui-tab-brief" >
  110. <ul class="layui-tab-title">
  111. <li <?php if( empty($_GPC['state']) || $_GPC['state']=='-1' ){ ?>class="layui-this"<?php } ?>><a href="{:U('group/orderaftersales', array('state' => -1))}">全部申请</a></li>
  112. <li <?php if($_GPC['state']=='0'){ ?>class="layui-this"<?php } ?> ><a href="{:U('group/orderaftersales', array('state' => 0))}">待处理</a></li>
  113. <li <?php if($_GPC['state']=='6'){ ?>class="layui-this"<?php } ?> ><a href="{:U('group/orderaftersales', array('state' => 6))}">退货中</a></li>
  114. <li <?php if($_GPC['state']=='3'){ ?>class="layui-this"<?php } ?> ><a href="{:U('group/orderaftersales', array('state' => 3))}">已完成</a></li>
  115. <li <?php if( $_GPC['state']=='1' ){ ?>class="layui-this"<?php } ?> ><a href="{:U('group/orderaftersales', array('state' => 1))}">已拒绝</a></li>
  116. </ul>
  117. </div>
  118. <div class="layui-card-body" style="padding:15px;">
  119. <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
  120. <input type="hidden" name="c" value="group" />
  121. <input type="hidden" name="a" value="orderaftersales" />
  122. <input type="hidden" name="order_status_id" value="{$order_status_id}" />
  123. <div class="layui-form-item">
  124. <div class="layui-inline">
  125. <div class="layui-input-inline" style="width:100px;">
  126. <select name='searchtime' lay-ignore class='layui-input layui-unselect' style="width:100px;padding:0 5px;" id="searchtime">
  127. <option value=''>不按时间</option>
  128. <option value='create' <?php if( $searchtime=='create'){ ?>selected<?php } ?>>下单时间</option>
  129. <option value='pay' <?php if( $searchtime=='pay'){ ?>selected<?php } ?>>付款时间</option>
  130. <option value='send' <?php if( $searchtime=='send'){ ?>selected<?php } ?>>发货时间</option>
  131. <option value='finish' <?php if( $searchtime=='finish'){ ?>selected<?php } ?>>完成时间</option>
  132. </select>
  133. </div>
  134. <div class="layui-input-inline" style="width:280px;">
  135. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
  136. </div>
  137. <div class="layui-input-inline" style="width:100px;">
  138. <select name='delivery' lay-ignore class='layui-input layui-unselect' style="width:100px;padding:0 5px;" id="type">
  139. <option value=''>配送方式</option>
  140. <option value='pickup' <?php if( $delivery=='pickup'){ ?>selected<?php } ?>>自提</option>
  141. <option value='tuanz_send' <?php if( $delivery=='tuanz_send'){ ?>selected<?php } ?>>团长配送</option>
  142. <option value='express' <?php if( $delivery=='express'){ ?>selected<?php } ?>>快递</option>
  143. </select>
  144. </div>
  145. <div class="layui-input-inline" style="width:110px;">
  146. <select name='searchfield' lay-ignore class='layui-input layui-unselect' style="width:110px;padding:0 5px;" >
  147. <option value='ordersn' <?php if( $searchfield=='ordersn'){ ?>selected<?php } ?>>订单号</option>
  148. <option value='member' <?php if( $searchfield=='member'){ ?>selected<?php } ?>>会员信息</option>
  149. <option value='mobile' <?php if( $searchfield=='mobile'){ ?>selected<?php } ?>>手机号</option>
  150. <option value='address' <?php if( $searchfield=='address'){ ?>selected<?php } ?>>收件人信息</option>
  151. <option value='location' <?php if( $searchfield=='location'){ ?>selected<?php } ?>>地址信息</option>
  152. <option value='shipping_no' <?php if( $searchfield=='shipping_no'){ ?>selected<?php } ?>>快递单号</option>
  153. <option value='goodstitle' <?php if( $searchfield=='goodstitle'){ ?>selected<?php } ?>>商品名称</option>
  154. <option value='trans_id' <?php if( $searchfield=='trans_id'){ ?>selected<?php } ?>>微信支付单号</option>
  155. <?php if($is_community != 1){ ?>
  156. <option value='head_name' <?php if( $searchfield=='head_name'){ ?>selected<?php } ?>>团长姓名</option>
  157. <option value='head_address' <?php if( $searchfield=='head_address'){ ?>selected<?php } ?>>小区名称</option>
  158. <?php } ?>
  159. <?php
  160. if (!defined('ROLE') || ROLE != 'agenter' )
  161. {
  162. ?>
  163. <option value='supply_name' <?php if( $searchfield=='supply_name'){ ?>selected<?php } ?>>供应商名称</option>
  164. <?php } ?>
  165. <!--<option value='goodssn' <?php if( $searchfield=='goodssn'){ ?>selected<?php } ?>>商品编码</option>-->
  166. </select>
  167. </div>
  168. <div class="layui-input-inline" >
  169. <input type="text" class="layui-input" name="keyword" value="{$keyword}" placeholder="请输入关键词"/>
  170. </div>
  171. <input type="hidden" name="export" id="export" value="0">
  172. <div class="layui-input-inline">
  173. <button class="layui-btn layui-btn-sm" data-export="0" type="submit"> 搜索</button>
  174. <button type="submit" name="export" data-export="1" value="1" class="layui-btn layui-btn-sm">导出</button>
  175. </div>
  176. </div>
  177. </div>
  178. </form>
  179. <form action="" class="layui-form" lay-filter="example" method="post" >
  180. <div class="row">
  181. <div class="list-div list-tb-div">
  182. <table cellpadding="0" cellspacing="0" border="0">
  183. <thead>
  184. <tr>
  185. <th width="3%" class="sign"><div class="tDiv">
  186. <label for="all_list" class="checkbox_stars"></label></div></th>
  187. <th width="25%"><div class="tDiv">订单号</div></th>
  188. <th width="9%"><div class="tDiv">单价/数量</div></th>
  189. <th width="12%"><div class="tDiv">买家</div></th>
  190. <th width="8%"><div class="tDiv">支付/配送</div></th>
  191. <th width="14%"><div class="tDiv">小区/团长</div></th>
  192. <th width="10%"><div class="tDiv">价格</div></th>
  193. <th width="8%"><div class="tDiv">处理状态</div></th>
  194. <th width="9%"><div class="tDiv">操作</div></th>
  195. </tr>
  196. </thead>
  197. </table>
  198. <table cellpadding="0" cellspacing="0" border="0">
  199. <colgroup>
  200. <col width="28%">
  201. <col width="9%">
  202. <col width="12%">
  203. <col width="8%">
  204. <col width="14%">
  205. <col width="10%">
  206. <col width="9%">
  207. <col width="8%">
  208. </colgroup>
  209. <tbody>
  210. <?php foreach( $list as $item ){ ?>
  211. <tr class="tr-order-sn">
  212. <td colspan="10">
  213. <div class="tDiv ml10">
  214. <span class="sign">
  215. </span>
  216. <span class="words">订单号: {$item['order_num_alias']}</span>
  217. <span class="words">下单时间:{:date('Y-m-d',$item['date_added'])}&nbsp {:date('H:i:s',$item['date_added'])}</span>
  218. <span class="words">
  219. <?php if(in_array($item['ore_state'], array(3))){ ?>&nbsp;<span class="label label-success">{$order_refund_state[$item['ore_state']]}</span><?php } ?>
  220. <?php if( in_array($item['ore_state'], array(1,4)) ){ ?><label class='label label-danger'>{$order_refund_state[$item['ore_state']]}</label><?php } ?>
  221. <?php if( in_array($item['ore_state'], array(0,5)) ){ ?><label class='label label-default'>{$order_refund_state[$item['ore_state']]}</label><?php } ?>
  222. </span>
  223. </div>
  224. </td>
  225. </tr>
  226. <tr class="">
  227. <td class="td-product">
  228. <?php $i =1;
  229. foreach($item['goods'] as $k => $g){ ?>
  230. <div class="tDiv relative tpinfo <?php if($i == count($item['goods'])){ ?>last<?php } ?> ">
  231. <div class="img"><img width="70" src="{:tomedia($g['goods_images'])}" alt="" /></div>
  232. <div class="product-info">
  233. <div class="name mb5">
  234. {$g['name']}
  235. </div>
  236. <div>
  237. <?php if( !empty($g['option_sku'])){ ?>{$g['option_sku']}<?php } ?>
  238. </div>
  239. <div class="order_icon_items">
  240. </div>
  241. </div>
  242. </div>
  243. <?php $i++; } ?>
  244. </td>
  245. <td class="td-price" style="vertical-align: top;">
  246. <?php $i =1;
  247. foreach($item['goods'] as $k => $g){ ?>
  248. <div class="tDiv tpinfo <?php if($i == count($item['goods'])){ ?>last<?php } ?>" style="display: flex;align-items: center;">¥<?php echo round($g['total']/$g['quantity'],2); ?>
  249. x {$g['quantity']} </div>
  250. <?php $i++; } ?>
  251. </td>
  252. <td>
  253. <div class="tDiv" >
  254. <font style="color: #999;">{$item['shipping_name']}</font><br/><font style="color: #999;">{$item['shipping_tel']}</font>
  255. <br/>
  256. <?php if (defined('ROLE') && ROLE == 'agenter' ){ ?>
  257. <font style="color: #999;">会员名:</font>{$item['nickname']}
  258. <?php if( !empty($item['member_content']) ){ ?>
  259. <br/><font class="text-danger">{$item['member_content']}</font>
  260. <?php } ?>
  261. <?php }else{ ?>
  262. <?php if($s_id == 1){ ?>
  263. <a class="text-primary" href="{:U('user/detail',array('id'=>$item['member_id']))}"><font style="color: #999;">会员名:</font>{$item['nickname']}</a>
  264. <?php }else{ ?>
  265. <a class="text-primary user" ><font style="color: #999;">会员名:</font>{$item['nickname']}</a>
  266. <?php } ?>
  267. <?php if( !empty($item['member_content']) ){ ?>
  268. <br/><font class="text-danger">{$item['member_content']}</font>
  269. <?php } ?>
  270. <?php } ?>
  271. <br/>
  272. </div>
  273. </td>
  274. <td>
  275. <div class="tDiv" style="height: 100px;">
  276. <!-- 已支付 -->
  277. <?php if( $item['order_status_id'] != 3 && $item['order_status_id'] != 5){ ?>
  278. <?php if( $item['payment_code']=='yuer'){ ?>
  279. <span> <i class="text-warning" style="font-size: 17px;"></i><span>余额支付</span></span>
  280. <?php }else if( $item['payment_code']=='admin' ){ ?>
  281. <span> <i class=" text-danger" style="font-size: 17px"></i>后台付款</span>
  282. <?php }else{ ?>
  283. <span class="line-text"> 微信支付</span>
  284. <?php } ?>
  285. <?php }elseif( $item['order_status_id'] == 3 || $item['order_status_id'] == 5 ){ ?>
  286. <!-- 未支付 -->
  287. <?php if( $item['paytypevalue']!=3){ ?>
  288. <label class='label label-default'>未支付</label>
  289. <?php }else{ ?>
  290. <span> <i class="text-primary style="font-size: 17px"></i>货到付款</span>
  291. <?php } ?>
  292. <?php } ?>
  293. <br/>
  294. <?php if( $item['delivery']=='pickup'){ ?><font class="text-danger">(自提)</font><?php } ?>
  295. <?php if( $item['delivery']=='express'){ ?><font class="text-danger">(快递)</font><?php } ?>
  296. <?php if( $item['delivery']=='tuanz_send'){ ?><font class="text-danger">(团长配送)</font><?php } ?>
  297. </div>
  298. </td>
  299. <?php if($is_can_look_headinfo){ ?>
  300. <td>
  301. <div class="tDiv" style="text-align: left;">
  302. <div style='margin-top:5px;display:block;float:left;'>
  303. {$item['head_name']}
  304. </div>
  305. <div style='margin-top:5px;display:block;float:left;'>
  306. 电话:{$item['head_mobile']}
  307. </div>
  308. <div style='margin-top:5px;display:block;float:left;cursor: pointer;' >
  309. <font style="color: #999;">小区:</font> <font class="line-text">{$item['community_name']} ({$item['province']} {$item['city']})
  310. </div>
  311. </div>
  312. </td>
  313. <?php }else{ ?>
  314. <td>
  315. <div class="tDiv" style="text-align: left;">
  316. <div style='margin-top:5px;display:block; text-align: center;'>
  317. {$item['head_name']}
  318. </div>
  319. </div>
  320. </td>
  321. <?php } ?>
  322. <td>
  323. <div class="tDiv" style="">
  324. <?php if($item['is_free_shipping_fare'] == 1){ ?>
  325. <span style='margin-top:5px;margin-left:5px;display:block;'>
  326. 运 费:+{:round( $item['fare_shipping_free'],2)}
  327. </span>
  328. <span style='margin-top:5px;margin-left:5px;display:block;'>
  329. 满{$item['man_e_money']}免运费:-{:round( $item['fare_shipping_free'],2)}
  330. </span>
  331. <?php }else{ ?>
  332. <span style='margin-top:5px;margin-left:5px;display:block;'>
  333. 运 费:+{:round( $item['shipping_fare'],2)}
  334. </span>
  335. <?php } ?>
  336. <?php if($item['fullreduction_money'] >0){ ?>
  337. <span style='margin-top:5px;margin-left:5px;display:block;'>
  338. 满 减:-{:round( $item['fullreduction_money'],2)}
  339. </span>
  340. <?php } ?>
  341. <?php if($item['voucher_credit'] >0){ ?>
  342. <span style='margin-top:5px;margin-left:5px;display:block;'>
  343. 优惠券:-{:round( $item['voucher_credit'],2)}
  344. </span>
  345. <?php } ?>
  346. <span style='margin-top:5px;margin-left:5px;display:block;'>
  347. 商品小计:{:round($item['total'],2)}
  348. </span>
  349. <span style='margin-top:5px;margin-left:5px;display:block;'>
  350. <?php $free_tongji = $item['total']+$item['shipping_fare']-$item['voucher_credit']-$item['fullreduction_money'];
  351. if($free_tongji < 0){
  352. $free_tongji = 0;
  353. }
  354. ?>
  355. 应收总款:{:round($free_tongji ,2)}
  356. </span>
  357. </div>
  358. </td>
  359. <td>
  360. <div class="tDiv" style="">
  361. <span class='text-{$item[order_status_id]}'>
  362. <?php
  363. if($item['ore_state'] == 0){
  364. ?>
  365. 待处理
  366. <?php }else if($item['ore_state'] == 1){ ?>
  367. 已拒绝
  368. <?php }else if($item['ore_state'] == 3){ ?>
  369. 已完成
  370. <?php }else if($item['ore_state'] == 5){ ?>
  371. 已拒绝
  372. <?php }else if($item['ore_state'] == 6){ ?>
  373. 退货中
  374. <?php } ?>
  375. </span>
  376. </div>
  377. </td>
  378. <td>
  379. <div class="tDiv" style="">
  380. <a class='op text-primary' href="{:U('order/oprefund', array('id' => $item['order_id'],'ref_id' => $item['ref_id']))}" >查看详情</a>
  381. <?php if($item['ore_state'] == 0){ ?>
  382. <a class='op' data-toggle="ajaxModal" href="javascript:;" data-href="{:U('order/oprefund_doform', array('ref_id' => $item['ref_id']))}" >
  383. <i class="icow icow-flag-o" style="color: #df5254;display: inline-block;vertical-align: middle" title="平台审核"></i>
  384. 平台审核
  385. &nbsp
  386. </a>
  387. <?php } ?>
  388. <?php if($item['is_forbidden'] == 1){ ?>
  389. <p style="color:red;">禁止此用户再次申请</p>
  390. <?php } ?>
  391. </div>
  392. </td>
  393. </tr>
  394. <tr>
  395. <td colspan="8">
  396. <div style='background:#fdeeee;color:red;padding-left: 10px;'>
  397. 订单状态:{$order_status_arr[$item['order_status_id']]}
  398. </div>
  399. </td>
  400. </tr>
  401. <tr>
  402. <td colspan="8">
  403. <div style="height:20px;">&nbsp;</div>
  404. </td>
  405. </tr>
  406. <?php } ?>
  407. </tbody>
  408. <tfoot>
  409. <tr>
  410. <td colspan="0">
  411. <div class="page-table-header">
  412. </div>
  413. </td>
  414. <td colspan="8" style="text-align: right">
  415. {$pager}
  416. </td>
  417. </tr>
  418. </tfoot>
  419. </table>
  420. </div>
  421. </div>
  422. </form>
  423. </div>
  424. </div>
  425. </div>
  426. <script src="/layuiadmin/layui/layui.js"></script>
  427. <script>
  428. layui.config({
  429. base: '/layuiadmin/' //静态资源所在路径
  430. }).extend({
  431. index: 'lib/index' //主入口模块
  432. }).use('index');
  433. </script>
  434. <script>
  435. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  436. var layer = layui.layer;
  437. var $;
  438. layui.use(['jquery', 'layer','form'], function(){
  439. $ = layui.$;
  440. var form = layui.form;
  441. $('.deldom').click(function(){
  442. var s_url = $(this).attr('data-href');
  443. layer.confirm($(this).attr('data-confirm'), function(index){
  444. $.ajax({
  445. url:s_url,
  446. type:'post',
  447. dataType:'json',
  448. success:function(info){
  449. $('#ajaxModal').removeClass('in');
  450. $('.modal-backdrop').removeClass('in');
  451. if(info.status == 0)
  452. {
  453. layer.msg(info.result.message,{icon: 1,time: 2000});
  454. }else if(info.status == 1){
  455. var go_url = location.href;
  456. if( info.result.hasOwnProperty("url") )
  457. {
  458. go_url = info.result.url;
  459. }
  460. layer.msg('操作成功',{time: 1000,
  461. end:function(){
  462. location.href = info.result.url;
  463. }
  464. });
  465. }
  466. }
  467. })
  468. },function(){
  469. console.log(232323);
  470. $('#ajaxModal').removeClass('in');
  471. $('.modal-backdrop').removeClass('in');
  472. });
  473. })
  474. $('.btn-operation').click(function(){
  475. var ids_arr = [];
  476. var obj = $(this);
  477. var s_toggle = $(this).attr('data-toggle');
  478. var s_url = $(this).attr('data-href');
  479. $("input[name=item_checkbox]").each(function() {
  480. if( $(this).prop('checked') )
  481. {
  482. ids_arr.push( $(this).val() );
  483. }
  484. })
  485. if(ids_arr.length < 1)
  486. {
  487. layer.msg('请选择要操作的内容');
  488. }else{
  489. var can_sub = true;
  490. if( s_toggle == 'batch-remove' )
  491. {
  492. can_sub = false;
  493. layer.confirm($(obj).attr('data-confirm'), function(index){
  494. $.ajax({
  495. url:s_url,
  496. type:'post',
  497. dataType:'json',
  498. data:{ids:ids_arr},
  499. success:function(info){
  500. if(info.status == 0)
  501. {
  502. layer.msg(info.result.message,{icon: 1,time: 2000});
  503. }else if(info.status == 1){
  504. var go_url = location.href;
  505. if( info.result.hasOwnProperty("url") )
  506. {
  507. go_url = info.result.url;
  508. }
  509. layer.msg('操作成功',{time: 1000,
  510. end:function(){
  511. location.href = info.result.url;
  512. }
  513. });
  514. }
  515. }
  516. })
  517. });
  518. }else{
  519. $.ajax({
  520. url:s_url,
  521. type:'post',
  522. dataType:'json',
  523. data:{ids:ids_arr},
  524. success:function(info){
  525. if(info.status == 0)
  526. {
  527. layer.msg(info.result.message,{icon: 1,time: 2000});
  528. }else if(info.status == 1){
  529. var go_url = location.href;
  530. if( info.result.hasOwnProperty("url") )
  531. {
  532. go_url = info.result.url;
  533. }
  534. layer.msg('操作成功',{time: 1000,
  535. end:function(){
  536. location.href = info.result.url;
  537. }
  538. });
  539. }
  540. }
  541. })
  542. }
  543. }
  544. })
  545. form.on('switch(restwsitch)', function(data){
  546. var s_url = $(this).attr('data-href')
  547. var rest = 1;
  548. if(data.elem.checked)
  549. {
  550. rest = 1;
  551. }else{
  552. rest = 0;
  553. }
  554. $.ajax({
  555. url:s_url,
  556. type:'post',
  557. dataType:'json',
  558. data:{rest:rest},
  559. success:function(info){
  560. if(info.status == 0)
  561. {
  562. layer.msg(info.result.message,{icon: 1,time: 2000});
  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('switch(enablewsitch)', function(data){
  579. var s_url = $(this).attr('data-href')
  580. var enable = 1;
  581. if(data.elem.checked)
  582. {
  583. enable = 1;
  584. }else{
  585. enable = 0;
  586. }
  587. $.ajax({
  588. url:s_url,
  589. type:'post',
  590. dataType:'json',
  591. data:{enable:enable},
  592. success:function(info){
  593. if(info.status == 0)
  594. {
  595. layer.msg(info.result.message,{icon: 1,time: 2000});
  596. }else if(info.status == 1){
  597. var go_url = location.href;
  598. if( info.result.hasOwnProperty("url") )
  599. {
  600. go_url = info.result.url;
  601. }
  602. layer.msg('操作成功',{time: 1000,
  603. end:function(){
  604. location.href = info.result.url;
  605. }
  606. });
  607. }
  608. }
  609. })
  610. });
  611. form.on('switch(statewsitch)', function(data){
  612. var s_url = $(this).attr('data-href')
  613. var state = 1;
  614. if(data.elem.checked)
  615. {
  616. state = 1;
  617. }else{
  618. state = 0;
  619. }
  620. $.ajax({
  621. url:s_url,
  622. type:'post',
  623. dataType:'json',
  624. data:{state:state},
  625. success:function(info){
  626. if(info.status == 0)
  627. {
  628. layer.msg(info.result.message,{icon: 1,time: 2000});
  629. }else if(info.status == 1){
  630. var go_url = location.href;
  631. if( info.result.hasOwnProperty("url") )
  632. {
  633. go_url = info.result.url;
  634. }
  635. layer.msg('操作成功',{time: 1000,
  636. end:function(){
  637. location.href = info.result.url;
  638. }
  639. });
  640. }
  641. }
  642. })
  643. });
  644. form.on('checkbox(checkboxall)', function(data){
  645. if(data.elem.checked)
  646. {
  647. $("input[name=item_checkbox]").each(function() {
  648. $(this).prop("checked", true);
  649. });
  650. $("input[name=checkall]").each(function() {
  651. $(this).prop("checked", true);
  652. });
  653. }else{
  654. $("input[name=item_checkbox]").each(function() {
  655. $(this).prop("checked", false);
  656. });
  657. $("input[name=checkall]").each(function() {
  658. $(this).prop("checked", false);
  659. });
  660. }
  661. form.render('checkbox');
  662. });
  663. $('.user').click(function(){
  664. layer.msg('权限不足!',{icon: 2,time: 1200});
  665. });
  666. //监听提交
  667. form.on('submit(formDemo)', function(data){
  668. $.ajax({
  669. url: data.form.action,
  670. type: data.form.method,
  671. data: data.field,
  672. dataType:'json',
  673. success: function (info) {
  674. if(info.status == 0)
  675. {
  676. layer.msg(info.result.message,{icon: 1,time: 2000});
  677. }else if(info.status == 1){
  678. var go_url = location.href;
  679. if( info.result.hasOwnProperty("url") )
  680. {
  681. go_url = info.result.url;
  682. }
  683. layer.msg('操作成功',{time: 1000,
  684. end:function(){
  685. location.href = info.result.url;
  686. }
  687. });
  688. }
  689. }
  690. });
  691. return false;
  692. });
  693. })
  694. </script>
  695. <script>
  696. var ajax_url = "";
  697. $(function(){
  698. $("[data-toggle='ajaxModal']").click(function () {
  699. var s_url = $(this).attr('data-href');
  700. ajax_url = s_url;
  701. console.log(23);
  702. $.ajax({
  703. url:s_url,
  704. type:"get",
  705. success:function(shtml){
  706. $('#ajaxModal').html(shtml);
  707. $("#ajaxModal").modal();
  708. }
  709. })
  710. });
  711. $(document).delegate(".modal-footer .btn-primary","click",function(){
  712. var s_data = $('#ajaxModal form').serialize();
  713. var loadingIndex = layer.load();
  714. $.ajax({
  715. url:ajax_url,
  716. type:'post',
  717. dataType:'json',
  718. data:s_data,
  719. success:function(info){
  720. if(info.status == 0)
  721. {
  722. layer.msg(info.result.message,{icon: 1,time: 2000});
  723. layer.close(loadingIndex);
  724. }else if(info.status == 1){
  725. var go_url = location.href;
  726. if( info.result.hasOwnProperty("url") )
  727. {
  728. go_url = info.result.url;
  729. }
  730. layer.msg('操作成功',{time: 1000,
  731. end:function(){
  732. location.href = info.result.url;
  733. }
  734. });
  735. }
  736. }
  737. })
  738. return false;
  739. })
  740. })
  741. </script>
  742. <div id="ajaxModal" class="modal fade" style="display: none;">
  743. </div>
  744. <script>
  745. //没有选中时间段不能导出
  746. $(function () {
  747. $('.btn-submit').click(function () {
  748. var e = $(this).data('export');
  749. if(e==1 ){
  750. if($('#keyword').val() !='' ){
  751. $('#export').val(1);
  752. $('#search').submit();
  753. }else if($('#searchtime').val()!=''){
  754. $('#export').val(1);
  755. $('#search').submit();
  756. }else{
  757. $('#export').val(1);
  758. $('#search').submit();
  759. return;
  760. }
  761. }else{
  762. $('#export').val(0);
  763. $('#search').submit();
  764. }
  765. })
  766. })
  767. </script>
  768. </body>