children_store.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. <label class="layui-form-label">等级</label>
  37. <div class="layui-input-block">
  38. <select name="level" class="layui-input" style="display: block">
  39. <option value="">全部</option>
  40. {volist name="level_list" id="vo"}
  41. <option value="{$vo.value}" class="layui-select">{$vo.label}</option>
  42. {/volist}
  43. </select>
  44. </div>
  45. </div>
  46. <div class="layui-inline">
  47. <div class="layui-input-inline">
  48. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search"
  49. lay-filter="search">
  50. <i class="layui-icon layui-icon-search"></i>搜索
  51. </button>
  52. <button class="layui-btn layui-btn-primary layui-btn-sm export" lay-submit="export"
  53. lay-filter="export">
  54. <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出
  55. </button>
  56. </div>
  57. </div>
  58. </div>
  59. </form>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="layui-col-md12">
  64. <div class="layui-card">
  65. <!-- <div class="layui-card-header">门店列表</div>-->
  66. <div class="layui-card-body">
  67. <table class="layui-hide" id="List" lay-filter="List"></table>
  68. <script type="text/html" id="headimgurl">
  69. <img style="cursor: pointer" lay-event='open_image' src="{{d.image}}">
  70. </script>
  71. <script type="text/html" id="address">
  72. {{d.address}} {{d.detailed_address}}
  73. </script>
  74. <script type="text/html" id="checkboxstatus">
  75. <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show'
  76. lay-text='显示|隐藏' {{ d.is_show== 1 ? 'checked' : '' }}>
  77. </script>
  78. <script type="text/html" id="act">
  79. <!-- <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='edit'>-->
  80. <!-- 编辑门店-->
  81. <!-- </button>-->
  82. <!-- <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='stock'>-->
  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('children_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: 'level_text', title: '门店等级', width: '10%'},
  112. {field: 'phone', title: '门店电话', width: '10%'},
  113. {field: 'address', title: '地址', templet: '#address'},
  114. {field: 'day_time', title: '营业时间', width: '15%'},
  115. // {field: 'valid_time', title: '核销有效日期', width: '11%'},
  116. // {field: 'status', title: '是否显示', templet: "#checkboxstatus", width: '8%'},
  117. {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '14%'},
  118. ];
  119. });
  120. //查询条件
  121. layList.search('search', function (where) {
  122. layList.reload(where);
  123. });
  124. //excel下载
  125. layList.search('export', function (where) {
  126. where.excel = 1;
  127. location.href = layList.U({c: 'merchant.system_store', a: 'children_list', q: where});
  128. })
  129. //门店是否显示
  130. layList.switch('is_show', function (odj, value) {
  131. if (odj.elem.checked == true) {
  132. layList.baseGet(layList.Url({
  133. c: 'system.system_store',
  134. a: 'set_show',
  135. p: {is_show: 1, id: value}
  136. }), function (res) {
  137. layList.msg(res.msg, function () {
  138. layList.reload();
  139. });
  140. });
  141. } else {
  142. layList.baseGet(layList.Url({
  143. c: 'system.system_store',
  144. a: 'set_show',
  145. p: {is_show: 0, id: value}
  146. }), function (res) {
  147. layList.msg(res.msg, function () {
  148. layList.reload();
  149. });
  150. });
  151. }
  152. });
  153. //点击事件绑定
  154. layList.tool(function (event, data, obj) {
  155. switch (event) {
  156. case 'del':
  157. var url = layList.U({c: 'system.system_store', a: 'delete', q: {id: data.id}});
  158. if (data.is_del) var code = {title: "操作提示", text: "确定恢复门店吗?", type: 'info', confirm: '是的,恢复该门店'};
  159. else var code = {title: "操作提示", text: "确定将该门店删除吗?", type: 'info', confirm: '是的,删除该门店'};
  160. $eb.$swal('delete', function () {
  161. $eb.axios.get(url).then(function (res) {
  162. if (res.status == 200 && res.data.code == 200) {
  163. $eb.$swal('success', res.data.msg);
  164. obj.del();
  165. location.reload();
  166. } else
  167. return Promise.reject(res.data.msg || '删除失败')
  168. }).catch(function (err) {
  169. $eb.$swal('error', err);
  170. });
  171. }, code)
  172. break;
  173. case 'open_image':
  174. $eb.openImage(data.image);
  175. break;
  176. case 'edit':
  177. $eb.createModalFrame(data.name + '-编辑', layList.U({
  178. c: 'system.system_store',
  179. a: 'add',
  180. q: {id: data.id}
  181. }), {h: 700, w: 1100});
  182. break;
  183. case 'stock':
  184. $eb.createModalFrame(data.name + '-库存', layList.U({
  185. c: 'system.system_store',
  186. a: 'storeProductInfo',
  187. q: {id: data.id}
  188. }), {
  189. h: 700,
  190. w: 1100
  191. });
  192. break;
  193. case 'bill':
  194. $eb.createModalFrame(data.name + '-佣金', layList.U({
  195. c: 'system.system_store',
  196. a: 'store_bill_log',
  197. q: {id: data.id}
  198. }), {
  199. h: 700,
  200. w: 1100
  201. });
  202. break;
  203. }
  204. })
  205. </script>
  206. {/block}