Browse Source

refactor(ui-kit): Orders E类看板/列表双视图+处理记录抽屉 + Cards D类评分+sticky footer(五态)

liaoxg 1 day ago
parent
commit
75618bc9d7
2 changed files with 1011 additions and 122 deletions
  1. 407 49
      train-web/src/views/Cards.vue
  2. 604 73
      train-web/src/views/Orders.vue

+ 407 - 49
train-web/src/views/Cards.vue

@@ -1,42 +1,161 @@
 <template>
-  <div class="page-container">
-    <div class="page-header">
-      <h2 class="page-title">教学卡评分</h2>
-      <el-button type="primary" icon="el-icon-refresh" @click="fetchPending">刷新</el-button>
+  <div class="cards-page">
+    <!-- 内容工具栏 -->
+    <div class="toolbar">
+      <div class="toolbar-left">
+        <el-button icon="el-icon-refresh" @click="fetchPending">刷新</el-button>
+      </div>
+      <div class="toolbar-right">
+        <span class="toolbar-count">待评教学卡 {{ list.length }} 张</span>
+      </div>
+    </div>
+
+    <!-- 加载态 -->
+    <div v-if="state === 'loading'" class="loading-wrap">
+      <div class="card">
+        <div class="sk" style="width:320px;height:22px;margin-bottom:16px"></div>
+        <div class="sk" style="height:40px;margin-bottom:16px"></div>
+        <h3 class="section-title">评分</h3>
+        <div class="sk" style="height:44px;margin-bottom:4px"></div>
+        <div class="sk" style="height:48px;margin-bottom:4px"></div>
+        <div class="sk" style="height:48px;margin-bottom:4px"></div>
+        <div class="sk" style="height:48px;margin-bottom:4px"></div>
+        <div class="sk" style="height:52px;margin-top:14px"></div>
+      </div>
+    </div>
+
+    <!-- 错误态 -->
+    <div v-else-if="state === 'error'">
+      <div class="err-banner">
+        <span>教学卡列表加载失败,请重新加载</span>
+        <el-button size="mini" @click="fetchPending">重试</el-button>
+      </div>
+      <div class="card empty-state">
+        <div class="empty-ico"></div>
+        <h4>无法加载待评教学卡</h4>
+        <p>请检查网络连接后重试</p>
+        <el-button type="primary" size="small" @click="fetchPending">重新加载</el-button>
+      </div>
+    </div>
+
+    <!-- 列表态:待评卡片列表 -->
+    <div v-else-if="!currentCard">
+      <div v-if="list.length === 0" class="card empty-state">
+        <div class="empty-ico"></div>
+        <h4>暂无待评教学卡</h4>
+        <p>所有教学卡均已完成评分</p>
+        <el-button type="primary" size="small" @click="fetchPending">重新加载</el-button>
+      </div>
+      <div v-else class="card table-card">
+        <el-table :data="list" style="width:100%">
+          <el-table-column prop="id" label="ID" width="70" />
+          <el-table-column prop="userName" label="学员" min-width="100" />
+          <el-table-column prop="cardName" label="卡片名称" min-width="140" />
+          <el-table-column prop="cardType" label="卡片类型" width="100">
+            <template slot-scope="{ row }">
+              <el-tag size="small">{{ row.cardType }}</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column prop="content" label="提交内容" min-width="200" show-overflow-tooltip />
+          <el-table-column prop="createdAt" label="提交时间" width="170" />
+          <el-table-column label="操作" width="120" fixed="right">
+            <template slot-scope="{ row }">
+              <el-button size="mini" type="primary" @click="openScoring(row)">评分</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+
+    <!-- 评分态 -->
+    <div v-else>
+      <!-- 步骤条 -->
+      <div class="card">
+        <div class="steps">
+          <div class="step on"><i>1</i>填写评分</div>
+          <div class="step-line"></div>
+          <div class="step"><i>2</i>校验</div>
+          <div class="step-line"></div>
+          <div class="step"><i>3</i>提交</div>
+        </div>
+
+        <!-- 信息条 -->
+        <div class="info-bar">
+          <span>评审对象:<b>{{ currentCard.userName }}</b></span>
+          <span>教学卡:{{ currentCard.cardName }}</span>
+          <span>类型:{{ currentCard.cardType }}</span>
+        </div>
+
+        <!-- 提交内容展示 -->
+        <div class="content-box">
+          <h3 class="section-title">提交内容</h3>
+          <div class="content-text">{{ currentCard.content }}</div>
+        </div>
+
+        <!-- 评分维度(适配单 score 接口:整体评分 0-100) -->
+        <h3 class="section-title">整体评分</h3>
+        <div class="score-section">
+          <div class="score-input-row">
+            <span class="score-label">评分(0-100)</span>
+            <el-input-number
+              v-model="scoreValue"
+              :min="0"
+              :max="100"
+              :step="5"
+              :disabled="submitting"
+              size="medium"
+            />
+          </div>
+          <div class="score-stars">
+            <span
+              v-for="n in 5"
+              :key="'star' + n"
+              class="star"
+              :class="{ on: n <= Math.round(scoreValue / 20) }"
+              @click="scoreValue = n * 20"
+            >★</span>
+            <span class="score-hint">点击星星快速评分(每星 20 分)</span>
+          </div>
+          <div class="score-desc">
+            <span v-if="scoreValue >= 90">优秀 · 知识点覆盖全面,表达清晰</span>
+            <span v-else-if="scoreValue >= 75">良好 · 整体完成度高,部分细节可改进</span>
+            <span v-else-if="scoreValue >= 60">合格 · 基本达标,建议加强薄弱环节</span>
+            <span v-else-if="scoreValue > 0">待改进 · 多处需补充完善</span>
+            <span v-else class="muted">请打分</span>
+          </div>
+        </div>
+
+        <!-- 评审评语(本地草稿,后端暂不持久化) -->
+        <h3 class="section-title">评审评语(选填)</h3>
+        <el-input
+          type="textarea"
+          v-model="comment"
+          :rows="4"
+          placeholder="填写评语建议(选填,当前版本暂不持久化)"
+          maxlength="500"
+          show-word-limit
+          :disabled="submitting"
+        />
+      </div>
+    </div>
+
+    <!-- sticky footer:评分态常驻 -->
+    <div class="footbar" v-if="currentCard">
+      <span>评审对象:{{ currentCard.userName }} · {{ currentCard.cardName }}</span>
+      <div>
+        <el-button size="small" @click="cancelScoring" :disabled="submitting">取消</el-button>
+        <el-button size="small" @click="fetchPending" :disabled="submitting">跳过</el-button>
+        <el-button type="primary" size="small" :loading="submitting" @click="handleScore">提交评分</el-button>
+      </div>
     </div>
 
