index.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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='sender'>
  86. 配送员列表
  87. </button>
  88. <!-- <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='bill'>-->
  89. <!-- 门店佣金-->
  90. <!-- </button>-->
  91. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='del'>
  92. {{# if(d.is_del){ }}
  93. 恢复门店
  94. {{# }else{ }}
  95. 删除门店
  96. {{# } }}
  97. </button>
  98. </script>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  105. {/block}
  106. {block name="script"}
  107. <script>
  108. var type = <?=$type?>;
  109. layList.tableList('List', "{:Url('list',['type'=>$type])}", function () {
  110. return [
  111. {field: 'id', title: 'ID', sort: true, event: 'id', width: '4%'},
  112. {field: 'image', title: '门店图片', templet: '#headimgurl', width: '6%'},
  113. {field: 'name', title: '门店名称', width: '10%'},
  114. {field: 'leader', title: '门店店长', width: '8%'},
  115. {field: 'phone', title: '门店电话', width: '8%'},
  116. {field: 'deposit', title: '总押金', width: '6%'},
  117. {field: 'deposit_back', title: '已退押金', width: '6%'},
  118. {field: 'address', title: '地址', templet: '#address'},
  119. {field: 'day_time', title: '营业时间', width: '10%'},
  120. // {field: 'valid_time', title: '核销有效日期', width: '11%'},
  121. {field: 'status', title: '是否显示', templet: "#checkboxstatus", width: '8%'},
  122. {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '14%'},
  123. ];
  124. });
  125. //查询条件
  126. layList.search('search', function (where) {
  127. layList.reload(where);
  128. });
  129. //excel下载
  130. layList.search('export', function (where) {
  131. where.excel = 1;
  132. location.href = layList.U({c: 'system.system_store', a: 'list', q: where});
  133. })
  134. //门店是否显示
  135. layList.switch('is_show', function (odj, value) {
  136. if (odj.elem.checked == true) {
  137. layList.baseGet(layList.Url({
  138. c: 'system.system_store',
  139. a: 'set_show',
  140. p: {is_show: 1, id: value}
  141. }), function (res) {
  142. layList.msg(res.msg, function () {
  143. layList.reload();
  144. });
  145. });
  146. } else {
  147. layList.baseGet(layList.Url({
  148. c: 'system.system_store',
  149. a: 'set_show',
  150. p: {is_show: 0, id: value}
  151. }), function (res) {
  152. layList.msg(res.msg, function () {
  153. layList.reload();
  154. });
  155. });
  156. }
  157. });
  158. //点击事件绑定
  159. layList.tool(function (event, data, obj) {
  160. switch (event) {
  161. case 'del':
  162. var url = layList.U({c: 'system.system_store', a: 'delete', q: {id: data.id}});
  163. if (data.is_del) var code = {title: "操作提示", text: "确定恢复门店吗?", type: 'info', confirm: '是的,恢复该门店'};
  164. else var code = {title: "操作提示", text: "确定将该门店删除吗?", type: 'info', confirm: '是的,删除该门店'};
  165. $eb.$swal('delete', function () {
  166. $eb.axios.get(url).then(function (res) {
  167. if (res.status == 200 && res.data.code == 200) {
  168. $eb.$swal('success', res.data.msg);
  169. obj.del();
  170. location.reload();
  171. } else
  172. return Promise.reject(res.data.msg || '删除失败')
  173. }).catch(function (err) {
  174. $eb.$swal('error', err);
  175. });
  176. }, code)
  177. break;
  178. case 'open_image':
  179. $eb.openImage(data.image);
  180. break;
  181. case 'edit':
  182. $eb.createModalFrame(data.name + '-编辑', layList.U({a: 'add', q: {id: data.id}}), {h: 700, w: 1100});
  183. break;
  184. case 'stock':
  185. $eb.createModalFrame(data.name + '-库存', layList.U({a: 'storeProductInfo', q: {id: data.id}}), {
  186. h: 700,
  187. w: 1100
  188. });
  189. break;
  190. case 'pick_point':
  191. $eb.createModalFrame(data.name + '-自提点', layList.U({a: 'store_point', q: {id: data.id}}), {
  192. h: 700,
  193. w: 1100
  194. });
  195. break;
  196. case 'sender':
  197. $eb.createModalFrame(data.name + '-配送员', layList.U({a: 'store_sender', q: {id: data.id}}), {
  198. h: 700,
  199. w: 1100
  200. });
  201. break;
  202. case 'bill':
  203. $eb.createModalFrame(data.name + '-佣金', layList.U({a: 'store_bill_log', q: {id: data.id}}), {
  204. h: 700,
  205. w: 1100
  206. });
  207. break;
  208. }
  209. })
  210. </script>
  211. {/block}