apply.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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('apply',['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('apply',['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('apply',['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. </div>
  42. </div>
  43. </div>
  44. </form>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="layui-col-md12">
  49. <div class="layui-card">
  50. <!-- <div class="layui-card-header">门店列表</div>-->
  51. <div class="layui-card-body">
  52. <table class="layui-hide" id="List" lay-filter="List"></table>
  53. <script type="text/html" id="headimgurl">
  54. <img style="cursor: pointer" lay-event='open_image' src="{{d.image}}">
  55. </script>
  56. <script type="text/html" id="cert">
  57. <img style="cursor: pointer" lay-event='open_image' src="{{d.cert}}">
  58. </script>
  59. <script type="text/html" id="address">
  60. {{d.address}} {{d.detailed_address}}
  61. </script>
  62. <script type="text/html" id="act">
  63. {{# if(d.status == 0){ }}
  64. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='edit'>
  65. 审核
  66. </button>
  67. {{# } }}
  68. </script>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  75. {/block}
  76. {block name="script"}
  77. <script>
  78. var type = <?=$type?>;
  79. layList.tableList('List', "{:Url('apply_list',['type'=>$type])}", function () {
  80. return [
  81. {field: 'id', title: 'ID', sort: true, event: 'id', width: '4%'},
  82. {field: 'image', title: '门店图片', templet: '#headimgurl', width: '6%'},
  83. {field: 'name', title: '门店名称', width: '10%'},
  84. {field: 'user', title: '申请人'},
  85. {field: 'leader', title: '联系人'},
  86. {field: 'phone', title: '电话', width: '10%'},
  87. {field: 'address', title: '地址', templet: '#address'},
  88. {field: 'cert', title: '营业执照', templet: '#cert', width: '6%'},
  89. {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '14%'},
  90. ];
  91. });
  92. //查询条件
  93. layList.search('search', function (where) {
  94. layList.reload(where);
  95. });
  96. //excel下载
  97. layList.search('export', function (where) {
  98. where.excel = 1;
  99. location.href = layList.U({c: 'system.system_store', a: 'list', q: where});
  100. })
  101. //门店是否显示
  102. layList.switch('is_show', function (odj, value) {
  103. if (odj.elem.checked == true) {
  104. layList.baseGet(layList.Url({
  105. c: 'system.system_store',
  106. a: 'set_show',
  107. p: {is_show: 1, id: value}
  108. }), function (res) {
  109. layList.msg(res.msg, function () {
  110. layList.reload();
  111. });
  112. });
  113. } else {
  114. layList.baseGet(layList.Url({
  115. c: 'system.system_store',
  116. a: 'set_show',
  117. p: {is_show: 0, id: value}
  118. }), function (res) {
  119. layList.msg(res.msg, function () {
  120. layList.reload();
  121. });
  122. });
  123. }
  124. });
  125. //点击事件绑定
  126. layList.tool(function (event, data, obj) {
  127. switch (event) {
  128. case 'del':
  129. var url = layList.U({c: 'system.system_store', a: 'delete', q: {id: data.id}});
  130. if (data.is_del) var code = {title: "操作提示", text: "确定恢复门店吗?", type: 'info', confirm: '是的,恢复该门店'};
  131. else var code = {title: "操作提示", text: "确定将该门店删除吗?", type: 'info', confirm: '是的,删除该门店'};
  132. $eb.$swal('delete', function () {
  133. $eb.axios.get(url).then(function (res) {
  134. if (res.status == 200 && res.data.code == 200) {
  135. $eb.$swal('success', res.data.msg);
  136. obj.del();
  137. location.reload();
  138. } else
  139. return Promise.reject(res.data.msg || '删除失败')
  140. }).catch(function (err) {
  141. $eb.$swal('error', err);
  142. });
  143. }, code)
  144. break;
  145. case 'open_image':
  146. $eb.openImage(data.image);
  147. break;
  148. case 'edit':
  149. $eb.createModalFrame(data.name + '-编辑', layList.U({a: 'add', q: {id: data.id}}), {h: 700, w: 1100});
  150. break;
  151. case 'init':
  152. var url = layList.U({c: 'system.system_store', a: 'init', q: {store_id: data.id}});
  153. var code = {title: "操作提示", text: "确定初始化商品吗?", type: 'info', confirm: '是'};
  154. $eb.$swal('delete', function () {
  155. $eb.axios.get(url).then(function (res) {
  156. if (res.status == 200 && res.data.code == 200) {
  157. $eb.$swal('success', res.data.msg);
  158. obj.del();
  159. location.reload();
  160. } else
  161. return Promise.reject(res.data.msg || '初始化失败')
  162. }).catch(function (err) {
  163. $eb.$swal('error', err);
  164. });
  165. }, code)
  166. break;
  167. }
  168. })
  169. </script>
  170. {/block}