070fdbff40790cc6bc4790446001414b.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <?php if (!defined('THINK_PATH')) exit();?><!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': '<?php echo ($_W['uniacid']); ?>',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '<?php echo ($_W['acid']); ?>',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '<?php echo ($_W['openid']); ?>',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '<?php echo ($_W['uid']); ?>',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '<?php echo ($_W['siteroot']); ?>',
  27. 'siteurl': '<?php echo ($_W['siteurl']); ?>',
  28. 'attachurl': '<?php echo ($_W['attachurl']); ?>',
  29. 'attachurl_local': '<?php echo ($_W['attachurl_local']); ?>',
  30. 'attachurl_remote': '<?php echo ($_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' : <?php echo 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. .layui-table[lay-size=lg] td, .layui-table[lay-size=lg] th {
  46. padding: 15px 10px;
  47. }
  48. </style>
  49. </head>
  50. <body layadmin-themealias="default">
  51. <div class="layui-fluid">
  52. <div class="layui-card">
  53. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">门店管理</span></div>
  54. <div class="layui-tab layui-tab-brief">
  55. <ul class="layui-tab-title">
  56. <li <?php if(empty($state)){ ?>class="layui-this"<?php } ?>><a href="<?php echo U('salesroom/index');?>">全部</a></li>
  57. <li <?php if(!empty($state) && $state == 1){ ?>class="layui-this"<?php } ?>><a href="<?php echo U('salesroom/index', array('state' => 1));?>">已启用</a></li>
  58. <li <?php if(!empty($state) && $state == 2){ ?>class="layui-this"<?php } ?>><a href="<?php echo U('salesroom/index', array('state' => 2));?>">已禁用</a></li>
  59. </ul>
  60. </div>
  61. <div class="layui-card-body" style="padding:15px;">
  62. <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
  63. <input type="hidden" name="c" value="salesroom" />
  64. <input type="hidden" name="type" value="<?php echo ($type); ?>" />
  65. <div class="layui-form-item">
  66. <div class="layui-inline">
  67. <div class="layui-input-inline">
  68. <input type="text" class="layui-input" name='keyword' value="<?php echo ($keyword); ?>" placeholder="门店地址/名称/电话">
  69. </div>
  70. <div class="layui-input-inline">
  71. <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
  72. </div>
  73. </div>
  74. </div>
  75. </form>
  76. <form action="" class="layui-form" lay-filter="example" method="post" >
  77. <div class="row">
  78. <div class="col-md-12">
  79. <div class="page-table-header">
  80. <span>
  81. <a href="<?php echo U('salesroom/add', array('ok' => 1));?>" class="layui-btn layui-btn-sm"><i class="fa fa-plus"></i> 新增门店</a>
  82. </span>
  83. </div>
  84. <table class="layui-table" lay-skin="line" lay-size="lg">
  85. <thead>
  86. <tr>
  87. <th style="width:100px;">排序</th>
  88. <th style="">门店名称</th>
  89. <th style="width:20%;">门店电话/地址</th>
  90. <th style="">所属供应商</th>
  91. <th style="">核销人员</th>
  92. <th style="width: 200px;">门店状态</th>
  93. <th style="width: 250px;">操作</th>
  94. </tr>
  95. </thead>
  96. <tbody>
  97. <?php foreach( $list as $item ){ ?>
  98. <tr>
  99. <td>
  100. <?php echo ($item['displayorder']); ?>
  101. </td>
  102. <td>
  103. <?php echo ($item['room_name']); ?>
  104. </td>
  105. <td>
  106. <?php echo ($item['mobile']); ?><br/><?php echo ($item['room_address']); ?>
  107. </td>
  108. <td>
  109. <?php echo ($item['supply_name']); ?>
  110. </td>
  111. <td>
  112. <?php if($item['member_count'] > 0){ ?>
  113. <a style="color:#428bca;" href="<?php echo U('salesroom_member/index', array('salesroom_id'=>$item['id'],'ok' => 1));?>" >
  114. <?php echo ($item['member_count']); ?>
  115. </a>
  116. <?php }else{ ?>
  117. <?php echo ($item['member_count']); ?>
  118. <?php } ?>
  119. </td>
  120. <td>
  121. <input type="checkbox" name="" lay-filter="statewsitch" data-href="<?php echo U('salesroom/change',array('type'=>'state','id'=>$item['id']));?>" <?php if( $item['state']==1){ ?>checked<?php }else{ } ?> lay-skin="switch" lay-text="启用|禁用">
  122. <?php if($item['state'] == 0){ ?>
  123. <br/><span style="font-size: 12px;color: #c3c3c3;">禁用时间:<?php echo ($item['disable_time']); ?></span>
  124. <?php } ?>
  125. </td>
  126. <td style="overflow:visible;position:relative">
  127. <a class='layui-btn layui-btn-xs' href="<?php echo U('salesroom_order/index', array('salesroom_id'=>$item['id']));?>" >
  128. 核销统计
  129. </a>
  130. <a class='layui-btn layui-btn-xs' href="<?php echo U('salesroom/add', array('id'=>$item['id'],'ok' => 1));?>" >
  131. <i class="layui-icon layui-icon-edit"></i>编辑
  132. </a>
  133. <a class='layui-btn layui-btn-xs deldom' href="javascript:;" data-href="<?php echo U('salesroom/delete',array('id'=>$item['id']));?>" data-confirm='门店删除后,门店所属的所有商品将变为普通商品,确认删除?'>
  134. <i class="layui-icon">&#xe640;</i>删除
  135. </a>
  136. </td>
  137. </tr>
  138. <?php } ?>
  139. </tbody>
  140. <tfoot>
  141. <tr>
  142. <td colspan="7" style="text-align: right">
  143. <?php echo ($pager); ?>
  144. </td>
  145. </tr>
  146. </tfoot>
  147. </table>
  148. </div>
  149. </div>
  150. </form>
  151. </div>
  152. </div>
  153. </div>
  154. <script src="/layuiadmin/layui/layui.js"></script>
  155. <script>
  156. layui.config({
  157. base: '/layuiadmin/' //静态资源所在路径
  158. }).extend({
  159. index: 'lib/index' //主入口模块
  160. }).use('index');
  161. </script>
  162. <script>
  163. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  164. var layer = layui.layer;
  165. var $;
  166. layui.use(['jquery', 'layer','form'], function(){
  167. $ = layui.$;
  168. var form = layui.form;
  169. $('.deldom').click(function(){
  170. var s_url = $(this).attr('data-href');
  171. layer.confirm($(this).attr('data-confirm'), function(index){
  172. $.ajax({
  173. url:s_url,
  174. type:'post',
  175. dataType:'json',
  176. success:function(info){
  177. if(info.status == 0)
  178. {
  179. layer.msg(info.result.message,{icon: 1,time: 2000});
  180. }else if(info.status == 1){
  181. var go_url = location.href;
  182. if( info.result.hasOwnProperty("url") )
  183. {
  184. go_url = info.result.url;
  185. }
  186. layer.msg('操作成功',{time: 1000,
  187. end:function(){
  188. location.href = info.result.url;
  189. }
  190. });
  191. }
  192. }
  193. })
  194. });
  195. })
  196. form.on('switch(statewsitch)', function(data){
  197. var s_url = $(this).attr('data-href')
  198. var s_value = 1;
  199. if(data.elem.checked)
  200. {
  201. s_value = 1;
  202. }else{
  203. s_value = 0;
  204. }
  205. if(s_value == 0){
  206. layer.confirm('门店禁用后,门店所属的所有商品将变为普通商品,确认禁用门店?', function(index){
  207. $.ajax({
  208. url:s_url,
  209. type:'post',
  210. dataType:'json',
  211. data:{value:s_value},
  212. success:function(info){
  213. if(info.status == 0)
  214. {
  215. layer.msg(info.result.message,{icon: 1,time: 2000});
  216. }else if(info.status == 1){
  217. var go_url = location.href;
  218. if( info.result.hasOwnProperty("url") )
  219. {
  220. go_url = info.result.url;
  221. }
  222. layer.msg('操作成功',{time: 1000,
  223. end:function(){
  224. location.href = info.result.url;
  225. }
  226. });
  227. }
  228. }
  229. })
  230. }, function () {
  231. location.href = location.href;
  232. });
  233. }else{
  234. $.ajax({
  235. url:s_url,
  236. type:'post',
  237. dataType:'json',
  238. data:{value:s_value},
  239. success:function(info){
  240. if(info.status == 0)
  241. {
  242. layer.msg(info.result.message,{icon: 1,time: 2000});
  243. }else if(info.status == 1){
  244. var go_url = location.href;
  245. if( info.result.hasOwnProperty("url") )
  246. {
  247. go_url = info.result.url;
  248. }
  249. layer.msg('操作成功',{time: 1000,
  250. end:function(){
  251. location.href = info.result.url;
  252. }
  253. });
  254. }
  255. }
  256. })
  257. }
  258. });
  259. })
  260. </script>
  261. </body>
  262. </html>