价格与充值待审批就地弹抽屉;审批站内信可打开对应审批单;修复审批页开发态回车空白。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
dc3da65e1c
commit
77642cdc94
@ -214,6 +214,14 @@ export async function getSalesProductPublishSyncStatus(params: {
|
||||
OnlinePublishTime?: string | null
|
||||
pendingContentHash?: string | null
|
||||
onlineContentHash?: string | null
|
||||
approvalPending?: boolean
|
||||
ApprovalPending?: boolean
|
||||
approvalInstanceId?: number | null
|
||||
ApprovalInstanceId?: number | null
|
||||
approvalInstanceNo?: string | null
|
||||
ApprovalInstanceNo?: string | null
|
||||
approvalStatusName?: string | null
|
||||
ApprovalStatusName?: string | null
|
||||
}>(res.data)
|
||||
}
|
||||
|
||||
|
||||
1
src/components.d.ts
vendored
1
src/components.d.ts
vendored
@ -12,6 +12,7 @@ declare module 'vue' {
|
||||
AgentSideRail: typeof import('./components/agent-side-rail/index.vue')['default']
|
||||
AiAdvisorShell: typeof import('./components/NanaAssistant/AiAdvisorShell.vue')['default']
|
||||
ApiTest: typeof import('./components/ApiTest/index.vue')['default']
|
||||
ApprovalDetailDrawer: typeof import('./components/ApprovalDetailDrawer/index.vue')['default']
|
||||
BasicLayoutLeftRight: typeof import('./components/BasicLayoutLeftRight/index.vue')['default']
|
||||
Block: typeof import('./components/global-setting/block.vue')['default']
|
||||
Cascader: typeof import('./components/CascaderPro/Cascader.vue')['default']
|
||||
|
||||
1016
src/components/ApprovalDetailDrawer/index.vue
Normal file
1016
src/components/ApprovalDetailDrawer/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -1502,7 +1502,39 @@ export default {
|
||||
'system.approval.inbox.reject': 'Reject',
|
||||
'system.approval.inbox.withdraw': 'Withdraw',
|
||||
'system.approval.inbox.payload': 'Payload',
|
||||
'system.approval.inbox.basicInfo': 'Basics',
|
||||
'system.approval.inbox.bizSummary': 'Business content',
|
||||
'system.approval.inbox.noSummary': 'No business summary',
|
||||
'system.approval.inbox.rawPayload': 'View raw payload',
|
||||
'system.approval.inbox.price.description': 'Description',
|
||||
'system.approval.inbox.price.aiReport': 'AI analysis report',
|
||||
'system.approval.inbox.price.noAiReport': 'No AI report attached',
|
||||
'system.approval.inbox.price.expandReport': 'Expand full AI report',
|
||||
'system.approval.inbox.price.skippedAi': 'AI skipped',
|
||||
'system.approval.inbox.recharge.customer': 'Customer',
|
||||
'system.approval.inbox.recharge.payType': 'Payment method',
|
||||
'system.approval.inbox.recharge.serialNo': 'Serial No.',
|
||||
'system.approval.inbox.recharge.remark': 'Remark',
|
||||
'system.approval.inbox.recharge.screenshot': 'Screenshot',
|
||||
'system.approval.inbox.recharge.viewImage': 'View image',
|
||||
'system.approval.inbox.recharge.noScreenshot': 'No screenshot',
|
||||
'system.approval.inbox.noTimeline': 'No timeline yet',
|
||||
'system.approval.inbox.completedTime': 'Completed at',
|
||||
'system.approval.inbox.executedTime': 'Executed at',
|
||||
'system.approval.inbox.executeMessage': 'Execution result',
|
||||
'system.approval.inbox.copy': 'Copy',
|
||||
'system.approval.inbox.copySuccess': 'Copied',
|
||||
'system.approval.inbox.copyFailed': 'Copy failed',
|
||||
'system.approval.inbox.timeline': 'Timeline',
|
||||
'system.approval.inbox.event.submitted': 'Submitted',
|
||||
'system.approval.inbox.event.approved': 'Approved',
|
||||
'system.approval.inbox.event.rejected': 'Rejected',
|
||||
'system.approval.inbox.event.withdrawn': 'Withdrawn',
|
||||
'system.approval.inbox.event.executing': 'Executing',
|
||||
'system.approval.inbox.event.executed': 'Executed',
|
||||
'system.approval.inbox.event.executeFailed': 'Execution failed',
|
||||
'system.approval.inbox.event.rejectCompensateFailed': 'Reject compensate failed',
|
||||
'system.approval.inbox.event.withdrawCompensateFailed': 'Withdraw compensate failed',
|
||||
'system.approval.inbox.rejectPlaceholder': 'Rejection reason',
|
||||
'system.approval.inbox.rejectRequired': 'Rejection reason is required',
|
||||
'system.approval.inbox.approveConfirm': 'Approve instance {no}?',
|
||||
@ -4585,6 +4617,7 @@ export default {
|
||||
'system.announcement.actions.view': 'View',
|
||||
'system.announcement.actions.delete': 'Delete',
|
||||
'system.announcement.actions.readConfirm': 'Confirm Read',
|
||||
'system.announcement.actions.openApproval': 'Open approval',
|
||||
'system.announcement.messageType.inform': 'Inform',
|
||||
'system.announcement.messageType.message': 'Message',
|
||||
'system.announcement.messageType.notice': 'Notice',
|
||||
@ -4788,6 +4821,9 @@ export default {
|
||||
'user.recharge.deposit.message.uploadVoucherFirst': 'Please upload recharge voucher first',
|
||||
'user.recharge.deposit.message.submitFailed': 'Submit failed',
|
||||
'user.recharge.deposit.message.submitSuccess': 'Recharge application submitted, pending review',
|
||||
'user.recharge.deposit.message.pendingApproval': 'Submitted for approval ({no}); credited after approval',
|
||||
'user.recharge.deposit.message.pendingApprovalFallback': 'Submitted for approval; credited after approval',
|
||||
'user.recharge.deposit.message.bypassed': 'Recharge credited',
|
||||
|
||||
// User - Recharge Record
|
||||
'user.recharge.record.search.serialNo': 'Serial No',
|
||||
@ -4795,7 +4831,8 @@ export default {
|
||||
'user.recharge.record.search.status': 'Recharge Status',
|
||||
'user.recharge.record.search.statusPlaceholder': 'Please select',
|
||||
'user.recharge.record.search.statusAll': 'All',
|
||||
'user.recharge.record.search.statusPending': 'Pending',
|
||||
'user.recharge.record.search.statusPending': 'Pending review',
|
||||
'user.recharge.record.search.statusPendingApproval': 'Pending approval',
|
||||
'user.recharge.record.search.statusSuccess': 'Success',
|
||||
'user.recharge.record.search.statusFailed': 'Failed',
|
||||
'user.recharge.record.search.actions.search': 'Search',
|
||||
@ -4815,18 +4852,25 @@ export default {
|
||||
'user.recharge.record.message.approveError': 'Approve failed',
|
||||
'user.recharge.record.message.rejectError': 'Reject failed',
|
||||
'user.recharge.record.table.serialNo': 'Serial No',
|
||||
'user.recharge.record.table.customerCode': 'Customer Code',
|
||||
'user.recharge.record.table.customerName': 'Customer Name',
|
||||
'user.recharge.record.table.payTime': 'Recharge Time',
|
||||
'user.recharge.record.table.payType': 'Payment Method',
|
||||
'user.recharge.record.table.payAmount': 'Recharge Amount',
|
||||
'user.recharge.record.table.payImage': 'Recharge Screenshot',
|
||||
'user.recharge.record.table.viewImage': 'View',
|
||||
'user.recharge.record.table.payStatus': 'Recharge Status',
|
||||
'user.recharge.record.table.approvalNo': 'Approval No.',
|
||||
'user.recharge.record.table.auditTime': 'Audit Time',
|
||||
'user.recharge.record.table.auditBy': 'Auditor',
|
||||
'user.recharge.record.table.remarks': 'Remarks',
|
||||
'user.recharge.record.message.noPayImage': 'No screenshot available',
|
||||
'user.recharge.record.message.approvalDetailMissing': 'Approval instance missing; refresh and retry',
|
||||
'user.recharge.record.payment.alipay': 'Alipay',
|
||||
'user.recharge.record.payment.wechat': 'WeChat',
|
||||
'user.recharge.record.actions.approve': 'Approve',
|
||||
'user.recharge.record.actions.reject': 'Reject',
|
||||
'user.recharge.record.actions.viewApproval': 'View approval',
|
||||
'user.recharge.record.message.approveSuccess': 'Approved',
|
||||
'user.recharge.record.message.rejectSuccess': 'Rejected',
|
||||
'user.recharge.record.message.exportSuccess': 'Exported successfully',
|
||||
@ -5377,6 +5421,7 @@ export default {
|
||||
'channel.salesProducts.actions.publishConfig': 'Publish config',
|
||||
'channel.salesProducts.actions.publishRules': 'Publish rules',
|
||||
'channel.salesProducts.actions.publishPrice': 'Publish prices',
|
||||
'channel.salesProducts.actions.viewPriceApproval': 'View approval',
|
||||
'channel.salesProducts.actions.add': 'Add',
|
||||
'channel.salesProducts.actions.edit': 'Edit',
|
||||
'channel.salesProducts.actions.delete': 'Delete',
|
||||
@ -5469,9 +5514,12 @@ export default {
|
||||
'channel.salesProducts.publish.legend.remove': 'Removed',
|
||||
'channel.salesProducts.publish.legend.change': 'Changed',
|
||||
'channel.salesProducts.publish.legend.same': 'Unchanged',
|
||||
'channel.salesProducts.publish.badge.pending': 'Pending',
|
||||
'channel.salesProducts.publish.badge.synced': 'Synced',
|
||||
'channel.salesProducts.publish.badge.pending': 'Pending publish',
|
||||
'channel.salesProducts.publish.badge.pendingApproval': 'Pending approval',
|
||||
'channel.salesProducts.publish.badge.synced': 'Published',
|
||||
'channel.salesProducts.publish.badge.checking': 'Checking…',
|
||||
'channel.salesProducts.publish.approvalNo': 'Approval No. {no}',
|
||||
'channel.salesProducts.publish.approvalDetailMissing': 'Approval instance missing; refresh and retry',
|
||||
|
||||
'channel.salesProducts.rules.schemeTitle': 'Shipping scheme',
|
||||
'channel.salesProducts.rules.scheme.costLowest': 'Lowest cost',
|
||||
|
||||
@ -1493,7 +1493,39 @@ export default {
|
||||
'system.approval.inbox.reject': '驳回',
|
||||
'system.approval.inbox.withdraw': '撤回',
|
||||
'system.approval.inbox.payload': '业务载荷',
|
||||
'system.approval.inbox.timeline': '事件时间线',
|
||||
'system.approval.inbox.basicInfo': '基本信息',
|
||||
'system.approval.inbox.bizSummary': '业务内容',
|
||||
'system.approval.inbox.noSummary': '暂无业务摘要',
|
||||
'system.approval.inbox.rawPayload': '查看原始载荷',
|
||||
'system.approval.inbox.price.description': '发布说明',
|
||||
'system.approval.inbox.price.aiReport': 'AI 分析报告',
|
||||
'system.approval.inbox.price.noAiReport': '提交时未附带 AI 报告',
|
||||
'system.approval.inbox.price.expandReport': '展开完整 AI 报告',
|
||||
'system.approval.inbox.price.skippedAi': '已跳过 AI',
|
||||
'system.approval.inbox.recharge.customer': '客户',
|
||||
'system.approval.inbox.recharge.payType': '支付方式',
|
||||
'system.approval.inbox.recharge.serialNo': '流水号',
|
||||
'system.approval.inbox.recharge.remark': '备注',
|
||||
'system.approval.inbox.recharge.screenshot': '充值截图',
|
||||
'system.approval.inbox.recharge.viewImage': '查看大图',
|
||||
'system.approval.inbox.recharge.noScreenshot': '未上传截图',
|
||||
'system.approval.inbox.noTimeline': '暂无流转记录',
|
||||
'system.approval.inbox.completedTime': '完成时间',
|
||||
'system.approval.inbox.executedTime': '执行时间',
|
||||
'system.approval.inbox.executeMessage': '执行结果',
|
||||
'system.approval.inbox.copy': '复制',
|
||||
'system.approval.inbox.copySuccess': '单号已复制',
|
||||
'system.approval.inbox.copyFailed': '复制失败',
|
||||
'system.approval.inbox.timeline': '审批流转',
|
||||
'system.approval.inbox.event.submitted': '已提交',
|
||||
'system.approval.inbox.event.approved': '已通过',
|
||||
'system.approval.inbox.event.rejected': '已驳回',
|
||||
'system.approval.inbox.event.withdrawn': '已撤回',
|
||||
'system.approval.inbox.event.executing': '执行中',
|
||||
'system.approval.inbox.event.executed': '执行成功',
|
||||
'system.approval.inbox.event.executeFailed': '执行失败',
|
||||
'system.approval.inbox.event.rejectCompensateFailed': '驳回补偿失败',
|
||||
'system.approval.inbox.event.withdrawCompensateFailed': '撤回补偿失败',
|
||||
'system.approval.inbox.rejectPlaceholder': '请填写驳回意见',
|
||||
'system.approval.inbox.rejectRequired': '驳回意见不能为空',
|
||||
'system.approval.inbox.approveConfirm': '确认通过审批单 {no}?',
|
||||
@ -4607,6 +4639,7 @@ export default {
|
||||
'system.announcement.actions.view': '查看',
|
||||
'system.announcement.actions.delete': '删除',
|
||||
'system.announcement.actions.readConfirm': '确认已读',
|
||||
'system.announcement.actions.openApproval': '打开审批单',
|
||||
'system.announcement.messageType.inform': '通知',
|
||||
'system.announcement.messageType.message': '消息',
|
||||
'system.announcement.messageType.notice': '公告',
|
||||
@ -4810,6 +4843,9 @@ export default {
|
||||
'user.recharge.deposit.message.uploadVoucherFirst': '请先上传充值凭证',
|
||||
'user.recharge.deposit.message.submitFailed': '提交失败',
|
||||
'user.recharge.deposit.message.submitSuccess': '充值申请已提交,请等待审核',
|
||||
'user.recharge.deposit.message.pendingApproval': '已提交审批({no}),通过后入账',
|
||||
'user.recharge.deposit.message.pendingApprovalFallback': '已提交审批,通过后入账',
|
||||
'user.recharge.deposit.message.bypassed': '充值已入账',
|
||||
|
||||
// 用户 - 充值记录
|
||||
'user.recharge.record.search.serialNo': '流水号',
|
||||
@ -4818,6 +4854,7 @@ export default {
|
||||
'user.recharge.record.search.statusPlaceholder': '请选择',
|
||||
'user.recharge.record.search.statusAll': '全部',
|
||||
'user.recharge.record.search.statusPending': '待审核',
|
||||
'user.recharge.record.search.statusPendingApproval': '待审批',
|
||||
'user.recharge.record.search.statusSuccess': '成功',
|
||||
'user.recharge.record.search.statusFailed': '失败',
|
||||
'user.recharge.record.search.actions.search': '搜索',
|
||||
@ -4837,18 +4874,25 @@ export default {
|
||||
'user.recharge.record.message.approveError': '审核失败',
|
||||
'user.recharge.record.message.rejectError': '拒绝失败',
|
||||
'user.recharge.record.table.serialNo': '流水号',
|
||||
'user.recharge.record.table.customerCode': '客户编码',
|
||||
'user.recharge.record.table.customerName': '客户名称',
|
||||
'user.recharge.record.table.payTime': '充值时间',
|
||||
'user.recharge.record.table.payType': '支付方式',
|
||||
'user.recharge.record.table.payAmount': '充值金额',
|
||||
'user.recharge.record.table.payImage': '充值截图',
|
||||
'user.recharge.record.table.viewImage': '查看',
|
||||
'user.recharge.record.table.payStatus': '充值状态',
|
||||
'user.recharge.record.table.approvalNo': '审批号',
|
||||
'user.recharge.record.table.auditTime': '审核时间',
|
||||
'user.recharge.record.table.auditBy': '审核人',
|
||||
'user.recharge.record.table.remarks': '备注',
|
||||
'user.recharge.record.message.noPayImage': '暂无充值截图',
|
||||
'user.recharge.record.message.approvalDetailMissing': '暂无审批单,请刷新后重试',
|
||||
'user.recharge.record.payment.alipay': '支付宝',
|
||||
'user.recharge.record.payment.wechat': '微信',
|
||||
'user.recharge.record.actions.approve': '通过',
|
||||
'user.recharge.record.actions.reject': '拒绝',
|
||||
'user.recharge.record.actions.viewApproval': '查看审批',
|
||||
'user.recharge.record.message.approveSuccess': '已通过',
|
||||
'user.recharge.record.message.rejectSuccess': '已拒绝',
|
||||
'user.recharge.record.message.exportSuccess': '导出成功',
|
||||
@ -5400,6 +5444,7 @@ export default {
|
||||
'channel.salesProducts.actions.publishConfig': '发布配置',
|
||||
'channel.salesProducts.actions.publishRules': '发布规则',
|
||||
'channel.salesProducts.actions.publishPrice': '价格发布',
|
||||
'channel.salesProducts.actions.viewPriceApproval': '查看审批',
|
||||
'channel.salesProducts.actions.add': '新增',
|
||||
'channel.salesProducts.actions.edit': '编辑',
|
||||
'channel.salesProducts.actions.delete': '删除',
|
||||
@ -5493,8 +5538,11 @@ export default {
|
||||
'channel.salesProducts.publish.legend.change': '修改',
|
||||
'channel.salesProducts.publish.legend.same': '不变',
|
||||
'channel.salesProducts.publish.badge.pending': '待发布',
|
||||
'channel.salesProducts.publish.badge.synced': '已同步',
|
||||
'channel.salesProducts.publish.badge.pendingApproval': '待审批',
|
||||
'channel.salesProducts.publish.badge.synced': '已发布',
|
||||
'channel.salesProducts.publish.badge.checking': '检测中…',
|
||||
'channel.salesProducts.publish.approvalNo': '审批号 {no}',
|
||||
'channel.salesProducts.publish.approvalDetailMissing': '暂无审批单,请刷新后重试',
|
||||
|
||||
'channel.salesProducts.rules.schemeTitle': '排货方案',
|
||||
'channel.salesProducts.rules.scheme.costLowest': '成本最低',
|
||||
|
||||
47
src/utils/approvalNoticeLink.ts
Normal file
47
src/utils/approvalNoticeLink.ts
Normal file
@ -0,0 +1,47 @@
|
||||
/** 审批站内信深链标记,例:[OMS_APPROVAL:id=12&tab=todo] */
|
||||
|
||||
export type ApprovalNoticeTab = 'todo' | 'submitted'
|
||||
|
||||
export type ApprovalNoticeLink = {
|
||||
instanceId: number
|
||||
tab: ApprovalNoticeTab
|
||||
}
|
||||
|
||||
const MARKER_RE = /\[OMS_APPROVAL:([^\]]+)\]/i
|
||||
|
||||
export function buildApprovalNoticeMarker(
|
||||
instanceId: number,
|
||||
tab: ApprovalNoticeTab = 'todo',
|
||||
): string {
|
||||
return `[OMS_APPROVAL:id=${instanceId}&tab=${tab}]`
|
||||
}
|
||||
|
||||
export function parseApprovalNoticeLink(content?: string | null): ApprovalNoticeLink | null {
|
||||
const text = String(content || '')
|
||||
const match = text.match(MARKER_RE)
|
||||
if (!match?.[1]) return null
|
||||
const params = new URLSearchParams(match[1].replace(/;/g, '&'))
|
||||
const id = Number(params.get('id') || 0)
|
||||
if (!Number.isFinite(id) || id <= 0) return null
|
||||
const tabRaw = String(params.get('tab') || 'todo').trim()
|
||||
const tab: ApprovalNoticeTab = tabRaw === 'submitted' ? 'submitted' : 'todo'
|
||||
return { instanceId: id, tab }
|
||||
}
|
||||
|
||||
/** 展示给用户时去掉机器标记 */
|
||||
export function stripApprovalNoticeMarker(content?: string | null): string {
|
||||
return String(content || '')
|
||||
.replace(MARKER_RE, '')
|
||||
.replace(/\n{3,}/g, '\n\n')
|
||||
.trim()
|
||||
}
|
||||
|
||||
export function buildApprovalInboxLocation(link: ApprovalNoticeLink) {
|
||||
return {
|
||||
path: '/system/approval/inbox',
|
||||
query: {
|
||||
tab: link.tab,
|
||||
instanceId: String(link.instanceId),
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -52,6 +52,7 @@
|
||||
import PricePublishAiAssistDrawer from './components/PricePublishAiAssistDrawer.vue';
|
||||
import type { PricePublishAiAdoptPayload } from './components/PricePublishAiAssistDrawer.vue';
|
||||
import BillingSimulateDrawer from './components/BillingSimulateDrawer.vue';
|
||||
import ApprovalDetailDrawer from '@/components/ApprovalDetailDrawer/index.vue';
|
||||
import { buildPricePublishAiSkipReport, type PricePublishRiskLevel } from './pricePublishAiSkill';
|
||||
import { pickResolvedAudit } from '@/utils/auditFields';
|
||||
import { useUserStore } from '@/store';
|
||||
@ -1452,12 +1453,15 @@
|
||||
return detail?.content ?? detail?.Content ?? null;
|
||||
}
|
||||
|
||||
/** 仅展示后端 sync-status.pending,前端不做快照 diff */
|
||||
/** 同步态:待发布 / 待审批(+审批号) / 已发布 */
|
||||
async function refreshPricePublishSyncStatus(productId?: number) {
|
||||
const pid = productId ?? selectedProduct.value;
|
||||
if (pid == null) {
|
||||
pricePublishChecking.value = false;
|
||||
pricePublishPending.value = null;
|
||||
priceApprovalPending.value = false;
|
||||
priceApprovalInstanceId.value = null;
|
||||
priceApprovalInstanceNo.value = '';
|
||||
return;
|
||||
}
|
||||
const seq = priceTabLoadSeq;
|
||||
@ -1470,13 +1474,46 @@
|
||||
if (seq !== priceTabLoadSeq || selectedProduct.value !== pid) return;
|
||||
const pending = status?.pending ?? status?.Pending;
|
||||
pricePublishPending.value = typeof pending === 'boolean' ? pending : null;
|
||||
const approvalPending = Boolean(
|
||||
status?.approvalPending ?? status?.ApprovalPending,
|
||||
);
|
||||
priceApprovalPending.value = approvalPending;
|
||||
const instanceId =
|
||||
status?.approvalInstanceId ?? status?.ApprovalInstanceId ?? null;
|
||||
priceApprovalInstanceId.value =
|
||||
typeof instanceId === 'number' && instanceId > 0 ? instanceId : null;
|
||||
priceApprovalInstanceNo.value = String(
|
||||
status?.approvalInstanceNo ?? status?.ApprovalInstanceNo ?? '',
|
||||
).trim();
|
||||
} catch {
|
||||
if (seq === priceTabLoadSeq) pricePublishPending.value = null;
|
||||
if (seq === priceTabLoadSeq) {
|
||||
pricePublishPending.value = null;
|
||||
priceApprovalPending.value = false;
|
||||
priceApprovalInstanceId.value = null;
|
||||
priceApprovalInstanceNo.value = '';
|
||||
}
|
||||
} finally {
|
||||
if (seq === priceTabLoadSeq) pricePublishChecking.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const priceApprovalDrawerVisible = ref(false);
|
||||
|
||||
function openPriceApprovalDrawer() {
|
||||
if (!priceApprovalInstanceId.value) {
|
||||
Message.warning(t('channel.salesProducts.publish.approvalDetailMissing'));
|
||||
return;
|
||||
}
|
||||
priceApprovalDrawerVisible.value = true;
|
||||
}
|
||||
|
||||
async function onPriceApprovalChanged() {
|
||||
const pid = selectedProduct.value;
|
||||
if (pid == null) return;
|
||||
await refreshPricePublishSyncStatus(pid);
|
||||
await loadPriceTabData(pid, { force: true });
|
||||
}
|
||||
|
||||
let recordsTabLoadedProductId: number | null = null;
|
||||
let recordsLoadSeq = 0;
|
||||
let publishContentSeq = 0;
|
||||
@ -1635,12 +1672,18 @@
|
||||
priceTabLoadedProductId = null;
|
||||
pricePublishPending.value = null;
|
||||
pricePublishChecking.value = false;
|
||||
priceApprovalPending.value = false;
|
||||
priceApprovalInstanceId.value = null;
|
||||
priceApprovalInstanceNo.value = '';
|
||||
effectiveVersion.value = '--';
|
||||
effectiveTime.value = '--';
|
||||
} else if (activeTab.value === 'price') {
|
||||
// 切到卖价 tab / 换产品:先清空徽章,等 sync-status 回来再显示
|
||||
pricePublishPending.value = null;
|
||||
pricePublishChecking.value = false;
|
||||
priceApprovalPending.value = false;
|
||||
priceApprovalInstanceId.value = null;
|
||||
priceApprovalInstanceNo.value = '';
|
||||
}
|
||||
if (productChanged && activeTab.value !== 'rules') {
|
||||
rulesTabLoadedProductId = null;
|
||||
@ -1907,6 +1950,9 @@
|
||||
const publishDiffRows = ref<SnapshotDiffRow[]>([]);
|
||||
const pricePublishPending = ref<boolean | null>(null);
|
||||
const pricePublishChecking = ref(false);
|
||||
const priceApprovalPending = ref(false);
|
||||
const priceApprovalInstanceId = ref<number | null>(null);
|
||||
const priceApprovalInstanceNo = ref('');
|
||||
|
||||
const publishDiffStatus = computed(() => {
|
||||
if (!publishHasOnlineSnapshot.value) return 'first';
|
||||
@ -2332,6 +2378,14 @@
|
||||
? t('channel.salesProducts.publish.pendingApproval', { no: approvalNo })
|
||||
: t('channel.salesProducts.publish.pendingApprovalFallback'),
|
||||
);
|
||||
if (operatorType === 'price') {
|
||||
priceApprovalPending.value = true;
|
||||
priceApprovalInstanceNo.value = approvalNo;
|
||||
const approvalId =
|
||||
publishResult?.approvalInstanceId ?? publishResult?.ApprovalInstanceId ?? null;
|
||||
priceApprovalInstanceId.value =
|
||||
typeof approvalId === 'number' && approvalId > 0 ? approvalId : null;
|
||||
}
|
||||
} else {
|
||||
Message.success(t('channel.salesProducts.publish.success'));
|
||||
}
|
||||
@ -2348,14 +2402,12 @@
|
||||
publishConfirmDate.value = dayjs();
|
||||
clearPricePublishAiReport();
|
||||
publishModalMethods.closeModal();
|
||||
if (decision !== 'PendingApproval') {
|
||||
if (operatorType === 'price') {
|
||||
await loadRecordsTabData(pid, true);
|
||||
await loadPriceTabData(pid, { force: true });
|
||||
await refreshPricePublishSyncStatus(pid);
|
||||
} else if (decision !== 'PendingApproval') {
|
||||
await loadRecordsTabData(pid, true);
|
||||
if (operatorType === 'price') {
|
||||
// 不乐观改徽章;等后端 sync-status 重算
|
||||
pricePublishPending.value = null;
|
||||
await loadPriceTabData(pid, { force: true });
|
||||
await refreshPricePublishSyncStatus(pid);
|
||||
}
|
||||
}
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || t('channel.salesProducts.publish.fail'));
|
||||
@ -4530,6 +4582,15 @@
|
||||
<div v-else-if="selectedProduct != null && activeTab === 'price'" class="tabs-toolbar">
|
||||
<a-space :size="8">
|
||||
<a-button
|
||||
v-if="priceApprovalPending"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="openPriceApprovalDrawer"
|
||||
>
|
||||
{{ t('channel.salesProducts.actions.viewPriceApproval') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
v-else
|
||||
type="primary"
|
||||
size="small"
|
||||
:loading="publishModalLoading"
|
||||
@ -4602,13 +4663,25 @@
|
||||
{{ t('channel.salesProducts.price.effectiveVersion', { version: effectiveVersion }) }}
|
||||
<span style="margin-left: 16px; color: var(--color-text-3);">生效时间:{{ effectiveTime }}</span>
|
||||
<a-tag
|
||||
v-if="pricePublishChecking && pricePublishPending == null"
|
||||
v-if="pricePublishChecking && pricePublishPending == null && !priceApprovalPending"
|
||||
color="gray"
|
||||
size="small"
|
||||
class="price-sync-tag"
|
||||
>
|
||||
{{ t('channel.salesProducts.publish.badge.checking') }}
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-else-if="priceApprovalPending"
|
||||
color="arcoblue"
|
||||
size="small"
|
||||
class="price-sync-tag price-approval-tag"
|
||||
@click="openPriceApprovalDrawer"
|
||||
>
|
||||
{{ t('channel.salesProducts.publish.badge.pendingApproval') }}
|
||||
<template v-if="priceApprovalInstanceNo">
|
||||
· {{ priceApprovalInstanceNo }}
|
||||
</template>
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-else-if="pricePublishPending === true"
|
||||
color="orangered"
|
||||
@ -6266,6 +6339,12 @@
|
||||
</a-spin>
|
||||
</ModalPro>
|
||||
|
||||
<ApprovalDetailDrawer
|
||||
v-model:visible="priceApprovalDrawerVisible"
|
||||
:instance-id="priceApprovalInstanceId"
|
||||
@changed="onPriceApprovalChanged"
|
||||
/>
|
||||
|
||||
<PricePublishAiAssistDrawer
|
||||
v-model:visible="pricePublishAiVisible"
|
||||
:product-name="formData.productName || selectedProductContext?.productName"
|
||||
@ -6696,6 +6775,10 @@
|
||||
margin-left: 12px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.price-approval-tag {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.price-header-actions {
|
||||
|
||||
@ -118,6 +118,12 @@
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
<ApprovalDetailDrawer
|
||||
v-model:visible="approvalDrawerVisible"
|
||||
:instance-id="approvalDrawerInstanceId"
|
||||
@changed="loadList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -129,6 +135,7 @@ import { useI18n } from 'vue-i18n'
|
||||
import { Message, Modal } from '@arco-design/web-vue'
|
||||
import HandsontablePro from '@/components/HandsontablePro/index.vue'
|
||||
import PaginationPro from '@/components/PaginationPro/index.vue'
|
||||
import ApprovalDetailDrawer from '@/components/ApprovalDetailDrawer/index.vue'
|
||||
import { useTableContainerHeight } from '@/composables/useTableContainerHeight'
|
||||
import dayjs from 'dayjs'
|
||||
import zfbIcon from '@/assets/zfb.png'
|
||||
@ -147,17 +154,26 @@ defineOptions({
|
||||
|
||||
const { t } = useI18n()
|
||||
const { tableContainerRef, tableHeight } = useTableContainerHeight()
|
||||
const approvalDrawerVisible = ref(false)
|
||||
const approvalDrawerInstanceId = ref<number | null>(null)
|
||||
const handsontableHeight = computed(() => Math.max(tableHeight.value || 0, 400))
|
||||
|
||||
interface RechargeRecord {
|
||||
id?: number | string
|
||||
serialNo: string
|
||||
customerCode: string
|
||||
customerName: string
|
||||
payTime: string
|
||||
payType: string
|
||||
payAmount: number
|
||||
payImage?: string
|
||||
payStatus: string
|
||||
remarks?: string
|
||||
auditTime: string
|
||||
auditBy: string
|
||||
approvalPending: boolean
|
||||
approvalInstanceId: number | null
|
||||
approvalInstanceNo: string
|
||||
}
|
||||
|
||||
/** 无截图占位(提交时写 "0");GetPublicUrl("0") 也会返回空串 */
|
||||
@ -169,18 +185,31 @@ function resolvePayImageUrl(raw: unknown): string | undefined {
|
||||
}
|
||||
|
||||
function mapRow(item: any): RechargeRecord {
|
||||
const pt = Number(item.payType)
|
||||
const pt = Number(item.payType ?? item.PayType)
|
||||
// 接口约定:1-微信 2-支付宝
|
||||
const payType = pt === 2 ? 'zfb' : 'wx'
|
||||
const auditTimeRaw = item.auditTime ?? item.AuditTime
|
||||
const approvalPending = Boolean(item.approvalPending ?? item.ApprovalPending)
|
||||
const approvalId = item.approvalInstanceId ?? item.ApprovalInstanceId ?? null
|
||||
return {
|
||||
id: item.id,
|
||||
serialNo: item.serialNumber ?? '',
|
||||
payTime: item.rechargeTime ?? '',
|
||||
id: item.id ?? item.Id,
|
||||
serialNo: item.serialNumber ?? item.SerialNumber ?? '',
|
||||
customerCode: item.customerCode ?? item.CustomerCode ?? '',
|
||||
customerName: item.customerName ?? item.CustomerName ?? '',
|
||||
payTime: item.rechargeTime ?? item.RechargeTime ?? '',
|
||||
payType,
|
||||
payAmount: item.rechargeAmount ?? 0,
|
||||
payAmount: item.rechargeAmount ?? item.RechargeAmount ?? 0,
|
||||
payImage: resolvePayImageUrl(item.rechargeScreenshot ?? item.RechargeScreenshot),
|
||||
payStatus: String(item.rechargeStatus ?? ''),
|
||||
remarks: item.remark ?? '',
|
||||
payStatus: String(item.rechargeStatus ?? item.RechargeStatus ?? ''),
|
||||
remarks: item.remark ?? item.Remark ?? '',
|
||||
auditTime: auditTimeRaw ? dayjs(auditTimeRaw).format('YYYY-MM-DD HH:mm:ss') : '',
|
||||
auditBy: item.auditBy ?? item.AuditBy ?? '',
|
||||
approvalPending,
|
||||
approvalInstanceId:
|
||||
typeof approvalId === 'number' && approvalId > 0 ? approvalId : null,
|
||||
approvalInstanceNo: String(
|
||||
item.approvalInstanceNo ?? item.ApprovalInstanceNo ?? '',
|
||||
).trim(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -284,11 +313,16 @@ onMounted(() => {
|
||||
|
||||
const hotColumns = computed(() => [
|
||||
{ key: 'serialNo', label: t('user.recharge.record.table.serialNo'), width: 180 },
|
||||
{ key: 'customerCode', label: t('user.recharge.record.table.customerCode'), width: 120 },
|
||||
{ key: 'customerName', label: t('user.recharge.record.table.customerName'), width: 140 },
|
||||
{ key: 'payTime', label: t('user.recharge.record.table.payTime'), width: 180 },
|
||||
{ key: 'payType', label: t('user.recharge.record.table.payType'), width: 120 },
|
||||
{ key: 'payAmount', label: t('user.recharge.record.table.payAmount'), width: 120 },
|
||||
{ key: 'payImage', label: t('user.recharge.record.table.payImage'), width: 120 },
|
||||
{ key: 'payStatus', label: t('user.recharge.record.table.payStatus'), width: 100 },
|
||||
{ key: 'approvalInstanceNo', label: t('user.recharge.record.table.approvalNo'), width: 160 },
|
||||
{ key: 'auditTime', label: t('user.recharge.record.table.auditTime'), width: 180 },
|
||||
{ key: 'auditBy', label: t('user.recharge.record.table.auditBy'), width: 120 },
|
||||
{ key: 'remarks', label: t('user.recharge.record.table.remarks'), width: 150 },
|
||||
])
|
||||
|
||||
@ -317,6 +351,9 @@ function customCellRenderer(row: number, col: number, value: any, rowData: any):
|
||||
}
|
||||
if (colKey === 'payStatus') {
|
||||
const status = rowData?.payStatus
|
||||
if (status === '1' && rowData?.approvalPending) {
|
||||
return buildStatusTagHtml(t('user.recharge.record.search.statusPendingApproval'), 'brand')
|
||||
}
|
||||
if (status === '1') {
|
||||
return buildStatusTagHtml(t('user.recharge.record.search.statusPending'), 'wait')
|
||||
}
|
||||
@ -328,14 +365,34 @@ function customCellRenderer(row: number, col: number, value: any, rowData: any):
|
||||
}
|
||||
return '--'
|
||||
}
|
||||
if (colKey === 'approvalInstanceNo') {
|
||||
const no = String(rowData?.approvalInstanceNo || '').trim()
|
||||
if (!no) return '--'
|
||||
return `<span data-role="view-recharge-approval" data-row-index="${row}" style="color:var(--app-primary-color);cursor:pointer;">${no}</span>`
|
||||
}
|
||||
if (colKey === 'remarks') {
|
||||
return value ? `<span style="color:${getEmphasisTextColor('wait')};">${value}</span>` : null
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
function openRechargeApprovalDrawer(row?: RechargeRecord | null) {
|
||||
const id = row?.approvalInstanceId
|
||||
if (!id) {
|
||||
Message.warning(t('user.recharge.record.message.approvalDetailMissing'))
|
||||
return
|
||||
}
|
||||
approvalDrawerInstanceId.value = id
|
||||
approvalDrawerVisible.value = true
|
||||
}
|
||||
|
||||
function actionRenderer(row: any, _rowIndex: number): string {
|
||||
if (String(row?.payStatus) !== '1') return ''
|
||||
if (row?.approvalPending) {
|
||||
return wrapWarehouseActions([
|
||||
renderWarehouseActionBtn('viewApproval', t('user.recharge.record.actions.viewApproval')),
|
||||
])
|
||||
}
|
||||
return wrapWarehouseActions([
|
||||
renderWarehouseActionBtn('approve', t('user.recharge.record.actions.approve')),
|
||||
renderWarehouseActionBtn('reject', t('user.recharge.record.actions.reject')),
|
||||
@ -344,6 +401,10 @@ function actionRenderer(row: any, _rowIndex: number): string {
|
||||
|
||||
async function handleActionClick(row: any, _rowIndex: number, action?: string) {
|
||||
if (!row?.id) return
|
||||
if (action === 'viewApproval') {
|
||||
openRechargeApprovalDrawer(row)
|
||||
return
|
||||
}
|
||||
if (action === 'approve') {
|
||||
Modal.confirm({
|
||||
title: t('user.recharge.record.modal.approveConfirmTitle'),
|
||||
@ -391,6 +452,18 @@ async function handleRejectSubmit() {
|
||||
}
|
||||
|
||||
function handleViewPayImageClick(event: MouseEvent) {
|
||||
const approvalTrigger = (event.target as HTMLElement | null)?.closest?.(
|
||||
'[data-role="view-recharge-approval"]',
|
||||
)
|
||||
if (approvalTrigger) {
|
||||
const rowIndex = Number(approvalTrigger.getAttribute('data-row-index'))
|
||||
const row = Number.isFinite(rowIndex) ? tableRows.value[rowIndex] : null
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
openRechargeApprovalDrawer(row)
|
||||
return
|
||||
}
|
||||
|
||||
const trigger = (event.target as HTMLElement | null)?.closest?.('[data-role="view-pay-image"]')
|
||||
if (!trigger) return
|
||||
const rowIndex = Number(trigger.getAttribute('data-row-index'))
|
||||
|
||||
@ -43,12 +43,15 @@ export default {
|
||||
'h5Admin.recharge.loadMore': 'Load more',
|
||||
'h5Admin.recharge.loadFailed': 'Failed to load',
|
||||
'h5Admin.recharge.tab.pending': 'Pending',
|
||||
'h5Admin.recharge.tab.pendingApproval': 'Pending approval',
|
||||
'h5Admin.recharge.tab.all': 'All',
|
||||
'h5Admin.recharge.tab.success': 'Approved',
|
||||
'h5Admin.recharge.tab.failed': 'Rejected',
|
||||
'h5Admin.recharge.customer': 'Customer',
|
||||
'h5Admin.recharge.serialNo': 'Serial No.',
|
||||
'h5Admin.recharge.time': 'Time',
|
||||
'h5Admin.recharge.approvalNo': 'Approval No.',
|
||||
'h5Admin.recharge.approvalTip': 'In approval flow — handle it in PC Approval Inbox',
|
||||
'h5Admin.recharge.remark': 'Remark',
|
||||
'h5Admin.recharge.viewImage': 'Screenshot',
|
||||
'h5Admin.recharge.approve': 'Approve',
|
||||
|
||||
@ -43,12 +43,15 @@ export default {
|
||||
'h5Admin.recharge.loadMore': '加载更多',
|
||||
'h5Admin.recharge.loadFailed': '加载失败',
|
||||
'h5Admin.recharge.tab.pending': '待审核',
|
||||
'h5Admin.recharge.tab.pendingApproval': '待审批',
|
||||
'h5Admin.recharge.tab.all': '全部',
|
||||
'h5Admin.recharge.tab.success': '已通过',
|
||||
'h5Admin.recharge.tab.failed': '已驳回',
|
||||
'h5Admin.recharge.customer': '客户',
|
||||
'h5Admin.recharge.serialNo': '流水号',
|
||||
'h5Admin.recharge.time': '时间',
|
||||
'h5Admin.recharge.approvalNo': '审批号',
|
||||
'h5Admin.recharge.approvalTip': '已进入审批流,请到 PC「审批待办」处理',
|
||||
'h5Admin.recharge.remark': '备注',
|
||||
'h5Admin.recharge.viewImage': '查看截图',
|
||||
'h5Admin.recharge.approve': '通过',
|
||||
|
||||
@ -67,8 +67,8 @@
|
||||
<div class="h5-ar__card-top">
|
||||
<div class="h5-ar__card-main">
|
||||
<strong class="h5-ar__amount">¥{{ formatAmount(row.payAmount) }}</strong>
|
||||
<span class="h5-ar__status" :class="`is-${statusTone(row.payStatus)}`">
|
||||
{{ statusLabel(row.payStatus) }}
|
||||
<span class="h5-ar__status" :class="`is-${statusTone(row.payStatus, row.approvalPending)}`">
|
||||
{{ statusLabel(row.payStatus, row.approvalPending) }}
|
||||
</span>
|
||||
</div>
|
||||
<span class="h5-ar__pay">
|
||||
@ -90,6 +90,10 @@
|
||||
<span>{{ t('h5Admin.recharge.time') }}</span>
|
||||
{{ formatTime(row.payTime) }}
|
||||
</p>
|
||||
<p v-if="row.approvalInstanceNo">
|
||||
<span>{{ t('h5Admin.recharge.approvalNo') }}</span>
|
||||
{{ row.approvalInstanceNo }}
|
||||
</p>
|
||||
<p v-if="row.remarks">
|
||||
<span>{{ t('h5Admin.recharge.remark') }}</span>
|
||||
{{ row.remarks }}
|
||||
@ -105,7 +109,10 @@
|
||||
>
|
||||
{{ t('h5Admin.recharge.viewImage') }}
|
||||
</button>
|
||||
<template v-if="row.payStatus === '1'">
|
||||
<p v-if="row.payStatus === '1' && row.approvalPending" class="h5-ar__approval-tip">
|
||||
{{ t('h5Admin.recharge.approvalTip') }}
|
||||
</p>
|
||||
<template v-else-if="row.payStatus === '1'">
|
||||
<button
|
||||
type="button"
|
||||
class="h5-ar__btn is-danger"
|
||||
@ -199,6 +206,8 @@ interface RechargeRow {
|
||||
customerId?: number | string;
|
||||
customerCode?: string;
|
||||
customerPhone?: string;
|
||||
approvalPending?: boolean;
|
||||
approvalInstanceNo?: string;
|
||||
}
|
||||
|
||||
const { t } = useI18n();
|
||||
@ -249,6 +258,9 @@ function mapRow(item: any): RechargeRow {
|
||||
customerId: item.customerId ?? item.CustomerId,
|
||||
customerCode: String(item.customerCode ?? item.CustomerCode ?? '') || undefined,
|
||||
customerPhone: String(item.customerPhone ?? item.CustomerPhone ?? '') || undefined,
|
||||
approvalPending: Boolean(item.approvalPending ?? item.ApprovalPending),
|
||||
approvalInstanceNo:
|
||||
String(item.approvalInstanceNo ?? item.ApprovalInstanceNo ?? '').trim() || undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@ -262,14 +274,16 @@ function formatTime(v?: string) {
|
||||
return d.isValid() ? d.format('YYYY-MM-DD HH:mm') : String(v);
|
||||
}
|
||||
|
||||
function statusLabel(code: string) {
|
||||
function statusLabel(code: string, approvalPending?: boolean) {
|
||||
if (code === '1' && approvalPending) return t('h5Admin.recharge.tab.pendingApproval');
|
||||
if (code === '1') return t('h5Admin.recharge.tab.pending');
|
||||
if (code === '2') return t('h5Admin.recharge.tab.success');
|
||||
if (code === '3') return t('h5Admin.recharge.tab.failed');
|
||||
return code || '—';
|
||||
}
|
||||
|
||||
function statusTone(code: string) {
|
||||
function statusTone(code: string, approvalPending?: boolean) {
|
||||
if (code === '1' && approvalPending) return 'brand';
|
||||
if (code === '1') return 'wait';
|
||||
if (code === '2') return 'ok';
|
||||
if (code === '3') return 'fail';
|
||||
@ -613,6 +627,11 @@ onMounted(() => {
|
||||
background: #fff7e8;
|
||||
}
|
||||
|
||||
&.is-brand {
|
||||
color: var(--app-primary-color, #1d7281);
|
||||
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 12%, #fff);
|
||||
}
|
||||
|
||||
&.is-ok {
|
||||
color: #00b42a;
|
||||
background: #e8ffea;
|
||||
@ -668,6 +687,17 @@ onMounted(() => {
|
||||
gap: 8px;
|
||||
justify-content: flex-end;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.h5-ar__approval-tip {
|
||||
margin: 0;
|
||||
flex: 1;
|
||||
min-width: 160px;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
color: var(--h5-text-3, #86909c);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.h5-ar__btn {
|
||||
|
||||
@ -229,12 +229,26 @@ async function submit() {
|
||||
}
|
||||
submitting.value = true;
|
||||
try {
|
||||
await submitRechargeApplication({
|
||||
const result: any = await submitRechargeApplication({
|
||||
rechargeAmount: Number(finalAmount.value),
|
||||
payType: payType.value === 'zfb' ? 2 : 1,
|
||||
screenshotFile: screenshotFile.value ?? undefined,
|
||||
});
|
||||
Message.success(t('h5.recharge.success'));
|
||||
const decision = String(result?.decision ?? result?.Decision ?? '').trim();
|
||||
const approvalNo = String(
|
||||
result?.approvalInstanceNo ?? result?.ApprovalInstanceNo ?? '',
|
||||
).trim();
|
||||
if (decision === 'PendingApproval') {
|
||||
Message.info(
|
||||
approvalNo
|
||||
? t('user.recharge.deposit.message.pendingApproval', { no: approvalNo })
|
||||
: t('user.recharge.deposit.message.pendingApprovalFallback'),
|
||||
);
|
||||
} else if (decision === 'Bypass') {
|
||||
Message.success(t('user.recharge.deposit.message.bypassed'));
|
||||
} else {
|
||||
Message.success(t('h5.recharge.success'));
|
||||
}
|
||||
step.value = 2;
|
||||
emit('success');
|
||||
} catch (e: any) {
|
||||
|
||||
@ -41,9 +41,17 @@
|
||||
{{ t('workplace.noticePopup.createTime') }}{{ detailTime }}
|
||||
</div>
|
||||
<div class="announcement-detail__content">
|
||||
{{ detail?.content || noContentText }}
|
||||
{{ displayNoticeContent(detail?.content) || noContentText }}
|
||||
</div>
|
||||
<div class="announcement-detail__actions">
|
||||
<a-button
|
||||
v-if="detailApprovalLink"
|
||||
type="primary"
|
||||
class="app-btn-primary-soft"
|
||||
@click="openApprovalFromNotice"
|
||||
>
|
||||
{{ t('system.announcement.actions.openApproval') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="detail && isNew(detail)"
|
||||
type="primary"
|
||||
@ -60,11 +68,17 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import dayjs from 'dayjs';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { getNoticeList, confirmNoticeRead, type NoticeDto } from '@/api/system/notice';
|
||||
import { onNoticeUnreadChanged } from '@/utils/notice-unread';
|
||||
import {
|
||||
buildApprovalInboxLocation,
|
||||
parseApprovalNoticeLink,
|
||||
stripApprovalNoticeMarker,
|
||||
} from '@/utils/approvalNoticeLink';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@ -75,6 +89,7 @@
|
||||
);
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
|
||||
const isInbox = computed(() => props.noticeType === 'message');
|
||||
const i18nPrefix = computed(() => (isInbox.value ? 'workplace.inbox' : 'workplace.announcement'));
|
||||
@ -90,6 +105,27 @@
|
||||
const detail = ref<NoticeDto | null>(null);
|
||||
const readLoading = ref(false);
|
||||
|
||||
const detailApprovalLink = computed(() => parseApprovalNoticeLink(detail.value?.content));
|
||||
|
||||
function displayNoticeContent(content?: string | null) {
|
||||
return stripApprovalNoticeMarker(content);
|
||||
}
|
||||
|
||||
async function openApprovalFromNotice() {
|
||||
const link = detailApprovalLink.value;
|
||||
if (!link) return;
|
||||
if (detail.value?.id != null && isNew(detail.value)) {
|
||||
try {
|
||||
await confirmNoticeRead(detail.value.id);
|
||||
markLocalRead(detail.value.id);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
detailVisible.value = false;
|
||||
router.push(buildApprovalInboxLocation(link));
|
||||
}
|
||||
|
||||
const detailTime = computed(() => {
|
||||
const raw = detail.value?.createTime;
|
||||
if (!raw) return '';
|
||||
|
||||
@ -171,13 +171,21 @@
|
||||
</a-tag>
|
||||
<span class="notice-drawer-time">{{ formatCreateTime(viewRecord.createTime) }}</span>
|
||||
</div>
|
||||
<div class="notice-drawer-content">{{ viewRecord.content || '--' }}</div>
|
||||
<div class="notice-drawer-content">{{ displayNoticeContent(viewRecord.content) }}</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<a-space>
|
||||
<a-button @click="drawerVisible = false">
|
||||
{{ t('system.announcement.drawer.close') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="viewApprovalLink"
|
||||
type="primary"
|
||||
class="app-btn-primary-soft"
|
||||
@click="openApprovalFromNotice"
|
||||
>
|
||||
{{ t('system.announcement.actions.openApproval') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="viewRecord && !viewRecord.isRead"
|
||||
type="primary"
|
||||
@ -214,6 +222,11 @@ import {
|
||||
type NoticeDto,
|
||||
type NoticeReceiverOption,
|
||||
} from '@/api/system/notice'
|
||||
import {
|
||||
buildApprovalInboxLocation,
|
||||
parseApprovalNoticeLink,
|
||||
stripApprovalNoticeMarker,
|
||||
} from '@/utils/approvalNoticeLink'
|
||||
|
||||
defineOptions({ name: 'SystemAnnouncement' })
|
||||
|
||||
@ -245,6 +258,27 @@ const formRef = ref()
|
||||
|
||||
const drawerVisible = ref(false)
|
||||
const viewRecord = ref<NoticeDto | null>(null)
|
||||
const viewApprovalLink = computed(() =>
|
||||
parseApprovalNoticeLink(viewRecord.value?.content),
|
||||
)
|
||||
|
||||
function displayNoticeContent(content?: string | null) {
|
||||
return stripApprovalNoticeMarker(content) || '--'
|
||||
}
|
||||
|
||||
async function openApprovalFromNotice() {
|
||||
const link = viewApprovalLink.value
|
||||
if (!link) return
|
||||
if (viewRecord.value?.id && !viewRecord.value.isRead) {
|
||||
try {
|
||||
await confirmNoticeRead(viewRecord.value.id)
|
||||
} catch {
|
||||
/* 已读失败不阻断跳转 */
|
||||
}
|
||||
}
|
||||
drawerVisible.value = false
|
||||
router.push(buildApprovalInboxLocation(link))
|
||||
}
|
||||
const readLoading = ref(false)
|
||||
|
||||
const addButtonLabel = computed(() =>
|
||||
|
||||
@ -55,66 +55,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a-drawer
|
||||
<ApprovalDetailDrawer
|
||||
v-model:visible="detailVisible"
|
||||
:title="t('system.approval.inbox.detailTitle')"
|
||||
:width="560"
|
||||
unmount-on-close
|
||||
>
|
||||
<template v-if="detail">
|
||||
<a-descriptions :column="1" size="large" bordered>
|
||||
<a-descriptions-item :label="t('system.approval.inbox.col.instanceNo')">
|
||||
{{ detail.instanceNo }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item :label="t('system.approval.inbox.col.title')">
|
||||
{{ detail.title }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item :label="t('system.approval.inbox.col.operation')">
|
||||
{{ detail.operationCode }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item :label="t('system.approval.inbox.col.status')">
|
||||
{{ detail.statusName }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item :label="t('system.approval.inbox.col.applicant')">
|
||||
{{ detail.applicantUserName || detail.applicantUserGuid }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item :label="t('system.approval.inbox.payload')">
|
||||
<pre class="json-block">{{ formatJson(detail.payloadJson) }}</pre>
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
|
||||
<div class="timeline-title">{{ t('system.approval.inbox.timeline') }}</div>
|
||||
<a-timeline>
|
||||
<a-timeline-item v-for="ev in detail.events || []" :key="ev.id">
|
||||
<div class="event-head">
|
||||
<strong>{{ ev.eventType }}</strong>
|
||||
<span class="event-time">{{ ev.createTime }}</span>
|
||||
</div>
|
||||
<div>{{ ev.operatorUserName }} {{ ev.message }}</div>
|
||||
</a-timeline-item>
|
||||
</a-timeline>
|
||||
|
||||
<div v-if="detail.canApprove || detail.canWithdraw" class="detail-actions">
|
||||
<a-button
|
||||
v-if="detail.canApprove && hasPermission('System.ApprovalTask.Approve')"
|
||||
type="primary"
|
||||
@click="doApprove(detail)"
|
||||
>
|
||||
{{ t('system.approval.inbox.approve') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="detail.canApprove && hasPermission('System.ApprovalTask.Reject')"
|
||||
status="danger"
|
||||
@click="openReject(detail)"
|
||||
>
|
||||
{{ t('system.approval.inbox.reject') }}
|
||||
</a-button>
|
||||
<a-button v-if="detail.canWithdraw" @click="doWithdraw(detail)">
|
||||
{{ t('system.approval.inbox.withdraw') }}
|
||||
</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</a-drawer>
|
||||
:instance-id="detailInstanceId"
|
||||
@changed="loadList"
|
||||
/>
|
||||
|
||||
<a-modal
|
||||
v-model:visible="rejectVisible"
|
||||
@ -133,17 +78,18 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { Message, Modal } from '@arco-design/web-vue'
|
||||
import HandsontablePro from '@/components/HandsontablePro/index.vue'
|
||||
import PaginationPro from '@/components/PaginationPro/index.vue'
|
||||
import SlidingTabs from '@/components/SlidingTabs/index.vue'
|
||||
import ApprovalDetailDrawer from '@/components/ApprovalDetailDrawer/index.vue'
|
||||
import { useTableContainerHeight } from '@/composables/useTableContainerHeight'
|
||||
import { hasPermission } from '@/utils/rbac-permission'
|
||||
import { renderWarehouseActionBtn, wrapWarehouseActions } from '@/utils/warehouseActionRenderer'
|
||||
import {
|
||||
approveApproval,
|
||||
getApprovalDetail,
|
||||
getApprovalMySubmitted,
|
||||
getApprovalMyTodo,
|
||||
rejectApproval,
|
||||
@ -154,6 +100,7 @@ import {
|
||||
defineOptions({ name: 'SystemApprovalInbox' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const route = useRoute()
|
||||
const { tableContainerRef, tableHeight } = useTableContainerHeight()
|
||||
const handsontableHeight = computed(() => Math.max(tableHeight.value || 0, 400))
|
||||
|
||||
@ -170,7 +117,7 @@ const pageSize = ref(50)
|
||||
const keyword = ref('')
|
||||
|
||||
const detailVisible = ref(false)
|
||||
const detail = ref<ApprovalInstanceDto | null>(null)
|
||||
const detailInstanceId = ref<number | null>(null)
|
||||
const rejectVisible = ref(false)
|
||||
const rejectComment = ref('')
|
||||
const rejectTarget = ref<ApprovalInstanceDto | null>(null)
|
||||
@ -232,22 +179,9 @@ function handlePageSizeChange() {
|
||||
loadList()
|
||||
}
|
||||
|
||||
function formatJson(raw?: string | null) {
|
||||
if (!raw) return '—'
|
||||
try {
|
||||
return JSON.stringify(JSON.parse(raw), null, 2)
|
||||
} catch {
|
||||
return raw
|
||||
}
|
||||
}
|
||||
|
||||
async function openDetail(id: number) {
|
||||
try {
|
||||
detail.value = await getApprovalDetail(id)
|
||||
detailVisible.value = true
|
||||
} catch (e: unknown) {
|
||||
Message.error((e as Error)?.message || t('common.loadFailed'))
|
||||
}
|
||||
function openDetail(id: number) {
|
||||
detailInstanceId.value = id
|
||||
detailVisible.value = true
|
||||
}
|
||||
|
||||
async function doApprove(row: ApprovalInstanceDto) {
|
||||
@ -346,6 +280,18 @@ async function loadList() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const tab = String(route.query.tab || '').trim()
|
||||
if (tab === 'submitted' || tab === 'todo') {
|
||||
activeTab.value = tab
|
||||
}
|
||||
const kw = String(route.query.keyword || '').trim()
|
||||
if (kw) {
|
||||
keyword.value = kw
|
||||
}
|
||||
const instanceId = Number(route.query.instanceId || 0)
|
||||
if (instanceId > 0) {
|
||||
openDetail(instanceId)
|
||||
}
|
||||
loadList()
|
||||
})
|
||||
</script>
|
||||
@ -417,36 +363,4 @@ onMounted(() => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.json-block {
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
font-size: 12px;
|
||||
max-height: 200px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.timeline-title {
|
||||
margin: 20px 0 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.event-head {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.event-time {
|
||||
color: var(--color-text-3);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.detail-actions {
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -314,12 +314,26 @@ const submit = async () => {
|
||||
|
||||
submitting.value = true;
|
||||
try {
|
||||
await submitRechargeApplication({
|
||||
const result: any = await submitRechargeApplication({
|
||||
rechargeAmount: Number(finalAmount.value),
|
||||
payType: payType.value === 'zfb' ? 2 : 1,
|
||||
screenshotFile: screenshotFile.value ?? undefined,
|
||||
});
|
||||
Message.success(t('user.recharge.deposit.message.submitSuccess'));
|
||||
const decision = String(result?.decision ?? result?.Decision ?? '').trim();
|
||||
const approvalNo = String(
|
||||
result?.approvalInstanceNo ?? result?.ApprovalInstanceNo ?? '',
|
||||
).trim();
|
||||
if (decision === 'PendingApproval') {
|
||||
Message.info(
|
||||
approvalNo
|
||||
? t('user.recharge.deposit.message.pendingApproval', { no: approvalNo })
|
||||
: t('user.recharge.deposit.message.pendingApprovalFallback'),
|
||||
);
|
||||
} else if (decision === 'Bypass') {
|
||||
Message.success(t('user.recharge.deposit.message.bypassed'));
|
||||
} else {
|
||||
Message.success(t('user.recharge.deposit.message.submitSuccess'));
|
||||
}
|
||||
current.value++;
|
||||
} catch (error: any) {
|
||||
Message.error(error?.message || t('user.recharge.deposit.message.submitFailed'));
|
||||
|
||||
@ -385,7 +385,15 @@ export default defineConfig(({ mode }) => {
|
||||
secure: false,
|
||||
bypass(req) {
|
||||
const path = req.url?.split('?')[0] ?? '';
|
||||
const systemSpaExact = ['/system/dict', '/system/warehouseAddress', '/system/announcement', '/system/country'];
|
||||
// 审批页与 API 同前缀(/system/approval/definition/list),必须精确匹配页面路径
|
||||
const systemSpaExact = [
|
||||
'/system/dict',
|
||||
'/system/warehouseAddress',
|
||||
'/system/announcement',
|
||||
'/system/country',
|
||||
'/system/approval/definition',
|
||||
'/system/approval/inbox',
|
||||
];
|
||||
if (systemSpaExact.some((p) => path === p || path === `${p}/`)) {
|
||||
return '/index.html';
|
||||
}
|
||||
@ -579,6 +587,9 @@ export default defineConfig(({ mode }) => {
|
||||
'/system/warehouseAddress',
|
||||
'/system/announcement',
|
||||
'/system/country',
|
||||
// 审批页与 API 同前缀,勿用前缀匹配(/system/approval/definition/list 须走代理)
|
||||
'/system/approval/definition',
|
||||
'/system/approval/inbox',
|
||||
// 仓储页面路径与 API 同段,必须精确匹配(/warehouse/parcel/list 走代理)
|
||||
'/warehouse/parcel',
|
||||
'/warehouse/inventory',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user