-    <el-table :data="list" v-loading="loading" border stripe style="width:100%">
-      <el-table-column prop="id" label="ID" width="80" />
-      <el-table-column prop="userName" label="学员" min-width="100" />
-      <el-table-column prop="cardName" label="卡片名称" min-width="140" />
-      <el-table-column prop="cardType" label="卡片类型" width="100">
-        <template slot-scope="{ row }">
-          <el-tag size="small">{{ row.cardType }}</el-tag>
-        </template>
-      </el-table-column>
-      <el-table-column prop="content" label="提交内容" min-width="200" show-overflow-tooltip />
-      <el-table-column prop="createdAt" label="提交时间" width="170" />
-      <el-table-column label="操作" width="180" fixed="right">
-        <template slot-scope="{ row }">
-          <el-button size="mini" type="primary" @click="openScoreDialog(row)">评分</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <el-dialog title="教学卡评分" :visible.sync="showDialog" width="400px">
-      <el-form label-width="70px">
-        <el-form-item label="卡片">
-          <span>{{ currentCard.cardName || '-' }}</span>
-        </el-form-item>
-        <el-form-item label="评分">
-          <el-input-number v-model="scoreValue" :min="0" :max="100" :step="5" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer">
-        <el-button @click="showDialog = false">取消</el-button>
-        <el-button type="primary" @click="handleScore" :loading="submitting">确定</el-button>
+    <!-- sticky footer:列表态 -->
+    <div class="footbar" v-else-if="!currentCard && list.length > 0">
+      <span>待评教学卡 <b>{{ list.length }}</b> 张</span>
+      <div>
+        <el-button size="small" @click="fetchPending">刷新列表</el-button>
       </div>
-    </el-dialog>
+    </div>
   </div>
 </template>
 
