提交
This commit is contained in:
1 parent
493f8d6756
commit
d84f4b944c
406 files changed
+58954
-10376
No files matched your search
@@ -32,6 +32,24 @@ export function getPlCarrierStatusTagType(status: string) {
|
||||
return status === '1' ? 'success' : 'danger'
|
||||
}
|
||||
|
||||
export function getPlCarrierAuditStatusLabel(status?: string) {
|
||||
const map: Record<string, string> = {
|
||||
pending: '待审核',
|
||||
approved: '已通过',
|
||||
rejected: '已驳回'
|
||||
}
|
||||
return status ? map[status] || status : '待审核'
|
||||
}
|
||||
|
||||
export function getPlCarrierAuditStatusTagType(status?: string) {
|
||||
const map: Record<string, string> = {
|
||||
pending: 'warning',
|
||||
approved: 'success',
|
||||
rejected: 'danger'
|
||||
}
|
||||
return map[status || ''] || 'info'
|
||||
}
|
||||
|
||||
export function getPlanProductSpec(product: { model?: string; packageSpec?: string }) {
|
||||
return product.model || product.packageSpec || '—'
|
||||
}
|
||||
@@ -150,6 +168,21 @@ export function getPlYesNoLabel(value?: number | boolean | null) {
|
||||
return value === 1 || value === true ? '是' : '否'
|
||||
}
|
||||
|
||||
export function getPlHasInvoiceLabelFromSettlement(settlement?: {
|
||||
invoiceNo?: string | null
|
||||
invoiceDate?: string | null
|
||||
invoiceAmount?: number | null
|
||||
invoiceAttachmentUrls?: string | null
|
||||
} | null) {
|
||||
if (!settlement) return '—'
|
||||
const hasInvoice =
|
||||
Boolean(settlement.invoiceNo?.trim()) ||
|
||||
Boolean(settlement.invoiceDate) ||
|
||||
(settlement.invoiceAmount != null && Number(settlement.invoiceAmount) > 0) ||
|
||||
Boolean(settlement.invoiceAttachmentUrls?.trim())
|
||||
return hasInvoice ? '是' : '否'
|
||||
}
|
||||
|
||||
/** 解析运输单司机回传附件(JSON 数组或逗号分隔) */
|
||||
export function parsePlFeedbackImages(raw?: string | string[] | null): string[] {
|
||||
if (!raw) return []
|
||||
@@ -169,3 +202,84 @@ export function parsePlFeedbackImages(raw?: string | string[] | null): string[]
|
||||
.map((item) => item.trim())
|
||||
.filter(Boolean)
|
||||
}
|
||||
|
||||
export function getPlRechargeTypeLabel(type: string) {
|
||||
return type === 'etc' ? 'ETC' : type === 'fuel' ? '加油' : type
|
||||
}
|
||||
|
||||
export function getPlRechargeTypeTagType(type: string) {
|
||||
return type === 'etc' ? 'primary' : type === 'fuel' ? 'success' : 'info'
|
||||
}
|
||||
|
||||
export function getPlRechargeApplyStatusLabel(status: string) {
|
||||
const map: Record<string, string> = {
|
||||
pending: '待发放',
|
||||
disbursed: '已发放',
|
||||
cancelled: '已作废'
|
||||
}
|
||||
return map[status] || status
|
||||
}
|
||||
|
||||
export function getPlRechargeApplyStatusTagType(status: string) {
|
||||
const map: Record<string, string> = {
|
||||
pending: 'warning',
|
||||
disbursed: 'success',
|
||||
cancelled: 'info'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
export const PL_GAS_STATION_PRESETS = ['中石化', '线上etc-app', '百链']
|
||||
|
||||
export const PL_MAINTENANCE_TYPE_PRESETS = ['保养', '维修', '年检']
|
||||
|
||||
export function getPlMaintenanceTypeLabel(type: string) {
|
||||
return type || '—'
|
||||
}
|
||||
|
||||
export function getPlMaintenanceTypeTagType(type: string) {
|
||||
const map: Record<string, string> = {
|
||||
保养: 'success',
|
||||
维修: 'warning',
|
||||
年检: 'primary'
|
||||
}
|
||||
return map[type] || 'info'
|
||||
}
|
||||
|
||||
export function getPlMaintenanceApplyStatusLabel(status: string) {
|
||||
const map: Record<string, string> = {
|
||||
pending: '待处理',
|
||||
processed: '已处理',
|
||||
cancelled: '已作废'
|
||||
}
|
||||
return map[status] || status
|
||||
}
|
||||
|
||||
export function getPlMaintenanceApplyStatusTagType(status: string) {
|
||||
const map: Record<string, string> = {
|
||||
pending: 'warning',
|
||||
processed: 'success',
|
||||
cancelled: 'info'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
export const PL_UREA_UNIT_PRESETS = ['吨桶']
|
||||
|
||||
export function getPlUreaApplyStatusLabel(status: string) {
|
||||
const map: Record<string, string> = {
|
||||
pending: '待发放',
|
||||
disbursed: '已发放',
|
||||
cancelled: '已作废'
|
||||
}
|
||||
return map[status] || status
|
||||
}
|
||||
|
||||
export function getPlUreaApplyStatusTagType(status: string) {
|
||||
const map: Record<string, string> = {
|
||||
pending: 'warning',
|
||||
disbursed: 'success',
|
||||
cancelled: 'info'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
Reference in new issue
Block a user