index.php 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. {/block}
  4. {block name="content"}
  5. <div class="layui-fluid" style="background: #fff;margin-top: -10px;">
  6. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  7. <ul class="layui-tab-title">
  8. <li lay-id="list" {eq name='type' value='1' }class="layui-this" {
  9. /eq}>
  10. <a href="{eq name='type' value='1'}javascript:;{else}{:Url('index',['type'=>1])}{/eq}">显示中的门店({$show})</a>
  11. </li>
  12. <li lay-id="list" {eq name='type' value='2' }class="layui-this" {
  13. /eq}>
  14. <a href="{eq name='type' value='2'}javascript:;{else}{:Url('index',['type'=>2])}{/eq}">隐藏中的门店({$hide})</a>
  15. </li>
  16. <li lay-id="list" {eq name='type' value='3' }class="layui-this" {
  17. /eq}>
  18. <a href="{eq name='type' value='3'}javascript:;{else}{:Url('index',['type'=>3])}{/eq}">回收站的门店({$recycle})</a>
  19. </li>
  20. </ul>
  21. </div>
  22. <div class="layui-row layui-col-space15">
  23. <div class="layui-col-md12">
  24. <div class="layui-card">
  25. <div class="layui-card-body">
  26. <form class="layui-form layui-form-pane" action="">
  27. <div class="layui-form-item">
  28. <div class="layui-inline">
  29. <label class="layui-form-label">门店名称</label>
  30. <div class="layui-input-block">
  31. <input type="text" name="name" class="layui-input" placeholder="请输入门店名称,关键字,编号">
  32. <input type="hidden" name="type" value="{$type}">
  33. </div>
  34. </div>
  35. <div class="layui-inline">
  36. <div class="layui-input-inline">
  37. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search"
  38. lay-filter="search">
  39. <i class="layui-icon layui-icon-search"></i>搜索
  40. </button>
  41. <button class="layui-btn layui-btn-primary layui-btn-sm export" lay-submit="export"
  42. lay-filter="export">
  43. <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出
  44. </button>
  45. </div>
  46. </div>
  47. </div>
  48. </form>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="layui-col-md12">
  53. <div class="layui-card">
  54. <!-- <div class="layui-card-header">门店列表</div>-->
  55. <div class="layui-card-body">
  56. <div class="layui-btn-container">
  57. <button class="layui-btn layui-btn-sm"
  58. onclick="$eb.createModalFrame(this.innerText,'{:Url('add')}',{h:700,w:1100})">添加门店
  59. </button>
  60. </div>
  61. <table class="layui-hide" id="List" lay-filter="List"></table>
  62. <script type="text/html" id="headimgurl">
  63. <img style="cursor: pointer" lay-event='open_image' src="{{d.image}}">
  64. </script>
  65. <script type="text/html" id="address">
  66. {{d.address}} {{d.detailed_address}}
  67. </script>
  68. <script type="text/html" id="checkboxstatus">
  69. <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show'
  70. lay-text='显示|隐藏' {{ d.is_show== 1 ? 'checked' : '' }}>
  71. </script>
  72. <script type="text/html" id="act">
  73. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='edit'>
  74. 编辑门店
  75. </button>
  76. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='stock'>
  77. 门店库存
  78. </button>
  79. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='bill'>
  80. 门店佣金
  81. </button>
  82. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='pick_point'>
  83. 自提点列表
  84. </button>
  85. <!-- <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='bill'>-->
  86. <!-- 门店佣金-->
  87. <!-- </button>-->
  88. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='del'>
  89. {{# if(d.is_del){ }}
  90. 恢复门店
  91. {{# }else{ }}
  92. 删除门店
  93. {{# } }}
  94. </button>
  95. </script>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  102. {/block}
  103. {block name="script"}
  104. <script>
  105. var type = <?=$type?>;
  106. layList.tableList('List', "{:Url('list',['type'=>$type])}", function () {
  107. return [
  108. {field: 'id', title: 'ID', sort: true, event: 'id', width: '4%'},
  109. {field: 'image', title: '门店图片', templet: '#headimgurl', width: '6%'},
  110. {field: 'name', title: '门店名称', width: '10%'},
  111. {field: 'leader', title: '门店店长', width: '8%'},
  112. {field: 'phone', title: '门店电话', width: '8%'},
  113. {field: 'deposit', title: '总押金', width: '6%'},
  114. {field: 'deposit_back', title: '已退押金', width: '6%'},
  115. {field: 'address', title: '地址', templet: '#address'},
  116. {field: 'day_time', title: '营业时间', width: '10%'},
  117. // {field: 'valid_time', title: '核销有效日期', width: '11%'},
  118. {field: 'status', title: '是否显示', templet: "#checkboxstatus", width: '8%'},
  119. {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '14%'},
  120. ];
  121. });
  122. //查询条件
  123. layList.search('search', function (where) {
  124. layList.reload(where);
  125. });
  126. //excel下载
  127. layList.search('export', function (where) {
  128. where.excel = 1;
  129. location.href = layList.U({c: 'system.system_store', a: 'list', q: where});
  130. })
  131. //门店是否显示
  132. layList.switch('is_show', function (odj, value) {
  133. if (odj.elem.checked == true) {
  134. layList.baseGet(layList.Url({
  135. c: 'system.system_store',
  136. a: 'set_show',
  137. p: {is_show: 1, id: value}
  138. }), function (res) {
  139. layList.msg(res.msg, function () {
  140. layList.reload();
  141. });
  142. });
  143. } else {
  144. layList.baseGet(layList.Url({
  145. c: 'system.system_store',
  146. a: 'set_show',
  147. p: {is_show: 0, id: value}
  148. }), function (res) {
  149. layList.msg(res.msg, function () {
  150. layList.reload();
  151. });
  152. });
  153. }
  154. });
  155. //点击事件绑定
  156. layList.tool(function (event, data, obj) {
  157. switch (event) {
  158. case 'del':
  159. var url = layList.U({c: 'system.system_store', a: 'delete', q: {id: data.id}});
  160. if (data.is_del) var code = {title: "操作提示", text: "确定恢复门店吗?", type: 'info', confirm: '是的,恢复该门店'};
  161. else var code = {title: "操作提示", text: "确定将该门店删除吗?", type: 'info', confirm: '是的,删除该门店'};
  162. $eb.$swal('delete', function () {
  163. $eb.axios.get(url).then(function (res) {
  164. if (res.status == 200 && res.data.code == 200) {
  165. $eb.$swal('success', res.data.msg);
  166. obj.del();
  167. location.reload();
  168. } else
  169. return Promise.reject(res.data.msg || '删除失败')
  170. }).catch(function (err) {
  171. $eb.$swal('error', err);
  172. });
  173. }, code)
  174. break;
  175. case 'open_image':
  176. $eb.openImage(data.image);
  177. break;
  178. case 'edit':
  179. $eb.createModalFrame(data.name + '-编辑', layList.U({a: 'add', q: {id: data.id}}), {h: 700, w: 1100});
  180. break;
  181. case 'stock':
  182. $eb.createModalFrame(data.name + '-库存', layList.U({a: 'storeProductInfo', q: {id: data.id}}), {
  183. h: 700,
  184. w: 1100
  185. });
  186. break;
  187. case 'pick_point':
  188. $eb.createModalFrame(data.name + '-自提点', layList.U({a: 'store_point', q: {id: data.id}}), {
  189. h: 700,
  190. w: 1100
  191. });
  192. break;
  193. case 'bill':
  194. $eb.createModalFrame(data.name + '-佣金', layList.U({a: 'store_bill_log', q: {id: data.id}}), {
  195. h: 700,
  196. w: 1100
  197. });
  198. break;
  199. }
  200. })
  201. </script>
  202. {/block}