|
|
@@ -837,9 +837,11 @@ Mock.mock(/\/api\/equity\/delete/, 'post', (options) => {
|
|
|
Mock.mock(/\/api\/audit\/list/, 'get', (options) => {
|
|
|
const url = new URL(options.url, 'http://localhost')
|
|
|
const auditStatus = url.searchParams.get('auditStatus') || ''
|
|
|
+ const bizName = url.searchParams.get('bizName') || ''
|
|
|
const bizId = url.searchParams.get('bizId') || ''
|
|
|
let filtered = auditList
|
|
|
if (auditStatus) filtered = filtered.filter(a => a.auditStatus === auditStatus)
|
|
|
+ if (bizName) filtered = filtered.filter(a => a.bizName.includes(bizName))
|
|
|
if (bizId) filtered = filtered.filter(a => String(a.bizId).includes(bizId))
|
|
|
return { code: 200, data: filtered, msg: 'ok' }
|
|
|
})
|
|
|
@@ -1023,4 +1025,222 @@ Mock.mock(/\/api\/equity-grant-campaign\/end/, 'post', (options) => {
|
|
|
return { code: 200, data: null, msg: '已结束' }
|
|
|
})
|
|
|
|
|
|
+// =============================================
|
|
|
+// 规则组审核
|
|
|
+// =============================================
|
|
|
+let ruleGroupAuditIdCounter = 200
|
|
|
+
|
|
|
+function nextRuleGroupAuditId() {
|
|
|
+ ruleGroupAuditIdCounter += 1
|
|
|
+ const d = new Date()
|
|
|
+ const ymd = d.getFullYear().toString() + String(d.getMonth() + 1).padStart(2, '0') + String(d.getDate()).padStart(2, '0')
|
|
|
+ return 'RGA' + ymd + String(ruleGroupAuditIdCounter).padStart(4, '0')
|
|
|
+}
|
|
|
+
|
|
|
+const ruleGroupAuditList = [
|
|
|
+ {
|
|
|
+ id: 'RGA202605250001',
|
|
|
+ auditType: 'new',
|
|
|
+ bizModuleName: '规则组',
|
|
|
+ bizId: 'RG20260420003',
|
|
|
+ bizName: '借记卡-跨境候选客群',
|
|
|
+ submitterName: '赵市场',
|
|
|
+ submitTime: '2026-05-25 10:00:00',
|
|
|
+ auditorName: '',
|
|
|
+ auditTime: '',
|
|
|
+ auditStatus: 'pending',
|
|
|
+ auditComment: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 'RGA202605230001',
|
|
|
+ auditType: 'new',
|
|
|
+ bizModuleName: '规则组',
|
|
|
+ bizId: 'RG20260401001',
|
|
|
+ bizName: '层层礼-借记卡新客圈选',
|
|
|
+ submitterName: '张运营',
|
|
|
+ submitTime: '2026-05-23 14:30:00',
|
|
|
+ auditorName: '王审核',
|
|
|
+ auditTime: '2026-05-24 09:00:00',
|
|
|
+ auditStatus: 'approved',
|
|
|
+ auditComment: '规则配置合理,准予上线'
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
+Mock.mock(/\/api\/rule-group-audit\/list/, 'get', (options) => {
|
|
|
+ const url = new URL(options.url, 'http://localhost')
|
|
|
+ const auditStatus = url.searchParams.get('auditStatus') || ''
|
|
|
+ const bizName = url.searchParams.get('bizName') || ''
|
|
|
+ const bizId = url.searchParams.get('bizId') || ''
|
|
|
+ let filtered = ruleGroupAuditList
|
|
|
+ if (auditStatus) filtered = filtered.filter(a => a.auditStatus === auditStatus)
|
|
|
+ if (bizName) filtered = filtered.filter(a => a.bizName.includes(bizName))
|
|
|
+ if (bizId) filtered = filtered.filter(a => String(a.bizId).includes(bizId))
|
|
|
+ return { code: 200, data: filtered, msg: 'ok' }
|
|
|
+})
|
|
|
+
|
|
|
+Mock.mock(/\/api\/rule-group-audit\/detail/, 'get', (options) => {
|
|
|
+ const url = new URL(options.url, 'http://localhost')
|
|
|
+ const id = url.searchParams.get('id')
|
|
|
+ const item = ruleGroupAuditList.find(a => a.id === id)
|
|
|
+ return item
|
|
|
+ ? { code: 200, data: item, msg: 'ok' }
|
|
|
+ : { code: 404, data: null, msg: '审核单不存在' }
|
|
|
+})
|
|
|
+
|
|
|
+Mock.mock(/\/api\/rule-group-audit\/approve/, 'post', (options) => {
|
|
|
+ const body = JSON.parse(options.body)
|
|
|
+ const idx = ruleGroupAuditList.findIndex(a => a.id === body.id)
|
|
|
+ if (idx < 0) return { code: 404, data: null, msg: '审核单不存在' }
|
|
|
+ const audit = ruleGroupAuditList[idx]
|
|
|
+ if (audit.auditStatus !== 'pending') return { code: 400, data: null, msg: '该审核单已完成' }
|
|
|
+ const now = nowStr()
|
|
|
+ ruleGroupAuditList[idx] = { ...audit, auditStatus: 'approved', auditorName: body.auditorName || '王审核', auditTime: now, auditComment: body.comment || '' }
|
|
|
+ return { code: 200, data: null, msg: '审核通过' }
|
|
|
+})
|
|
|
+
|
|
|
+Mock.mock(/\/api\/rule-group-audit\/reject/, 'post', (options) => {
|
|
|
+ const body = JSON.parse(options.body)
|
|
|
+ const idx = ruleGroupAuditList.findIndex(a => a.id === body.id)
|
|
|
+ if (idx < 0) return { code: 404, data: null, msg: '审核单不存在' }
|
|
|
+ const audit = ruleGroupAuditList[idx]
|
|
|
+ if (audit.auditStatus !== 'pending') return { code: 400, data: null, msg: '该审核单已完成' }
|
|
|
+ const now = nowStr()
|
|
|
+ ruleGroupAuditList[idx] = { ...audit, auditStatus: 'rejected', auditorName: body.auditorName || '王审核', auditTime: now, auditComment: body.comment || '' }
|
|
|
+ return { code: 200, data: null, msg: '已驳回' }
|
|
|
+})
|
|
|
+
|
|
|
+// =============================================
|
|
|
+// 发放计划审核
|
|
|
+// =============================================
|
|
|
+let campaignAuditIdCounter = 100
|
|
|
+
|
|
|
+function nextCampaignAuditId() {
|
|
|
+ campaignAuditIdCounter += 1
|
|
|
+ const d = new Date()
|
|
|
+ const ymd = d.getFullYear().toString() + String(d.getMonth() + 1).padStart(2, '0') + String(d.getDate()).padStart(2, '0')
|
|
|
+ return 'CA' + ymd + String(campaignAuditIdCounter).padStart(4, '0')
|
|
|
+}
|
|
|
+
|
|
|
+const campaignAuditList = [
|
|
|
+ {
|
|
|
+ id: 'CA202605200001',
|
|
|
+ auditType: 'new',
|
|
|
+ bizModuleName: '发放计划',
|
|
|
+ bizId: 'P000003',
|
|
|
+ bizName: '秋季养生权益季',
|
|
|
+ snapshot: {
|
|
|
+ name: '秋季养生权益季',
|
|
|
+ startTime: '2026-09-01 00:00:00',
|
|
|
+ endTime: '2026-11-30 23:59:59',
|
|
|
+ grantMode: 'claim',
|
|
|
+ crowdList: ['A0000120251224'],
|
|
|
+ equityList: ['Q100001', 'Q100004'],
|
|
|
+ grantCycle: 'monthly',
|
|
|
+ grantQuantity: 1,
|
|
|
+ validity: { type: 'relative', fixedRange: [], relativeDays: 30 },
|
|
|
+ smsTemplateId: 'GRANT_SMS_001',
|
|
|
+ smsTemplate: '【银行】尊敬的${customerName},您已获得${productName}权益,发放时间:${grantTime},请于${expireDate}前使用。'
|
|
|
+ },
|
|
|
+ submitterName: '王运营',
|
|
|
+ submitTime: '2026-05-20 09:30:00',
|
|
|
+ auditorName: '',
|
|
|
+ auditTime: '',
|
|
|
+ auditStatus: 'pending',
|
|
|
+ auditComment: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 'CA202605220001',
|
|
|
+ auditType: 'new',
|
|
|
+ bizModuleName: '发放计划',
|
|
|
+ bizId: 'P000004',
|
|
|
+ bizName: '冬季暖心权益发放',
|
|
|
+ snapshot: {
|
|
|
+ name: '冬季暖心权益发放',
|
|
|
+ startTime: '2026-12-01 00:00:00',
|
|
|
+ endTime: '2027-02-28 23:59:59',
|
|
|
+ grantMode: 'direct',
|
|
|
+ crowdList: ['A0000120251224'],
|
|
|
+ equityList: ['Q100001'],
|
|
|
+ grantCycle: 'total',
|
|
|
+ grantQuantity: 3,
|
|
|
+ validity: { type: 'fixed', fixedRange: ['2026-12-01', '2027-02-28'], relativeDays: 30 },
|
|
|
+ smsTemplateId: 'GRANT_SMS_002',
|
|
|
+ smsTemplate: '【银行】尊敬的${customerName},您已获得${productName}权益,有效期至${expireDate},请登录APP查看详情。'
|
|
|
+ },
|
|
|
+ submitterName: '陈运营',
|
|
|
+ submitTime: '2026-05-22 10:15:00',
|
|
|
+ auditorName: '',
|
|
|
+ auditTime: '',
|
|
|
+ auditStatus: 'pending',
|
|
|
+ auditComment: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 'CA202605180001',
|
|
|
+ auditType: 'new',
|
|
|
+ bizModuleName: '发放计划',
|
|
|
+ bizId: 'P000001',
|
|
|
+ bizName: '春季会员尊享礼遇',
|
|
|
+ snapshot: {
|
|
|
+ name: '春季会员尊享礼遇',
|
|
|
+ startTime: '2026-04-01 00:00:00',
|
|
|
+ endTime: '2026-06-30 23:59:59',
|
|
|
+ grantMode: 'direct',
|
|
|
+ crowdList: ['A0000120251224'],
|
|
|
+ equityList: ['Q100001'],
|
|
|
+ grantCycle: 'monthly',
|
|
|
+ grantQuantity: 2,
|
|
|
+ validity: { type: 'fixed', fixedRange: ['2026-04-01', '2026-06-30'], relativeDays: 30 },
|
|
|
+ smsTemplateId: 'GRANT_SMS_003',
|
|
|
+ smsTemplate: '【银行】${customerName}您好,${productName}已为您发放成功,有效期至${expireDate}。'
|
|
|
+ },
|
|
|
+ submitterName: '李运营',
|
|
|
+ submitTime: '2026-05-18 14:20:00',
|
|
|
+ auditorName: '王五',
|
|
|
+ auditTime: '2026-05-19 09:00:00',
|
|
|
+ auditStatus: 'approved',
|
|
|
+ auditComment: '发放计划内容合规,准予通过'
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
+Mock.mock(/\/api\/campaign-audit\/list/, 'get', (options) => {
|
|
|
+ const url = new URL(options.url, 'http://localhost')
|
|
|
+ const auditStatus = url.searchParams.get('auditStatus') || ''
|
|
|
+ const bizName = url.searchParams.get('bizName') || ''
|
|
|
+ let filtered = campaignAuditList
|
|
|
+ if (auditStatus) filtered = filtered.filter(a => a.auditStatus === auditStatus)
|
|
|
+ if (bizName) filtered = filtered.filter(a => a.bizName.includes(bizName))
|
|
|
+ return { code: 200, data: filtered, msg: 'ok' }
|
|
|
+})
|
|
|
+
|
|
|
+Mock.mock(/\/api\/campaign-audit\/detail/, 'get', (options) => {
|
|
|
+ const url = new URL(options.url, 'http://localhost')
|
|
|
+ const id = url.searchParams.get('id')
|
|
|
+ const item = campaignAuditList.find(a => a.id === id)
|
|
|
+ return item
|
|
|
+ ? { code: 200, data: item, msg: 'ok' }
|
|
|
+ : { code: 404, data: null, msg: '审核单不存在' }
|
|
|
+})
|
|
|
+
|
|
|
+Mock.mock(/\/api\/campaign-audit\/approve/, 'post', (options) => {
|
|
|
+ const body = JSON.parse(options.body)
|
|
|
+ const idx = campaignAuditList.findIndex(a => a.id === body.id)
|
|
|
+ if (idx < 0) return { code: 404, data: null, msg: '审核单不存在' }
|
|
|
+ const audit = campaignAuditList[idx]
|
|
|
+ if (audit.auditStatus !== 'pending') return { code: 400, data: null, msg: '该审核单已完成' }
|
|
|
+ const now = nowStr()
|
|
|
+ campaignAuditList[idx] = { ...audit, auditStatus: 'approved', auditorName: body.auditorName || '王五', auditTime: now, auditComment: body.comment || '' }
|
|
|
+ return { code: 200, data: null, msg: '审核通过' }
|
|
|
+})
|
|
|
+
|
|
|
+Mock.mock(/\/api\/campaign-audit\/reject/, 'post', (options) => {
|
|
|
+ const body = JSON.parse(options.body)
|
|
|
+ const idx = campaignAuditList.findIndex(a => a.id === body.id)
|
|
|
+ if (idx < 0) return { code: 404, data: null, msg: '审核单不存在' }
|
|
|
+ const audit = campaignAuditList[idx]
|
|
|
+ if (audit.auditStatus !== 'pending') return { code: 400, data: null, msg: '该审核单已完成' }
|
|
|
+ const now = nowStr()
|
|
|
+ campaignAuditList[idx] = { ...audit, auditStatus: 'rejected', auditorName: body.auditorName || '王五', auditTime: now, auditComment: body.comment || '' }
|
|
|
+ return { code: 200, data: null, msg: '已驳回' }
|
|
|
+})
|
|
|
+
|
|
|
export default Mock
|