store_point.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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('store_point',['id'=>$id,'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('store_point',['id'=>$id,'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('store_point',['id'=>$id,'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_point',['store_id'=>$id])}',{h:700,w:1100})">
  59. 添加自提点
  60. </button>
  61. </div>
  62. <table class="layui-hide" id="List" lay-filter="List"></table>
  63. <script type="text/html" id="headimgurl">
  64. <img style="cursor: pointer" lay-event='open_image' src="{{d.image}}">
  65. </script>
  66. <script type="text/html" id="address">
  67. {{d.address}} {{d.detailed_address}}
  68. </script>
  69. <script type="text/html" id="checkboxstatus">
  70. <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show'
  71. lay-text='显示|隐藏' {{ d.is_show== 1 ? 'checked' : '' }}>
  72. </script>
  73. <script type="text/html" id="act">
  74. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='edit'>
  75. 编辑自提点
  76. </button>
  77. <!-- <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='bill'>-->
  78. <!-- 门店佣金-->
  79. <!-- </button>-->
  80. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='del'>
  81. {{# if(d.is_del){ }}
  82. 恢复自提点
  83. {{# }else{ }}
  84. 删除自提点
  85. {{# } }}
  86. </button>
  87. </script>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  94. {/block}
  95. {block name="script"}
  96. <script>
  97. var type = <?=$type?>;
  98. var store_id = <?=$id?>;
  99. layList.tableList('List', "{:Url('store_point_list',['id'=>$id,'type'=>$type])}", function () {
  100. return [
  101. {field: 'id', title: 'ID', sort: true, event: 'id', width: '4%'},
  102. {field: 'name', title: '自提点名称', width: '10%'},
  103. {field: 'phone', title: '自提点电话', width: '8%'},
  104. {field: 'deposit', title: '总押金', width: '6%'},
  105. {field: 'deposit_back', title: '已退押金', width: '6%'},
  106. {field: 'address', title: '地址', templet: '#address'},
  107. {field: 'status', title: '是否显示', templet: "#checkboxstatus", width: '8%'},
  108. {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '14%'},
  109. ];
  110. });
  111. //查询条件
  112. layList.search('search', function (where) {
  113. where.store_id = store_id;
  114. layList.reload(where);
  115. });
  116. //excel下载
  117. layList.search('export', function (where) {
  118. where.excel = 1;
  119. where.store_id = store_id;
  120. location.href = layList.U({c: 'system.system_store', a: 'store_point_list', q: where});
  121. })
  122. //门店是否显示
  123. layList.switch('is_show', function (odj, value) {
  124. if (odj.elem.checked == true) {
  125. layList.baseGet(layList.Url({
  126. c: 'system.system_store',
  127. a: 'set_point_show',
  128. p: {is_show: 1, id: value}
  129. }), function (res) {
  130. layList.msg(res.msg, function () {
  131. layList.reload();
  132. });
  133. });
  134. } else {
  135. layList.baseGet(layList.Url({
  136. c: 'system.system_store',
  137. a: 'set_point_show',
  138. p: {is_show: 0, id: value}
  139. }), function (res) {
  140. layList.msg(res.msg, function () {
  141. layList.reload();
  142. });
  143. });
  144. }
  145. });
  146. //点击事件绑定
  147. layList.tool(function (event, data, obj) {
  148. switch (event) {
  149. case 'del':
  150. var url = layList.U({c: 'system.system_store', a: 'point_delete', q: {id: data.id}});
  151. if (data.is_del) var code = {title: "操作提示", text: "确定恢复自提点吗?", type: 'info', confirm: '是的,恢复该自提点'};
  152. else var code = {title: "操作提示", text: "确定将该自提点删除吗?", type: 'info', confirm: '是的,删除该自提点'};
  153. $eb.$swal('delete', function () {
  154. $eb.axios.get(url).then(function (res) {
  155. if (res.status == 200 && res.data.code == 200) {
  156. $eb.$swal('success', res.data.msg);
  157. obj.del();
  158. location.reload();
  159. } else
  160. return Promise.reject(res.data.msg || '删除失败')
  161. }).catch(function (err) {
  162. $eb.$swal('error', err);
  163. });
  164. }, code)
  165. break;
  166. case 'open_image':
  167. $eb.openImage(data.image);
  168. break;
  169. case 'edit':
  170. $eb.createModalFrame(data.name + '-编辑', layList.U({
  171. a: 'add_point',
  172. q: {id: data.id, store_id: store_id}
  173. }), {h: 700, w: 1100});
  174. break;
  175. // case 'bill':
  176. // $eb.createModalFrame(data.name + '-佣金', layList.U({a: 'store_bill_log', q: {id: data.id}}), {
  177. // h: 700,
  178. // w: 1100
  179. // });
  180. // break;
  181. }
  182. })
  183. </script>
  184. {/block}