AuditDetail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. <template>
  2. <div class="audit-detail" v-if="audit">
  3. <el-card>
  4. <!-- 步骤条 -->
  5. <el-steps :active="activeStep" simple style="margin-bottom: 20px;">
  6. <el-step title="权益信息" icon="el-icon-info"></el-step>
  7. <el-step title="设置规则" icon="el-icon-setting"></el-step>
  8. <el-step title="更多设置" icon="el-icon-monitor"></el-step>
  9. </el-steps>
  10. <!-- 步骤 0:权益信息 -->
  11. <div v-show="activeStep === 0">
  12. <el-card shadow="never" class="section-card">
  13. <div slot="header" class="section-title">基本信息</div>
  14. <el-form :model="form" label-width="120px" label-position="left">
  15. <el-row :gutter="20">
  16. <el-col :span="8">
  17. <el-form-item label="权益来源">
  18. <el-radio-group v-model="form.source" disabled>
  19. <el-radio-button label="银行自有"></el-radio-button>
  20. <el-radio-button label="荣数商品"></el-radio-button>
  21. <el-radio-button label="第三方"></el-radio-button>
  22. </el-radio-group>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="8" v-if="form.source === '银行自有'">
  26. <el-form-item label="权益类型">
  27. <el-radio-group v-model="form.productType" disabled>
  28. <el-radio-button label="券码"></el-radio-button>
  29. </el-radio-group>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="8" v-if="form.source === '银行自有'">
  33. <el-form-item label="商户名称">
  34. <el-input :value="form.merchantName" readonly></el-input>
  35. </el-form-item>
  36. </el-col>
  37. </el-row>
  38. <el-row :gutter="20">
  39. <el-col :span="8" v-if="form.source === '第三方'">
  40. <el-form-item label="外部权益链接">
  41. <el-input :value="form.externalLink" readonly></el-input>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="8" v-if="form.source === '第三方'">
  45. <el-form-item label="是否有详情页">
  46. <el-radio-group v-model="form.externalJumpMethod" disabled>
  47. <el-radio-button label="没有"></el-radio-button>
  48. <el-radio-button label="有"></el-radio-button>
  49. </el-radio-group>
  50. </el-form-item>
  51. </el-col>
  52. </el-row>
  53. <el-row :gutter="20">
  54. <el-col :span="8">
  55. <el-form-item label="权益名称">
  56. <el-input :value="form.equityName" readonly></el-input>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="8">
  60. <el-form-item label="权益副标题">
  61. <el-input :value="form.subTitle" readonly></el-input>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="8" v-if="form.source === '银行自有'">
  65. <el-form-item label="SIP商品编号">
  66. <el-input :value="form.skuNo" readonly></el-input>
  67. </el-form-item>
  68. </el-col>
  69. </el-row>
  70. <el-row :gutter="20">
  71. <el-col :span="8">
  72. <el-form-item label="权益图标">
  73. <div v-if="form.listIcon && form.listIcon.length" class="image-preview">
  74. <img :src="form.listIcon[0]" class="preview-img" />
  75. </div>
  76. <span v-else class="no-data">暂无图片</span>
  77. </el-form-item>
  78. </el-col>
  79. </el-row>
  80. </el-form>
  81. </el-card>
  82. <el-card v-if="shouldShowDetailCard" shadow="never" class="section-card">
  83. <div slot="header" class="section-title">详情信息</div>
  84. <el-form :model="form" label-width="120px" label-position="left">
  85. <el-row :gutter="20">
  86. <el-col :span="8">
  87. <el-form-item label="权益主图">
  88. <div v-if="form.mainImage && form.mainImage.length" class="image-preview">
  89. <img :src="form.mainImage[0]" class="preview-img" />
  90. </div>
  91. <span v-else class="no-data">暂无图片</span>
  92. </el-form-item>
  93. </el-col>
  94. </el-row>
  95. <el-row :gutter="20">
  96. <el-col :span="12">
  97. <el-form-item label="权益介绍">
  98. <el-input :value="form.introduction" type="textarea" :rows="4" readonly></el-input>
  99. </el-form-item>
  100. </el-col>
  101. </el-row>
  102. <el-row :gutter="20">
  103. <el-col :span="12">
  104. <el-form-item label="权益有效期">
  105. <el-input
  106. :value="form.validityType === 'fromGrantPlan' ? '取自发放计划' : (form.validityText || '-')"
  107. readonly
  108. ></el-input>
  109. </el-form-item>
  110. </el-col>
  111. </el-row>
  112. <el-row :gutter="20">
  113. <el-col :span="12">
  114. <el-form-item label="权益内容">
  115. <div class="rich-text-view" v-html="form.overview || '暂无内容'"></div>
  116. </el-form-item>
  117. </el-col>
  118. <el-col :span="12">
  119. <el-form-item label="权益说明">
  120. <div class="rich-text-view" v-html="form.details || '暂无内容'"></div>
  121. </el-form-item>
  122. </el-col>
  123. </el-row>
  124. <el-row :gutter="20" v-if="form.source === '银行自有' || form.source === '荣数商品'">
  125. <el-col :span="8">
  126. <el-form-item label="领取成功按钮">
  127. <el-input :value="form.successButtonText" readonly></el-input>
  128. </el-form-item>
  129. </el-col>
  130. </el-row>
  131. </el-form>
  132. </el-card>
  133. </div>
  134. <!-- 步骤 1:规则 -->
  135. <div v-show="activeStep === 1">
  136. <el-card shadow="never" class="section-card">
  137. <div slot="header" class="section-title">展示规则</div>
  138. <el-form :model="form" label-width="120px" label-position="left">
  139. <el-form-item label="展示时间限制">
  140. <el-switch v-model="form.showTimeEnabled" disabled></el-switch>
  141. <template v-if="form.showTimeEnabled">
  142. <div class="rule-pane">
  143. <el-input :value="form.showStartTime" readonly style="width: 240px;"></el-input>
  144. <span style="margin: 0 8px;">-</span>
  145. <el-input :value="form.showEndTime" readonly style="width: 240px;"></el-input>
  146. </div>
  147. </template>
  148. </el-form-item>
  149. <el-form-item label="展示客群限制">
  150. <el-switch v-model="form.showGroupEnabled" disabled></el-switch>
  151. <template v-if="form.showGroupEnabled">
  152. <div class="rule-pane">
  153. <el-input :value="(form.showGroupTagIds || []).join('、')" readonly></el-input>
  154. </div>
  155. </template>
  156. </el-form-item>
  157. </el-form>
  158. </el-card>
  159. <el-card shadow="never" class="section-card">
  160. <div slot="header" class="section-title">领取规则</div>
  161. <el-form :model="form" label-width="120px" label-position="left">
  162. <el-form-item label="领取时间限制">
  163. <el-switch v-model="form.claimTimeEnabled" disabled></el-switch>
  164. <template v-if="form.claimTimeEnabled">
  165. <div class="rule-pane">
  166. <el-input :value="form.claimStartTime" readonly style="width: 240px;"></el-input>
  167. <span style="margin: 0 8px;">-</span>
  168. <el-input :value="form.claimEndTime" readonly style="width: 240px;"></el-input>
  169. </div>
  170. </template>
  171. </el-form-item>
  172. <el-form-item label="领取客群限制">
  173. <el-switch v-model="form.claimGroupEnabled" disabled></el-switch>
  174. </el-form-item>
  175. </el-form>
  176. </el-card>
  177. </div>
  178. <!-- 步骤 2:更多设置 -->
  179. <div v-show="activeStep === 2">
  180. <el-card shadow="never" class="section-card">
  181. <div slot="header" class="section-title">显示页面</div>
  182. <el-form :model="form" label-width="120px" label-position="left">
  183. <el-form-item label="权益首页/列表页">
  184. <el-radio-group v-model="form.showOnHome" disabled>
  185. <el-radio label="显示">显示</el-radio>
  186. <el-radio label="不显示">不显示</el-radio>
  187. </el-radio-group>
  188. </el-form-item>
  189. <el-form-item label="组装页">
  190. <el-radio-group v-model="form.showOnAssembly" disabled>
  191. <el-radio label="显示">显示</el-radio>
  192. <el-radio label="不显示">不显示</el-radio>
  193. </el-radio-group>
  194. <div v-if="form.showOnAssembly === '显示'" class="rule-pane">
  195. <el-input :value="(form.assemblyPages || []).join(',')" readonly></el-input>
  196. </div>
  197. </el-form-item>
  198. </el-form>
  199. </el-card>
  200. <el-card shadow="never" class="section-card">
  201. <div slot="header" class="section-title">分享设置</div>
  202. <el-form :model="form" label-width="120px" label-position="left">
  203. <el-form-item label="是否支持分享">
  204. <el-switch v-model="form.shareEnabled" disabled></el-switch>
  205. </el-form-item>
  206. </el-form>
  207. </el-card>
  208. </div>
  209. <!-- 步骤导航 -->
  210. <div class="step-navigation">
  211. <el-button v-if="activeStep > 0" @click="prevStep" icon="el-icon-arrow-left">上一步</el-button>
  212. <el-button
  213. v-if="activeStep < 2"
  214. type="primary"
  215. @click="nextStep"
  216. style="margin-left: auto;"
  217. >下一步<i class="el-icon-arrow-right el-icon--right"></i></el-button>
  218. </div>
  219. <!-- 已审记录 -->
  220. <el-card v-if="audit.auditStatus !== 'pending'" shadow="never" class="section-card audit-action-card">
  221. <div slot="header" class="section-title">审核记录</div>
  222. <el-form label-width="120px" label-position="left">
  223. <el-row :gutter="20">
  224. <el-col :span="8">
  225. <el-form-item label="审核人">
  226. <span>{{ audit.auditorName || '-' }}</span>
  227. </el-form-item>
  228. </el-col>
  229. <el-col :span="8">
  230. <el-form-item label="审核时间">
  231. <span>{{ audit.auditTime || '-' }}</span>
  232. </el-form-item>
  233. </el-col>
  234. <el-col :span="8">
  235. <el-form-item label="审核结果">
  236. <el-tag :type="auditStatusTag(audit.auditStatus)" size="small">
  237. {{ auditStatusLabel(audit.auditStatus) }}
  238. </el-tag>
  239. </el-form-item>
  240. </el-col>
  241. </el-row>
  242. </el-form>
  243. </el-card>
  244. <!-- 操作栏 -->
  245. <div class="action-bar">
  246. <el-button @click="goBack">返回</el-button>
  247. <template v-if="canAudit">
  248. <el-button type="danger" @click="handleReject">驳回</el-button>
  249. <el-button type="primary" @click="handleApprove">通过</el-button>
  250. </template>
  251. </div>
  252. </el-card>
  253. </div>
  254. </template>
  255. <script>
  256. import request from '@/utils/request'
  257. const detailMockMap = {
  258. 'Q100001': {
  259. listIcon: [], mainImage: [],
  260. introduction: '权益A 介绍内容示例',
  261. overview: '<p>权益内容内容</p>',
  262. details: '<p>权益说明内容</p>',
  263. successButtonText: '马上去使用',
  264. showTimeEnabled: true,
  265. showStartTime: '2026-01-01 00:00:00',
  266. showEndTime: '2026-12-31 23:59:59',
  267. showGroupEnabled: false,
  268. showGroupTagIds: [],
  269. claimTimeEnabled: true,
  270. claimStartTime: '2026-01-01 00:00:00',
  271. claimEndTime: '2026-12-31 23:59:59',
  272. claimGroupEnabled: false
  273. },
  274. 'Q100002': {
  275. externalJumpMethod: '没有', externalLink: '太古地产',
  276. listIcon: [], mainImage: [], introduction: '',
  277. overview: '', details: '',
  278. successButtonText: '',
  279. showTimeEnabled: false, showStartTime: '', showEndTime: '',
  280. showGroupEnabled: true, showGroupTagIds: ['客群A'],
  281. claimTimeEnabled: true,
  282. claimStartTime: '2026-02-01 00:00:00',
  283. claimEndTime: '2026-11-30 23:59:59',
  284. claimGroupEnabled: true
  285. },
  286. 'Q100003': {
  287. externalJumpMethod: '有', externalLink: '龙腾',
  288. listIcon: [], mainImage: [],
  289. introduction: '权益C 介绍内容示例',
  290. overview: '<p>外部详情页权益内容</p>',
  291. details: '<p>外部详情页权益说明</p>',
  292. showTimeEnabled: false,
  293. claimTimeEnabled: false,
  294. claimGroupEnabled: false
  295. },
  296. 'Q100004': {
  297. externalJumpMethod: '有', externalLink: 'h5链接',
  298. listIcon: [], mainImage: [],
  299. introduction: '权益D 介绍内容示例',
  300. overview: '<p>自定义链接权益内容</p>',
  301. details: '<p>自定义链接权益说明</p>',
  302. showTimeEnabled: false,
  303. claimTimeEnabled: false,
  304. claimGroupEnabled: false
  305. }
  306. }
  307. export default {
  308. name: 'AuditDetail',
  309. data() {
  310. return {
  311. audit: null,
  312. activeStep: 0,
  313. form: {
  314. source: '银行自有',
  315. productType: '',
  316. externalJumpMethod: '',
  317. externalLink: '',
  318. equityName: '',
  319. subTitle: '',
  320. skuNo: '',
  321. merchantName: '',
  322. listIcon: [],
  323. mainImage: [],
  324. introduction: '',
  325. validityType: 'fromGrantPlan',
  326. validityText: '',
  327. overview: '',
  328. details: '',
  329. successButtonText: '',
  330. showTimeEnabled: false,
  331. showStartTime: '',
  332. showEndTime: '',
  333. showGroupEnabled: false,
  334. showGroupTagIds: [],
  335. claimTimeEnabled: false,
  336. claimStartTime: '',
  337. claimEndTime: '',
  338. claimGroupEnabled: false,
  339. showOnHome: '不显示',
  340. showOnAssembly: '不显示',
  341. assemblyPages: [],
  342. shareEnabled: false
  343. }
  344. }
  345. },
  346. computed: {
  347. shouldShowDetailCard() {
  348. const s = this.form.source
  349. if (s === '银行自有' || s === '荣数商品') return true
  350. if (s === '第三方' && this.form.externalJumpMethod === '有') return true
  351. return false
  352. },
  353. canAudit() {
  354. if (!this.audit || this.audit.auditStatus !== 'pending') return false
  355. const t = this.audit.auditType
  356. if (t === 'new') return this.activeStep === 2
  357. return true
  358. }
  359. },
  360. created() {
  361. this.loadAudit()
  362. },
  363. methods: {
  364. loadAudit() {
  365. const id = this.$route.params.id
  366. request.get(`/api/audit/detail?id=${id}`).then(res => {
  367. this.audit = res.data
  368. if (this.audit) this.populateForm()
  369. }).catch(() => {})
  370. },
  371. populateForm() {
  372. const bizId = this.audit.bizId
  373. // 1) 先用 mockMap 填充丰富的详情字段
  374. if (detailMockMap[bizId]) {
  375. Object.assign(this.form, detailMockMap[bizId])
  376. }
  377. // 2) 用 audit snapshot 覆盖(变更类型时会包含最新内容)
  378. Object.assign(this.form, this.audit.snapshot || {})
  379. // 3) 推导第三方相关字段
  380. if (this.form.source === '第三方') {
  381. if (this.form.jumpLink && !this.form.externalLink) this.form.externalLink = this.form.jumpLink
  382. if (this.form.jumpMethod && !this.form.externalJumpMethod) {
  383. this.form.externalJumpMethod = this.form.jumpMethod
  384. }
  385. }
  386. },
  387. auditTypeLabel(t) {
  388. return { new: '新增', offshelf: '下架' }[t] || t
  389. },
  390. auditTypeTag(t) {
  391. return { new: 'success', offshelf: 'danger' }[t] || ''
  392. },
  393. auditStatusLabel(s) {
  394. return { pending: '待审核', approved: '已通过', rejected: '已驳回' }[s] || s
  395. },
  396. auditStatusTag(s) {
  397. return { pending: 'warning', approved: 'success', rejected: 'danger' }[s] || ''
  398. },
  399. nextStep() { if (this.activeStep < 2) this.activeStep++ },
  400. prevStep() { if (this.activeStep > 0) this.activeStep-- },
  401. handleApprove() {
  402. this.$confirm('确定通过该审核单吗?', '提示', {
  403. confirmButtonText: '通过',
  404. cancelButtonText: '取消',
  405. type: 'success'
  406. }).then(() => {
  407. request.post('/api/audit/approve', { id: this.audit.id }).then(() => {
  408. this.$message.success('审核通过')
  409. this.$router.push('/customization/hsbc/audit')
  410. }).catch(() => {})
  411. }).catch(() => {})
  412. },
  413. handleReject() {
  414. this.$confirm('确定驳回该审核单吗?', '提示', {
  415. confirmButtonText: '驳回',
  416. cancelButtonText: '取消',
  417. type: 'warning'
  418. }).then(() => {
  419. request.post('/api/audit/reject', { id: this.audit.id }).then(() => {
  420. this.$message.success('已驳回')
  421. this.$router.push('/customization/hsbc/audit')
  422. }).catch(() => {})
  423. }).catch(() => {})
  424. },
  425. goBack() {
  426. this.$router.push('/customization/hsbc/audit')
  427. }
  428. }
  429. }
  430. </script>
  431. <style scoped>
  432. .audit-detail {
  433. padding: 0;
  434. }
  435. .header-bar {
  436. display: flex;
  437. justify-content: space-between;
  438. align-items: center;
  439. }
  440. .header-left .title {
  441. font-size: 16px;
  442. font-weight: 600;
  443. color: #303133;
  444. }
  445. .section-card {
  446. margin-bottom: 16px;
  447. border: none;
  448. }
  449. .section-card >>> .el-card__header {
  450. padding: 12px 20px;
  451. background: #fafafa;
  452. border-bottom: 1px solid #ebeef5;
  453. }
  454. .section-title {
  455. font-size: 14px;
  456. font-weight: 600;
  457. color: #303133;
  458. }
  459. .offshelf-reason {
  460. color: #f56c6c;
  461. font-weight: 500;
  462. }
  463. .rule-pane {
  464. display: flex;
  465. align-items: center;
  466. width: 600px;
  467. background: #f1f2f5;
  468. padding: 12px 20px;
  469. margin-top: 10px;
  470. }
  471. .image-preview {
  472. width: 80px;
  473. height: 80px;
  474. border: 1px solid #d9d9d9;
  475. border-radius: 4px;
  476. overflow: hidden;
  477. }
  478. .preview-img {
  479. width: 100%;
  480. height: 100%;
  481. object-fit: cover;
  482. }
  483. .no-data {
  484. color: #c0c4cc;
  485. font-size: 13px;
  486. }
  487. .rich-text-view {
  488. border: 1px solid #dcdfe6;
  489. border-radius: 4px;
  490. padding: 8px 12px;
  491. min-height: 80px;
  492. font-size: 14px;
  493. color: #606266;
  494. line-height: 1.6;
  495. }
  496. .step-navigation {
  497. display: flex;
  498. justify-content: space-between;
  499. margin-top: 20px;
  500. padding-top: 20px;
  501. border-top: 1px solid #ebeef5;
  502. }
  503. .audit-action-card {
  504. margin-top: 8px;
  505. }
  506. .action-bar {
  507. display: flex;
  508. justify-content: center;
  509. gap: 12px;
  510. margin-top: 20px;
  511. padding-top: 20px;
  512. border-top: 1px solid #ebeef5;
  513. }
  514. </style>