fix: update some files
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m44s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m44s
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<ArtSearchBar
|
||||
v-model:filter="searchForm"
|
||||
:items="searchFormItems"
|
||||
:show-expand="false"
|
||||
show-expand
|
||||
@reset="handleReset"
|
||||
@search="handleSearch"
|
||||
></ArtSearchBar>
|
||||
@@ -300,6 +300,7 @@
|
||||
import { AgentRechargeService, CommissionService, ShopService } from '@/api/modules'
|
||||
import {
|
||||
ElMessage,
|
||||
ElMessageBox,
|
||||
ElTag,
|
||||
ElButton,
|
||||
ElCascader,
|
||||
@@ -356,6 +357,18 @@
|
||||
|
||||
const isAgentAccount = computed(() => Number(userStore.info.user_type) === 3)
|
||||
const isPlatformAccount = computed(() => [1, 2].includes(Number(userStore.info.user_type)))
|
||||
const isRestrictedCustomerRole = computed(() => [3, 4].includes(Number(userStore.info.user_type)))
|
||||
const hiddenInternalColumnProps = new Set([
|
||||
'approval_provider',
|
||||
'submitter_name',
|
||||
'approval_status',
|
||||
'current_approver_summary',
|
||||
'processing_status_name',
|
||||
'remark',
|
||||
'rejection_reason'
|
||||
])
|
||||
const shouldShowInternalColumn = (prop?: string) =>
|
||||
!isRestrictedCustomerRole.value || !hiddenInternalColumnProps.has(prop || '')
|
||||
const canViewRecharge = computed(() => [1, 2, 3].includes(Number(userStore.info.user_type)))
|
||||
const canCreateRecharge = computed(() => isAgentAccount.value || isPlatformAccount.value)
|
||||
const createMode = ref<'online' | 'offline'>(isAgentAccount.value ? 'online' : 'offline')
|
||||
@@ -369,6 +382,7 @@
|
||||
const voucherUploading = ref(false)
|
||||
const confirmPayLoading = ref(false)
|
||||
const rejectLoading = ref(false)
|
||||
const triggerApprovalLoading = ref(false)
|
||||
const tableRef = ref()
|
||||
const createDialogVisible = ref(false)
|
||||
const exportDialogVisible = ref(false)
|
||||
@@ -385,7 +399,7 @@
|
||||
const qrContent = ref('')
|
||||
const onlineRequestId = ref<string | null>(null)
|
||||
const paymentStatusTimer = ref<ReturnType<typeof setInterval> | null>(null)
|
||||
const ONLINE_MIN_RECHARGE_AMOUNT_FEN = 10
|
||||
const ONLINE_MIN_RECHARGE_AMOUNT_FEN = 10000
|
||||
const ONLINE_MAX_RECHARGE_AMOUNT_FEN = 100000000
|
||||
const paymentMethodsBounds = reactive({
|
||||
min_amount: ONLINE_MIN_RECHARGE_AMOUNT_FEN,
|
||||
@@ -493,13 +507,13 @@
|
||||
{
|
||||
label: '起止时间',
|
||||
prop: 'dateRange',
|
||||
type: 'date',
|
||||
type: 'datetimerange',
|
||||
config: {
|
||||
type: 'daterange',
|
||||
type: 'datetimerange',
|
||||
rangeSeparator: '至',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
valueFormat: 'YYYY-MM-DD'
|
||||
valueFormat: 'YYYY-MM-DDTHH:mm:ssZ'
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -534,7 +548,7 @@
|
||||
{ label: '支付时间', prop: 'paid_at' },
|
||||
{ label: '完成时间', prop: 'completed_at' },
|
||||
{ label: '更新时间', prop: 'updated_at' }
|
||||
]
|
||||
].filter(({ prop }) => shouldShowInternalColumn(prop))
|
||||
|
||||
const createFormRef = ref<FormInstance>()
|
||||
const confirmPayFormRef = ref<FormInstance>()
|
||||
@@ -694,139 +708,142 @@
|
||||
}
|
||||
|
||||
// 动态列配置
|
||||
const { columnChecks, columns } = useCheckedColumns(() => [
|
||||
{
|
||||
prop: 'recharge_no',
|
||||
label: '充值单号',
|
||||
minWidth: 240,
|
||||
formatter: (row: AgentRecharge) => {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;',
|
||||
onClick: (e: MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
handleNameClick(row)
|
||||
}
|
||||
},
|
||||
row.recharge_no
|
||||
)
|
||||
const { columnChecks, columns } = useCheckedColumns(() =>
|
||||
[
|
||||
{
|
||||
prop: 'recharge_no',
|
||||
label: '充值单号',
|
||||
minWidth: 240,
|
||||
formatter: (row: AgentRecharge) => {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;',
|
||||
onClick: (e: MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
handleNameClick(row)
|
||||
}
|
||||
},
|
||||
row.recharge_no
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'shop_name',
|
||||
label: '店铺名称',
|
||||
minWidth: 150,
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'recharge_source',
|
||||
label: '充值来源',
|
||||
width: 140,
|
||||
formatter: (row: AgentRecharge) => getRechargeSourceText(row)
|
||||
},
|
||||
{
|
||||
prop: 'amount',
|
||||
label: '充值金额',
|
||||
width: 120,
|
||||
formatter: (row: AgentRecharge) => formatCurrency(row.amount)
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: AgentRecharge) => {
|
||||
return h(ElTag, { type: getStatusType(row.status) }, () => row.status_name || '-')
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'approval_provider',
|
||||
label: '审批渠道',
|
||||
width: 110,
|
||||
formatter: (row: AgentRecharge) => {
|
||||
if (row.approval_provider === 'wecom' || row.approval_source === 'wecom') return '企微'
|
||||
if (row.approval_source === 'legacy') return '历史审批'
|
||||
return row.approval_provider || row.approval_source || '-'
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'submitter_name',
|
||||
label: '提交人',
|
||||
width: 120,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentRecharge) => row.submitter_name || '-'
|
||||
},
|
||||
{
|
||||
prop: 'approval_status',
|
||||
label: '审批状态',
|
||||
width: 120,
|
||||
formatter: (row: AgentRecharge) => getApprovalStatusText(row)
|
||||
},
|
||||
{
|
||||
prop: 'current_approver_summary',
|
||||
label: '当前审批人摘要',
|
||||
minWidth: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentRecharge) => getCurrentApproverSummaryText(row)
|
||||
},
|
||||
{
|
||||
prop: 'processing_status_name',
|
||||
label: '业务处理状态',
|
||||
width: 140,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentRecharge) => getProcessingStatusText(row)
|
||||
},
|
||||
{
|
||||
prop: 'payment_method',
|
||||
label: '支付方式',
|
||||
width: 140,
|
||||
formatter: (row: AgentRecharge) => getPaymentMethodText(row.payment_method)
|
||||
},
|
||||
{
|
||||
prop: 'payment_channel',
|
||||
label: '支付通道',
|
||||
width: 120,
|
||||
formatter: (row: AgentRecharge) => row.payment_channel || '-'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '运营备注',
|
||||
minWidth: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentRecharge) => row.remark || '-'
|
||||
},
|
||||
{
|
||||
prop: 'rejection_reason',
|
||||
label: '驳回原因',
|
||||
minWidth: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentRecharge) => formatRejectionReason(row.rejection_reason)
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '创建时间',
|
||||
width: 180,
|
||||
formatter: (row: AgentRecharge) => formatDateTime(row.created_at)
|
||||
},
|
||||
{
|
||||
prop: 'paid_at',
|
||||
label: '支付时间',
|
||||
width: 180,
|
||||
formatter: (row: AgentRecharge) => (row.paid_at ? formatDateTime(row.paid_at) : '-')
|
||||
},
|
||||
{
|
||||
prop: 'completed_at',
|
||||
label: '完成时间',
|
||||
width: 180,
|
||||
formatter: (row: AgentRecharge) =>
|
||||
row.completed_at ? formatDateTime(row.completed_at) : '-'
|
||||
},
|
||||
{
|
||||
prop: 'updated_at',
|
||||
label: '更新时间',
|
||||
width: 180,
|
||||
formatter: (row: AgentRecharge) => formatDateTime(row.updated_at)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'shop_name',
|
||||
label: '店铺名称',
|
||||
minWidth: 150,
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'recharge_source',
|
||||
label: '充值来源',
|
||||
width: 140,
|
||||
formatter: (row: AgentRecharge) => getRechargeSourceText(row)
|
||||
},
|
||||
{
|
||||
prop: 'amount',
|
||||
label: '充值金额',
|
||||
width: 120,
|
||||
formatter: (row: AgentRecharge) => formatCurrency(row.amount)
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: AgentRecharge) => {
|
||||
return h(ElTag, { type: getStatusType(row.status) }, () => row.status_name || '-')
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'approval_provider',
|
||||
label: '审批渠道',
|
||||
width: 110,
|
||||
formatter: (row: AgentRecharge) => {
|
||||
if (row.approval_provider === 'wecom' || row.approval_source === 'wecom') return '企微'
|
||||
if (row.approval_source === 'legacy') return '历史审批'
|
||||
return row.approval_provider || row.approval_source || '-'
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'submitter_name',
|
||||
label: '提交人',
|
||||
width: 120,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentRecharge) => row.submitter_name || '-'
|
||||
},
|
||||
{
|
||||
prop: 'approval_status',
|
||||
label: '审批状态',
|
||||
width: 120,
|
||||
formatter: (row: AgentRecharge) => getApprovalStatusText(row)
|
||||
},
|
||||
{
|
||||
prop: 'current_approver_summary',
|
||||
label: '当前审批人摘要',
|
||||
minWidth: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentRecharge) => getCurrentApproverSummaryText(row)
|
||||
},
|
||||
{
|
||||
prop: 'processing_status_name',
|
||||
label: '业务处理状态',
|
||||
width: 140,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentRecharge) => getProcessingStatusText(row)
|
||||
},
|
||||
{
|
||||
prop: 'payment_method',
|
||||
label: '支付方式',
|
||||
width: 140,
|
||||
formatter: (row: AgentRecharge) => getPaymentMethodText(row.payment_method)
|
||||
},
|
||||
{
|
||||
prop: 'payment_channel',
|
||||
label: '支付通道',
|
||||
width: 120,
|
||||
formatter: (row: AgentRecharge) => row.payment_channel || '-'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '运营备注',
|
||||
minWidth: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentRecharge) => row.remark || '-'
|
||||
},
|
||||
{
|
||||
prop: 'rejection_reason',
|
||||
label: '驳回原因',
|
||||
minWidth: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentRecharge) => formatRejectionReason(row.rejection_reason)
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '创建时间',
|
||||
width: 180,
|
||||
formatter: (row: AgentRecharge) => formatDateTime(row.created_at)
|
||||
},
|
||||
{
|
||||
prop: 'paid_at',
|
||||
label: '支付时间',
|
||||
width: 180,
|
||||
formatter: (row: AgentRecharge) => (row.paid_at ? formatDateTime(row.paid_at) : '-')
|
||||
},
|
||||
{
|
||||
prop: 'completed_at',
|
||||
label: '完成时间',
|
||||
width: 180,
|
||||
formatter: (row: AgentRecharge) => (row.completed_at ? formatDateTime(row.completed_at) : '-')
|
||||
},
|
||||
{
|
||||
prop: 'updated_at',
|
||||
label: '更新时间',
|
||||
width: 180,
|
||||
formatter: (row: AgentRecharge) => formatDateTime(row.updated_at)
|
||||
}
|
||||
])
|
||||
].filter(({ prop }) => shouldShowInternalColumn(prop))
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
@@ -1294,6 +1311,37 @@
|
||||
})
|
||||
}
|
||||
|
||||
// 补发历史线下代理充值审批
|
||||
const handleTriggerApproval = (row: AgentRecharge) => {
|
||||
if (triggerApprovalLoading.value) return
|
||||
|
||||
ElMessageBox.confirm(`确定要为充值单号 ${row.recharge_no} 补发企微审批吗?`, '补发审批', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(async () => {
|
||||
triggerApprovalLoading.value = true
|
||||
try {
|
||||
const res = await AgentRechargeService.triggerApproval(row.id)
|
||||
if (res.code !== 0) {
|
||||
ElMessage.error(res.msg || '补发审批失败')
|
||||
return
|
||||
}
|
||||
ElMessage.success('补发审批成功')
|
||||
await getTableData()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
ElMessage.error('补发审批失败')
|
||||
} finally {
|
||||
triggerApprovalLoading.value = false
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// 用户取消
|
||||
})
|
||||
}
|
||||
|
||||
// 处理名称点击
|
||||
const handleNameClick = (row: AgentRecharge) => {
|
||||
if (hasAuth('agent_recharge:detail_page')) {
|
||||
@@ -1317,7 +1365,8 @@
|
||||
hasAuth,
|
||||
onViewPaymentVoucher: handleViewPaymentVoucher,
|
||||
onConfirmPayment: handleShowConfirmPay,
|
||||
onReject: handleShowReject
|
||||
onReject: handleShowReject,
|
||||
onTriggerApproval: handleTriggerApproval
|
||||
})
|
||||
if (isPlatformAccount.value && hasAuth(AUDIT_PERMISSIONS.agentRechargeEntry)) {
|
||||
const resourceTarget = resolveAuditResourceTarget({
|
||||
@@ -1352,6 +1401,13 @@
|
||||
type: 'primary'
|
||||
})
|
||||
}
|
||||
|
||||
const paymentVoucherIndex = actions.findIndex((action) => action.label === '支付凭证')
|
||||
if (paymentVoucherIndex > 0) {
|
||||
const [paymentVoucherAction] = actions.splice(paymentVoucherIndex, 1)
|
||||
actions.unshift(paymentVoucherAction)
|
||||
}
|
||||
|
||||
return actions
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user