|
@@ -378,6 +378,7 @@ const equityList = [
|
|
|
productId: 'Q100001',
|
|
productId: 'Q100001',
|
|
|
equityName: '权益A',
|
|
equityName: '权益A',
|
|
|
source: '银行自有',
|
|
source: '银行自有',
|
|
|
|
|
+ isPlatformExchange: '是',
|
|
|
jumpMethod: '-',
|
|
jumpMethod: '-',
|
|
|
jumpLink: '-',
|
|
jumpLink: '-',
|
|
|
exchangeMethod: '权益平台',
|
|
exchangeMethod: '权益平台',
|
|
@@ -398,6 +399,7 @@ const equityList = [
|
|
|
productId: 'Q100002',
|
|
productId: 'Q100002',
|
|
|
equityName: '权益B',
|
|
equityName: '权益B',
|
|
|
source: '第三方',
|
|
source: '第三方',
|
|
|
|
|
+ isPlatformExchange: '否',
|
|
|
jumpMethod: '没有',
|
|
jumpMethod: '没有',
|
|
|
jumpLink: '太古地产',
|
|
jumpLink: '太古地产',
|
|
|
exchangeMethod: '第三方(列表跳转)',
|
|
exchangeMethod: '第三方(列表跳转)',
|
|
@@ -418,6 +420,7 @@ const equityList = [
|
|
|
productId: 'Q100003',
|
|
productId: 'Q100003',
|
|
|
equityName: '权益C',
|
|
equityName: '权益C',
|
|
|
source: '第三方',
|
|
source: '第三方',
|
|
|
|
|
+ isPlatformExchange: '否',
|
|
|
jumpMethod: '有',
|
|
jumpMethod: '有',
|
|
|
jumpLink: '龙腾',
|
|
jumpLink: '龙腾',
|
|
|
exchangeMethod: '第三方(详情页跳转)',
|
|
exchangeMethod: '第三方(详情页跳转)',
|
|
@@ -438,6 +441,7 @@ const equityList = [
|
|
|
productId: 'Q100004',
|
|
productId: 'Q100004',
|
|
|
equityName: '权益D',
|
|
equityName: '权益D',
|
|
|
source: '第三方',
|
|
source: '第三方',
|
|
|
|
|
+ isPlatformExchange: '否',
|
|
|
jumpMethod: '有',
|
|
jumpMethod: '有',
|
|
|
jumpLink: 'h5链接',
|
|
jumpLink: 'h5链接',
|
|
|
exchangeMethod: '第三方(详情页跳转)',
|
|
exchangeMethod: '第三方(详情页跳转)',
|
|
@@ -458,6 +462,7 @@ const equityList = [
|
|
|
productId: 'Q100005',
|
|
productId: 'Q100005',
|
|
|
equityName: '权益E',
|
|
equityName: '权益E',
|
|
|
source: '银行自有',
|
|
source: '银行自有',
|
|
|
|
|
+ isPlatformExchange: '是',
|
|
|
jumpMethod: '-',
|
|
jumpMethod: '-',
|
|
|
jumpLink: '-',
|
|
jumpLink: '-',
|
|
|
exchangeMethod: '权益平台',
|
|
exchangeMethod: '权益平台',
|
|
@@ -478,6 +483,7 @@ const equityList = [
|
|
|
productId: 'Q100006',
|
|
productId: 'Q100006',
|
|
|
equityName: '权益F(草稿)',
|
|
equityName: '权益F(草稿)',
|
|
|
source: '银行自有',
|
|
source: '银行自有',
|
|
|
|
|
+ isPlatformExchange: '是',
|
|
|
jumpMethod: '-',
|
|
jumpMethod: '-',
|
|
|
jumpLink: '-',
|
|
jumpLink: '-',
|
|
|
exchangeMethod: '权益平台',
|
|
exchangeMethod: '权益平台',
|
|
@@ -493,10 +499,56 @@ const equityList = [
|
|
|
showOnHome: '不显示',
|
|
showOnHome: '不显示',
|
|
|
showOnAssembly: '不显示',
|
|
showOnAssembly: '不显示',
|
|
|
assemblyPages: []
|
|
assemblyPages: []
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ productId: 'Q100007',
|
|
|
|
|
+ equityName: '微信立减金 5元(满10减5)',
|
|
|
|
|
+ source: '荣数商品',
|
|
|
|
|
+ isPlatformExchange: '是',
|
|
|
|
|
+ jumpMethod: '-',
|
|
|
|
|
+ jumpLink: '-',
|
|
|
|
|
+ exchangeMethod: '权益平台',
|
|
|
|
|
+ productType: '微信立减金',
|
|
|
|
|
+ skuNo: 'V0000003900000801',
|
|
|
|
|
+ rongshuProduct: '微信立减金 5元(满10减5)',
|
|
|
|
|
+ merchantName: '微信支付',
|
|
|
|
|
+ stockCount: 2000,
|
|
|
|
|
+ creator: '张三',
|
|
|
|
|
+ createTime: '2026-05-20 10:00:00',
|
|
|
|
|
+ reviewer: '李四',
|
|
|
|
|
+ reviewTime: '2026-05-22 15:30:00',
|
|
|
|
|
+ shelfStatus: '已上架',
|
|
|
|
|
+ auditStatus: '审核通过',
|
|
|
|
|
+ showOnHome: '显示',
|
|
|
|
|
+ showOnAssembly: '不显示',
|
|
|
|
|
+ assemblyPages: []
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ productId: 'Q100008',
|
|
|
|
|
+ equityName: '微信立减金 50元(满200减50)',
|
|
|
|
|
+ source: '荣数商品',
|
|
|
|
|
+ isPlatformExchange: '是',
|
|
|
|
|
+ jumpMethod: '-',
|
|
|
|
|
+ jumpLink: '-',
|
|
|
|
|
+ exchangeMethod: '权益平台',
|
|
|
|
|
+ productType: '微信立减金',
|
|
|
|
|
+ skuNo: 'V0000003900000807',
|
|
|
|
|
+ rongshuProduct: '微信立减金 50元(满200减50)',
|
|
|
|
|
+ merchantName: '微信支付',
|
|
|
|
|
+ stockCount: 400,
|
|
|
|
|
+ creator: '张三',
|
|
|
|
|
+ createTime: '2026-05-18 09:30:00',
|
|
|
|
|
+ reviewer: '',
|
|
|
|
|
+ reviewTime: '',
|
|
|
|
|
+ shelfStatus: '未上架',
|
|
|
|
|
+ auditStatus: '上架待审核',
|
|
|
|
|
+ showOnHome: '显示',
|
|
|
|
|
+ showOnAssembly: '显示',
|
|
|
|
|
+ assemblyPages: ['组装页1']
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
-let equityIdCounter = 100006
|
|
|
|
|
|
|
+let equityIdCounter = 100008
|
|
|
|
|
|
|
|
const auditList = [
|
|
const auditList = [
|
|
|
{
|
|
{
|
|
@@ -509,6 +561,7 @@ const auditList = [
|
|
|
snapshot: {
|
|
snapshot: {
|
|
|
equityName: '权益B',
|
|
equityName: '权益B',
|
|
|
source: '第三方',
|
|
source: '第三方',
|
|
|
|
|
+ isPlatformExchange: '否',
|
|
|
jumpMethod: '没有',
|
|
jumpMethod: '没有',
|
|
|
jumpLink: '太古地产',
|
|
jumpLink: '太古地产',
|
|
|
productType: '',
|
|
productType: '',
|
|
@@ -536,6 +589,7 @@ const auditList = [
|
|
|
snapshot: {
|
|
snapshot: {
|
|
|
equityName: '权益D',
|
|
equityName: '权益D',
|
|
|
source: '第三方',
|
|
source: '第三方',
|
|
|
|
|
+ isPlatformExchange: '否',
|
|
|
jumpMethod: '有',
|
|
jumpMethod: '有',
|
|
|
jumpLink: 'h5链接',
|
|
jumpLink: 'h5链接',
|
|
|
productType: '',
|
|
productType: '',
|
|
@@ -563,6 +617,7 @@ const auditList = [
|
|
|
snapshot: {
|
|
snapshot: {
|
|
|
equityName: '权益A',
|
|
equityName: '权益A',
|
|
|
source: '银行自有',
|
|
source: '银行自有',
|
|
|
|
|
+ isPlatformExchange: '是',
|
|
|
jumpMethod: '-',
|
|
jumpMethod: '-',
|
|
|
jumpLink: '-',
|
|
jumpLink: '-',
|
|
|
productType: '券码',
|
|
productType: '券码',
|
|
@@ -599,9 +654,10 @@ function snapshotOf(equity) {
|
|
|
return {
|
|
return {
|
|
|
equityName: equity.equityName,
|
|
equityName: equity.equityName,
|
|
|
source: equity.source,
|
|
source: equity.source,
|
|
|
|
|
+ isPlatformExchange: equity.isPlatformExchange || (equity.source === '第三方' ? '否' : '是'),
|
|
|
|
|
+ productType: equity.isPlatformExchange === '否' ? '' : (equity.productType || '券码'),
|
|
|
jumpMethod: equity.jumpMethod,
|
|
jumpMethod: equity.jumpMethod,
|
|
|
jumpLink: equity.jumpLink,
|
|
jumpLink: equity.jumpLink,
|
|
|
- productType: equity.productType,
|
|
|
|
|
skuNo: equity.skuNo,
|
|
skuNo: equity.skuNo,
|
|
|
merchantName: equity.merchantName,
|
|
merchantName: equity.merchantName,
|
|
|
subTitle: equity.subTitle || ''
|
|
subTitle: equity.subTitle || ''
|
|
@@ -654,10 +710,11 @@ Mock.mock(/\/api\/equity\/save-draft/, 'post', (options) => {
|
|
|
productId: newId,
|
|
productId: newId,
|
|
|
equityName: body.equityName || '未命名权益',
|
|
equityName: body.equityName || '未命名权益',
|
|
|
source: body.source || '银行自有',
|
|
source: body.source || '银行自有',
|
|
|
|
|
+ isPlatformExchange: body.isPlatformExchange || '是',
|
|
|
jumpMethod: body.jumpMethod || '-',
|
|
jumpMethod: body.jumpMethod || '-',
|
|
|
jumpLink: body.jumpLink || '-',
|
|
jumpLink: body.jumpLink || '-',
|
|
|
exchangeMethod: body.exchangeMethod || '权益平台',
|
|
exchangeMethod: body.exchangeMethod || '权益平台',
|
|
|
- productType: body.productType || '',
|
|
|
|
|
|
|
+ productType: body.isPlatformExchange === '否' ? '' : (body.productType || '券码'),
|
|
|
skuNo: body.skuNo || '',
|
|
skuNo: body.skuNo || '',
|
|
|
merchantName: body.merchantName || '',
|
|
merchantName: body.merchantName || '',
|
|
|
creator: body.creator || '李运营',
|
|
creator: body.creator || '李运营',
|
|
@@ -697,10 +754,11 @@ Mock.mock(/\/api\/equity\/submit/, 'post', (options) => {
|
|
|
productId: newId,
|
|
productId: newId,
|
|
|
equityName: body.equityName || '未命名权益',
|
|
equityName: body.equityName || '未命名权益',
|
|
|
source: body.source || '银行自有',
|
|
source: body.source || '银行自有',
|
|
|
|
|
+ isPlatformExchange: body.isPlatformExchange || '是',
|
|
|
jumpMethod: body.jumpMethod || '-',
|
|
jumpMethod: body.jumpMethod || '-',
|
|
|
jumpLink: body.jumpLink || '-',
|
|
jumpLink: body.jumpLink || '-',
|
|
|
exchangeMethod: body.exchangeMethod || '权益平台',
|
|
exchangeMethod: body.exchangeMethod || '权益平台',
|
|
|
- productType: body.productType || '',
|
|
|
|
|
|
|
+ productType: body.isPlatformExchange === '否' ? '' : (body.productType || '券码'),
|
|
|
skuNo: body.skuNo || '',
|
|
skuNo: body.skuNo || '',
|
|
|
merchantName: body.merchantName || '',
|
|
merchantName: body.merchantName || '',
|
|
|
creator: submitter,
|
|
creator: submitter,
|
|
@@ -915,11 +973,13 @@ const equityGrantCampaignList = [
|
|
|
startTime: '2026-05-01 00:00:00',
|
|
startTime: '2026-05-01 00:00:00',
|
|
|
endTime: '2026-08-31 23:59:59',
|
|
endTime: '2026-08-31 23:59:59',
|
|
|
crowdList: [],
|
|
crowdList: [],
|
|
|
|
|
+ isAutoGrant: '是',
|
|
|
grantMode: 'claim',
|
|
grantMode: 'claim',
|
|
|
equityList: ['Q100001', 'Q100004', 'Q100005'],
|
|
equityList: ['Q100001', 'Q100004', 'Q100005'],
|
|
|
grantCycle: 'total',
|
|
grantCycle: 'total',
|
|
|
grantQuantity: 1,
|
|
grantQuantity: 1,
|
|
|
validity: { type: 'relative', fixedRange: [], relativeDays: 30 },
|
|
validity: { type: 'relative', fixedRange: [], relativeDays: 30 },
|
|
|
|
|
+ auditStatus: '审核通过',
|
|
|
createTime: '2026-04-20 14:10:00',
|
|
createTime: '2026-04-20 14:10:00',
|
|
|
updateTime: '2026-04-20 14:10:00'
|
|
updateTime: '2026-04-20 14:10:00'
|
|
|
},
|
|
},
|
|
@@ -929,11 +989,13 @@ const equityGrantCampaignList = [
|
|
|
startTime: '2026-04-01 00:00:00',
|
|
startTime: '2026-04-01 00:00:00',
|
|
|
endTime: '2026-06-30 23:59:59',
|
|
endTime: '2026-06-30 23:59:59',
|
|
|
crowdList: ['A0000120251224'],
|
|
crowdList: ['A0000120251224'],
|
|
|
|
|
+ isAutoGrant: '否',
|
|
|
grantMode: 'direct',
|
|
grantMode: 'direct',
|
|
|
equityList: ['Q100001'],
|
|
equityList: ['Q100001'],
|
|
|
grantCycle: 'monthly',
|
|
grantCycle: 'monthly',
|
|
|
grantQuantity: 2,
|
|
grantQuantity: 2,
|
|
|
validity: { type: 'fixed', fixedRange: ['2026-04-01', '2026-06-30'], relativeDays: 30 },
|
|
validity: { type: 'fixed', fixedRange: ['2026-04-01', '2026-06-30'], relativeDays: 30 },
|
|
|
|
|
+ auditStatus: '新增待审核',
|
|
|
createTime: '2026-03-25 10:20:30',
|
|
createTime: '2026-03-25 10:20:30',
|
|
|
updateTime: '2026-03-25 10:20:30'
|
|
updateTime: '2026-03-25 10:20:30'
|
|
|
}
|
|
}
|
|
@@ -970,6 +1032,7 @@ Mock.mock(/\/api\/equity-grant-campaign\/save/, 'post', (options) => {
|
|
|
startTime: body.startTime,
|
|
startTime: body.startTime,
|
|
|
endTime: body.endTime,
|
|
endTime: body.endTime,
|
|
|
crowdList: body.crowdList || [],
|
|
crowdList: body.crowdList || [],
|
|
|
|
|
+ isAutoGrant: body.isAutoGrant || '是',
|
|
|
equityList: body.equityList || [],
|
|
equityList: body.equityList || [],
|
|
|
grantCycle: body.grantCycle || 'total',
|
|
grantCycle: body.grantCycle || 'total',
|
|
|
grantQuantity: body.grantQuantity || 1,
|
|
grantQuantity: body.grantQuantity || 1,
|
|
@@ -985,10 +1048,12 @@ Mock.mock(/\/api\/equity-grant-campaign\/save/, 'post', (options) => {
|
|
|
startTime: body.startTime,
|
|
startTime: body.startTime,
|
|
|
endTime: body.endTime,
|
|
endTime: body.endTime,
|
|
|
crowdList: body.crowdList || [],
|
|
crowdList: body.crowdList || [],
|
|
|
|
|
+ isAutoGrant: body.isAutoGrant || '是',
|
|
|
equityList: body.equityList || [],
|
|
equityList: body.equityList || [],
|
|
|
grantCycle: body.grantCycle || 'total',
|
|
grantCycle: body.grantCycle || 'total',
|
|
|
grantQuantity: body.grantQuantity || 1,
|
|
grantQuantity: body.grantQuantity || 1,
|
|
|
validity: body.validity || defaultValidity,
|
|
validity: body.validity || defaultValidity,
|
|
|
|
|
+ auditStatus: '新增待审核',
|
|
|
createTime: now,
|
|
createTime: now,
|
|
|
updateTime: now
|
|
updateTime: now
|
|
|
})
|
|
})
|
|
@@ -1003,6 +1068,99 @@ Mock.mock(/\/api\/equity-grant-campaign\/delete/, 'post', (options) => {
|
|
|
return { code: 200, data: null, msg: '删除成功' }
|
|
return { code: 200, data: null, msg: '删除成功' }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+// =============================================
|
|
|
|
|
+// 发放任务
|
|
|
|
|
+// =============================================
|
|
|
|
|
+const grantTaskList = [
|
|
|
|
|
+ {
|
|
|
|
|
+ taskId: 'T20260501001',
|
|
|
|
|
+ planName: '夏日畅享权益月',
|
|
|
|
|
+ planId: 'P000002',
|
|
|
|
|
+ taskType: '自动',
|
|
|
|
|
+ taskCycle: '2026-05-01 ~ 2026-05-31',
|
|
|
|
|
+ status: '已完成',
|
|
|
|
|
+ createTime: '2026-05-01 00:00:00',
|
|
|
|
|
+ executeTime: '2026-05-01 00:05:12',
|
|
|
|
|
+ executor: '系统'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ taskId: 'T20260401001',
|
|
|
|
|
+ planName: '春季会员尊享礼遇',
|
|
|
|
|
+ planId: 'P000001',
|
|
|
|
|
+ taskType: '手动',
|
|
|
|
|
+ taskCycle: '2026-04-01 ~ 2026-04-30',
|
|
|
|
|
+ status: '待执行',
|
|
|
|
|
+ createTime: '2026-04-01 00:00:00',
|
|
|
|
|
+ executeTime: '',
|
|
|
|
|
+ executor: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ taskId: 'T20260401002',
|
|
|
|
|
+ planName: '春季会员尊享礼遇',
|
|
|
|
|
+ planId: 'P000001',
|
|
|
|
|
+ taskType: '手动',
|
|
|
|
|
+ taskCycle: '2026-05-01 ~ 2026-05-31',
|
|
|
|
|
+ status: '执行中',
|
|
|
|
|
+ createTime: '2026-05-01 00:00:00',
|
|
|
|
|
+ executeTime: '2026-05-01 10:30:00',
|
|
|
|
|
+ executor: '张三'
|
|
|
|
|
+ }
|
|
|
|
|
+]
|
|
|
|
|
+
|
|
|
|
|
+Mock.mock(/\/api\/grant-task\/list/, 'get', (options) => {
|
|
|
|
|
+ const url = new URL(options.url, 'http://localhost')
|
|
|
|
|
+ const planName = url.searchParams.get('planName') || ''
|
|
|
|
|
+ const status = url.searchParams.get('status') || ''
|
|
|
|
|
+ let filtered = grantTaskList
|
|
|
|
|
+ if (planName) filtered = filtered.filter(t => t.planName.includes(planName))
|
|
|
|
|
+ if (status) filtered = filtered.filter(t => t.status === status)
|
|
|
|
|
+ return { code: 200, data: filtered, msg: 'ok' }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+Mock.mock(/\/api\/grant-task\/detail/, 'get', (options) => {
|
|
|
|
|
+ const url = new URL(options.url, 'http://localhost')
|
|
|
|
|
+ const taskId = url.searchParams.get('taskId') || ''
|
|
|
|
|
+ const task = grantTaskList.find(t => t.taskId === taskId)
|
|
|
|
|
+ if (!task) return { code: 404, data: null, msg: '任务不存在' }
|
|
|
|
|
+ const plan = equityGrantCampaignList.find(c => c.id === task.planId)
|
|
|
|
|
+ const cycleMap = {
|
|
|
|
|
+ 'total': '整个周期',
|
|
|
|
|
+ 'monthly': '每月',
|
|
|
|
|
+ 'quarterly': '每季度',
|
|
|
|
|
+ 'yearly': '每年'
|
|
|
|
|
+ }
|
|
|
|
|
+ const planData = {
|
|
|
|
|
+ ...task,
|
|
|
|
|
+ grantMode: plan ? plan.grantMode : 'claim',
|
|
|
|
|
+ isAutoGrant: plan ? plan.isAutoGrant : '是',
|
|
|
|
|
+ planStartTime: plan ? plan.startTime : '',
|
|
|
|
|
+ planEndTime: plan ? plan.endTime : '',
|
|
|
|
|
+ grantQuantityLabel: plan ? `${cycleMap[plan.grantCycle] || plan.grantCycle} ${plan.grantQuantity} 个` : '',
|
|
|
|
|
+ validityLabel: plan ? (plan.validity.type === 'fixed' ? (plan.validity.fixedRange.join(' 至 ')) : `自发放起 ${plan.validity.relativeDays} 天内有效`) : '',
|
|
|
|
|
+ crowdLabel: plan ? (plan.crowdList.length ? plan.crowdList.map(id => {
|
|
|
|
|
+ const crowdNames = { 'A0000120251224': '名单1' }
|
|
|
|
|
+ return crowdNames[id] ? `${crowdNames[id]} (${id})` : id
|
|
|
|
|
+ }).join('、') : '-') : '-',
|
|
|
|
|
+ equityLabel: plan ? (plan.equityList.length ? plan.equityList.map(id => {
|
|
|
|
|
+ const e = equityList.find(p => p.productId === id)
|
|
|
|
|
+ return e ? `${e.equityName} (${id})` : id
|
|
|
|
|
+ }).join('、') : '-') : '-',
|
|
|
|
|
+ smsLabel: plan ? '发放成功通用模板' : '-'
|
|
|
|
|
+ }
|
|
|
|
|
+ return { code: 200, data: planData, msg: 'ok' }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+Mock.mock(/\/api\/grant-task\/execute/, 'post', (options) => {
|
|
|
|
|
+ const body = JSON.parse(options.body)
|
|
|
|
|
+ const idx = grantTaskList.findIndex(t => t.taskId === body.taskId)
|
|
|
|
|
+ if (idx < 0) return { code: 404, data: null, msg: '任务不存在' }
|
|
|
|
|
+ if (grantTaskList[idx].status !== '待执行') return { code: 400, data: null, msg: '该任务不在待执行状态' }
|
|
|
|
|
+ grantTaskList[idx].status = '执行中'
|
|
|
|
|
+ grantTaskList[idx].executeTime = nowStr()
|
|
|
|
|
+ grantTaskList[idx].executor = '运营人员'
|
|
|
|
|
+ return { code: 200, data: null, msg: '执行成功' }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
Mock.mock(/\/api\/equity-grant-campaign\/detail/, 'get', (options) => {
|
|
Mock.mock(/\/api\/equity-grant-campaign\/detail/, 'get', (options) => {
|
|
|
const url = new URL(options.url, 'http://localhost')
|
|
const url = new URL(options.url, 'http://localhost')
|
|
|
const id = url.searchParams.get('id')
|
|
const id = url.searchParams.get('id')
|
|
@@ -1016,13 +1174,39 @@ Mock.mock(/\/api\/equity-grant-campaign\/end/, 'post', (options) => {
|
|
|
const body = JSON.parse(options.body)
|
|
const body = JSON.parse(options.body)
|
|
|
const idx = equityGrantCampaignList.findIndex(c => c.id === body.id)
|
|
const idx = equityGrantCampaignList.findIndex(c => c.id === body.id)
|
|
|
if (idx < 0) return { code: 404, data: null, msg: '发放计划不存在' }
|
|
if (idx < 0) return { code: 404, data: null, msg: '发放计划不存在' }
|
|
|
|
|
+ const cur = equityGrantCampaignList[idx]
|
|
|
|
|
+ if (cur.auditStatus !== '审核通过') return { code: 400, data: null, msg: '仅审核通过状态可提交结束审核' }
|
|
|
|
|
+ // 创建审核单并更新发放计划状态为结束待审核
|
|
|
|
|
+ const auditId = nextCampaignAuditId()
|
|
|
const now = nowStr()
|
|
const now = nowStr()
|
|
|
- equityGrantCampaignList[idx] = {
|
|
|
|
|
- ...equityGrantCampaignList[idx],
|
|
|
|
|
- endTime: now,
|
|
|
|
|
- updateTime: now
|
|
|
|
|
- }
|
|
|
|
|
- return { code: 200, data: null, msg: '已结束' }
|
|
|
|
|
|
|
+ equityGrantCampaignList[idx] = { ...cur, auditStatus: '结束待审核', updateTime: now }
|
|
|
|
|
+ campaignAuditList.unshift({
|
|
|
|
|
+ id: auditId,
|
|
|
|
|
+ auditType: 'end',
|
|
|
|
|
+ bizModuleName: '发放计划',
|
|
|
|
|
+ bizId: cur.id,
|
|
|
|
|
+ bizName: cur.name,
|
|
|
|
|
+ snapshot: {
|
|
|
|
|
+ name: cur.name,
|
|
|
|
|
+ startTime: cur.startTime,
|
|
|
|
|
+ endTime: cur.endTime,
|
|
|
|
|
+ grantMode: cur.grantMode,
|
|
|
|
|
+ crowdList: cur.crowdList || [],
|
|
|
|
|
+ equityList: cur.equityList || [],
|
|
|
|
|
+ grantCycle: cur.grantCycle,
|
|
|
|
|
+ grantQuantity: cur.grantQuantity,
|
|
|
|
|
+ validity: cur.validity,
|
|
|
|
|
+ smsTemplateId: cur.smsTemplateId || '',
|
|
|
|
|
+ smsTemplate: cur.smsTemplate || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ submitterName: body.submitterName || '运营',
|
|
|
|
|
+ submitTime: now,
|
|
|
|
|
+ auditorName: '',
|
|
|
|
|
+ auditTime: '',
|
|
|
|
|
+ auditStatus: 'pending',
|
|
|
|
|
+ auditComment: ''
|
|
|
|
|
+ })
|
|
|
|
|
+ return { code: 200, data: { auditId }, msg: '已提交结束审核' }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// =============================================
|
|
// =============================================
|
|
@@ -1205,10 +1389,10 @@ const campaignAuditList = [
|
|
|
Mock.mock(/\/api\/campaign-audit\/list/, 'get', (options) => {
|
|
Mock.mock(/\/api\/campaign-audit\/list/, 'get', (options) => {
|
|
|
const url = new URL(options.url, 'http://localhost')
|
|
const url = new URL(options.url, 'http://localhost')
|
|
|
const auditStatus = url.searchParams.get('auditStatus') || ''
|
|
const auditStatus = url.searchParams.get('auditStatus') || ''
|
|
|
- const bizName = url.searchParams.get('bizName') || ''
|
|
|
|
|
|
|
+ const bizId = url.searchParams.get('bizId') || ''
|
|
|
let filtered = campaignAuditList
|
|
let filtered = campaignAuditList
|
|
|
if (auditStatus) filtered = filtered.filter(a => a.auditStatus === auditStatus)
|
|
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 => a.bizId === bizId)
|
|
|
return { code: 200, data: filtered, msg: 'ok' }
|
|
return { code: 200, data: filtered, msg: 'ok' }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -1229,6 +1413,21 @@ Mock.mock(/\/api\/campaign-audit\/approve/, 'post', (options) => {
|
|
|
if (audit.auditStatus !== 'pending') return { code: 400, data: null, msg: '该审核单已完成' }
|
|
if (audit.auditStatus !== 'pending') return { code: 400, data: null, msg: '该审核单已完成' }
|
|
|
const now = nowStr()
|
|
const now = nowStr()
|
|
|
campaignAuditList[idx] = { ...audit, auditStatus: 'approved', auditorName: body.auditorName || '王五', auditTime: now, auditComment: body.comment || '' }
|
|
campaignAuditList[idx] = { ...audit, auditStatus: 'approved', auditorName: body.auditorName || '王五', auditTime: now, auditComment: body.comment || '' }
|
|
|
|
|
+ // 同步更新发放计划主表
|
|
|
|
|
+ const campaignIdx = equityGrantCampaignList.findIndex(c => c.id === audit.bizId)
|
|
|
|
|
+ if (campaignIdx >= 0) {
|
|
|
|
|
+ if (audit.auditType === 'new') {
|
|
|
|
|
+ equityGrantCampaignList[campaignIdx].auditStatus = '审核通过'
|
|
|
|
|
+ } else if (audit.auditType === 'end') {
|
|
|
|
|
+ // 结束审核通过:实际结束发放计划
|
|
|
|
|
+ equityGrantCampaignList[campaignIdx] = {
|
|
|
|
|
+ ...equityGrantCampaignList[campaignIdx],
|
|
|
|
|
+ endTime: now,
|
|
|
|
|
+ auditStatus: '审核通过',
|
|
|
|
|
+ updateTime: now
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return { code: 200, data: null, msg: '审核通过' }
|
|
return { code: 200, data: null, msg: '审核通过' }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -1240,6 +1439,13 @@ Mock.mock(/\/api\/campaign-audit\/reject/, 'post', (options) => {
|
|
|
if (audit.auditStatus !== 'pending') return { code: 400, data: null, msg: '该审核单已完成' }
|
|
if (audit.auditStatus !== 'pending') return { code: 400, data: null, msg: '该审核单已完成' }
|
|
|
const now = nowStr()
|
|
const now = nowStr()
|
|
|
campaignAuditList[idx] = { ...audit, auditStatus: 'rejected', auditorName: body.auditorName || '王五', auditTime: now, auditComment: body.comment || '' }
|
|
campaignAuditList[idx] = { ...audit, auditStatus: 'rejected', auditorName: body.auditorName || '王五', auditTime: now, auditComment: body.comment || '' }
|
|
|
|
|
+ // 驳回后回退发放计划审核状态为审核通过,允许重新编辑/结束
|
|
|
|
|
+ const campaignIdx = equityGrantCampaignList.findIndex(c => c.id === audit.bizId)
|
|
|
|
|
+ if (campaignIdx >= 0) equityGrantCampaignList[campaignIdx] = {
|
|
|
|
|
+ ...equityGrantCampaignList[campaignIdx],
|
|
|
|
|
+ auditStatus: '审核通过',
|
|
|
|
|
+ updateTime: now
|
|
|
|
|
+ }
|
|
|
return { code: 200, data: null, msg: '已驳回' }
|
|
return { code: 200, data: null, msg: '已驳回' }
|
|
|
})
|
|
})
|
|
|
|
|
|