|
|
@@ -13,6 +13,8 @@ import {
|
|
|
} from '@/utils/oa-approval-print-related'
|
|
|
import { formatProgressPersonLines } from '@/utils/oa-progress-person-lines'
|
|
|
import { formatDeptDisplay } from '@/utils/oa-dept-value'
|
|
|
+import { formatMoneyDisplay } from '@/utils/money-format'
|
|
|
+import { toRmbUpper } from '@/utils/rmb-upper'
|
|
|
|
|
|
export const OA_PRINT_COMPANY_NAME = '安徽中科兴皖医学研究有限公司'
|
|
|
|
|
|
@@ -244,6 +246,27 @@ async function walkRules(
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
+ if (type === 'money') {
|
|
|
+ const showUpper = rule.props?.showUpper !== false
|
|
|
+ const n =
|
|
|
+ value == null || value === ''
|
|
|
+ ? null
|
|
|
+ : typeof value === 'number'
|
|
|
+ ? value
|
|
|
+ : Number(String(value).replace(/,/g, ''))
|
|
|
+ if (n == null || !Number.isFinite(n)) {
|
|
|
+ out.push({ label, text: '-' })
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ const numText = formatMoneyDisplay(n, 2)
|
|
|
+ const upper = showUpper ? toRmbUpper(n) : ''
|
|
|
+ out.push({
|
|
|
+ label,
|
|
|
+ text: upper ? `${numText}(${upper})` : numText
|
|
|
+ })
|
|
|
+ continue
|
|
|
+ }
|
|
|
+
|
|
|
if (UPLOAD_TYPES.has(type) || String(rule.name || '').toLowerCase().includes('upload')) {
|
|
|
const urls = extractUrls(value)
|
|
|
out.push({ label, urls: urls.length ? urls : [], text: urls.length ? undefined : '-' })
|