| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-export-dialog');
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 0 0;position: relative;">
- <div class="input-item">
- <el-input size="small" placeholder="请输入会员id" v-model="search.user_id" clearable>
- </el-input>
- </div>
- <div class="input-item">
- <el-input size="small" placeholder="会员昵称/手机号" v-model="search.keyword" clearable>
- </el-input>
- </div>
- <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="结束日期">
- </el-date-picker>
- <div class="input-item">
- <el-button type="primary" size="small" icon="el-icon-search" @click="handleClick" class="search_button">搜索</el-button>
- </div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="全部" name="-1"></el-tab-pane>
- <el-tab-pane label="未审核" name="0"></el-tab-pane>
- <el-tab-pane label="已审核" name="1"></el-tab-pane>
- <el-tab-pane label="驳回" name="2"></el-tab-pane>
- <div class="table-body">
- <el-table :data="list" size="small" stripe @selection-change="handleSelectionChange" v-loading="loading" style="margin-bottom: 15px">
- <el-table-column type="selection" align="center" width="60"></el-table-column>
- <el-table-column prop="id" label="ID" min-width="100" align="center"></el-table-column>
- <el-table-column prop="user.id" label="会员ID" min-width="100" align="center"></el-table-column>
- <el-table-column label="基本信息" min-width="200">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
- <div>{{scope.row.user.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="num" label="充值金额" min-width="100" align="center"></el-table-column>
- <el-table-column label="凭证" prop="payment_evidence" align="center" style="width: 50px;height: 50px;">
- <template slot-scope="scope">
- <div>
- <el-image :src="scope.row.payment_evidence" :preview-src-list="[scope.row.payment_evidence]">
- </el-image>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="状态" prop="status_text" min-width="120" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.withdraw_status==0">待审核</div>
- <div v-if="scope.row.withdraw_status==1">已审核</div>
- <div v-if="scope.row.withdraw_status==2">驳回</div>
- </template>
- </el-table-column>
- <el-table-column label="时间" min-width="200" align="center">
- <template slot-scope="scope">
- <div>申请时间:{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
- </template>
- </el-table-column>
- <el-table-column label="备注" min-width="200" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.remark}}</div>
- </template>
- </el-table-column>
- <el-table-column label="操作" min-width="200" align="center">
- <template slot-scope="scope">
- <el-button size="mini" circle style="margin-top: 10px" v-if="scope.row.withdraw_status == 0" @click="openDialogForm(scope.row,1)">
- <el-tooltip class="item" effect="dark" content="同意" placement="top">
- <img src="resources/img/mall/pass.png" alt="">
- </el-tooltip>
- </el-button>
- <el-button size="mini" circle style="margin-left: 10px;margin-top: 10px" v-if="scope.row.withdraw_status == 0" @click="openDialogForm(scope.row,2)">
- <el-tooltip class="item" effect="dark" content="拒绝" placement="top">
- <img src="resources/img/mall/nopass.png" alt="">
- </el-tooltip>
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <div flex="box:last cross:center">
- <div></div>
- <div>
- <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">
- </el-pagination>
- </div>
- </div>
- </div>
- </el-tabs>
- </el-card>
- <el-dialog :close-on-click-modal="false" :title="new_status == 1 ? '通过申请' : '驳回申请'" :visible.sync="dialogFormVisible" width="20%" center>
- <el-form :model="check_form">
- <el-form-item label="备注" label-width="100px" required>
- <el-col :span="18">
- <el-input v-model="check_form.remark" type="textarea" autocomplete="off"></el-input>
- </el-col>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="closeDialogForm">取 消</el-button>
- <el-button type="primary" v-loading="applyLoading" @click="apply()">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- dialogFormVisible: false,
- dialogVisible: false,
- dialogTitle: '批量审核',
- export_url: 'mall/finance/cash',
- search: {
- keyword: '',
- status: -1,
- user_id: '',
- withdraw_type: '',
- withdraw_from: '',
- date: '',
- start_date: '',
- end_date: '',
- },
- multipleSelection: [],
- checkedData: undefined,
- alipay: {
- content: '',
- showAlipay: false,
- alipay_way: "",
- alitopay_switch: false,
- avoidtax_switch: false,
- },
- loading: false,
- activeName: '-1',
- list: [],
- pagination: null,
- export_list: [],
- user_id: '',
- withdraw_type: '',
- withdraw_from: '',
- keyword: '',
- date: '',
- start_date: '',
- end_date: '',
- page: 1,
- batch_cash: {
- status: null,
- content: null,
- },
- dialogLoading: false,
- apply_status: 1,
- check_form: {
- remark: '',
- verification_code: ''
- },
- new_status: 0,
- is_disabled: false,
- mobile : '',
- need_risk : 0,
- cash_log :null,
- applyLoading: false,
- };
- },
- mounted() {
- this.loadData();
- },
- created() {
- this.checkChannel()
- },
- methods: {
- handleSelectionChange(val) {
- this.multipleSelection = val;
- this.checkedData = val;
- },
- handleClickItem() { //图片预览点击遮罩层关闭
- // 获取遮罩层dom
- setTimeout(() => {
- let domImageMask = document.querySelector(".el-image-viewer__mask");
- if (!domImageMask) {
- return;
- }
- domImageMask.addEventListener("click", () => {
- // 点击遮罩层时调用关闭按钮的 click 事件
- document.querySelector(".el-image-viewer__close").click();
- });
- }, 300)
- },
- confirmSubmit() {
- if (this.date) {
- this.search.start_date = this.date[0];
- this.search.end_date = this.date[1];
- }
- this.search.status = this.activeName
- },
- selectDateTime(e) {
- if (e != null) {
- this.start_date = e[0];
- this.end_date = e[1];
- this.search.start_date = e[0];
- this.search.end_date = e[1];
- } else {
- this.start_date = '';
- this.end_date = '';
- }
- this.page = 1;
- this.loadData();
- },
- loadData(status = -1, page = 1) {
- this.loading = true;
- let params = {
- r: 'mall/finance/recharge-audit',
- status: status,
- page: page,
- user_id: this.search.user_id,
- keyword: this.search.keyword,
- };
- if (this.date) {
- Object.assign(params, {
- start_date: this.date[0],
- end_date: this.date[1],
- });
- }
- request({
- params,
- method: 'get'
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- this.page = page
- this.list = e.data.data.list;
- this.pagination = e.data.data.pagination;
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.loading = false;
- });
- },
- pageChange(page) {
- this.loadData(this.activeName, page);
- },
- handleClick(tab, event) {
- // console.log(this.user_id);
- // console.log(this.withdraw_type);
- // console.log(this.withdraw_from);
- // console.log(this.keyword);
- this.search.status = this.activeName
- this.loadData(this.activeName)
- },
- checkChannel() {
- request({
- params: {
- r: 'mall/finance/check-channel',
- },
- method: 'get',
- }).then(e => {
- if (e.data.code === 0) {
- this.alipay.alitopay_switch = e.data.data.alitopay && e.data.data.alitopay.is_install == 1 ? true : false
- this.alipay.avoidtax_switch = e.data.data.avoidtax && e.data.data.avoidtax.is_install == 1 ? true : false
- console.log(e.data)
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- done();
- instance.confirmButtonLoading = false;
- });
- },
- openDialogForm(cash,status) {
- this.dialogFormVisible = true;
- this.new_status = status;
- this.cash_log = cash;
- },
- closeDialogForm() {
- this.dialogFormVisible = false;
- this.new_status = 0;
- this.check_form.remark = ''
- this.check_form.verification_code = '';
- },
- apply() {
- if (this.applyLoading === true) return;
- this.applyLoading = true;
- request({
- params: {
- r: 'mall/finance/recharge-apply',
- },
- method: 'post',
- data: {
- id: this.cash_log.id,
- status: this.new_status,
- remark: this.check_form.remark,
- }
- }).then(e => {
- if (e.data.code === 0) {
- this.closeDialogForm();
- this.loadData(this.activeName, this.page);
- } else {
- this.$message.error(e.data.msg);
- }
- this.applyLoading = false;
- }).catch(e => {
- this.applyLoading = false;
- });
- },
- handle(type, data = null) {
- let ids = [];
- switch (type) {
- case 'open':
- if (this.multipleSelection.length == 0) {
- this.$message({
- type: 'warning',
- message: '请选择要审核的数据'
- });
- return;
- }
- this.batch_cash.status = data
- if (data == 1) {
- this.apply_status = 1;
- this.dialogTitle = '批量审核';
- } else {
- this.apply_status = 2;
- this.dialogTitle = '批量打款';
- }
- this.dialogVisible = true;
- break;
- case 'batch_apply': // 批量审核
- var is_return = false;
- this.multipleSelection.forEach(item => {
- if (item.status != 0 && is_return == false) {
- this.$message({
- type: 'warning',
- message: 'ID:' + item.id + ' 的数据非待审核状态'
- });
- is_return = true;
- }
- ids.push(item.id)
- })
- if (is_return == true) return;
- this.dialogLoading = true;
- data.ids = ids;
- this.send(data, 'mall/finance/batch-cash-apply', (resp) => {
- this.dialogLoading = false;
- this.dialogVisible = false;
- this.loadData();
- });
- break;
- case 'batch_remit': // 批量打款
- var is_return = false;
- this.multipleSelection.forEach(item => {
- if (item.status != 1 && is_return == false) {
- this.$message({
- type: 'warning',
- message: 'ID:' + item.id + ' 的数据非待打款状态'
- });
- is_return = true;
- }
- ids.push(item.id)
- })
- if (is_return == true) return;
- this.dialogLoading = true;
- data.ids = ids;
- this.send(data, 'mall/finance/batch-cash-apply', (resp) => {
- this.dialogLoading = false;
- this.dialogVisible = false;
- this.loadData();
- });
- break;
- }
- },
- send(params, url, callback = null) {
- let self = this;
- let basic_params = {
- r: url
- };
- request({
- params: basic_params,
- method: 'post',
- data: params
- }).then(e => {
- if (e.data.code == 0) {
- self.$message.success(e.data.msg);
- } else {
- self.$message.error(e.data.msg);
- }
- if (callback) callback(e.data);
- }).catch(e => {
- console.log(e);
- });
- },
- }
- })
- </script>
- <style>
- .el-tabs__header {
- padding: 0 20px;
- height: 56px;
- line-height: 56px;
- background-color: #fff;
- }
- .export-btn {
- position: absolute;
- top: 10px;
- right: 10px;
- z-index: 2;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .table-body .el-table__row .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper,
- .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 0 20px 20px;
- }
- .search_float {
- float: right;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .default-avatar {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- margin-right: 8px;
- }
- .uer-nickname {
- flex: 1;
- }
- .user_img {
- position: relative;
- margin-right: 8px;
- /* height: 50px;
- width: 50px; */
- }
- </style>
|