|
|
@@ -1,264 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="butler-review admin-page">
|
|
|
- <el-tabs v-model="activeTab" @tab-click="onTabChange">
|
|
|
- <el-tab-pane label="管家审核" name="review">
|
|
|
- <div class="header admin-page-header">
|
|
|
- <h2 class="admin-page-title">管家审核</h2>
|
|
|
- <div class="flex items-center gap-sm">
|
|
|
- <el-select v-model="statusFilter" placeholder="审核状态" @change="loadList">
|
|
|
- <el-option label="全部状态" value="" />
|
|
|
- <el-option label="待审核" value="pending" />
|
|
|
- <el-option label="已通过" value="approved" />
|
|
|
- <el-option label="已拒绝" value="rejected" />
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="table-scroll-wrap">
|
|
|
- <el-table :data="list" v-loading="loading" border stripe>
|
|
|
- <el-table-column prop="id" label="档案ID" width="80" />
|
|
|
- <el-table-column prop="userId" label="用户ID" width="80" />
|
|
|
- <el-table-column label="管家等级" width="100">
|
|
|
- <template slot-scope="{ row }">{{ row.tier || '-' }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="审核状态" width="100">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag :type="statusType(row.status)">{{ statusLabel(row.status) }}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="description" label="申请说明" min-width="200" show-overflow-tooltip />
|
|
|
- <el-table-column prop="memberCount" label="已服务人数" width="100" />
|
|
|
- <el-table-column prop="maxMembers" label="上限人数" width="80" />
|
|
|
- <el-table-column prop="rejectReason" label="拒绝原因" width="150" show-overflow-tooltip />
|
|
|
- <el-table-column label="操作" width="160" fixed="right">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <template v-if="row.status === 'pending'">
|
|
|
- <el-button size="mini" type="success" @click="handleReview(row, 'approve')">通过</el-button>
|
|
|
- <el-dropdown trigger="hover" @command="(cmd) => handleActionCmd(row, cmd)">
|
|
|
- <el-button size="mini">
|
|
|
- 更多<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </el-button>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="reject" icon="el-icon-close">拒绝</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </template>
|
|
|
- <span v-else class="no-op">—</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
-
|
|
|
- <el-pagination
|
|
|
- @size-change="onPageChange"
|
|
|
- @current-change="onPageChange"
|
|
|
- :current-page="page"
|
|
|
- :page-size="size"
|
|
|
- :total="total"
|
|
|
- layout="total, prev, pager, next"
|
|
|
- class="pagination-wrap"
|
|
|
- />
|
|
|
-
|
|
|
- <el-dialog title="填写拒绝原因" :visible.sync="rejectDialogVisible" width="400px">
|
|
|
- <el-input v-model="rejectReason" type="textarea" :rows="3" placeholder="请输入拒绝原因" />
|
|
|
- <span slot="footer">
|
|
|
- <el-button @click="rejectDialogVisible = false">取消</el-button>
|
|
|
- <el-button type="danger" @click="confirmReject">确认拒绝</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- </el-tab-pane>
|
|
|
-
|
|
|
- <el-tab-pane label="服务记录" name="service-records">
|
|
|
- <div class="header admin-page-header">
|
|
|
- <h2 class="admin-page-title">管家服务记录</h2>
|
|
|
- </div>
|
|
|
- <div class="table-scroll-wrap">
|
|
|
- <el-table :data="serviceRecords" v-loading="srLoading" border stripe>
|
|
|
- <el-table-column prop="id" label="记录ID" width="80" />
|
|
|
- <el-table-column prop="butlerId" label="管家ID" width="80" />
|
|
|
- <el-table-column prop="memberUserId" label="会员ID" width="80" />
|
|
|
- <el-table-column label="服务类型" width="120">
|
|
|
- <template slot-scope="{ row }">{{ serviceTypeLabel(row.serviceType) }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="amountP" label="金额(P点)" width="100" />
|
|
|
- <el-table-column prop="platformFeeP" label="平台留成" width="100" />
|
|
|
- <el-table-column prop="butlerAmountP" label="管家所得" width="100" />
|
|
|
- <el-table-column prop="yearMonth" label="结算年月" width="100" />
|
|
|
- <el-table-column prop="createdAt" label="创建时间" width="160" />
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
- <el-pagination
|
|
|
- @size-change="srPage = $event; loadServiceRecords()"
|
|
|
- @current-change="srPage = $event; loadServiceRecords()"
|
|
|
- :current-page="srPage"
|
|
|
- :page-size="srSize"
|
|
|
- :total="srTotal"
|
|
|
- layout="total, prev, pager, next"
|
|
|
- class="pagination-wrap"
|
|
|
- />
|
|
|
- </el-tab-pane>
|
|
|
-
|
|
|
- <el-tab-pane label="佣金结算" name="settlements">
|
|
|
- <div class="header admin-page-header">
|
|
|
- <h2 class="admin-page-title">管家佣金结算</h2>
|
|
|
- </div>
|
|
|
- <div class="table-scroll-wrap">
|
|
|
- <el-table :data="settlements" v-loading="stLoading" border stripe>
|
|
|
- <el-table-column prop="id" label="结算单ID" width="80" />
|
|
|
- <el-table-column prop="butlerId" label="管家ID" width="80" />
|
|
|
- <el-table-column prop="yearMonth" label="结算年月" width="100" />
|
|
|
- <el-table-column prop="memberCount" label="服务家庭数" width="100" />
|
|
|
- <el-table-column prop="annualBaseAmountP" label="年费基准" width="100" />
|
|
|
- <el-table-column prop="totalButlerAmountP" label="管家总所得" width="120" />
|
|
|
- <el-table-column label="结算状态" width="100">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag :type="row.status === 'paid' ? 'success' : 'warning'">{{ row.status === 'paid' ? '已结算' : '待结算' }}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="settledAt" label="结算时间" width="160" />
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
- <el-pagination
|
|
|
- @size-change="stPage = $event; loadSettlements()"
|
|
|
- @current-change="stPage = $event; loadSettlements()"
|
|
|
- :current-page="stPage"
|
|
|
- :page-size="stSize"
|
|
|
- :total="stTotal"
|
|
|
- layout="total, prev, pager, next"
|
|
|
- class="pagination-wrap"
|
|
|
- />
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import { getButlerList, reviewButler, getButlerServiceRecords, getButlerSettlements } from '@/api/butler'
|
|
|
-
|
|
|
-export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- activeTab: 'review',
|
|
|
- // 审核列表
|
|
|
- list: [],
|
|
|
- loading: false,
|
|
|
- page: 1,
|
|
|
- size: 20,
|
|
|
- total: 0,
|
|
|
- statusFilter: 'pending',
|
|
|
- rejectDialogVisible: false,
|
|
|
- rejectTarget: null,
|
|
|
- rejectReason: '',
|
|
|
- // 服务记录
|
|
|
- serviceRecords: [],
|
|
|
- srLoading: false,
|
|
|
- srPage: 1,
|
|
|
- srSize: 20,
|
|
|
- srTotal: 0,
|
|
|
- // 结算
|
|
|
- settlements: [],
|
|
|
- stLoading: false,
|
|
|
- stPage: 1,
|
|
|
- stSize: 20,
|
|
|
- stTotal: 0
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.loadList()
|
|
|
- },
|
|
|
- methods: {
|
|
|
- statusType(status) {
|
|
|
- const map = { pending: 'warning', approved: 'success', rejected: 'danger' }
|
|
|
- return map[status] || 'info'
|
|
|
- },
|
|
|
- statusLabel(status) {
|
|
|
- const map = { pending: '待审核', approved: '已通过', rejected: '已拒绝' }
|
|
|
- return map[status] || status
|
|
|
- },
|
|
|
- serviceTypeLabel(type) {
|
|
|
- const map = { annual: '年费服务', per_session: '按次服务' }
|
|
|
- return map[type] || type
|
|
|
- },
|
|
|
- onTabChange() {
|
|
|
- this.page = 1
|
|
|
- if (this.activeTab === 'review') this.loadList()
|
|
|
- else if (this.activeTab === 'service-records') this.loadServiceRecords()
|
|
|
- else if (this.activeTab === 'settlements') this.loadSettlements()
|
|
|
- },
|
|
|
- async loadList() {
|
|
|
- this.loading = true
|
|
|
- try {
|
|
|
- const params = { page: this.page, size: this.size, status: this.statusFilter }
|
|
|
- const res = await getButlerList(params)
|
|
|
- this.list = res.data.list || []
|
|
|
- this.total = res.data.total || 0
|
|
|
- } catch (e) {
|
|
|
- this.$message.error('加载失败')
|
|
|
- } finally {
|
|
|
- this.loading = false
|
|
|
- }
|
|
|
- },
|
|
|
- async loadServiceRecords() {
|
|
|
- this.srLoading = true
|
|
|
- try {
|
|
|
- const res = await getButlerServiceRecords({ page: this.srPage, size: this.srSize })
|
|
|
- this.serviceRecords = res.data.list || []
|
|
|
- this.srTotal = res.data.total || 0
|
|
|
- } catch (e) {
|
|
|
- this.$message.error('加载失败')
|
|
|
- } finally {
|
|
|
- this.srLoading = false
|
|
|
- }
|
|
|
- },
|
|
|
- async loadSettlements() {
|
|
|
- this.stLoading = true
|
|
|
- try {
|
|
|
- const res = await getButlerSettlements({ page: this.stPage, size: this.stSize })
|
|
|
- this.settlements = res.data.list || []
|
|
|
- this.stTotal = res.data.total || 0
|
|
|
- } catch (e) {
|
|
|
- this.$message.error('加载失败')
|
|
|
- } finally {
|
|
|
- this.stLoading = false
|
|
|
- }
|
|
|
- },
|
|
|
- onPageChange(val) {
|
|
|
- this.page = val
|
|
|
- this.loadList()
|
|
|
- },
|
|
|
- async handleReview(row, action) {
|
|
|
- try {
|
|
|
- await reviewButler({ userId: row.userId, action: action, reason: this.rejectReason })
|
|
|
- this.$message.success('审核完成')
|
|
|
- this.loadList()
|
|
|
- } catch (e) {
|
|
|
- this.$message.error('操作失败')
|
|
|
- }
|
|
|
- },
|
|
|
- showRejectDialog(row) {
|
|
|
- this.rejectTarget = row
|
|
|
- this.rejectReason = ''
|
|
|
- this.rejectDialogVisible = true
|
|
|
- },
|
|
|
- handleActionCmd(row, cmd) {
|
|
|
- switch (cmd) {
|
|
|
- case 'reject': this.showRejectDialog(row); break
|
|
|
- }
|
|
|
- },
|
|
|
- async confirmReject() {
|
|
|
- if (!this.rejectReason) {
|
|
|
- this.$message.warning('请填写拒绝原因')
|
|
|
- return
|
|
|
- }
|
|
|
- await this.handleReview(this.rejectTarget, 'reject')
|
|
|
- this.rejectDialogVisible = false
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style scoped>
|
|
|
-.no-op {
|
|
|
- color: #ccc;
|
|
|
-}
|
|
|
-</style>
|