recharge_auth.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. {/block}
  4. {block name="content"}
  5. <style>
  6. .btn-outline{
  7. border:none;
  8. }
  9. .btn-outline:hover{
  10. background-color: #0e9aef;
  11. color: #fff;
  12. }
  13. .layui-form-item .layui-btn {
  14. margin-top: 5px;
  15. margin-right: 10px;
  16. }
  17. .layui-btn-primary{
  18. margin-right: 10px;
  19. margin-left: 0!important;
  20. }
  21. label{
  22. margin-bottom: 0!important;
  23. margin-top: 4px;
  24. }
  25. </style>
  26. <div class="layui-fluid">
  27. <div class="layui-row layui-col-space15" id="app">
  28. <!--搜索条件-->
  29. <div class="layui-col-md12">
  30. <div class="layui-card">
  31. <div class="layui-card-header">搜索条件</div>
  32. <div class="layui-card-body">
  33. <div class="layui-carousel layadmin-carousel layadmin-shortcut" lay-anim="" lay-indicator="inside"
  34. lay-arrow="none" style="background:none">
  35. <div class="layui-card-body">
  36. <div class="layui-row layui-col-space10 layui-form-item">
  37. <div class="layui-col-lg12">
  38. <label class="layui-form-label">审核状态:</label>
  39. <div class="layui-input-block" v-cloak="">
  40. <button class="layui-btn layui-btn-sm"
  41. :class="{'layui-btn-primary':where.auth_status!==item.value}"
  42. @click="where.auth_status = item.value" type="button"
  43. v-for="item in auth_status">{{item.name}}
  44. </button>
  45. </div>
  46. </div>
  47. <div class="layui-col-lg12">
  48. <label class="layui-form-label">关键字:</label>
  49. <div class="layui-input-block">
  50. <input type="text" name="real_name" style="width: 50%" v-model="where.key"
  51. placeholder="请输入管理员姓名、订单编号" class="layui-input">
  52. </div>
  53. </div>
  54. <div class="layui-col-lg12">
  55. <div class="layui-input-block">
  56. <button @click="search" type="button"
  57. class="layui-btn layui-btn-sm layui-btn-normal">
  58. <i class="layui-icon layui-icon-search"></i>搜索
  59. </button>
  60. <button @click="excel" type="button"
  61. class="layui-btn layui-btn-warm layui-btn-sm export" type="button">
  62. <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出
  63. </button>
  64. <button @click="refresh" type="reset"
  65. class="layui-btn layui-btn-primary layui-btn-sm">
  66. <i class="layui-icon layui-icon-refresh"></i>刷新
  67. </button>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <!--end-->
  77. </div>
  78. <!--列表-->
  79. <div class="layui-row layui-col-space15">
  80. <div class="layui-col-md12">
  81. <div class="layui-card">
  82. <div class="layui-card-header">订单列表</div>
  83. <div class="layui-card-body">
  84. <table class="layui-hide" id="List" lay-filter="List"></table>
  85. <script type="text/html" id="user">
  86. {{d.user.nickname}}<br>
  87. {{d.user.phone}}
  88. </script>
  89. <script type="text/html" id="act">
  90. {{# if(d.auth_status==0){ }}
  91. <button type="button" class="layui-btn layui-btn-xs" lay-event="auth1"><i class="layui-icon layui-icon-ok"></i>通过</button>
  92. <button type="button" class="layui-btn layui-btn-xs" lay-event="auth0"><i class="layui-icon layui-icon-close"></i>拒绝</button>
  93. {{# } }}
  94. </script>
  95. <script type="text/html" id="number">
  96. {{# if(d.way==0){ }}
  97. <font color="#f00"> -{{d.number}} </font>
  98. {{# } }}
  99. {{# if(d.way==1){ }}
  100. {{d.number}}
  101. {{# } }}
  102. </script>
  103. <script type="text/html" id="type">
  104. {{# if(d.type=='now_money'){ }}
  105. <font color="#559900"> 余额 </font>
  106. {{# } }}
  107. {{# if(d.type=='consumer'){ }}
  108. <font color="#ff00ee"> 消费券 </font>
  109. {{# } }}
  110. {{# if(d.type=='integral'){ }}
  111. <font color="#00eeff"> 积分 </font>
  112. {{# } }}
  113. </script>
  114. <script type="text/html" id="status">
  115. {{# if(d.auth_status==1){ }}
  116. 通过
  117. {{# } }}
  118. {{# if(d.auth_status==-1){ }}
  119. 拒绝
  120. {{# } }}
  121. </script>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <!--end-->
  127. </div>
  128. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  129. {/block}
  130. {block name="script"}
  131. <script>
  132. layList.tableList('List', "{:Url('recharge_list',['key'=>$key])}", function () {
  133. return [
  134. {type: 'checkbox'},
  135. {field: 'id', title: '订单号', sort: true, event: 'id'},
  136. {field: 'uid', title: '用户信息', templet: '#user', align: 'center', width: '15%'},
  137. {field: 'type', title: '充值类型', templet: '#type'},
  138. {field: 'number', title: '充值余额', templet: '#number'},
  139. {field: 'admin_real_name', title: '创建员姓名', width: '10%', align: 'center'},
  140. {field: 'create_admin_time_txt', title: '创建时间', width: '10%', align: 'center'},
  141. {field: 'auth_real_name', title: '审核人', width: '10%', align: 'center'},
  142. {field: 'auth_admin_time_txt', title: '审核时间', width: '10%', align: 'center'},
  143. {field: 'evaluation', title: '付款凭证', width: '10%', sort: true, align: 'center'},
  144. {field: 'auth_status', title: '审核状态', templet: '#status', width: '8%', align: 'center'},
  145. {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '10%'},
  146. ];
  147. });
  148. layList.tool(function (event, data, obj) {
  149. switch (event) {
  150. case 'auth1':
  151. $eb.$swal('delete',function(){
  152. $eb.axios.get(layList.U({a:'recharge_auth_save',q:{id:data.id,auth_status:1}})).then(function(res){
  153. if(res.status == 200 && res.data.code == 200) {
  154. $eb.$swal('success',res.data.msg);
  155. layList.reload();
  156. }else
  157. return Promise.reject(res.data.msg || '删除失败')
  158. }).catch(function(err){
  159. $eb.$swal('error',err);
  160. });
  161. },{
  162. title:'您确定要通过审核',
  163. text:'通过后无法恢复请谨慎操作',
  164. confirm:'是的我要通过'
  165. })
  166. break;
  167. case 'auth0':
  168. $eb.$swal('delete',function(){
  169. $eb.axios.get(layList.U({a:'recharge_auth_save',q:{id:data.id,auth_status:-1}})).then(function(res){
  170. if(res.status == 200 && res.data.code == 200) {
  171. $eb.$swal('success',res.data.msg);
  172. layList.reload();
  173. }else
  174. return Promise.reject(res.data.msg || '删除失败')
  175. }).catch(function(err){
  176. $eb.$swal('error',err);
  177. });
  178. },{
  179. title:'您确定要拒绝',
  180. text:'拒绝后无法恢复请谨慎操作',
  181. confirm:'是的我要拒绝'
  182. })
  183. break;
  184. break;
  185. }
  186. })
  187. //下拉框
  188. $(document).click(function (e) {
  189. $('.layui-nav-child').hide();
  190. })
  191. function dropdown(that) {
  192. var oEvent = arguments.callee.caller.arguments[0] || event;
  193. oEvent.stopPropagation();
  194. var offset = $(that).offset();
  195. var top = offset.top - $(window).scrollTop();
  196. var index = $(that).parents('tr').data('index');
  197. $('.layui-nav-child').each(function (key) {
  198. if (key != index) {
  199. $(this).hide();
  200. }
  201. })
  202. if ($(document).height() < top + $(that).next('ul').height()) {
  203. $(that).next('ul').css({
  204. 'padding': 10,
  205. 'top': -($(that).parents('td').height() / 2 + $(that).height() + $(that).next('ul').height() / 2),
  206. 'min-width': 'inherit',
  207. 'position': 'absolute'
  208. }).toggle();
  209. } else {
  210. $(that).next('ul').css({
  211. 'padding': 10,
  212. 'top': $(that).parents('td').height() / 2 + $(that).height(),
  213. 'min-width': 'inherit',
  214. 'position': 'absolute'
  215. }).toggle();
  216. }
  217. }
  218. var key = '<?=$key?>';
  219. var status =<?=$auth_status ? $auth_status : "'-2'"?>;
  220. require(['vue'], function (Vue) {
  221. new Vue({
  222. el: "#app",
  223. data: {
  224. auth_status: [
  225. {name: '全部', value: '-2'},
  226. {name: '待审核', value: 0},
  227. {name: '通过', value: 1},
  228. {name: '拒绝', value: -1},
  229. ],
  230. where: {
  231. auth_status: status,
  232. key: key || '',
  233. excel: 0,
  234. },
  235. showtime: false,
  236. },
  237. watch: {
  238. 'where.auth_status': function () {
  239. this.where.excel = 0;
  240. layList.reload(this.where, true);
  241. },
  242. 'where.key': function () {
  243. this.where.excel = 0;
  244. layList.reload(this.where, true);
  245. }
  246. },
  247. methods: {
  248. setData: function (item) {
  249. var that = this;
  250. if (item.is_zd == true) {
  251. that.showtime = true;
  252. this.where.data = this.$refs.date_time.innerText;
  253. } else {
  254. this.showtime = false;
  255. this.where.data = item.value;
  256. }
  257. },
  258. search: function () {
  259. this.where.excel = 0;
  260. layList.reload(this.where, true);
  261. },
  262. refresh: function () {
  263. layList.reload();
  264. },
  265. excel: function () {
  266. this.where.excel = 1;
  267. location.href = layList.U({c: 'user.user', a: 'recharge_list', q: this.where});
  268. this.where.excel = 0;
  269. }
  270. },
  271. mounted: function () {
  272. var that = this;
  273. window.formReload = this.search;
  274. layList.laydate.render({
  275. elem: this.$refs.date_time,
  276. trigger: 'click',
  277. eventElem: this.$refs.time,
  278. range: true,
  279. change: function (value) {
  280. that.where.data = value;
  281. }
  282. });
  283. }
  284. })
  285. });
  286. </script>
  287. {/block}