|
@@ -1,1089 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="content">
|
|
|
- <div class="search_box">
|
|
|
- <div>
|
|
|
- <el-input
|
|
|
- v-model="params.search_name"
|
|
|
- clearable
|
|
|
- maxlength="11"
|
|
|
- placeholder="店铺名称/手机号"
|
|
|
- prefix-icon="el-icon-search"
|
|
|
- @keyup.enter.native="toSearch()"
|
|
|
- @clear="toSearch()"
|
|
|
- />
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-search"
|
|
|
- :loading="loading"
|
|
|
- @click="toSearch()"
|
|
|
- >搜索</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="table_box">
|
|
|
- <el-table
|
|
|
- ref="listTable"
|
|
|
- v-loading="loading"
|
|
|
- :header-cell-style="{ background: '#f8fbfc' }"
|
|
|
- border
|
|
|
- stripe
|
|
|
- :data="list"
|
|
|
- :height="tableHeight + 'px'"
|
|
|
- style="width: 100%"
|
|
|
- :cell-style="{ padding: '10px 0' }"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- label="序号"
|
|
|
- type="index"
|
|
|
- width="80"
|
|
|
- align="center"
|
|
|
- :index="
|
|
|
- (index) => params.page_size * (params.page_index - 1) + index + 1
|
|
|
- "
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="头像"
|
|
|
- prop="img"
|
|
|
- label-class-name="label"
|
|
|
- align="center"
|
|
|
- style="padding: 0"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <img width="36" height="36" :src="scope.row.img" class="hoverImg">
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="name"
|
|
|
- label="店铺名称"
|
|
|
- align="center"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click="getMoreInfo(row)"
|
|
|
- >{{ row.name }}的店铺</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- label="姓名"
|
|
|
- prop="user"
|
|
|
- align="center"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="{ row }">
|
|
|
- {{ row.username }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="星级" prop="star" align="center" width="60" /> -->
|
|
|
- <el-table-column label="开通时间" prop="created_at" align="center" width="160" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column
|
|
|
- label="手机号"
|
|
|
- prop="phone"
|
|
|
- align="center"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="认证状态"
|
|
|
- prop="user"
|
|
|
- align="center"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag
|
|
|
- :color="storeStatus(row.is_apply).color"
|
|
|
- style="color: #ffffff"
|
|
|
- >
|
|
|
- {{ storeStatus(row.is_apply).name }}
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" prop="status" align="center">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-button
|
|
|
- @click="handleDetail(row)"
|
|
|
- type="text"
|
|
|
-
|
|
|
- >账户明细</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 侧边栏 -->
|
|
|
- <el-drawer :title="storeInfo.name" :visible.sync="showUser" direction="rtl" size="45%">
|
|
|
- <div class="sidebar_box">
|
|
|
- <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
- <el-tab-pane label="基本信息" name="first" />
|
|
|
- <el-tab-pane label="用户列表" name="second" />
|
|
|
- <el-tab-pane label="收款记录" name="third" />
|
|
|
- </el-tabs>
|
|
|
- <el-form v-if="activeName == 'first'">
|
|
|
- <el-form-item label="商户号:">{{ authState.sub_mchid }}</el-form-item>
|
|
|
- <el-form-item label="店铺名称:">{{ storeInfo.name }}</el-form-item>
|
|
|
- <el-form-item label="联系方式:">{{ storeInfo.phone }}</el-form-item>
|
|
|
- <el-form-item v-if="storeInfo" label="认证状态:">
|
|
|
- <template>
|
|
|
- <span v-if="authState">{{ authState.applyment_state_desc }}</span>
|
|
|
- <span v-else>未认证</span>
|
|
|
- </template>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- v-if="authState.audit_detail && authState.audit_detail.length > 0"
|
|
|
- label="原因:"
|
|
|
- >{{ authState.audit_detail[0].reject_reason }}</el-form-item>
|
|
|
- <el-form-item label="星级:">{{ storeInfo.star }}</el-form-item>
|
|
|
- <el-form-item label="店铺地区:">
|
|
|
- {{ storeInfo.province ? storeInfo.province : "" }}{{ storeInfo.city ? storeInfo.city : ""
|
|
|
- }}{{ storeInfo.area ? storeInfo.area : "" }}
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="店铺地址:">
|
|
|
- {{ storeInfo.address ? storeInfo.address : '' }}
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="可提现资金:"
|
|
|
- >{{
|
|
|
- accountInfo.available_amount
|
|
|
- ? blanceFmt(accountInfo.available_amount)
|
|
|
- : 0
|
|
|
- }}元</el-form-item>
|
|
|
- <el-form-item label="冻结资金:">
|
|
|
- {{
|
|
|
- accountInfo.pending_amount
|
|
|
- ? blanceFmt(accountInfo.pending_amount)
|
|
|
- : 0
|
|
|
- }}元</el-form-item>
|
|
|
- <el-form-item v-if="storeInfo.is_apply == 3" label="开户银行:">{{
|
|
|
- storeInfo.account_bank
|
|
|
- }}</el-form-item>
|
|
|
- <el-form-item v-if="storeInfo.is_apply == 3" label="银行卡号:">{{
|
|
|
- storeInfo.account_number
|
|
|
- }}</el-form-item>
|
|
|
-
|
|
|
- <el-form-item v-if="storeInfo.qr_code" label="微信二维码:">
|
|
|
- <template>
|
|
|
- <img :src="storeInfo.qr_code" class="qr_code"> </template></el-form-item>
|
|
|
- </el-form>
|
|
|
- <div v-if="activeName == 'second'" class="user_table">
|
|
|
- <div class="search_box">
|
|
|
- <el-input
|
|
|
- v-model="userParams.search_name"
|
|
|
- placeholder="请输入手机号搜索"
|
|
|
- clearable
|
|
|
- @clear="(userParams.page_index = 1), getUser()"
|
|
|
- />
|
|
|
- <el-button type="primary" @click="getUser()">搜索</el-button>
|
|
|
- </div>
|
|
|
- <div class="user_info">
|
|
|
- <el-table
|
|
|
- v-loading="loading"
|
|
|
- border
|
|
|
- stripe
|
|
|
- :data="userList"
|
|
|
- :header-cell-style="{ background: '#eef1f6', color: '#606266' }"
|
|
|
- :cell-style="{ padding: '2px 0'}"
|
|
|
- >
|
|
|
- <el-table-column label="客户昵称" prop="nickname" align="center" />
|
|
|
- <el-table-column
|
|
|
- label="头像"
|
|
|
- prop="avatar"
|
|
|
- width="80"
|
|
|
- label-class-name="label"
|
|
|
- align="center"
|
|
|
- style="padding: 0"
|
|
|
- >
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <img
|
|
|
- width="36"
|
|
|
- height="36"
|
|
|
- :src="row.avatar"
|
|
|
- class="hoverImg"
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="手机号" prop="phone" align="center" />
|
|
|
- <el-table-column label="总销量" prop="total" align="center" />
|
|
|
- <el-table-column label="总销售金额" prop="account" align="center" />
|
|
|
- <el-table-column label="用户状态" align="center">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag :type="row.status == 0 ? 'success' : 'danger'">
|
|
|
- {{ row.status == 0 ? "启用" : "禁用" }}
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="操作"
|
|
|
- prop="status"
|
|
|
- width="120"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-button type="text" @click="handleDisable(row, 1)">{{
|
|
|
- row.status === 0 ? "禁用" : "启用"
|
|
|
- }}</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
- <div class="page">
|
|
|
- <pagination
|
|
|
- :total="userTotal"
|
|
|
- :limit="userParams.page_size"
|
|
|
- :page="userParams.page_index"
|
|
|
- @pagination="userPage"
|
|
|
- @update:limit="userPage"
|
|
|
- />
|
|
|
- </div>
|
|
|
-
|
|
|
- </div>
|
|
|
- <div v-if="activeName == 'third'">
|
|
|
- <div class="date_picker" >
|
|
|
- <el-date-picker
|
|
|
- v-model="dateVal"
|
|
|
- type="daterange"
|
|
|
- :picker-options="pickerOptions"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- :default-time="['00:00:00', '23:59:59']"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- format="yyyy-MM-dd HH:mm:ss"
|
|
|
- align="right"
|
|
|
- :clearable="false"
|
|
|
- @change="receiptParams.page_index=1,getReceipt()"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <el-tabs
|
|
|
- v-model="receiptParams.type"
|
|
|
- type="card"
|
|
|
- class="date_tab"
|
|
|
- @tab-click="changeState"
|
|
|
- >
|
|
|
- <el-tab-pane label="全部" name="0" v-if="showAll"/>
|
|
|
- <el-tab-pane label="收款" name="1" />
|
|
|
- <el-tab-pane label="解冻" name="2" />
|
|
|
- <el-tab-pane label="提现" name="3" />
|
|
|
- <el-tab-pane label="退款" name="4" />
|
|
|
- </el-tabs>
|
|
|
- <div class="record">
|
|
|
- <!-- <el-tabs
|
|
|
- v-model="receiptParams.cycle"
|
|
|
- tab-position="left"
|
|
|
- @tab-click="changedate"
|
|
|
- >
|
|
|
- <el-tab-pane label="全部" name="all" />
|
|
|
- <el-tab-pane label="今天" name="today" />
|
|
|
- <el-tab-pane label="本周" name="week" />
|
|
|
- <el-tab-pane label="本月" name="month" />
|
|
|
- <el-tab-pane label="本季" name="quarter" />
|
|
|
- <el-tab-pane label="本年" name="year" />
|
|
|
- </el-tabs> -->
|
|
|
- <div class="record_table">
|
|
|
- <el-table
|
|
|
- v-loading="loading"
|
|
|
- border
|
|
|
- stripe
|
|
|
- :data="receiptList"
|
|
|
- style="width: 100%"
|
|
|
- :header-cell-style="{ background: '#f8fbfc' }"
|
|
|
- :cell-style="{ padding: receiptParams.type == 3?'2px 0':'8px 0' }"
|
|
|
- >
|
|
|
- <el-table-column label="类型" width="50">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <span v-if="row.type == 1">收款</span>
|
|
|
- <span v-if="row.type == 2">解冻</span>
|
|
|
- <span v-if="row.type == 3">提现</span>
|
|
|
- <span v-if="row.type == 4">退款</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="金额(元)"
|
|
|
- prop="money"
|
|
|
- align="center"
|
|
|
- width="100"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="可提现金额(元)"
|
|
|
- prop="account"
|
|
|
- align="center"
|
|
|
- width="140"
|
|
|
- v-if="receiptParams.type==='0'"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="时间"
|
|
|
- prop="created_at"
|
|
|
- align="center"
|
|
|
- :width="receiptParams.type == 3?160:''"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- v-if="receiptParams.type == 3"
|
|
|
- label="提现状态"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="{ row }">
|
|
|
- {{ row.status_code | getStatus(row.status) }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column v-if="receiptParams.type == 3" label="操作">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click="withdrawalDetail(row)"
|
|
|
- >查看明细</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-dialog
|
|
|
- title="提现明细"
|
|
|
- :visible.sync="showDetail"
|
|
|
- width="30%"
|
|
|
- center
|
|
|
- :modal="false"
|
|
|
- >
|
|
|
- <el-form>
|
|
|
- <el-form-item v-if="withdrawal.amount" label="提现金额:">{{
|
|
|
- blanceFmt(withdrawal.amount)
|
|
|
- }}</el-form-item>
|
|
|
- <el-form-item
|
|
|
- v-if="withdrawal.create_time"
|
|
|
- label="提现时间:"
|
|
|
- >{{ withdrawal.create_time | rTime }}</el-form-item>
|
|
|
- <el-form-item v-if="withdrawal.status" label="提现状态:">{{
|
|
|
- withdrawal.status | getStatus1
|
|
|
- }}</el-form-item>
|
|
|
- <el-form-item
|
|
|
- v-if="withdrawal.status == 'FAIL'"
|
|
|
- label="失败原因:"
|
|
|
- >{{ withdrawal.reason }}</el-form-item>
|
|
|
- <el-form-item
|
|
|
- v-if="withdrawal.update_time"
|
|
|
- label="更新时间:"
|
|
|
- >{{ withdrawal.update_time | rTime }}</el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="showDetail = false"
|
|
|
- >确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- <pagination
|
|
|
- :total="receiptTotal"
|
|
|
- :limit="receiptParams.page_size"
|
|
|
- :page="receiptParams.page_index"
|
|
|
- @pagination="receiptPage"
|
|
|
- @update:limit="receiptPage"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-drawer>
|
|
|
- <div class="batch-container">
|
|
|
- <pagination
|
|
|
- :total="totalPage"
|
|
|
- :limit="params.page_size"
|
|
|
- :page="params.page_index"
|
|
|
- @pagination="changePagination"
|
|
|
- @update:limit="changePagination"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import {
|
|
|
- chaXunSaler,
|
|
|
- storeDisabled,
|
|
|
- storeUserList,
|
|
|
- userDisabled,
|
|
|
- getReceipt,
|
|
|
- getAccount,
|
|
|
- getWithdrawal,
|
|
|
- storeExport,
|
|
|
- setWxAuth,
|
|
|
- storeQuery,
|
|
|
- getDataInfo,
|
|
|
- deleteStore,
|
|
|
- resDelStore,
|
|
|
- newStore,
|
|
|
- getAccountDetailAll
|
|
|
-} from '@/api/store'
|
|
|
-import { storeStatus, blanceFmt, format } from '@/filters/common'
|
|
|
-import { formatter } from '@/filters/index'
|
|
|
-// 获取页面的按钮操作权限
|
|
|
-export default {
|
|
|
- name: 'StoreList',
|
|
|
- filters: {
|
|
|
- getStatus(val,status) {
|
|
|
- if(val==='SUCCESS'&& status===0){
|
|
|
- return '受理成功'
|
|
|
- }else if(val==='SUCCESS'&&status===1){
|
|
|
- return '提现成功'
|
|
|
- }else if(val==='CREATE_SUCCESS'){
|
|
|
- return '受理成功'
|
|
|
- }else if(val==='FAIL'){
|
|
|
- return '提现失败'
|
|
|
- }else if(val==='REFUND'){
|
|
|
- return '提现退票'
|
|
|
- }else if(val==='CLOSE'){
|
|
|
- return '关单'
|
|
|
- }else if(val==='INIT'){
|
|
|
- return '业务单已创建'
|
|
|
- }else{
|
|
|
- return '未知'
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- getStatus1(val){
|
|
|
-switch (val) {
|
|
|
- case 'CREATE_SUCCESS':
|
|
|
- return '受理成功'
|
|
|
- break
|
|
|
- case 'SUCCESS':
|
|
|
- return '提现成功'
|
|
|
- break
|
|
|
- case 'FAIL':
|
|
|
- return '提现失败'
|
|
|
- break
|
|
|
- case 'REFUND':
|
|
|
- return '提现退票'
|
|
|
- break
|
|
|
- case 'CLOSE':
|
|
|
- return '关单'
|
|
|
- break
|
|
|
- case 'INIT':
|
|
|
- return '业务单已创建'
|
|
|
- break
|
|
|
- }
|
|
|
- },
|
|
|
- rTime(date) {
|
|
|
- const add0 = (num) => (num < 10 ? '0' + num : num)
|
|
|
- const time = new Date(date)
|
|
|
- const year = time.getFullYear()
|
|
|
- const month = time.getMonth() + 1
|
|
|
- const day = time.getDate()
|
|
|
- const hour = time.getHours()
|
|
|
- const minite = time.getMinutes()
|
|
|
- const second = time.getSeconds()
|
|
|
- return `${year}-${add0(month)}-${add0(day)} ${add0(hour)}:${add0(
|
|
|
- minite
|
|
|
- )}:${add0(second)}`
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- showAll:false, //显示所有明细
|
|
|
- dateVal: [], // 时间段
|
|
|
- pickerOptions: {
|
|
|
- // shortcuts: [{
|
|
|
- // text: '最近一周',
|
|
|
- // onClick(picker) {
|
|
|
- // const end = new Date()
|
|
|
- // const start = new Date()
|
|
|
- // start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
|
|
- // picker.$emit('pick', [start, end])
|
|
|
- // }
|
|
|
- // }, {
|
|
|
- // text: '最近一个月',
|
|
|
- // onClick(picker) {
|
|
|
- // const end = new Date()
|
|
|
- // const start = new Date()
|
|
|
- // start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
|
|
- // picker.$emit('pick', [start, end])
|
|
|
- // }
|
|
|
- // }, {
|
|
|
- // text: '最近三个月',
|
|
|
- // onClick(picker) {
|
|
|
- // const end = new Date()
|
|
|
- // const start = new Date()
|
|
|
- // start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
|
|
- // picker.$emit('pick', [start, end])
|
|
|
- // }
|
|
|
- // }]
|
|
|
- },
|
|
|
- loading: false,
|
|
|
- canOpenNum: 0,
|
|
|
- openedNum: 0,
|
|
|
- number: '',
|
|
|
- activeName: 'first', // 抽屉里的tab切换
|
|
|
- roles: this.$route.meta.buttonAuthList ? this.$route.meta.buttonAuthList : [], // 获取页面的按钮操作权限
|
|
|
- params: {
|
|
|
- // 店铺列表参数
|
|
|
- page_index: 1,
|
|
|
- page_size: 15,
|
|
|
- search_name: '',
|
|
|
- },
|
|
|
- options: [
|
|
|
- {
|
|
|
- value: 0,
|
|
|
- label: '全部'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 1,
|
|
|
- label: '未认证'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 2,
|
|
|
- label: '审核中'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 3,
|
|
|
- label: '待签约'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 4,
|
|
|
- label: '已完成'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 5,
|
|
|
- label: '被驳回'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 6,
|
|
|
- label: '已冻结'
|
|
|
- }
|
|
|
- ],
|
|
|
- userParams: {
|
|
|
- // 用户列表参数
|
|
|
- page_index: 1,
|
|
|
- page_size: 15,
|
|
|
- search_name: '',
|
|
|
- store_id: ''
|
|
|
- },
|
|
|
- receiptParams: {
|
|
|
- // 收款记录参数
|
|
|
- page_index: 1,
|
|
|
- page_size: 15,
|
|
|
- id: '',
|
|
|
- type: '1',
|
|
|
- start_at: '',
|
|
|
- end_at: ''
|
|
|
- },
|
|
|
- storeInfo: '', // 店铺信息
|
|
|
- userList: [], // 店铺用户列表
|
|
|
- showUser: false, // 是否显示用户信息
|
|
|
- userTotal: 0, // 用户总条数
|
|
|
- list: [], // 商铺列表
|
|
|
- searchName: '', // 搜索名称
|
|
|
- totalPage: 0, // 店铺总个数
|
|
|
- receiptList: [], // 收款记录
|
|
|
- receiptTotal: 0, // 收款记录总条数
|
|
|
- authState: {}, // 店铺认证状态
|
|
|
- accountInfo: {
|
|
|
- available_amount: 0,
|
|
|
- pending_amount: 0
|
|
|
- }, // 店铺账户信息
|
|
|
- withdrawal: '', // 店铺提现信息
|
|
|
- showDetail: false, // 是否显示提现状态弹窗
|
|
|
- tableHeight: 0 // table的高度
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- console.log(this.$route.meta.buttonAuthList, 'roles')
|
|
|
- this.storeStatus = storeStatus // 店铺状态转换
|
|
|
- this.blanceFmt = blanceFmt // 分转换为元
|
|
|
- this.format = format
|
|
|
- this.getList()
|
|
|
- this.getData()
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.tableHeight = document.getElementsByClassName(
|
|
|
- 'table_box'
|
|
|
- )[0].offsetHeight
|
|
|
- })
|
|
|
- },
|
|
|
- methods: {
|
|
|
- //账户明细
|
|
|
- handleDetail(row){
|
|
|
- this.storeInfo = JSON.parse(JSON.stringify(row))
|
|
|
- this.showAll = true
|
|
|
- this.showUser =true
|
|
|
- this.receiptParams.type = '0'
|
|
|
- this.activeName = 'third'
|
|
|
- this.dateVal=[]
|
|
|
- this.getCurrentMonthFirst()
|
|
|
- this.getCurrentMonthLast()
|
|
|
- this.getReceipt()
|
|
|
- },
|
|
|
- // getAllAccount(){
|
|
|
- // this.receiptParams.start_at = this.dateVal[0]
|
|
|
- // this.receiptParams.end_at = this.dateVal[1]
|
|
|
- // const {page_index,page_size,id,start_at,end_at} = this.receiptParams
|
|
|
- // getAccountDetailAll({page_index,page_size,id,start_at,end_at}).then(res=>{
|
|
|
- // if(res.code===200){
|
|
|
- // this.receiptList = res.data.list.list
|
|
|
- // this.receiptTotal = res.data.total
|
|
|
-
|
|
|
- // }else{
|
|
|
- // this.$message.error('获取账户明细失败')
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- // 获取当前月份第一天
|
|
|
- getCurrentMonthFirst() {
|
|
|
- var date = new Date()
|
|
|
- date.setDate(1)
|
|
|
- var month = parseInt(date.getMonth() + 1)
|
|
|
- var day = date.getDate()
|
|
|
- var year = date.getFullYear()
|
|
|
- if (month < 10) month = '0' + month
|
|
|
- if (day < 10) day = '0' + day
|
|
|
- this.dateVal[0] = (`${year}-${month}-${day} 00:00:00`)
|
|
|
- },
|
|
|
- // 获取当前月份的最后一天
|
|
|
- getCurrentMonthLast() {
|
|
|
- var date = new Date()
|
|
|
- var currentMonth = date.getMonth()
|
|
|
- var nextMonth = ++currentMonth
|
|
|
- var nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1)
|
|
|
- var oneDay = 1000 * 60 * 60 * 24
|
|
|
- var lastTime = new Date(nextMonthFirstDay - oneDay)
|
|
|
- var month = parseInt(lastTime.getMonth() + 1)
|
|
|
- var day = lastTime.getDate()
|
|
|
- var year = lastTime.getFullYear()
|
|
|
- if (month < 10) {
|
|
|
- month = '0' + month
|
|
|
- }
|
|
|
- if (day < 10) {
|
|
|
- day = '0' + day
|
|
|
- }
|
|
|
- this.dateVal[1] = (`${year}-${month}-${day} 23:59:59`)
|
|
|
- },
|
|
|
- // tab 切换
|
|
|
- handleTagToggle(tab) {
|
|
|
- this.params.is_delete = Number(tab.name)
|
|
|
- this.list = []
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- getData() {
|
|
|
- getDataInfo().then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.number = res.data
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg || '获取数据失败')
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 重开店铺按钮
|
|
|
- handleReopen(row) {
|
|
|
- this.$confirm(`确认要重开${row.name}的店铺吗?,请确保店铺钱包里没有资金`, {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.reopenStore(row)
|
|
|
- })
|
|
|
- },
|
|
|
- reopenStore(row) {
|
|
|
- newStore({ id: row.id }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(`重开${row.name}的店铺成功!`)
|
|
|
- this.getList()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg || `重开${row.name}的店铺失败!`)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 删除/恢复按钮
|
|
|
- handleDel(row) {
|
|
|
- const hint = row.deleted_at ? '恢复' : '删除'
|
|
|
- if (!row.deleted_at) {
|
|
|
- this.$prompt('请输入删除原因', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- inputPattern: /^.+$/,
|
|
|
- inputErrorMessage: '删除原因不能为空'
|
|
|
- }).then(({ value }) => {
|
|
|
- this.delStore(row.id, row.name, hint, value)
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '取消输入'
|
|
|
- })
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- this.$confirm(`确认要${hint}${row.name}的店铺吗?`, {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.delStore(row.id, row.name, hint)
|
|
|
- })
|
|
|
- },
|
|
|
- // 删除/恢复事件
|
|
|
- delStore(id, name, hint, remark) {
|
|
|
- const http = hint === '恢复' ? resDelStore : deleteStore
|
|
|
- const data = hint === '恢复' ? { id } : { id, remark }
|
|
|
- http(data).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(`${hint}${name}的店铺成功!`)
|
|
|
- this.getList()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg || `${hint}${name}的店铺失败!`)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 更新店铺认证状态
|
|
|
- refState(type) {
|
|
|
- storeQuery({ id: this.storeInfo.id }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.authState = res.data.length === 0 ? '' : res.data
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg || '状态更新失败')
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 认证重置
|
|
|
- resetAuth(row) {
|
|
|
- this.$confirm(`确认要重置${row.name}的店铺认证状态吗?`, {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.setWxAuth(row.id, row.name)
|
|
|
- })
|
|
|
- },
|
|
|
- // 重置认证
|
|
|
- setWxAuth(store_id, name) {
|
|
|
- setWxAuth({ store_id }).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(`重置${name}的店铺认证状态成功`)
|
|
|
- this.getList()
|
|
|
- } else {
|
|
|
- this.$message.error(`重置${name}的店铺认证状态失败`)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- formatJson(filterVal, jsonData) {
|
|
|
- return jsonData.map((v) =>
|
|
|
- filterVal.map((j) => {
|
|
|
- if (j === 'timestamp') {
|
|
|
- return parseTime(v[j])
|
|
|
- } else {
|
|
|
- return v[j]
|
|
|
- }
|
|
|
- })
|
|
|
- )
|
|
|
- },
|
|
|
- // 提现记录查看明细
|
|
|
- withdrawalDetail(row) {
|
|
|
- this.loading = true
|
|
|
- const { transaction_id, order_no } = row
|
|
|
- getWithdrawal({
|
|
|
- id: this.storeInfo.id,
|
|
|
- withdraw_id: transaction_id,
|
|
|
- out_request_no: order_no
|
|
|
- }).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.withdrawal = res.data
|
|
|
- this.showDetail = true
|
|
|
- console.log(res, '提现状态')
|
|
|
- }else{
|
|
|
- this.$message.error(res.msg||'获取失败')
|
|
|
- }
|
|
|
- this.loading = false
|
|
|
- }).catch(()=>{
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- },
|
|
|
- /* 展开侧边栏*/
|
|
|
- getMoreInfo(row) {
|
|
|
- this.showAll = false
|
|
|
- this.storeInfo = JSON.parse(JSON.stringify(row))
|
|
|
- this.authState = []
|
|
|
- this.showUser = true
|
|
|
- this.activeName = 'first'
|
|
|
- this.receiptParams.type='1'
|
|
|
- this.getInfo()
|
|
|
- },
|
|
|
- //基本信息
|
|
|
- getInfo(){
|
|
|
- // 获取店铺状态
|
|
|
- this.refState(1)
|
|
|
- // 获取店铺银行账户信息
|
|
|
- if (this.storeInfo.is_apply === 3) {
|
|
|
- getAccount({ id:this.storeInfo.id }).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.accountInfo = res.data
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg || '获取账户信息失败')
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.accountInfo = []
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- /* 获取店铺列表 */
|
|
|
- getList() {
|
|
|
- this.loading = true
|
|
|
- // const { search_name } = this.params
|
|
|
- chaXunSaler(this.params).then(
|
|
|
- (res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.loading = false
|
|
|
- this.list = res.data.list
|
|
|
- this.totalPage = res.data.total
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg || '获取店铺列表失败')
|
|
|
- }
|
|
|
- this.loading = false
|
|
|
- }
|
|
|
- ).catch(()=>{
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取店铺用户列表
|
|
|
- getUser() {
|
|
|
- this.userParams.store_id = this.storeInfo.id
|
|
|
- const params = this.userParams
|
|
|
- storeUserList(params).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.userList = res.data.list
|
|
|
- this.userTotal = res.data.total
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg || '获取用户列表失败')
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取收款记录
|
|
|
- getReceipt() {
|
|
|
- this.receiptList=[]
|
|
|
- if (!this.dateVal) {
|
|
|
- this.$message.warning('请先选择时间')
|
|
|
- return
|
|
|
- }
|
|
|
- this.receiptParams.id = this.storeInfo.id
|
|
|
- this.receiptParams.start_at = this.dateVal[0]
|
|
|
- this.receiptParams.end_at = this.dateVal[1]
|
|
|
- //全部收款记录
|
|
|
- if(this.receiptParams.type==='0'){
|
|
|
- const {page_index,page_size,id,start_at,end_at} = this.receiptParams
|
|
|
- getAccountDetailAll({page_index,page_size,id,start_at,end_at}).then(res=>{
|
|
|
- if(res.code===200){
|
|
|
- this.receiptList = res.data.list.list
|
|
|
- this.receiptTotal = res.data.total
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
- // 收款 解冻 提现 退款
|
|
|
- getReceipt(this.receiptParams).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.receiptList = res.data.list.list
|
|
|
- this.receiptTotal = res.data.total
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg || '获取收款记录失败')
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- // 切换侧边栏tab
|
|
|
- handleClick(tab) {
|
|
|
- const name = tab.name
|
|
|
- switch (name) {
|
|
|
- case 'first':
|
|
|
- this.getInfo()
|
|
|
- case 'second':
|
|
|
- this.getUser()
|
|
|
- break
|
|
|
- case 'third':
|
|
|
- this.getCurrentMonthFirst()
|
|
|
- this.getCurrentMonthLast()
|
|
|
- this.getReceipt()
|
|
|
- break
|
|
|
- default:
|
|
|
- break
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- // 切换收款记录tab
|
|
|
- changeState(tab) {
|
|
|
- this.receiptParams.type =tab.name
|
|
|
- this.receiptParams.page_index = 1
|
|
|
- this.getReceipt()
|
|
|
- },
|
|
|
- // 切换收款记录时间
|
|
|
- changedate(tab) {
|
|
|
- this.receiptParams.cycle = tab.name
|
|
|
- this.receiptParams.page_index = 1
|
|
|
- this.getReceipt()
|
|
|
- },
|
|
|
-
|
|
|
- /* 启用/禁用提示*/
|
|
|
- handleDisable(info, type) {
|
|
|
- const { id, name, status } = info
|
|
|
- if (status === 0) {
|
|
|
- this.$prompt('请输入禁用原因', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- inputPattern: /^.+$/,
|
|
|
- inputErrorMessage: '禁用原因不能为空'
|
|
|
- }).then(({ value }) => {
|
|
|
- console.log(value, 'value')
|
|
|
- this.operaDisabled(id, name, type, status, value)
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '取消输入'
|
|
|
- })
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- const hint = status === 0 ? '禁用' : '启用'
|
|
|
- this.$confirm(`确认要${hint}${name}`, {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.operaDisabled(id, name, type, status)
|
|
|
- })
|
|
|
- },
|
|
|
- /* 是否启用/禁用*/
|
|
|
- operaDisabled(id, name, type, status, remark) {
|
|
|
- const http = type === 0 ? storeDisabled : userDisabled
|
|
|
- const data = type === 0 ? { id, remark } : { id }
|
|
|
- http(data).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(
|
|
|
- status === 0 ? `已禁用${name}` : `已启用${name}`
|
|
|
- )
|
|
|
- type === 0 ? this.getList() : this.getUser()
|
|
|
- } else {
|
|
|
- this.$message.error('设置失败')
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 分页页码变化
|
|
|
- changePagination(data, type) {
|
|
|
- console.log(data, type)
|
|
|
- const { page, limit } = data
|
|
|
- this.params.page_size = limit
|
|
|
- this.params.page_index = page
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- // 用户列表分页变化
|
|
|
- userPage(data) {
|
|
|
- const { page, limit } = data
|
|
|
- this.userParams.page_size = limit
|
|
|
- this.userParams.page_index = page
|
|
|
- this.getUser()
|
|
|
- },
|
|
|
- // 收款列表分页变化
|
|
|
- receiptPage(data) {
|
|
|
- const { page, limit } = data
|
|
|
- this.receiptParams.page_size = limit
|
|
|
- this.receiptParams.page_index = page
|
|
|
- this.getReceipt()
|
|
|
- },
|
|
|
- toSearch() {
|
|
|
- this.params.page_index = 1
|
|
|
- this.getList()
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-.qr_code {
|
|
|
- width: 150px;
|
|
|
- height: 150px;
|
|
|
-}
|
|
|
-
|
|
|
-:focus {
|
|
|
- outline: 0;
|
|
|
-}
|
|
|
-.el-drawer {
|
|
|
- width: 40% !important;
|
|
|
-}
|
|
|
-.content {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- height: calc(100vh - 50px);
|
|
|
- margin-left: 15px;
|
|
|
- .search_box {
|
|
|
- width: 80%;
|
|
|
- display: flex;
|
|
|
- justify-content: flex-start;
|
|
|
- align-items: center;
|
|
|
- margin: 20px 0;
|
|
|
- .el-input {
|
|
|
- width: 240px;
|
|
|
- margin-right: 15px;
|
|
|
- flex-shrink: 0;
|
|
|
- }
|
|
|
- .select {
|
|
|
- margin-right: 15px;
|
|
|
- }
|
|
|
- }
|
|
|
- .store_num {
|
|
|
- padding-bottom: 15px;
|
|
|
- }
|
|
|
- .el-pagination {
|
|
|
- margin-top: 8px;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- .table_box {
|
|
|
- width: 100%;
|
|
|
- flex: 1;
|
|
|
- }
|
|
|
- .el-dialog {
|
|
|
- width: 400px;
|
|
|
- }
|
|
|
-}
|
|
|
-.sidebar_box {
|
|
|
- width: 95%;
|
|
|
- height: 100%;
|
|
|
- margin: 0 auto;
|
|
|
- .el-form-item{
|
|
|
- margin-bottom:10px;
|
|
|
- .ref_img{
|
|
|
- width: 25px;
|
|
|
- height: 25px;
|
|
|
- vertical-align:middle;
|
|
|
- margin:0 0 10px 15px;
|
|
|
- }
|
|
|
- }
|
|
|
- .user_table {
|
|
|
- height: 100%;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- .search_box {
|
|
|
- width: 50%;
|
|
|
- display: flex;
|
|
|
- justify-content: flex-start;
|
|
|
- .el-input {
|
|
|
- margin-right: 15px;
|
|
|
- }
|
|
|
- }
|
|
|
- .user_info{
|
|
|
- height:70%;
|
|
|
- width: 100%;
|
|
|
- overflow-y: scroll;
|
|
|
- }
|
|
|
- .page{
|
|
|
- padding:15px 0;
|
|
|
- flex-shrink: 0;
|
|
|
- }
|
|
|
- }
|
|
|
- .date_picker{
|
|
|
- padding:15px 0;
|
|
|
- .el-date-editor{
|
|
|
- width: 400px;
|
|
|
- }
|
|
|
- }
|
|
|
- // .date_tab {
|
|
|
- // margin-left: 65px;
|
|
|
- // }
|
|
|
- .record {
|
|
|
- display: flex;
|
|
|
- justify-content: flex-start;
|
|
|
- .record_table {
|
|
|
- width: 90%;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|