cloudroam
2025-03-28 cef2bb0eeeb91a22860cf5d23c7348af1ba921dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<template>
  <div class="base-page-wrapper coupon-detail">
    <el-bus-title title="优惠券信息" size="small" />
    <el-bus-form
      ref="form"
      label-width="auto"
      :content="formContent"
      readonly
      class="readonly-form"
    />
    <div class="base-page-wrapper__line"></div>
    <el-bus-title title="发放记录" size="small" />
    <el-bus-crud v-bind="recordTableConfig" />
    <div class="text-center mt-20">
      <el-button class="min-w-100" @click="goBack">返回</el-button>
    </div>
  </div>
</template>
 
<script>
import {
  couponForm,
  couponRecordColumn,
  recordTableConfig,
} from '@/utils/coupon-form'
import CouponDetail from '@/plugins/mixins/coupon-detail.vue'
export default {
  mixins: [CouponDetail],
  data() {
    return {
      detailUrl: `flower/api/v2/coupon/user`,
      formContent: [
        {
          type: 'row',
          items: [
            ...couponForm(),
            {
              label: '发放时间:',
              id: 'createTime',
              type: 'input',
            },
            {
              label: '有效期:',
              id: 'effectiveTime',
              inputFormat: (row) => {
                return row.usageStartDate
                  ? `${row.usageStartDate} ~ ${row.usageEndDate || ''}`
                  : `发放后${row.usageTimeNum}${row.usageTimeTypeName || ''}`
              },
              span: 24,
            },
          ],
        },
      ],
      recordTableConfig: {
        ...recordTableConfig(this.$route.params.id),
        columns: [...couponRecordColumn('发放时间')],
      },
    }
  },
  head() {
    return {
      title: '用户优惠券详情',
    }
  },
}
</script>
 
<style lang="scss" scoped>
@import '@/assets/coupon/detail.scss';
</style>