|
|
@@ -1,18 +1,9 @@
|
|
|
<template>
|
|
|
<div class="page-container">
|
|
|
<el-card>
|
|
|
- <div slot="header">
|
|
|
- <span>心愿管理</span>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- style="float: right"
|
|
|
- @click="handleRefresh"
|
|
|
- :loading="loading"
|
|
|
- >
|
|
|
- 刷新
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
+ <PageHeader slot="header" title="心愿管理">
|
|
|
+ <el-button type="primary" size="small" @click="handleRefresh" :loading="loading">刷新</el-button>
|
|
|
+ </PageHeader>
|
|
|
|
|
|
<el-tabs v-model="activeTab" @tab-click="handleTabClick">
|
|
|
<!-- 待处理列表 -->
|
|
|
@@ -20,34 +11,22 @@
|
|
|
<!-- 统计卡片 -->
|
|
|
<el-row :gutter="20" style="margin-bottom: 20px">
|
|
|
<el-col :span="6">
|
|
|
- <el-card shadow="hover" class="stat-card draft">
|
|
|
- <div class="stat-num">{{ draftCount }}</div>
|
|
|
- <div class="stat-label">待定价</div>
|
|
|
- </el-card>
|
|
|
+ <StatCard label="待定价" :value="draftCount" color="info" icon="el-icon-price-tag" />
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-card shadow="hover" class="stat-card pending">
|
|
|
- <div class="stat-num">{{ pendingCount }}</div>
|
|
|
- <div class="stat-label">待审批</div>
|
|
|
- </el-card>
|
|
|
+ <StatCard label="待审批" :value="pendingCount" color="warning" icon="el-icon-time" />
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-card shadow="hover" class="stat-card approved">
|
|
|
- <div class="stat-num">{{ approvedCount }}</div>
|
|
|
- <div class="stat-label">待兑现</div>
|
|
|
- </el-card>
|
|
|
+ <StatCard label="待兑现" :value="approvedCount" color="primary" icon="el-icon-circle-check" />
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-card shadow="hover" class="stat-card exchanging">
|
|
|
- <div class="stat-num">{{ exchangingCount }}</div>
|
|
|
- <div class="stat-label">待收货</div>
|
|
|
- </el-card>
|
|
|
+ <StatCard label="待收货" :value="exchangingCount" color="primary" icon="el-icon-box" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<!-- 待定价列表 -->
|
|
|
<div v-if="draftWishes.length > 0" class="wish-section">
|
|
|
- <div class="section-title">待定价</div>
|
|
|
+ <SectionTitle title="待定价" />
|
|
|
<div class="adm-table-wrap">
|
|
|
<el-table style="width: 100%" height="100%" :data="draftWishes" border v-loading="loading">
|
|
|
<el-table-column prop="id" label="ID" width="80"></el-table-column>
|
|
|
@@ -78,7 +57,7 @@
|
|
|
|
|
|
<!-- 待审批兑换列表 -->
|
|
|
<div v-if="pendingExchangeWishes.length > 0" class="wish-section">
|
|
|
- <div class="section-title">⏳ 待审批兑换</div>
|
|
|
+ <SectionTitle title="⏳ 待审批兑换" />
|
|
|
<div class="adm-table-wrap">
|
|
|
<el-table :data="pendingExchangeWishes" border v-loading="loading" style="width: 100%" height="100%">
|
|
|
<el-table-column prop="id" label="ID" width="80"></el-table-column>
|
|
|
@@ -86,7 +65,7 @@
|
|
|
<el-table-column prop="title" label="心愿名称" min-width="200"></el-table-column>
|
|
|
<el-table-column prop="pointsRequired" label="所需积分" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag type="warning">{{ scope.row.pointsRequired }}</el-tag>
|
|
|
+ <StatusTag type="warning" :text="String(scope.row.pointsRequired)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="exchangeRequestedAt" label="申请时间" width="180">
|
|
|
@@ -113,7 +92,7 @@
|
|
|
|
|
|
<!-- 待兑现列表 -->
|
|
|
<div v-if="approvedWishes.length > 0" class="wish-section">
|
|
|
- <div class="section-title">待兑现</div>
|
|
|
+ <SectionTitle title="待兑现" />
|
|
|
<div class="adm-table-wrap">
|
|
|
<el-table :data="approvedWishes" border v-loading="loading" style="width: 100%" height="100%">
|
|
|
<el-table-column prop="id" label="ID" width="80"></el-table-column>
|
|
|
@@ -121,7 +100,7 @@
|
|
|
<el-table-column prop="title" label="心愿名称" min-width="200"></el-table-column>
|
|
|
<el-table-column prop="pointsRequired" label="已扣积分" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag type="success">{{ scope.row.pointsRequired }}</el-tag>
|
|
|
+ <StatusTag type="success" :text="String(scope.row.pointsRequired)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="exchangeApprovedAt" label="批准时间" width="180">
|
|
|
@@ -140,7 +119,7 @@
|
|
|
|
|
|
<!-- 待收货列表 -->
|
|
|
<div v-if="exchangingWishes.length > 0" class="wish-section">
|
|
|
- <div class="section-title">待收货确认</div>
|
|
|
+ <SectionTitle title="待收货确认" />
|
|
|
<div class="adm-table-wrap">
|
|
|
<el-table :data="exchangingWishes" border v-loading="loading" style="width: 100%" height="100%">
|
|
|
<el-table-column prop="id" label="ID" width="80"></el-table-column>
|
|
|
@@ -238,7 +217,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="pointsRequired" label="所需积分" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.pointsRequired" type="warning">{{ scope.row.pointsRequired }}</el-tag>
|
|
|
+ <StatusTag v-if="scope.row.pointsRequired" type="warning" :text="String(scope.row.pointsRequired)" />
|
|
|
<span v-else class="no-price">未定价</span>
|
|
|
</template>
|
|
|
<template slot="header">
|
|
|
@@ -252,9 +231,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="status" label="状态" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag :type="getStatusType(scope.row.status)" size="small">
|
|
|
- {{ scope.row.statusText }}
|
|
|
- </el-tag>
|
|
|
+ <StatusTag :type="getStatusType(scope.row.status)" :text="scope.row.statusText" size="small" />
|
|
|
</template>
|
|
|
<template slot="header">
|
|
|
<span class="sort-header" @click.stop="onSortClick('status', $event)">状态<span v-if="sortIndex('status') !== null" class="sort-index" :class="sortClass('status') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('status') }}</span>{{ sortIcon('status') }}</span>
|
|
|
@@ -262,9 +239,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="creatorType" label="创建者" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag :type="scope.row.creatorType === 'parent' ? 'primary' : 'success'" size="small">
|
|
|
- {{ scope.row.creatorType === 'parent' ? '家长' : '孩子' }}
|
|
|
- </el-tag>
|
|
|
+ <StatusTag :type="scope.row.creatorType === 'parent' ? 'primary' : 'success'" :text="scope.row.creatorType === 'parent' ? '家长' : '孩子'" size="small" />
|
|
|
</template>
|
|
|
<template slot="header">
|
|
|
<span class="sort-header" @click.stop="onSortClick('creatorType', $event)">创建者<span v-if="sortIndex('creatorType') !== null" class="sort-index" :class="sortClass('creatorType') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('creatorType') }}</span>{{ sortIcon('creatorType') }}</span>
|
|
|
@@ -584,39 +559,10 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-.stat-card {
|
|
|
- text-align: center;
|
|
|
- cursor: pointer;
|
|
|
-}
|
|
|
-
|
|
|
-.stat-card.draft { border-top: 3px solid #909399; }
|
|
|
-.stat-card.pending { border-top: 3px solid #E6A23C; }
|
|
|
-.stat-card.approved { border-top: 3px solid #409EFF; }
|
|
|
-.stat-card.exchanging { border-top: 3px solid #409EFF; }
|
|
|
-
|
|
|
-.stat-num {
|
|
|
- font-size: 32px;
|
|
|
- font-weight: bold;
|
|
|
- color: #333;
|
|
|
-}
|
|
|
-
|
|
|
-.stat-label {
|
|
|
- font-size: 14px;
|
|
|
- color: #666;
|
|
|
- margin-top: 5px;
|
|
|
-}
|
|
|
-
|
|
|
.wish-section {
|
|
|
margin-bottom: 30px;
|
|
|
}
|
|
|
|
|
|
-.section-title {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: bold;
|
|
|
- margin-bottom: 15px;
|
|
|
- color: #333;
|
|
|
-}
|
|
|
-
|
|
|
.no-price {
|
|
|
color: #999;
|
|
|
font-size: 12px;
|
|
|
@@ -630,6 +576,6 @@ export default {
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
.sort-header:hover {
|
|
|
- color: #409eff;
|
|
|
+ color: var(--adm-primary);
|
|
|
}
|
|
|
</style>
|