This commit is contained in:
@@ -10,6 +10,19 @@ export enum RefundStatus {
|
|||||||
RETURNED = 4 // 已退回
|
RETURNED = 4 // 已退回
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 审批状态
|
||||||
|
export enum RefundApprovalStatus {
|
||||||
|
SUBMITTING = 0, // 提交中
|
||||||
|
APPROVING = 1, // 审批中
|
||||||
|
APPROVED = 2, // 已通过
|
||||||
|
REJECTED = 3, // 已拒绝
|
||||||
|
REVOKED = 4, // 已撤销
|
||||||
|
REVOKED_AFTER_APPROVED = 5, // 通过后撤销
|
||||||
|
DELETED = 6, // 已删除
|
||||||
|
SUBMIT_FAILED = 7, // 提交失败
|
||||||
|
RESULT_UNKNOWN = 8 // 提交结果未知
|
||||||
|
}
|
||||||
|
|
||||||
export interface RefundAttachment {
|
export interface RefundAttachment {
|
||||||
file_key: string
|
file_key: string
|
||||||
file_name?: string
|
file_name?: string
|
||||||
@@ -70,7 +83,7 @@ export interface Refund {
|
|||||||
approval_provider?: 'wecom' | null
|
approval_provider?: 'wecom' | null
|
||||||
approval_instance_id?: number | null
|
approval_instance_id?: number | null
|
||||||
approval_source?: 'none' | 'legacy' | 'wecom' | null // 审批来源
|
approval_source?: 'none' | 'legacy' | 'wecom' | null // 审批来源
|
||||||
approval_status?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | null // 审批状态
|
approval_status?: RefundApprovalStatus | null // 审批状态
|
||||||
approval_status_name?: string | null // 审批状态名称
|
approval_status_name?: string | null // 审批状态名称
|
||||||
current_approver_summary?: string | null // 当前审批人摘要
|
current_approver_summary?: string | null // 当前审批人摘要
|
||||||
processing_status?: string | null // 业务处理状态
|
processing_status?: string | null // 业务处理状态
|
||||||
|
|||||||
@@ -113,7 +113,13 @@
|
|||||||
import DetailPage from '@/components/common/DetailPage.vue'
|
import DetailPage from '@/components/common/DetailPage.vue'
|
||||||
import type { DetailSection } from '@/components/common/DetailPage.vue'
|
import type { DetailSection } from '@/components/common/DetailPage.vue'
|
||||||
import { RefundService } from '@/api/modules'
|
import { RefundService } from '@/api/modules'
|
||||||
import type { Refund, ResubmitRefundRequest, RefundAttachment } from '@/types/api'
|
import {
|
||||||
|
RefundApprovalStatus,
|
||||||
|
RefundStatus,
|
||||||
|
type Refund,
|
||||||
|
type ResubmitRefundRequest,
|
||||||
|
type RefundAttachment
|
||||||
|
} from '@/types/api'
|
||||||
import { fenToYuan, formatDateTime, yuanToFen } from '@/utils/business/format'
|
import { fenToYuan, formatDateTime, yuanToFen } from '@/utils/business/format'
|
||||||
import { toVoucherKeyList, getErrorMessage } from '@/utils/business'
|
import { toVoucherKeyList, getErrorMessage } from '@/utils/business'
|
||||||
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
|
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
|
||||||
@@ -456,22 +462,14 @@
|
|||||||
resubmitUploadRef.value?.clearFiles(false)
|
resubmitUploadRef.value?.clearFiles(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
const canResubmit = (item: Refund) => {
|
const canResubmit = (item: Refund) =>
|
||||||
const statusText = [item.approval_status, item.approval_status_name, item.status_name]
|
item.status === RefundStatus.REJECTED ||
|
||||||
.filter(Boolean)
|
item.status === RefundStatus.RETURNED ||
|
||||||
.join(' ')
|
item.approval_status === RefundApprovalStatus.REJECTED ||
|
||||||
.toLowerCase()
|
item.approval_status === RefundApprovalStatus.REVOKED ||
|
||||||
|
item.approval_status === RefundApprovalStatus.REVOKED_AFTER_APPROVED ||
|
||||||
return (
|
item.approval_status === RefundApprovalStatus.SUBMIT_FAILED ||
|
||||||
item.status === 3 ||
|
item.approval_status === RefundApprovalStatus.RESULT_UNKNOWN
|
||||||
statusText.includes('reject') ||
|
|
||||||
statusText.includes('revoke') ||
|
|
||||||
statusText.includes('delete') ||
|
|
||||||
statusText.includes('驳回') ||
|
|
||||||
statusText.includes('撤销') ||
|
|
||||||
statusText.includes('删除')
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleShowResubmit = () => {
|
const handleShowResubmit = () => {
|
||||||
if (!refund.value || !canResubmit(refund.value)) return
|
if (!refund.value || !canResubmit(refund.value)) return
|
||||||
|
|||||||
@@ -150,6 +150,7 @@
|
|||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import {
|
import {
|
||||||
RefundStatus,
|
RefundStatus,
|
||||||
|
RefundApprovalStatus,
|
||||||
type Refund,
|
type Refund,
|
||||||
type RefundQueryParams,
|
type RefundQueryParams,
|
||||||
type ResubmitRefundRequest,
|
type ResubmitRefundRequest,
|
||||||
@@ -734,22 +735,14 @@
|
|||||||
return keys.length ? keys : toVoucherKeyList(row.refund_voucher_key)
|
return keys.length ? keys : toVoucherKeyList(row.refund_voucher_key)
|
||||||
}
|
}
|
||||||
|
|
||||||
const canResubmit = (row: Refund) => {
|
const canResubmit = (row: Refund) =>
|
||||||
const statusText = [row.approval_status, row.approval_status_name, row.status_name]
|
row.status === RefundStatus.REJECTED ||
|
||||||
.filter(Boolean)
|
row.status === RefundStatus.RETURNED ||
|
||||||
.join(' ')
|
row.approval_status === RefundApprovalStatus.REJECTED ||
|
||||||
.toLowerCase()
|
row.approval_status === RefundApprovalStatus.REVOKED ||
|
||||||
|
row.approval_status === RefundApprovalStatus.REVOKED_AFTER_APPROVED ||
|
||||||
return (
|
row.approval_status === RefundApprovalStatus.SUBMIT_FAILED ||
|
||||||
row.status === 3 ||
|
row.approval_status === RefundApprovalStatus.RESULT_UNKNOWN
|
||||||
statusText.includes('reject') ||
|
|
||||||
statusText.includes('revoke') ||
|
|
||||||
statusText.includes('delete') ||
|
|
||||||
statusText.includes('驳回') ||
|
|
||||||
statusText.includes('撤销') ||
|
|
||||||
statusText.includes('删除')
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const canTriggerApproval = (row: Refund) => {
|
const canTriggerApproval = (row: Refund) => {
|
||||||
const approvalStatusEmpty = row.approval_status === undefined || row.approval_status === null
|
const approvalStatusEmpty = row.approval_status === undefined || row.approval_status === null
|
||||||
|
|||||||
Reference in New Issue
Block a user