recharge-audit.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 0 0;position: relative;">
  7. <div class="input-item">
  8. <el-input size="small" placeholder="请输入会员id" v-model="search.user_id" clearable>
  9. </el-input>
  10. </div>
  11. <div class="input-item">
  12. <el-input size="small" placeholder="会员昵称/手机号" v-model="search.keyword" clearable>
  13. </el-input>
  14. </div>
  15. <el-date-picker size="small" v-model="date" type="datetimerange" style="float: left" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" @change="selectDateTime" end-placeholder="结束日期">
  16. </el-date-picker>
  17. <div class="input-item">
  18. <el-button type="primary" size="small" icon="el-icon-search" @click="handleClick" class="search_button">搜索</el-button>
  19. </div>
  20. <el-tabs v-model="activeName" @tab-click="handleClick">
  21. <el-tab-pane label="全部" name="-1"></el-tab-pane>
  22. <el-tab-pane label="未审核" name="0"></el-tab-pane>
  23. <el-tab-pane label="已审核" name="1"></el-tab-pane>
  24. <el-tab-pane label="驳回" name="2"></el-tab-pane>
  25. <div class="table-body">
  26. <el-table :data="list" size="small" stripe @selection-change="handleSelectionChange" v-loading="loading" style="margin-bottom: 15px">
  27. <el-table-column type="selection" align="center" width="60"></el-table-column>
  28. <el-table-column prop="id" label="ID" min-width="100" align="center"></el-table-column>
  29. <el-table-column prop="user.id" label="会员ID" min-width="100" align="center"></el-table-column>
  30. <el-table-column label="基本信息" min-width="200">
  31. <template slot-scope="scope">
  32. <div class="table-info-img-text">
  33. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  34. <div slot="error" class="image-slot">
  35. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  36. </div>
  37. </el-image>
  38. <div class="table-info-text">
  39. <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  40. <div>{{scope.row.user.mobile}}</div>
  41. </div>
  42. </div>
  43. </template>
  44. </el-table-column>
  45. <el-table-column prop="num" label="充值金额" min-width="100" align="center"></el-table-column>
  46. <el-table-column label="凭证" prop="payment_evidence" align="center" style="width: 50px;height: 50px;">
  47. <template slot-scope="scope">
  48. <div>
  49. <el-image :src="scope.row.payment_evidence" :preview-src-list="[scope.row.payment_evidence]">
  50. </el-image>
  51. </div>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="状态" prop="status_text" min-width="120" align="center">
  55. <template slot-scope="scope">
  56. <div v-if="scope.row.withdraw_status==0">待审核</div>
  57. <div v-if="scope.row.withdraw_status==1">已审核</div>
  58. <div v-if="scope.row.withdraw_status==2">驳回</div>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="时间" min-width="200" align="center">
  62. <template slot-scope="scope">
  63. <div>申请时间:{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="备注" min-width="200" align="center">
  67. <template slot-scope="scope">
  68. <div>{{scope.row.remark}}</div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="操作" min-width="200" align="center">
  72. <template slot-scope="scope">
  73. <el-button size="mini" circle style="margin-top: 10px" v-if="scope.row.withdraw_status == 0" @click="openDialogForm(scope.row,1)">
  74. <el-tooltip class="item" effect="dark" content="同意" placement="top">
  75. <img src="resources/img/mall/pass.png" alt="">
  76. </el-tooltip>
  77. </el-button>
  78. <el-button size="mini" circle style="margin-left: 10px;margin-top: 10px" v-if="scope.row.withdraw_status == 0" @click="openDialogForm(scope.row,2)">
  79. <el-tooltip class="item" effect="dark" content="拒绝" placement="top">
  80. <img src="resources/img/mall/nopass.png" alt="">
  81. </el-tooltip>
  82. </el-button>
  83. </template>
  84. </el-table-column>
  85. </el-table>
  86. <div flex="box:last cross:center">
  87. <div></div>
  88. <div>
  89. <el-pagination v-if="list.length > 0" style="display: inline-block;float: right;" background :page-size="pagination.defaultPageSize" @current-change="pageChange" layout="prev, pager, next" :current-page="pagination.current_page" :total="pagination.totalCount">
  90. </el-pagination>
  91. </div>
  92. </div>
  93. </div>
  94. </el-tabs>
  95. </el-card>
  96. <el-dialog :close-on-click-modal="false" :title="new_status == 1 ? '通过申请' : '驳回申请'" :visible.sync="dialogFormVisible" width="20%" center>
  97. <el-form :model="check_form">
  98. <el-form-item label="备注" label-width="100px" required>
  99. <el-col :span="18">
  100. <el-input v-model="check_form.remark" type="textarea" autocomplete="off"></el-input>
  101. </el-col>
  102. </el-form-item>
  103. </el-form>
  104. <div slot="footer" class="dialog-footer">
  105. <el-button @click="closeDialogForm">取 消</el-button>
  106. <el-button type="primary" v-loading="applyLoading" @click="apply()">确 定</el-button>
  107. </div>
  108. </el-dialog>
  109. </div>
  110. <script>
  111. const app = new Vue({
  112. el: '#app',
  113. data() {
  114. return {
  115. dialogFormVisible: false,
  116. dialogVisible: false,
  117. dialogTitle: '批量审核',
  118. export_url: 'mall/finance/cash',
  119. search: {
  120. keyword: '',
  121. status: -1,
  122. user_id: '',
  123. withdraw_type: '',
  124. withdraw_from: '',
  125. date: '',
  126. start_date: '',
  127. end_date: '',
  128. },
  129. multipleSelection: [],
  130. checkedData: undefined,
  131. alipay: {
  132. content: '',
  133. showAlipay: false,
  134. alipay_way: "",
  135. alitopay_switch: false,
  136. avoidtax_switch: false,
  137. },
  138. loading: false,
  139. activeName: '-1',
  140. list: [],
  141. pagination: null,
  142. export_list: [],
  143. user_id: '',
  144. withdraw_type: '',
  145. withdraw_from: '',
  146. keyword: '',
  147. date: '',
  148. start_date: '',
  149. end_date: '',
  150. page: 1,
  151. batch_cash: {
  152. status: null,
  153. content: null,
  154. },
  155. dialogLoading: false,
  156. apply_status: 1,
  157. check_form: {
  158. remark: '',
  159. verification_code: ''
  160. },
  161. new_status: 0,
  162. is_disabled: false,
  163. mobile : '',
  164. need_risk : 0,
  165. cash_log :null,
  166. applyLoading: false,
  167. };
  168. },
  169. mounted() {
  170. this.loadData();
  171. },
  172. created() {
  173. this.checkChannel()
  174. },
  175. methods: {
  176. handleSelectionChange(val) {
  177. this.multipleSelection = val;
  178. this.checkedData = val;
  179. },
  180. handleClickItem() { //图片预览点击遮罩层关闭
  181. // 获取遮罩层dom
  182. setTimeout(() => {
  183. let domImageMask = document.querySelector(".el-image-viewer__mask");
  184. if (!domImageMask) {
  185. return;
  186. }
  187. domImageMask.addEventListener("click", () => {
  188. // 点击遮罩层时调用关闭按钮的 click 事件
  189. document.querySelector(".el-image-viewer__close").click();
  190. });
  191. }, 300)
  192. },
  193. confirmSubmit() {
  194. if (this.date) {
  195. this.search.start_date = this.date[0];
  196. this.search.end_date = this.date[1];
  197. }
  198. this.search.status = this.activeName
  199. },
  200. selectDateTime(e) {
  201. if (e != null) {
  202. this.start_date = e[0];
  203. this.end_date = e[1];
  204. this.search.start_date = e[0];
  205. this.search.end_date = e[1];
  206. } else {
  207. this.start_date = '';
  208. this.end_date = '';
  209. }
  210. this.page = 1;
  211. this.loadData();
  212. },
  213. loadData(status = -1, page = 1) {
  214. this.loading = true;
  215. let params = {
  216. r: 'mall/finance/recharge-audit',
  217. status: status,
  218. page: page,
  219. user_id: this.search.user_id,
  220. keyword: this.search.keyword,
  221. };
  222. if (this.date) {
  223. Object.assign(params, {
  224. start_date: this.date[0],
  225. end_date: this.date[1],
  226. });
  227. }
  228. request({
  229. params,
  230. method: 'get'
  231. }).then(e => {
  232. this.loading = false;
  233. if (e.data.code == 0) {
  234. this.page = page
  235. this.list = e.data.data.list;
  236. this.pagination = e.data.data.pagination;
  237. } else {
  238. this.$message.error(e.data.msg);
  239. }
  240. }).catch(e => {
  241. this.loading = false;
  242. });
  243. },
  244. pageChange(page) {
  245. this.loadData(this.activeName, page);
  246. },
  247. handleClick(tab, event) {
  248. // console.log(this.user_id);
  249. // console.log(this.withdraw_type);
  250. // console.log(this.withdraw_from);
  251. // console.log(this.keyword);
  252. this.search.status = this.activeName
  253. this.loadData(this.activeName)
  254. },
  255. checkChannel() {
  256. request({
  257. params: {
  258. r: 'mall/finance/check-channel',
  259. },
  260. method: 'get',
  261. }).then(e => {
  262. if (e.data.code === 0) {
  263. this.alipay.alitopay_switch = e.data.data.alitopay && e.data.data.alitopay.is_install == 1 ? true : false
  264. this.alipay.avoidtax_switch = e.data.data.avoidtax && e.data.data.avoidtax.is_install == 1 ? true : false
  265. console.log(e.data)
  266. } else {
  267. this.$message.error(e.data.msg);
  268. }
  269. }).catch(e => {
  270. done();
  271. instance.confirmButtonLoading = false;
  272. });
  273. },
  274. openDialogForm(cash,status) {
  275. this.dialogFormVisible = true;
  276. this.new_status = status;
  277. this.cash_log = cash;
  278. },
  279. closeDialogForm() {
  280. this.dialogFormVisible = false;
  281. this.new_status = 0;
  282. this.check_form.remark = ''
  283. this.check_form.verification_code = '';
  284. },
  285. apply() {
  286. if (this.applyLoading === true) return;
  287. this.applyLoading = true;
  288. request({
  289. params: {
  290. r: 'mall/finance/recharge-apply',
  291. },
  292. method: 'post',
  293. data: {
  294. id: this.cash_log.id,
  295. status: this.new_status,
  296. remark: this.check_form.remark,
  297. }
  298. }).then(e => {
  299. if (e.data.code === 0) {
  300. this.closeDialogForm();
  301. this.loadData(this.activeName, this.page);
  302. } else {
  303. this.$message.error(e.data.msg);
  304. }
  305. this.applyLoading = false;
  306. }).catch(e => {
  307. this.applyLoading = false;
  308. });
  309. },
  310. handle(type, data = null) {
  311. let ids = [];
  312. switch (type) {
  313. case 'open':
  314. if (this.multipleSelection.length == 0) {
  315. this.$message({
  316. type: 'warning',
  317. message: '请选择要审核的数据'
  318. });
  319. return;
  320. }
  321. this.batch_cash.status = data
  322. if (data == 1) {
  323. this.apply_status = 1;
  324. this.dialogTitle = '批量审核';
  325. } else {
  326. this.apply_status = 2;
  327. this.dialogTitle = '批量打款';
  328. }
  329. this.dialogVisible = true;
  330. break;
  331. case 'batch_apply': // 批量审核
  332. var is_return = false;
  333. this.multipleSelection.forEach(item => {
  334. if (item.status != 0 && is_return == false) {
  335. this.$message({
  336. type: 'warning',
  337. message: 'ID:' + item.id + ' 的数据非待审核状态'
  338. });
  339. is_return = true;
  340. }
  341. ids.push(item.id)
  342. })
  343. if (is_return == true) return;
  344. this.dialogLoading = true;
  345. data.ids = ids;
  346. this.send(data, 'mall/finance/batch-cash-apply', (resp) => {
  347. this.dialogLoading = false;
  348. this.dialogVisible = false;
  349. this.loadData();
  350. });
  351. break;
  352. case 'batch_remit': // 批量打款
  353. var is_return = false;
  354. this.multipleSelection.forEach(item => {
  355. if (item.status != 1 && is_return == false) {
  356. this.$message({
  357. type: 'warning',
  358. message: 'ID:' + item.id + ' 的数据非待打款状态'
  359. });
  360. is_return = true;
  361. }
  362. ids.push(item.id)
  363. })
  364. if (is_return == true) return;
  365. this.dialogLoading = true;
  366. data.ids = ids;
  367. this.send(data, 'mall/finance/batch-cash-apply', (resp) => {
  368. this.dialogLoading = false;
  369. this.dialogVisible = false;
  370. this.loadData();
  371. });
  372. break;
  373. }
  374. },
  375. send(params, url, callback = null) {
  376. let self = this;
  377. let basic_params = {
  378. r: url
  379. };
  380. request({
  381. params: basic_params,
  382. method: 'post',
  383. data: params
  384. }).then(e => {
  385. if (e.data.code == 0) {
  386. self.$message.success(e.data.msg);
  387. } else {
  388. self.$message.error(e.data.msg);
  389. }
  390. if (callback) callback(e.data);
  391. }).catch(e => {
  392. console.log(e);
  393. });
  394. },
  395. }
  396. })
  397. </script>
  398. <style>
  399. .el-tabs__header {
  400. padding: 0 20px;
  401. height: 56px;
  402. line-height: 56px;
  403. background-color: #fff;
  404. }
  405. .export-btn {
  406. position: absolute;
  407. top: 10px;
  408. right: 10px;
  409. z-index: 2;
  410. }
  411. .table-body {
  412. padding: 20px;
  413. background-color: #fff;
  414. }
  415. .table-body .el-table__row .el-button {
  416. padding: 0 !important;
  417. border: 0;
  418. margin: 0 5px;
  419. }
  420. .el-table th>.cell {
  421. color: #333;
  422. font-weight: bold;
  423. font-size: 14px;
  424. }
  425. .el-table__footer-wrapper,
  426. .el-table__header-wrapper {
  427. border-bottom: 1.4px solid #D6D6D6;
  428. }
  429. .input-item {
  430. display: inline-block;
  431. width: 250px;
  432. margin: 0 0 20px 20px;
  433. }
  434. .search_float {
  435. float: right;
  436. }
  437. .input-item .el-input__inner:hover {
  438. border: 1px solid #dcdfe6;
  439. border-right: 0;
  440. outline: 0;
  441. }
  442. .input-item .el-input__inner:focus {
  443. border: 1px solid #dcdfe6;
  444. border-right: 0;
  445. outline: 0;
  446. }
  447. .input-item .el-input-group__append {
  448. background-color: #fff;
  449. border-left: 0;
  450. width: 10%;
  451. padding: 0;
  452. }
  453. .input-item .el-input-group__append .el-button {
  454. padding: 0;
  455. }
  456. .input-item .el-input-group__append .el-button {
  457. margin: 0;
  458. }
  459. .default-avatar {
  460. width: 50px;
  461. height: 50px;
  462. border-radius: 50%;
  463. margin-right: 8px;
  464. }
  465. .uer-nickname {
  466. flex: 1;
  467. }
  468. .user_img {
  469. position: relative;
  470. margin-right: 8px;
  471. /* height: 50px;
  472. width: 50px; */
  473. }
  474. </style>