| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569 |
- <template>
- <div class="audit-detail" v-if="audit">
- <el-card>
- <!-- 步骤条 -->
- <el-steps :active="activeStep" simple style="margin-bottom: 20px;">
- <el-step title="权益信息">
- <template #icon><el-icon><InfoFilled /></el-icon></template>
- </el-step>
- <el-step title="设置规则">
- <template #icon><el-icon><Setting /></el-icon></template>
- </el-step>
- <el-step title="更多设置">
- <template #icon><el-icon><Monitor /></el-icon></template>
- </el-step>
- </el-steps>
- <!-- 步骤 0:权益信息 -->
- <div v-show="activeStep === 0">
- <el-card shadow="never" class="section-card">
- <template #header>
- <div class="section-title">基本信息</div>
- </template>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="是否权益平台兑换" label-width="150px">
- <el-radio-group v-model="form.isPlatformExchange" disabled>
- <el-radio-button label="是"></el-radio-button>
- <el-radio-button label="否"></el-radio-button>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="8" v-if="form.isPlatformExchange === '是'">
- <el-form-item label="商品类型">
- <el-radio-group v-model="form.productType" disabled>
- <el-radio-button label="券码"></el-radio-button>
- <el-radio-button label="微信立减金"></el-radio-button>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="8" v-if="form.isPlatformExchange === '是' && form.productType === '微信立减金'">
- <el-form-item label="选择权益">
- <el-input :value="form.rongshuProduct" readonly></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8" v-if="form.isPlatformExchange === '否'">
- <el-form-item label="外部权益链接">
- <el-input :value="form.externalLink" readonly></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8" v-if="form.isPlatformExchange === '否'">
- <el-form-item label="是否有详情页">
- <el-radio-group v-model="form.externalJumpMethod" disabled>
- <el-radio-button label="没有"></el-radio-button>
- <el-radio-button label="有"></el-radio-button>
- </el-radio-group>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="权益名称">
- <el-input :value="form.equityName" readonly></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="权益副标题">
- <el-input :value="form.subTitle" readonly></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8" v-if="form.isPlatformExchange === '是' && form.productType === '券码'">
- <el-form-item label="SIP商品编号">
- <el-input :value="form.skuNo" readonly></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="权益图标">
- <div v-if="form.listIcon && form.listIcon.length" class="image-preview">
- <img :src="form.listIcon[0]" class="preview-img" />
- </div>
- <span v-else class="no-data">暂无图片</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </el-card>
- <el-card v-if="shouldShowDetailCard" shadow="never" class="section-card">
- <template #header>
- <div class="section-title">详情信息</div>
- </template>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="权益主图">
- <div v-if="form.mainImage && form.mainImage.length" class="image-preview">
- <img :src="form.mainImage[0]" class="preview-img" />
- </div>
- <span v-else class="no-data">暂无图片</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="权益介绍">
- <el-input :value="form.introduction" type="textarea" :rows="4" readonly></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="权益有效期">
- <el-input
- :value="form.validityType === 'fromGrantPlan' ? '取自发放计划' : (form.validityText || '-')"
- readonly
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="权益内容">
- <div class="rich-text-view" v-html="form.overview || '暂无内容'"></div>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="权益说明">
- <div class="rich-text-view" v-html="form.details || '暂无内容'"></div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" v-if="form.isPlatformExchange === '是' && form.productType === '券码'">
- <el-col :span="8">
- <el-form-item label="领取成功按钮">
- <el-input :value="form.successButtonText" readonly></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </el-card>
- </div>
- <!-- 步骤 1:规则 -->
- <div v-show="activeStep === 1">
- <el-card shadow="never" class="section-card">
- <template #header>
- <div class="section-title">展示规则</div>
- </template>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-form-item label="展示时间限制">
- <el-switch v-model="form.showTimeEnabled" disabled></el-switch>
- <template v-if="form.showTimeEnabled">
- <div class="rule-pane">
- <el-input :value="form.showStartTime" readonly style="width: 240px;"></el-input>
- <span style="margin: 0 8px;">-</span>
- <el-input :value="form.showEndTime" readonly style="width: 240px;"></el-input>
- </div>
- </template>
- </el-form-item>
- <el-form-item label="展示客群限制">
- <el-switch v-model="form.showGroupEnabled" disabled></el-switch>
- <template v-if="form.showGroupEnabled">
- <div class="rule-pane">
- <el-input :value="(form.showGroupTagIds || []).join('、')" readonly></el-input>
- </div>
- </template>
- </el-form-item>
- </el-form>
- </el-card>
- <el-card shadow="never" class="section-card">
- <template #header>
- <div class="section-title">领取规则</div>
- </template>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-form-item label="领取时间限制">
- <el-switch v-model="form.claimTimeEnabled" disabled></el-switch>
- <template v-if="form.claimTimeEnabled">
- <div class="rule-pane">
- <el-input :value="form.claimStartTime" readonly style="width: 240px;"></el-input>
- <span style="margin: 0 8px;">-</span>
- <el-input :value="form.claimEndTime" readonly style="width: 240px;"></el-input>
- </div>
- </template>
- </el-form-item>
- <el-form-item label="领取客群限制">
- <el-switch v-model="form.claimGroupEnabled" disabled></el-switch>
- </el-form-item>
- </el-form>
- </el-card>
- </div>
- <!-- 步骤 2:更多设置 -->
- <div v-show="activeStep === 2">
- <el-card shadow="never" class="section-card">
- <template #header>
- <div class="section-title">显示页面</div>
- </template>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-form-item label="权益首页">
- <el-radio-group v-model="form.showOnHome" disabled>
- <el-radio label="显示">显示</el-radio>
- <el-radio label="不显示">不显示</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="组装页">
- <el-radio-group v-model="form.showOnAssembly" disabled>
- <el-radio label="显示">显示</el-radio>
- <el-radio label="不显示">不显示</el-radio>
- </el-radio-group>
- <div v-if="form.showOnAssembly === '显示'" class="rule-pane">
- <el-input :value="(form.assemblyPages || []).join(',')" readonly></el-input>
- </div>
- </el-form-item>
- </el-form>
- </el-card>
- <el-card shadow="never" class="section-card">
- <template #header>
- <div class="section-title">分享设置</div>
- </template>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-form-item label="是否支持分享">
- <el-switch v-model="form.shareEnabled" disabled></el-switch>
- </el-form-item>
- </el-form>
- </el-card>
- </div>
- <!-- 步骤导航 -->
- <div class="step-navigation">
- <el-button v-if="activeStep > 0" @click="prevStep"><el-icon><ArrowLeft /></el-icon>上一步</el-button>
- <el-button
- v-if="activeStep < 2"
- type="primary"
- @click="nextStep"
- style="margin-left: auto;"
- >下一步<el-icon class="el-icon--right"><ArrowRight /></el-icon></el-button>
- </div>
- <!-- 已审记录 -->
- <el-card v-if="audit.auditStatus !== 'pending'" shadow="never" class="section-card audit-action-card">
- <template #header>
- <div class="section-title">审核记录</div>
- </template>
- <el-form label-width="120px" label-position="left">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="审核人">
- <span>{{ audit.auditorName || '-' }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="审核时间">
- <span>{{ audit.auditTime || '-' }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="审核结果">
- <el-tag :type="auditStatusTag(audit.auditStatus)" size="small">
- {{ auditStatusLabel(audit.auditStatus) }}
- </el-tag>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </el-card>
- <!-- 操作栏 -->
- <div class="action-bar">
- <el-button @click="goBack">返回</el-button>
- <template v-if="canAudit">
- <el-button type="danger" @click="handleReject">驳回</el-button>
- <el-button type="primary" @click="handleApprove">通过</el-button>
- </template>
- </div>
- </el-card>
- </div>
- </template>
- <script>
- import request from '@/utils/request'
- import { ElMessage, ElMessageBox } from 'element-plus'
- const detailMockMap = {
- 'Q100001': {
- isPlatformExchange: '是', productType: '券码',
- listIcon: [], mainImage: [],
- introduction: '权益A 介绍内容示例',
- overview: '<p>权益内容内容</p>',
- details: '<p>权益说明内容</p>',
- successButtonText: '马上去使用',
- showTimeEnabled: true,
- showStartTime: '2026-01-01 00:00:00',
- showEndTime: '2026-12-31 23:59:59',
- showGroupEnabled: false,
- showGroupTagIds: [],
- claimTimeEnabled: true,
- claimStartTime: '2026-01-01 00:00:00',
- claimEndTime: '2026-12-31 23:59:59',
- claimGroupEnabled: false
- },
- 'Q100002': {
- isPlatformExchange: '否', productType: '',
- externalJumpMethod: '没有', externalLink: '太古地产',
- listIcon: [], mainImage: [], introduction: '',
- overview: '', details: '',
- successButtonText: '',
- showTimeEnabled: false, showStartTime: '', showEndTime: '',
- showGroupEnabled: true, showGroupTagIds: ['客群A'],
- claimTimeEnabled: true,
- claimStartTime: '2026-02-01 00:00:00',
- claimEndTime: '2026-11-30 23:59:59',
- claimGroupEnabled: true
- },
- 'Q100003': {
- isPlatformExchange: '否', productType: '',
- externalJumpMethod: '有', externalLink: '龙腾',
- listIcon: [], mainImage: [],
- introduction: '权益C 介绍内容示例',
- overview: '<p>外部详情页权益内容</p>',
- details: '<p>外部详情页权益说明</p>',
- showTimeEnabled: false,
- claimTimeEnabled: false,
- claimGroupEnabled: false
- },
- 'Q100004': {
- isPlatformExchange: '否', productType: '',
- externalJumpMethod: '有', externalLink: 'h5链接',
- listIcon: [], mainImage: [],
- introduction: '权益D 介绍内容示例',
- overview: '<p>自定义链接权益内容</p>',
- details: '<p>自定义链接权益说明</p>',
- showTimeEnabled: false,
- claimTimeEnabled: false,
- claimGroupEnabled: false
- }
- }
- export default {
- name: 'AuditDetail',
- data() {
- return {
- audit: null,
- activeStep: 0,
- form: {
- isPlatformExchange: '是',
- source: '银行自有',
- productType: '券码',
- rongshuProduct: '',
- externalJumpMethod: '',
- externalLink: '',
- equityName: '',
- subTitle: '',
- skuNo: '',
- merchantName: '',
- listIcon: [],
- mainImage: [],
- introduction: '',
- validityType: 'fromGrantPlan',
- validityText: '',
- overview: '',
- details: '',
- successButtonText: '',
- showTimeEnabled: false,
- showStartTime: '',
- showEndTime: '',
- showGroupEnabled: false,
- showGroupTagIds: [],
- claimTimeEnabled: false,
- claimStartTime: '',
- claimEndTime: '',
- claimGroupEnabled: false,
- showOnHome: '不显示',
- showOnAssembly: '不显示',
- assemblyPages: [],
- shareEnabled: false
- }
- }
- },
- computed: {
- mappedSource() {
- if (this.form.isPlatformExchange === '否') return '第三方'
- if (this.form.productType === '微信立减金') return '荣数商品'
- return '银行自有'
- },
- shouldShowDetailCard() {
- if (this.form.isPlatformExchange === '是') return true
- if (this.form.isPlatformExchange === '否' && this.form.externalJumpMethod === '有') return true
- return false
- },
- canAudit() {
- if (!this.audit || this.audit.auditStatus !== 'pending') return false
- const t = this.audit.auditType
- if (t === 'new') return this.activeStep === 2
- return true
- }
- },
- created() {
- this.loadAudit()
- },
- methods: {
- loadAudit() {
- const id = this.$route.params.id
- request.get(`/api/audit/detail?id=${id}`).then(res => {
- this.audit = res.data
- if (this.audit) this.populateForm()
- }).catch(() => {})
- },
- populateForm() {
- const bizId = this.audit.bizId
- // 1) 先用 mockMap 填充丰富的详情字段
- if (detailMockMap[bizId]) {
- Object.assign(this.form, detailMockMap[bizId])
- }
- // 2) 用 audit snapshot 覆盖(变更类型时会包含最新内容)
- Object.assign(this.form, this.audit.snapshot || {})
- // 3) 根据接口返回的 source 推算 isPlatformExchange 和 productType
- if (!this.form.isPlatformExchange || this.form.isPlatformExchange === '') {
- if (this.form.source === '第三方') this.form.isPlatformExchange = '否'
- else this.form.isPlatformExchange = '是'
- }
- if (this.form.isPlatformExchange === '是' && (!this.form.productType || this.form.productType === '')) {
- this.form.productType = this.form.source === '荣数商品' ? '微信立减金' : '券码'
- }
- if (this.form.isPlatformExchange === '否') {
- this.form.productType = ''
- }
- // 4) 推导第三方相关字段
- if (this.form.isPlatformExchange === '否') {
- if (this.form.jumpLink && !this.form.externalLink) this.form.externalLink = this.form.jumpLink
- if (this.form.jumpMethod && !this.form.externalJumpMethod) {
- this.form.externalJumpMethod = this.form.jumpMethod
- }
- }
- },
- auditTypeLabel(t) {
- return { new: '新增', offshelf: '下架' }[t] || t
- },
- auditTypeTag(t) {
- return { new: 'success', offshelf: 'danger' }[t] || ''
- },
- auditStatusLabel(s) {
- return { pending: '待审核', approved: '已通过', rejected: '已驳回' }[s] || s
- },
- auditStatusTag(s) {
- return { pending: 'warning', approved: 'success', rejected: 'danger' }[s] || ''
- },
- nextStep() { if (this.activeStep < 2) this.activeStep++ },
- prevStep() { if (this.activeStep > 0) this.activeStep-- },
- handleApprove() {
- ElMessageBox.confirm('确定通过该审核单吗?', '提示', {
- confirmButtonText: '通过',
- cancelButtonText: '取消',
- type: 'success'
- }).then(() => {
- request.post('/api/audit/approve', { id: this.audit.id }).then(() => {
- ElMessage.success('审核通过')
- this.$router.push('/customization/hsbc/audit')
- }).catch(() => {})
- }).catch(() => {})
- },
- handleReject() {
- ElMessageBox.confirm('确定驳回该审核单吗?', '提示', {
- confirmButtonText: '驳回',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- request.post('/api/audit/reject', { id: this.audit.id }).then(() => {
- ElMessage.success('已驳回')
- this.$router.push('/customization/hsbc/audit')
- }).catch(() => {})
- }).catch(() => {})
- },
- goBack() {
- this.$router.push('/customization/hsbc/audit')
- }
- }
- }
- </script>
- <style scoped>
- .audit-detail {
- padding: 0;
- }
- .header-bar {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .header-left .title {
- font-size: 16px;
- font-weight: 600;
- color: #303133;
- }
- .section-card {
- margin-bottom: 16px;
- border: none;
- }
- .section-card >>> .el-card__header {
- padding: 12px 20px;
- background: #fafafa;
- border-bottom: 1px solid #ebeef5;
- }
- .section-title {
- font-size: 14px;
- font-weight: 600;
- color: #303133;
- }
- .offshelf-reason {
- color: #f56c6c;
- font-weight: 500;
- }
- .rule-pane {
- display: flex;
- align-items: center;
- width: 600px;
- background: #f1f2f5;
- padding: 12px 20px;
- margin-top: 10px;
- }
- .image-preview {
- width: 80px;
- height: 80px;
- border: 1px solid #d9d9d9;
- border-radius: 4px;
- overflow: hidden;
- }
- .preview-img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- .no-data {
- color: #c0c4cc;
- font-size: 13px;
- }
- .rich-text-view {
- border: 1px solid #dcdfe6;
- border-radius: 4px;
- padding: 8px 12px;
- min-height: 80px;
- font-size: 14px;
- color: #606266;
- line-height: 1.6;
- }
- .step-navigation {
- display: flex;
- justify-content: space-between;
- margin-top: 20px;
- padding-top: 20px;
- border-top: 1px solid #ebeef5;
- }
- .audit-action-card {
- margin-top: 8px;
- }
- .action-bar {
- display: flex;
- justify-content: center;
- gap: 12px;
- margin-top: 20px;
- padding-top: 20px;
- border-top: 1px solid #ebeef5;
- }
- </style>
|