45db4fb773498717a3fd5e27f566f314.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <?php /*a:5:{s:70:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\system\system_store\index.php";i:1595820902;s:61:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\container.php";i:1595820902;s:62:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\frame_head.php";i:1595820902;s:57:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\style.php";i:1595820902;s:64:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\frame_footer.php";i:1595820902;}*/ ?>
  2. <!DOCTYPE html>
  3. <html lang="zh-CN">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <?php if(empty($is_layui) || (($is_layui instanceof \think\Collection || $is_layui instanceof \think\Paginator ) && $is_layui->isEmpty())): ?>
  8. <link href="/system/frame/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
  9. <?php endif; ?>
  10. <link href="/static/plug/layui/css/layui.css" rel="stylesheet">
  11. <link href="/system/css/layui-admin.css" rel="stylesheet">
  12. <link href="/system/frame/css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
  13. <link href="/system/frame/css/animate.min.css" rel="stylesheet">
  14. <link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
  15. <script src="/system/frame/js/jquery.min.js"></script>
  16. <script src="/system/frame/js/bootstrap.min.js"></script>
  17. <script src="/static/plug/layui/layui.all.js"></script>
  18. <script>
  19. $eb = parent._mpApi;
  20. window.controlle="<?php echo strtolower(trim(preg_replace("/[A-Z]/", "_\\0", app('request')->controller()), "_"));?>";
  21. window.module="<?php echo app('http')->getName();?>";
  22. </script>
  23. <title></title>
  24. <!--<script type="text/javascript" src="/static/plug/basket.js"></script>-->
  25. <script type="text/javascript" src="/static/plug/requirejs/require.js"></script>
  26. <?php /* <script type="text/javascript" src="/static/plug/requirejs/require-basket-load.js"></script> */ ?>
  27. <script>
  28. var hostname = location.hostname;
  29. if(location.port) hostname += ':' + location.port;
  30. requirejs.config({
  31. map: {
  32. '*': {
  33. 'css': '/static/plug/requirejs/require-css.js'
  34. }
  35. },
  36. shim:{
  37. 'iview':{
  38. deps:['css!iviewcss']
  39. },
  40. 'layer':{
  41. deps:['css!layercss']
  42. }
  43. },
  44. baseUrl:'//'+hostname+'/',
  45. paths: {
  46. 'static':'static',
  47. 'system':'system',
  48. 'vue':'static/plug/vue/dist/vue.min',
  49. 'axios':'static/plug/axios.min',
  50. 'iview':'static/plug/iview/dist/iview.min',
  51. 'iviewcss':'static/plug/iview/dist/styles/iview',
  52. 'lodash':'static/plug/lodash',
  53. 'layer':'static/plug/layer/layer',
  54. 'layercss':'static/plug/layer/theme/default/layer',
  55. 'jquery':'static/plug/jquery/jquery.min',
  56. 'moment':'static/plug/moment',
  57. 'sweetalert':'static/plug/sweetalert2/sweetalert2.all.min',
  58. 'formCreate':'/static/plug/form-create/form-create.min',
  59. },
  60. basket: {
  61. excludes:['system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
  62. // excludes:['system/util/mpFormBuilder','system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
  63. }
  64. });
  65. </script>
  66. <script type="text/javascript" src="/system/util/mpFrame.js"></script>
  67. </head>
  68. <body class="gray-bg">
  69. <div class="wrapper wrapper-content">
  70. <div class="layui-fluid" style="background: #fff;margin-top: -10px;">
  71. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  72. <ul class="layui-tab-title">
  73. <li lay-id="list" <?php if($type == '1'): ?>class="layui-this" <?php endif; ?>>
  74. <a href="<?php if($type == '1'): ?>javascript:;<?php else: ?><?php echo Url('index',['type'=>1]); ?><?php endif; ?>">显示中的门店(<?php echo htmlentities($show); ?>)</a>
  75. </li>
  76. <li lay-id="list" <?php if($type == '2'): ?>class="layui-this" <?php endif; ?>>
  77. <a href="<?php if($type == '2'): ?>javascript:;<?php else: ?><?php echo Url('index',['type'=>2]); ?><?php endif; ?>">隐藏中的门店(<?php echo htmlentities($hide); ?>)</a>
  78. </li>
  79. <li lay-id="list" <?php if($type == '3'): ?>class="layui-this" <?php endif; ?>>
  80. <a href="<?php if($type == '3'): ?>javascript:;<?php else: ?><?php echo Url('index',['type'=>3]); ?><?php endif; ?>">回收站的门店(<?php echo htmlentities($recycle); ?>)</a>
  81. </li>
  82. </ul>
  83. </div>
  84. <div class="layui-row layui-col-space15">
  85. <div class="layui-col-md12">
  86. <div class="layui-card">
  87. <div class="layui-card-body">
  88. <form class="layui-form layui-form-pane" action="">
  89. <div class="layui-form-item">
  90. <div class="layui-inline">
  91. <label class="layui-form-label">门店名称</label>
  92. <div class="layui-input-block">
  93. <input type="text" name="name" class="layui-input" placeholder="请输入门店名称,关键字,编号">
  94. <input type="hidden" name="type" value="<?php echo htmlentities($type); ?>">
  95. </div>
  96. </div>
  97. <div class="layui-inline">
  98. <div class="layui-input-inline">
  99. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  100. <i class="layui-icon layui-icon-search"></i>搜索</button>
  101. <button class="layui-btn layui-btn-primary layui-btn-sm export" lay-submit="export" lay-filter="export">
  102. <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出</button>
  103. </div>
  104. </div>
  105. </div>
  106. </form>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="layui-col-md12">
  111. <div class="layui-card">
  112. <!-- <div class="layui-card-header">门店列表</div>-->
  113. <div class="layui-card-body">
  114. <div class="layui-btn-container">
  115. <button class="layui-btn layui-btn-sm"
  116. onclick="$eb.createModalFrame(this.innerText,'<?php echo Url('add'); ?>',{h:700,w:1100})">添加门店
  117. </button>
  118. </div>
  119. <table class="layui-hide" id="List" lay-filter="List"></table>
  120. <script type="text/html" id="headimgurl">
  121. <img style="cursor: pointer" lay-event='open_image' src="{{d.image}}">
  122. </script>
  123. <script type="text/html" id="address">
  124. {{d.address}} {{d.detailed_address}}
  125. </script>
  126. <script type="text/html" id="checkboxstatus">
  127. <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show'
  128. lay-text='显示|隐藏' {{ d.is_show== 1 ? 'checked' : '' }}>
  129. </script>
  130. <script type="text/html" id="act">
  131. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='edit'>
  132. 编辑门店
  133. </button>
  134. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='del'>
  135. {{# if(d.is_del){ }}
  136. 恢复门店
  137. {{# }else{ }}
  138. 删除门店
  139. {{# } }}
  140. </button>
  141. </script>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. <script src="/system/js/layuiList.js"></script>
  148. <script>
  149. var type=<?=$type?>;
  150. layList.tableList('List', "<?php echo Url('list',['type'=>$type]); ?>", function () {
  151. return [
  152. {field: 'id', title: 'ID', sort: true, event: 'id', width: '4%'},
  153. {field: 'image', title: '门店图片', templet: '#headimgurl', width: '6%'},
  154. {field: 'name', title: '门店名称', width: '10%'},
  155. {field: 'phone', title: '门店电话', width: '10%'},
  156. {field: 'address', title: '地址', templet: '#address'},
  157. {field: 'day_time', title: '营业时间', width: '15%'},
  158. // {field: 'valid_time', title: '核销有效日期', width: '11%'},
  159. {field: 'status', title: '是否显示', templet: "#checkboxstatus", width: '8%'},
  160. {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '14%'},
  161. ];
  162. });
  163. //查询条件
  164. layList.search('search',function(where){
  165. layList.reload(where);
  166. });
  167. //excel下载
  168. layList.search('export',function(where){
  169. where.excel = 1;
  170. location.href=layList.U({c:'system.system_store',a:'list',q:where});
  171. })
  172. //门店是否显示
  173. layList.switch('is_show', function (odj, value) {
  174. if (odj.elem.checked == true) {
  175. layList.baseGet(layList.Url({
  176. c: 'system.system_store',
  177. a: 'set_show',
  178. p: {is_show: 1, id: value}
  179. }), function (res) {
  180. layList.msg(res.msg, function () {
  181. layList.reload();
  182. });
  183. });
  184. } else {
  185. layList.baseGet(layList.Url({
  186. c: 'system.system_store',
  187. a: 'set_show',
  188. p: {is_show: 0, id: value}
  189. }), function (res) {
  190. layList.msg(res.msg, function () {
  191. layList.reload();
  192. });
  193. });
  194. }
  195. });
  196. //点击事件绑定
  197. layList.tool(function (event, data, obj) {
  198. switch (event) {
  199. case 'del':
  200. var url = layList.U({c: 'system.system_store', a: 'delete', q: {id: data.id}});
  201. if(data.is_del) var code = {title:"操作提示",text:"确定恢复门店吗?",type:'info',confirm:'是的,恢复该门店'};
  202. else var code = {title: "操作提示", text: "确定将该门店删除吗?", type: 'info', confirm: '是的,删除该门店'};
  203. $eb.$swal('delete', function () {
  204. $eb.axios.get(url).then(function (res) {
  205. if (res.status == 200 && res.data.code == 200) {
  206. $eb.$swal('success', res.data.msg);
  207. obj.del();
  208. location.reload();
  209. } else
  210. return Promise.reject(res.data.msg || '删除失败')
  211. }).catch(function (err) {
  212. $eb.$swal('error', err);
  213. });
  214. }, code)
  215. break;
  216. case 'open_image':
  217. $eb.openImage(data.image);
  218. break;
  219. case 'edit':
  220. $eb.createModalFrame(data.name + '-编辑', layList.U({a: 'add', q: {id: data.id}}), {h: 700, w: 1100});
  221. break;
  222. }
  223. })
  224. </script>
  225. </div>
  226. </body>
  227. </html>