| | |
| | | type: 'row', |
| | | items: [ |
| | | ...couponForm(), |
| | | { label: '总数:', id: 'couponAmount', type: 'input' }, |
| | | { label: '发放数量:', id: 'couponAmount', type: 'input' }, |
| | | { label: '每人限领:', id: 'getLimit', type: 'input' }, |
| | | { label: '已领取:', id: 'getNum', type: 'input' }, |
| | | { label: '剩余:', id: 'unGetNum', type: 'input' }, |
| | | { label: '领取渠道:', id: 'getTypeName', type: 'input' }, |
| | | { |
| | | label: '领取时间:', |
| | | id: 'getStartDate', |
| | |
| | | ], |
| | | recordTableConfig: { |
| | | ...recordTableConfig(this.$route.params.id), |
| | | columns: [...couponRecordColumn()], |
| | | columns: [...couponRecordColumn('领取时间')], |
| | | }, |
| | | } |
| | | }, |
| | |
| | | type: 'row', |
| | | items: [ |
| | | ...couponForm(), |
| | | { label: '已发放总数:', id: 'todo' }, |
| | | { label: '已发放总数:', id: 'getNum' }, |
| | | { |
| | | label: '有效期:', |
| | | id: 'usageStartDate', |
| | |
| | | ], |
| | | recordTableConfig: { |
| | | ...recordTableConfig(this.$route.params.id), |
| | | columns: [...couponRecordColumn()], |
| | | columns: [...couponRecordColumn('发放时间')], |
| | | }, |
| | | } |
| | | }, |
| | |
| | | items: [ |
| | | ...couponForm(), |
| | | { |
| | | label: '发放时间:', |
| | | id: 'createTime', |
| | | type: 'input', |
| | | }, |
| | | { |
| | | label: '有效期:', |
| | | id: 'usageStartDate', |
| | | 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()], |
| | | columns: [...couponRecordColumn('发放时间')], |
| | | }, |
| | | } |
| | | }, |
| | |
| | | }, |
| | | columns: [ |
| | | ...couponColumn(), |
| | | { label: '发放时间', prop: 'usageStartDate', minWidth: 180 }, |
| | | { label: '发放时间', prop: 'createTime', minWidth: 180 }, |
| | | { |
| | | label: '有效期', |
| | | formatter: (row) => |
| | | row.usageStartDate |
| | | ? `${row.usageStartDate} ~ ${row.usageEndDate || ''}` |
| | | : '', |
| | | : `发放后${row.usageTimeNum}${row.usageTimeTypeName || ''}`, |
| | | minWidth: 400, |
| | | }, |
| | | { label: '状态', prop: 'statusName', minWidth: 120 }, |
| | |
| | | rules: { required: true, message: '请选择领取用户' }, |
| | | inputFormat: (row) => { |
| | | if ('customerList' in row) { |
| | | return row.customerList |
| | | return row.customerList.filter((i) => i) |
| | | } |
| | | }, |
| | | outputFormat: (val) => { |
| | |
| | | ], |
| | | recordTableConfig: { |
| | | ...recordTableConfig(this.$route.params.id), |
| | | columns: [...couponRecordColumn()], |
| | | columns: [...couponRecordColumn('兑换时间')], |
| | | }, |
| | | } |
| | | }, |
| | | head() { |
| | | return { |
| | | title: '会员优惠券详情', |
| | | title: '积分优惠券详情', |
| | | } |
| | | }, |
| | | } |
| | |
| | | <template> |
| | | <el-bus-crud v-bind="tableConfig" /> |
| | | <el-bus-crud ref="crud" v-bind="tableConfig" /> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | ) |
| | | if (code === 0) { |
| | | this.$message.success('上架成功') |
| | | this.$refs.crud.clearSelection() |
| | | } |
| | | } catch (e) { |
| | | return false |
| | |
| | | ) |
| | | if (code === 0) { |
| | | this.$message.success('下架成功') |
| | | this.$refs.crud.clearSelection() |
| | | } |
| | | } catch (e) { |
| | | return false |
| | |
| | | ) |
| | | if (code === 0) { |
| | | this.$message.success('上架成功') |
| | | this.$refs.crud.clearSelection() |
| | | } |
| | | } catch (e) { |
| | | return false |
| | |
| | | ) |
| | | if (code === 0) { |
| | | this.$message.success('下架成功') |
| | | this.$refs.crud.clearSelection() |
| | | } |
| | | } catch (e) { |
| | | return false |
| | |
| | | } |
| | | |
| | | // 优惠券领取/发放记录 |
| | | export const couponRecordColumn = () => { |
| | | export const couponRecordColumn = (timeName) => { |
| | | return [ |
| | | { label: '序号', type: 'index' }, |
| | | { label: '店铺名称', prop: 'customerName' }, |
| | | { label: '优惠券类型', prop: 'couponDiscountTypeName' }, |
| | | { |
| | | label: '使用条件', |
| | | formatter: (row) => `满${row.minOrderAmount}`, |
| | | }, |
| | | { label: '优惠券面值', prop: 'couponDiscountValue' }, |
| | | { label: '联系方式', prop: 'tel' }, |
| | | { label: timeName, prop: 'createTime' }, |
| | | { label: '状态', prop: 'statusName' }, |
| | | { label: '使用时间', prop: 'index' }, |
| | | { label: '使用时间', prop: 'usedTime' }, |
| | | { label: '订单号', prop: 'orderNo' }, |
| | | ] |
| | | } |