ソースを参照

券码管理:回收记录移至批次记录操作列,按批次维度展示记录

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
csk 3 週間 前
コミット
6393e22786

+ 30 - 18
工作空间/产研/权益/汇丰全行/产品原型/pc-demo/src/views/EquityProductCoupons.vue

@@ -12,9 +12,6 @@
         <el-button type="primary" @click="openImportDialog">
           <el-icon><Upload /></el-icon>导入券码
         </el-button>
-        <el-button @click="openRecycleRecordDialog">
-          <el-icon><Document /></el-icon>回收记录
-        </el-button>
       </div>
 
       <el-table :data="pagedBatchList" stripe style="width: 100%">
@@ -31,7 +28,7 @@
         </el-table-column>
         <el-table-column prop="importTime" label="导入时间" width="180"></el-table-column>
         <el-table-column prop="creator" label="创建人" width="100"></el-table-column>
-        <el-table-column label="操作" width="180" fixed="right">
+        <el-table-column label="操作" width="280" fixed="right">
           <template #default="scope">
             <el-button
               v-if="Number(scope.row.remainingCount) > 0"
@@ -39,6 +36,11 @@
               size="small"
               @click="handleRecycle(scope.row)"
             >回收</el-button>
+            <el-button
+              type="text"
+              size="small"
+              @click="openRecycleRecordDialog(scope.row)"
+            >回收记录</el-button>
             <el-button
               v-if="Number(scope.row.failCount) > 0"
               type="text"
@@ -170,11 +172,7 @@ export default {
       currentPage: 1,
       pageSize: 10,
       recycleRow: null,
-      recycleRecords: [
-        { recycleTime: '2026-05-10 14:22:08', type: '未发放券码回收', operator: '张三', amount: 120 },
-        { recycleTime: '2026-04-28 09:15:33', type: '已过期券码回收', operator: '李四', amount: 80 },
-        { recycleTime: '2026-04-12 16:40:51', type: '未发放券码回收', operator: '王五', amount: 200 }
-      ],
+      recordRow: null,
       recycleForm: {
         type: 'unissued',
         amount: undefined
@@ -196,7 +194,11 @@ export default {
           expireTime: '2026-12-31 23:59:59',
           fileStatus: '处理成功',
           importTime: '2026-04-15 10:32:18',
-          creator: '张三'
+          creator: '张三',
+          recycleRecords: [
+            { recycleTime: '2026-05-10 14:22:08', type: '未发放券码回收', operator: '张三', amount: 120 },
+            { recycleTime: '2026-04-28 09:15:33', type: '已过期券码回收', operator: '李四', amount: 80 }
+          ]
         },
         {
           importCount: 500,
@@ -207,7 +209,10 @@ export default {
           expireTime: '2026-09-30 23:59:59',
           fileStatus: '处理成功',
           importTime: '2026-04-20 14:15:42',
-          creator: '李四'
+          creator: '李四',
+          recycleRecords: [
+            { recycleTime: '2026-04-12 16:40:51', type: '未发放券码回收', operator: '王五', amount: 200 }
+          ]
         },
         {
           importCount: 800,
@@ -345,6 +350,9 @@ export default {
       if (!opt) return ''
       return opt.label.replace('回收', '')
     },
+    recycleRecords() {
+      return (this.recordRow && this.recordRow.recycleRecords) || []
+    },
     recycleMaxAmount() {
       const row = this.recycleRow
       if (!row) return 0
@@ -416,7 +424,8 @@ export default {
     handleExportFail(row) {
       ElMessage.success(`已开始导出失败券码(${row.failCount} 条)`)
     },
-    openRecycleRecordDialog() {
+    openRecycleRecordDialog(row) {
+      this.recordRow = row
       this.recycleRecordDialogVisible = true
     },
     downloadRecycleCoupons() {
@@ -442,12 +451,15 @@ export default {
         this.recycleRow.remainingCount = Math.max(0, Number(this.recycleRow.remainingCount) - amount)
       }
       const typeLabel = (this.recycleTypeOptions.find(o => o.value === this.recycleForm.type) || {}).label || ''
-      this.recycleRecords.unshift({
-        recycleTime: this.formatNow(),
-        type: typeLabel,
-        operator: '当前用户',
-        amount
-      })
+      if (this.recycleRow) {
+        if (!this.recycleRow.recycleRecords) this.recycleRow.recycleRecords = []
+        this.recycleRow.recycleRecords.unshift({
+          recycleTime: this.formatNow(),
+          type: typeLabel,
+          operator: '当前用户',
+          amount
+        })
+      }
       ElMessage.success('回收成功')
       this.recycleDialogVisible = false
     }