recharge_auth.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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="status">
  104. {{# if(d.auth_status==1){ }}
  105. 通过
  106. {{# } }}
  107. {{# if(d.auth_status==-1){ }}
  108. 拒绝
  109. {{# } }}
  110. </script>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <!--end-->
  116. </div>
  117. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  118. {/block}
  119. {block name="script"}
  120. <script>
  121. layList.tableList('List', "{:Url('recharge_list',['key'=>$key])}", function () {
  122. return [
  123. {type: 'checkbox'},
  124. {field: 'id', title: '订单号', sort: true, event: 'id', width: '14%'},
  125. {field: 'uid', title: '用户信息', templet: '#user', align: 'center'},
  126. {field: 'number', title: '充值余额', templet: '#number', height: 'full-20'},
  127. {field: 'admin_real_name', title: '创建员姓名', width: '10%', align: 'center'},
  128. {field: 'create_admin_time_txt', title: '创建时间', width: '10%', align: 'center'},
  129. {field: 'auth_real_name', title: '审核人', width: '10%', align: 'center'},
  130. {field: 'auth_admin_time_txt', title: '审核时间', width: '10%', align: 'center'},
  131. {field: 'evaluation', title: '付款凭证', width: '10%', sort: true, align: 'center'},
  132. {field: 'auth_status', title: '审核状态', templet: '#status', width: '8%', align: 'center'},
  133. {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '10%'},
  134. ];
  135. });
  136. layList.tool(function (event, data, obj) {
  137. switch (event) {
  138. case 'auth1':
  139. $eb.$swal('delete',function(){
  140. $eb.axios.get(layList.U({a:'recharge_auth_save',q:{id:data.id,auth_status:1}})).then(function(res){
  141. if(res.status == 200 && res.data.code == 200) {
  142. $eb.$swal('success',res.data.msg);
  143. layList.reload();
  144. }else
  145. return Promise.reject(res.data.msg || '删除失败')
  146. }).catch(function(err){
  147. $eb.$swal('error',err);
  148. });
  149. },{
  150. title:'您确定要通过审核',
  151. text:'通过后无法恢复请谨慎操作',
  152. confirm:'是的我要通过'
  153. })
  154. break;
  155. case 'auth0':
  156. $eb.$swal('delete',function(){
  157. $eb.axios.get(layList.U({a:'recharge_auth_save',q:{id:data.id,auth_status:-1}})).then(function(res){
  158. if(res.status == 200 && res.data.code == 200) {
  159. $eb.$swal('success',res.data.msg);
  160. layList.reload();
  161. }else
  162. return Promise.reject(res.data.msg || '删除失败')
  163. }).catch(function(err){
  164. $eb.$swal('error',err);
  165. });
  166. },{
  167. title:'您确定要拒绝',
  168. text:'拒绝后无法恢复请谨慎操作',
  169. confirm:'是的我要拒绝'
  170. })
  171. break;
  172. break;
  173. }
  174. })
  175. //下拉框
  176. $(document).click(function (e) {
  177. $('.layui-nav-child').hide();
  178. })
  179. function dropdown(that) {
  180. var oEvent = arguments.callee.caller.arguments[0] || event;
  181. oEvent.stopPropagation();
  182. var offset = $(that).offset();
  183. var top = offset.top - $(window).scrollTop();
  184. var index = $(that).parents('tr').data('index');
  185. $('.layui-nav-child').each(function (key) {
  186. if (key != index) {
  187. $(this).hide();
  188. }
  189. })
  190. if ($(document).height() < top + $(that).next('ul').height()) {
  191. $(that).next('ul').css({
  192. 'padding': 10,
  193. 'top': -($(that).parents('td').height() / 2 + $(that).height() + $(that).next('ul').height() / 2),
  194. 'min-width': 'inherit',
  195. 'position': 'absolute'
  196. }).toggle();
  197. } else {
  198. $(that).next('ul').css({
  199. 'padding': 10,
  200. 'top': $(that).parents('td').height() / 2 + $(that).height(),
  201. 'min-width': 'inherit',
  202. 'position': 'absolute'
  203. }).toggle();
  204. }
  205. }
  206. var key = '<?=$key?>';
  207. var status =<?=$auth_status ? $auth_status : "'-2'"?>;
  208. require(['vue'], function (Vue) {
  209. new Vue({
  210. el: "#app",
  211. data: {
  212. auth_status: [
  213. {name: '全部', value: '-2'},
  214. {name: '待审核', value: 0},
  215. {name: '通过', value: 1},
  216. {name: '拒绝', value: -1},
  217. ],
  218. where: {
  219. auth_status: status,
  220. key: key || '',
  221. excel: 0,
  222. },
  223. showtime: false,
  224. },
  225. watch: {
  226. 'where.auth_status': function () {
  227. this.where.excel = 0;
  228. layList.reload(this.where, true);
  229. },
  230. 'where.key': function () {
  231. this.where.excel = 0;
  232. layList.reload(this.where, true);
  233. }
  234. },
  235. methods: {
  236. setData: function (item) {
  237. var that = this;
  238. if (item.is_zd == true) {
  239. that.showtime = true;
  240. this.where.data = this.$refs.date_time.innerText;
  241. } else {
  242. this.showtime = false;
  243. this.where.data = item.value;
  244. }
  245. },
  246. search: function () {
  247. this.where.excel = 0;
  248. layList.reload(this.where, true);
  249. },
  250. refresh: function () {
  251. layList.reload();
  252. },
  253. excel: function () {
  254. this.where.excel = 1;
  255. location.href = layList.U({c: 'user.user', a: 'recharge_list', q: this.where});
  256. this.where.excel = 0;
  257. }
  258. },
  259. mounted: function () {
  260. var that = this;
  261. window.formReload = this.search;
  262. layList.laydate.render({
  263. elem: this.$refs.date_time,
  264. trigger: 'click',
  265. eventElem: this.$refs.time,
  266. range: true,
  267. change: function (value) {
  268. that.where.data = value;
  269. }
  270. });
  271. }
  272. })
  273. });
  274. </script>
  275. {/block}