@@ -49,10 +168,18 @@ export default {
     return {
       list: [],
       loading: false,
-      showDialog: false,
-      submitting: false,
-      currentCard: {},
-      scoreValue: 80
+      fetchFailed: false,
+      currentCard: null,
+      scoreValue: 80,
+      comment: '',
+      submitting: false
+    }
+  },
+  computed: {
+    state: function () {
+      if (this.fetchFailed) return 'error'
+      if (this.loading) return 'loading'
+      return 'normal'
     }
   },
   mounted: function () {
@@ -62,32 +189,45 @@ export default {
     fetchPending: function () {
       var self = this
       self.loading = true
+      self.fetchFailed = false
+      self.currentCard = null
       pendingCards().then(function (res) {
         self.list = res.data || []
       }).catch(function () {
-        self.$message.error('获取待评教学卡失败')
+        self.fetchFailed = true
       }).finally(function () {
         self.loading = false
       })
     },
-    openScoreDialog: function (row) {
+    openScoring: function (row) {
       this.currentCard = row
       this.scoreValue = 80
-      this.showDialog = true
+      this.comment = ''
+    },
+    cancelScoring: function () {
+      this.currentCard = null
+      this.scoreValue = 80
+      this.comment = ''
     },
     handleScore: function () {
       var self = this
       if (self.submitting) return
+      if (self.scoreValue < 0 || self.scoreValue > 100) {
+        self.$message.warning('评分需在 0-100 之间')
+        return
+      }
       self.submitting = true
       scoreCard({
         cardId: self.currentCard.id,
         score: self.scoreValue
       }).then(function () {
-        self.$message.success('评分成功')
-        self.showDialog = false
+        self.$message.success('评分提交成功')
+        self.currentCard = null
+        self.scoreValue = 80
+        self.comment = ''
         self.fetchPending()
       }).catch(function () {
-        self.$message.error('评分失败')
+        self.$message.error('评分提交失败')
       }).finally(function () {
         self.submitting = false
       })
@@ -97,16 +237,234 @@ export default {
 </script>
 
 <style scoped>
-.page-header {
+.cards-page {
+  padding-bottom: 72px;
+}
+
+/* 工具栏 */
+.toolbar {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 16px;
 }
+.toolbar-right {
+  font-size: 12px;
+  color: #6B7B8C;
+}
 
-.page-title {
-  margin: 0;
-  font-size: 18px;
+/* 步骤条 */
+.steps {
+  display: flex;
+  align-items: center;
+  margin-bottom: 18px;
+}
+.step {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  color: #6B7B8C;
+  font-size: 13px;
+}
+.step i {
+  width: 22px;
+  height: 22px;
+  border-radius: 50%;
+  border: 1px solid #C3D2DF;
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+  font-style: normal;
+  font-size: 12px;
+}
+.step.on {
+  color: #2E6FA8;
   font-weight: 600;
 }
+.step.on i {
+  background: #2E6FA8;
+  border-color: #2E6FA8;
+  color: #FFFFFF;
+}
+.step-line {
+  width: 60px;
+  height: 1px;
+  background: #DCE7F1;
+  margin: 0 14px;
+}
+
+/* 信息条 */
+.info-bar {
+  background: #E8F3FC;
+  padding: 10px 14px;
+  font-size: 13px;
+  color: #3B5A78;
+  display: flex;
+  gap: 28px;
+  margin-bottom: 16px;
+  border-radius: 4px;
+}
+.info-bar b {
+  color: #1E3A5F;
+}
+
+/* 提交内容展示 */
+.content-box {
+  margin-bottom: 16px;
+}
+.content-text {
+  background: #F7FAFD;
+  border: 1px solid #DCE7F1;
+  border-radius: 4px;
+  padding: 12px 14px;
+  font-size: 14px;
+  color: #1E3A5F;
+  line-height: 1.8;
+  white-space: pre-wrap;
+  word-break: break-all;
+}
+
+/* section 标题 */
+.section-title {
+  font-size: 15px;
+  font-weight: 600;
+  color: #1E3A5F;
+  margin: 16px 0 10px;
+}
+
+/* 评分区域 */
+.score-section {
+  border: 1px solid #DCE7F1;
+  border-radius: 8px;
+  padding: 16px;
+  margin-bottom: 16px;
+}
+.score-input-row {
+  display: flex;
+  align-items: center;
+  gap: 16px;
+  margin-bottom: 12px;
+}
+.score-label {
+  font-size: 14px;
+  color: #3B5A78;
+  font-weight: 600;
+  min-width: 120px;
+}
+.score-stars {
+  display: flex;
+  align-items: center;
+  margin-bottom: 8px;
+}
+.star {
+  font-size: 22px;
+  color: #C3D2DF;
+  cursor: pointer;
+  margin-right: 4px;
+}
+.star.on {
+  color: #2E6FA8;
+}
+.score-hint {
+  font-size: 12px;
+  color: #6B7B8C;
+  margin-left: 12px;
+}
+.score-desc {
+  font-size: 13px;
+  color: #3B5A78;
+  padding: 8px 12px;
+  background: #F7FAFD;
+  border-radius: 4px;
+}
+.score-desc .muted {
+  color: #C3D2DF;
+}
+
+/* 通用卡片 */
+.card {
+  background: #FFFFFF;
+  border: 1px solid #DCE7F1;
+  border-radius: 8px;
+  box-shadow: 0 2px 10px rgba(30, 58, 95, .06);
+  padding: 20px;
+  margin-bottom: 16px;
+}
+
+/* 表格卡 */
+.table-card {
+  padding: 0;
+  overflow: hidden;
+}
+
+/* 骨架屏 */
+.sk {
+  background: #E8F0F7;
+  border-radius: 4px;
+  animation: pulse 1.2s ease-in-out infinite alternate;
+}
+@keyframes pulse {
+  from { opacity: .55; }
+  to { opacity: 1; }
+}
+
+/* 错误 banner */
+.err-banner {
+  background: #FDE8E8;
+  border: 1px solid #C0392B;
+  color: #C0392B;
+  padding: 10px 12px;
+  border-radius: 4px;
+  font-size: 14px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 16px;
+}
+
+/* 空态 */
+.empty-state {
+  text-align: center;
+  padding: 48px 16px;
+}
+.empty-ico {
+  width: 60px;
+  height: 60px;
+  border-radius: 50%;
+  background: #E8F3FC;
+  margin: 0 auto 12px;
+}
+.empty-state h4 {
+  font-size: 15px;
+  color: #1E3A5F;
+  margin-bottom: 6px;
+}
+.empty-state p {
+  font-size: 13px;
+  color: #6B7B8C;
+  margin-bottom: 16px;
+}
+
+/* sticky footer */
+.footbar {
+  position: fixed;
+  left: 220px;
+  right: 0;
+  bottom: 0;
+  height: 56px;
+  background: #FFFFFF;
+  border-top: 1px solid #DCE7F1;
+  box-shadow: 0 -2px 10px rgba(30, 58, 95, .06);
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 0 24px;
+  z-index: 5;
+  font-size: 13px;
+  color: #3B5A78;
+}
+.footbar b {
+  color: #2E6FA8;
+  font-variant-numeric: tabular-nums;
+}
 </style>

+ 604 - 73
train-web/src/views/Orders.vue

@@ -1,59 +1,167 @@
 <template>
-  <div class="page-container">
-    <div class="page-header">
-      <h2 class="page-title">订单管理</h2>
-      <div class="filter-bar">
-        <el-select v-model="filters.status" placeholder="状态" clearable style="width:140px" @change="fetchList">
-          <el-option label="待支付" value="unpaid" />
-          <el-option label="已支付" value="paid" />
-          <el-option label="已退款" value="refunded" />
-          <el-option label="已关闭" value="closed" />
-          <el-option label="支付失败" value="failed" />
-        </el-select>
-        <el-button type="primary" icon="el-icon-refresh" @click="fetchList">刷新</el-button>
+  <div class="orders-page">
+    <!-- 内容工具栏:页头标题由外壳提供,此处仅放操作按钮 -->
+    <div class="toolbar">
+      <div class="toolbar-left">
+        <el-button icon="el-icon-refresh" @click="fetchList">刷新</el-button>
+        <el-button icon="el-icon-download" @click="$message.info('导出工单')">导出工单</el-button>
+      </div>
+      <div class="toolbar-right">
+        <span class="toolbar-count">共 {{ list.length }} 条订单</span>
+      </div>
+    </div>
+
+    <!-- 加载态 -->
+    <div v-if="state === 'loading'" class="loading-wrap">
+      <div class="card stats-row">
+        <div v-for="n in 4" :key="'sk' + n" class="stat-cell">
+          <div class="sk" style="width:40px;height:26px"></div>
+          <div class="sk" style="width:56px;height:12px;margin-top:8px"></div>
+        </div>
+      </div>
+      <div class="cols">
+        <div v-for="c in 3" :key="'col-sk' + c" class="col">
+          <div class="col-h"><span class="col-title">统计中</span></div>
+          <div class="sk" style="height:132px;margin-bottom:10px"></div>
+          <div class="sk" style="height:132px;margin-bottom:10px"></div>
+        </div>
+      </div>
+    </div>
+
+    <!-- 错误态 -->
+    <div v-else-if="state === 'error'" class="error-wrap">
+      <div class="err-banner">
+        <span>订单列表加载失败,请重新加载</span>
+        <el-button size="mini" @click="fetchList">重试</el-button>
+      </div>
+      <div class="card stats-row">
+        <div v-for="s in statDefs" :key="'err-' + s.key" class="stat-cell">
+          <div class="stat-num muted">—</div>
+          <div class="stat-label">{{ s.label }}</div>
+        </div>
+      </div>
+    </div>
+
+    <!-- 正常 / 空态 -->
+    <div v-else>
+      <!-- 统计行 -->
+      <div class="card stats-row">
+        <div v-for="s in statDefs" :key="s.key" class="stat-cell">
+          <div class="stat-num">{{ stats[s.key] }}</div>
+          <div class="stat-label">{{ s.label }}</div>
+        </div>
+      </div>
+
+      <!-- 视图切换 chip -->
+      <div class="view-toggle">
+        <button class="chip" :class="{ on: view === 'board' }" @click="view = 'board'">看板视图</button>
+        <button class="chip" :class="{ on: view === 'list' }" @click="view = 'list'">列表视图</button>
+        <span class="view-hint">按订单状态分组</span>
+      </div>
+
+      <!-- 空态 -->
+      <div v-if="state === 'empty'" class="card empty-state">
+        <div class="empty-ico"></div>
+        <h4>暂无订单</h4>
+        <p>当前筛选条件下没有订单记录</p>
+        <el-button type="primary" size="small" @click="fetchList">重新加载</el-button>
+      </div>
+
+      <!-- 看板视图 -->
+      <div v-else-if="view === 'board'" class="cols">
+        <div v-for="col in boardCols" :key="col.status" class="col">
+          <div class="col-h">
+            <span class="col-title">{{ col.label }}</span>
+            <span class="col-count">{{ colItems(col.status).length }} 单</span>
+          </div>
+          <div v-if="colItems(col.status).length === 0" class="col-empty">暂无工单</div>
+          <div
+            v-for="row in colItems(col.status)"
+            :key="row.id"
+            class="task-card"
+            :class="{ sel: selectedIds.indexOf(row.id) !== -1 }"
+            @click="toggleSelect(row)"
+          >
+            <div class="task-no">{{ row.orderNo }}</div>
+            <div class="task-name">{{ row.userName }} · {{ row.className }}</div>
+            <div class="task-meta">
+              <div>实付:¥{{ fenToYuan(row.amount) }}</div>
+              <div>创建:{{ fmtTime(row.createdAt) }}</div>
+              <div v-if="row.payTime">支付:{{ fmtTime(row.payTime) }}</div>
+            </div>
+            <div class="task-foot">
+              <el-tag :type="statusType(row.status)" size="mini">{{ statusLabel(row.status) }}</el-tag>
+              <el-button
+                v-if="row.status === 'paid'"
+                type="danger"
+                size="mini"
+                @click.stop="openRefund(row)"
+              >退款</el-button>
+              <span class="link" @click.stop="openDrawer(row)">处理记录</span>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <!-- 列表视图 -->
+      <div v-else class="card table-card">
+        <el-table
+          :data="list"
+          style="width:100%"
+          @selection-change="onSelectionChange"
+          @row-click="openDrawer"
+        >
+          <el-table-column type="selection" width="48" @click.stop />
+          <el-table-column prop="orderNo" label="订单号" min-width="180" />
+          <el-table-column prop="className" label="班次" min-width="130" />
+          <el-table-column prop="userName" label="报名人" width="100" />
+          <el-table-column label="实付金额" width="110">
+            <template slot-scope="scope">
+              <span>¥{{ fenToYuan(scope.row.amount) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="原价" width="100">
+            <template slot-scope="scope">
+              <span v-if="scope.row.originalAmount > 0">¥{{ fenToYuan(scope.row.originalAmount) }}</span>
+              <span v-else>-</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="状态" width="100">
+            <template slot-scope="scope">
+              <el-tag :type="statusType(scope.row.status)" size="small">{{ statusLabel(scope.row.status) }}</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column prop="payTime" label="支付时间" width="170">
+            <template slot-scope="scope">
+              <span>{{ fmtTime(scope.row.payTime) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="createdAt" label="创建时间" width="170">
+            <template slot-scope="scope">
+              <span>{{ fmtTime(scope.row.createdAt) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" width="160" fixed="right">
+            <template slot-scope="scope">
+              <span class="link" @click.stop="openDrawer(scope.row)">详情</span>
+              <el-button
+                v-if="scope.row.status === 'paid'"
+                type="danger"
+                size="mini"
+                style="margin-left:8px"
+                @click.stop="openRefund(scope.row)"
+              >退款</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
       </div>
     </div>
 
-    <el-table :data="list" v-loading="loading" border stripe style="width:100%">
-      <el-table-column prop="id" label="ID" width="70" />
-      <el-table-column prop="orderNo" label="订单号" min-width="180" />
-      <el-table-column prop="className" label="班次" min-width="130" />
-      <el-table-column prop="userName" label="报名人" width="100" />
-      <el-table-column label="实付金额" width="110">
-        <template slot-scope="scope">
-          <span>¥{{ fenToYuan(scope.row.amount) }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="原价" width="100">
-        <template slot-scope="scope">
-          <span v-if="scope.row.originalAmount > 0">¥{{ fenToYuan(scope.row.originalAmount) }}</span>
-          <span v-else>-</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="状态" width="100">
-        <template slot-scope="scope">
-          <el-tag :type="statusType(scope.row.status)" size="small">{{ statusLabel(scope.row.status) }}</el-tag>
-        </template>
-      </el-table-column>
-      <el-table-column prop="payTime" label="支付时间" width="170" :formatter="formatTime" />
-      <el-table-column prop="createdAt" label="创建时间" width="170" :formatter="formatTime" />
-      <el-table-column label="操作" width="130" fixed="right">
-        <template slot-scope="scope">
-          <el-button v-if="scope.row.status === 'paid'" type="danger" size="mini" @click="openRefund(scope.row)">退款</el-button>
-          <span v-else>-</span>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <!-- 退款对话框(test-mode 直接置 refunded) -->
+    <!-- 退款对话框 -->
     <el-dialog title="订单退款" :visible.sync="refundVisible" width="420px" :close-on-click-modal="false">
       <el-form label-width="90px">
-        <el-form-item label="订单号">
-          <span>{{ refundRow.orderNo }}</span>
-        </el-form-item>
-        <el-form-item label="实付金额">
-          <span>¥{{ fenToYuan(refundRow.amount) }}</span>
-        </el-form-item>
+        <el-form-item label="订单号"><span>{{ refundRow.orderNo }}</span></el-form-item>
+        <el-form-item label="实付金额"><span>¥{{ fenToYuan(refundRow.amount) }}</span></el-form-item>
         <el-form-item label="退款金额">
           <el-input-number v-model="refundAmount" :min="0.01" :max="refundMax" :precision="2" :step="1" />
         </el-form-item>
@@ -63,6 +171,65 @@
         <el-button type="danger" :loading="refunding" @click="confirmRefund">确认退款</el-button>
       </span>
     </el-dialog>
+
+    <!-- 处理记录抽屉 -->
+    <el-drawer
+      :visible.sync="drawerVisible"
+      size="440px"
+      :with-header="false"
+    >
+      <div class="drawer-inner" v-if="drawerRow">
+        <div class="dw-header">
+          <span class="dw-title">处理记录 · {{ drawerRow.orderNo }}</span>
+          <el-button type="text" icon="el-icon-close" @click="drawerVisible = false" />
+        </div>
+        <div class="dw-body">
+          <div class="dw-summary">
+            <div class="dw-name">{{ drawerRow.userName }} · {{ drawerRow.className }}</div>
+            <div class="dw-meta">
+              <el-tag :type="statusType(drawerRow.status)" size="mini">{{ statusLabel(drawerRow.status) }}</el-tag>
+              <span>实付 ¥{{ fenToYuan(drawerRow.amount) }}</span>
+            </div>
+          </div>
+          <div class="dw-timeline">
+            <div class="tl-item">
+              <b>订单创建</b>
+              <p>{{ fmtTime(drawerRow.createdAt) }}</p>
+            </div>
+            <div class="tl-item" v-if="drawerRow.payTime">
+              <b>支付成功</b>
+              <p>{{ fmtTime(drawerRow.payTime) }} · ¥{{ fenToYuan(drawerRow.amount) }}</p>
+            </div>
+            <div class="tl-item" v-if="drawerRow.status === 'refunded'">
+              <b>已退款</b>
+              <p>退款已处理</p>
+            </div>
+            <div class="tl-item" v-if="drawerRow.status === 'closed'">
+              <b>订单关闭</b>
+              <p>订单已关闭</p>
+            </div>
+            <div class="tl-item" v-if="drawerRow.status === 'unpaid'">
+              <b>待支付</b>
+              <p>等待学员完成支付</p>
+            </div>
+            <div class="tl-item" v-if="drawerRow.status === 'failed'">
+              <b>支付失败</b>
+              <p>支付未成功,订单状态异常</p>
+            </div>
+          </div>
+          <p class="dw-hint">退款操作请在确认影响后执行;批量操作请核对对象与数量。</p>
+        </div>
+      </div>
+    </el-drawer>
+
+    <!-- sticky footer:已选数常驻 -->
+    <div class="footbar" v-if="selected.length > 0">
+      <span>已选中 <b>{{ selected.length }}</b> 笔订单 · 总额 ¥{{ selectedTotal }}</span>
+      <div>
+        <el-button size="mini" @click="clearSelection">取消选择</el-button>
+        <el-button size="mini" @click="$message.info('批量导出')">批量导出</el-button>
+      </div>
+    </div>
   </div>
 </template>
 
@@ -75,14 +242,58 @@ export default {
     return {
       list: [],
       loading: false,
-      filters: {
-        status: ''
-      },
+      fetchFailed: false,
+      view: 'board',
+      filters: { status: '' },
       refundVisible: false,
       refundRow: {},
       refundAmount: 0,
       refundMax: 0,
-      refunding: false
+      refunding: false,
+      drawerVisible: false,
+      drawerRow: null,
+      selected: []
+    }
+  },
+  computed: {
+    state: function () {
+      if (this.fetchFailed) return 'error'
+      if (this.loading) return 'loading'
+      return this.list.length === 0 ? 'empty' : 'normal'
+    },
+    statDefs: function () {
+      return [
+        { key: 'total', label: '总订单' },
+        { key: 'unpaid', label: '待支付' },
+        { key: 'paid', label: '已支付' },
+        { key: 'refunded', label: '已退款' }
+      ]
+    },
+    stats: function () {
+      var self = this
+      var s = { total: self.list.length, unpaid: 0, paid: 0, refunded: 0 }
+      self.list.forEach(function (r) {
+        if (r.status === 'unpaid' || r.status === 'failed') s.unpaid++
+        else if (r.status === 'paid') s.paid++
+        else if (r.status === 'refunded') s.refunded++
+      })
+      return s
+    },
+    boardCols: function () {
+      return [
+        { status: 'unpaid', label: '待支付' },
+        { status: 'paid', label: '已支付' },
+        { status: 'refunded', label: '已退款' }
+      ]
+    },
+    selectedIds: function () {
+      return this.selected.map(function (r) { return r.id })
+    },
+    selectedTotal: function () {
+      var sum = this.selected.reduce(function (acc, r) {
+        return acc + Number(r.amount || 0)
+      }, 0)
+      return (sum / 100).toFixed(2)
     }
   },
   mounted: function () {
@@ -94,9 +305,9 @@ export default {
       if (isNaN(n)) return '0.00'
       return (n / 100).toFixed(2)
     },
-    formatTime: function (row, col, val) {
+    fmtTime: function (val) {
       if (!val) return '-'
-      return String(val).replace('T', ' ').substring(0, 19)
+      return String(val).replace('T', ' ').substring(0, 16)
     },
     statusType: function (status) {
       var map = { unpaid: 'warning', paid: 'success', refunded: 'info', closed: 'info', failed: 'danger' }
@@ -106,17 +317,28 @@ export default {
       var map = { unpaid: '待支付', paid: '已支付', refunded: '已退款', closed: '已关闭', failed: '支付失败' }
       return map[status] || status || '-'
     },
+    colItems: function (status) {
+      if (status === 'unpaid') {
+        return this.list.filter(function (r) { return r.status === 'unpaid' || r.status === 'failed' })
+      }
+      if (status === 'paid') {
+        return this.list.filter(function (r) { return r.status === 'paid' })
+      }
+      if (status === 'refunded') {
+        return this.list.filter(function (r) { return r.status === 'refunded' || r.status === 'closed' })
+      }
+      return []
+    },
     fetchList: function () {
       var self = this
       self.loading = true
+      self.fetchFailed = false
       var payload = {}
-      if (self.filters.status) {
-        payload.status = self.filters.status
-      }
+      if (self.filters.status) payload.status = self.filters.status
       orderList(payload).then(function (res) {
         self.list = res.data || []
       }).catch(function () {
-        self.$message.error('获取订单列表失败')
+        self.fetchFailed = true
       }).finally(function () {
         self.loading = false
       })
@@ -134,11 +356,8 @@ export default {
         return
       }
       self.refunding = true
-      var data = {
-        orderId: self.refundRow.id,
-        amount: Math.round(self.refundAmount * 100)
-      }
-      orderRefund(data).then(function (res) {
+      var data = { orderId: self.refundRow.id, amount: Math.round(self.refundAmount * 100) }
+      orderRefund(data).then(function () {
         self.$message.success('退款成功')
         self.refundVisible = false
         self.fetchList()
@@ -147,31 +366,343 @@ export default {
       }).finally(function () {
         self.refunding = false
       })
+    },
+    openDrawer: function (row) {
+      this.drawerRow = row
+      this.drawerVisible = true
+    },
+    toggleSelect: function (row) {
+      var idx = this.selectedIds.indexOf(row.id)
+      if (idx === -1) {
+        this.selected.push(row)
+      } else {
+        this.selected.splice(idx, 1)
+      }
+    },
+    onSelectionChange: function (rows) {
+      this.selected = rows
+    },
+    clearSelection: function () {
+      this.selected = []
     }
   }
 }
 </script>
 
 <style scoped>
-.page-header {
+.orders-page {
+  padding-bottom: 72px;
+}
+
+/* 工具栏 */
+.toolbar {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 16px;
 }
+.toolbar-right {
+  font-size: 12px;
+  color: #6B7B8C;
+}
+
+/* 统计行 */
+.stats-row {
+  display: grid;
+  grid-template-columns: repeat(4, 1fr);
+  margin-bottom: 16px;
+  padding: 0;
+  overflow: hidden;
+}
+.stat-cell {
+  padding: 14px 20px;
+  border-right: 1px solid #DCE7F1;
+}
+.stat-cell:last-child {
+  border-right: none;
+}
+.stat-num {
+  font-size: 26px;
+  font-weight: 700;
+  font-variant-numeric: tabular-nums;
+  color: #1E3A5F;
+}
+.stat-label {
+  font-size: 12px;
+  color: #6B7B8C;
+  margin-top: 2px;
+}
+.stat-num.muted {
+  color: #C3D2DF;
+}
+
+/* 视图切换 */
+.view-toggle {
+  display: flex;
+  align-items: center;
+  margin-bottom: 12px;
+}
+.chip {
+  border: 1px solid #C3D2DF;
+  background: #FFFFFF;
+  color: #3B5A78;
+  font-size: 13px;
+  padding: 5px 16px;
+  border-radius: 4px;
+  cursor: pointer;
+  margin-right: 8px;
+}
+.chip.on {
+  background: #E8F3FC;
+  border-color: #2E6FA8;
+  color: #2E6FA8;
+  font-weight: 600;
+}
+.view-hint {
+  font-size: 12px;
+  color: #6B7B8C;
+  margin-left: 8px;
+}
+
+/* 看板列 */
+.cols {
+  display: grid;
+  grid-template-columns: repeat(3, 1fr);
+  gap: 16px;
+  align-items: start;
+}
+.col {
+  background: #F0F4F9;
+  border: 1px solid #DCE7F1;
+  border-radius: 8px;
+  padding: 12px;
+  min-height: 200px;
+}
+.col-h {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding-bottom: 8px;
+  border-bottom: 1px solid #DCE7F1;
+  margin-bottom: 12px;
+}
+.col-title {
+  font-size: 15px;
+  font-weight: 600;
+  color: #1E3A5F;
+}
+.col-count {
+  font-size: 12px;
+  color: #6B7B8C;
+}
+.col-empty {
+  text-align: center;
+  font-size: 13px;
+  color: #6B7B8C;
+  padding: 32px 0;
+}
 
-.page-title {
-  margin: 0;
-  font-size: 18px;
+/* 任务卡 */
+.task-card {
+  background: #FFFFFF;
+  border: 1px solid #DCE7F1;
+  border-radius: 8px;
+  padding: 14px;
+  margin-bottom: 10px;
+  cursor: pointer;
+}
+.task-card.sel {
+  border-color: #2E6FA8;
+  background: #E8F3FC;
+}
+.task-no {
+  font-size: 12px;
+  color: #6B7B8C;
+  font-variant-numeric: tabular-nums;
+}
+.task-name {
+  font-size: 14px;
   font-weight: 600;
+  color: #1E3A5F;
+  margin: 4px 0;
+}
+.task-meta {
+  font-size: 12px;
+  color: #6B7B8C;
+  line-height: 1.8;
+}
+.task-foot {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-top: 10px;
+}
+
+/* 表格卡 */
+.table-card {
+  padding: 0;
+  overflow: hidden;
 }
 
-.filter-bar {
+/* 通用卡片 */
+.card {
+  background: #FFFFFF;
+  border: 1px solid #DCE7F1;
+  border-radius: 8px;
+  box-shadow: 0 2px 10px rgba(30, 58, 95, .06);
+  padding: 16px;
+}
+
+/* 骨架屏 */
+.sk {
+  background: #E8F0F7;
+  border-radius: 4px;
+  animation: pulse 1.2s ease-in-out infinite alternate;
+}
+@keyframes pulse {
+  from { opacity: .55; }
+  to { opacity: 1; }
+}
+
+/* 错误 banner */
+.err-banner {
+  background: #FDE8E8;
+  border: 1px solid #C0392B;
+  color: #C0392B;
+  padding: 10px 12px;
+  border-radius: 4px;
+  font-size: 14px;
   display: flex;
+  justify-content: space-between;
   align-items: center;
+  margin-bottom: 16px;
+}
+
+/* 空态 */
+.empty-state {
+  text-align: center;
+  padding: 48px 16px;
+  color: #6B7B8C;
+}
+.empty-ico {
+  width: 60px;
+  height: 60px;
+  border-radius: 50%;
+  background: #E8F3FC;
+  margin: 0 auto 12px;
+}
+.empty-state h4 {
+  font-size: 15px;
+  color: #1E3A5F;
+  margin-bottom: 6px;
+}
+.empty-state p {
+  font-size: 13px;
+  margin-bottom: 16px;
+}
+
+/* 抽屉 */
+.drawer-inner {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+}
+.dw-header {
+  height: 56px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 0 18px;
+  border-bottom: 1px solid #DCE7F1;
+}
+.dw-title {
+  font-size: 15px;
+  font-weight: 700;
+  color: #1E3A5F;
+}
+.dw-body {
+  flex: 1;
+  overflow: auto;
+  padding: 18px;
+}
+.dw-summary {
+  margin-bottom: 18px;
+}
+.dw-name {
+  font-size: 16px;
+  font-weight: 700;
+  color: #1E3A5F;
+  margin-bottom: 6px;
+}
+.dw-meta {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  font-size: 13px;
+  color: #3B5A78;
+}
+.dw-timeline {
+  border-left: 2px solid #E8F3FC;
+  margin-left: 6px;
+  padding-left: 16px;
+}
+.tl-item {
+  position: relative;
+  padding-bottom: 16px;
+}
+.tl-item::before {
+  content: "";
+  position: absolute;
+  left: -22px;
+  top: 5px;
+  width: 9px;
+  height: 9px;
+  border-radius: 50%;
+  background: #2E6FA8;
+}
+.tl-item b {
+  font-size: 14px;
+  color: #1E3A5F;
+}
+.tl-item p {
+  font-size: 12px;
+  color: #6B7B8C;
+}
+.dw-hint {
+  font-size: 12px;
+  color: #6B7B8C;
+  margin-top: 12px;
+  padding-top: 12px;
+  border-top: 1px solid #DCE7F1;
+}
+
+/* sticky footer */
+.footbar {
+  position: fixed;
+  left: 220px;
+  right: 0;
+  bottom: 0;
+  height: 56px;
+  background: #FFFFFF;
+  border-top: 1px solid #DCE7F1;
+  box-shadow: 0 -2px 10px rgba(30, 58, 95, .06);
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 0 24px;
+  z-index: 5;
+  font-size: 13px;
+  color: #3B5A78;
+}
+.footbar b {
+  color: #2E6FA8;
+  font-variant-numeric: tabular-nums;
 }
 
-.filter-bar .el-select {
-  margin-right: 12px;
+/* 链接 */
+.link {
+  color: #2E6FA8;
+  cursor: pointer;
+  font-size: 13px;
 }
-</style>
+</style>