| | |
| | | const STATUS_META = { |
| | | 1: { text: '正常', type: 'success', bool: true }, |
| | | 0: { text: '冻结', type: 'danger', bool: false } |
| | | 1: { textKey: 'common.status.normal', fallback: 'Normal', type: 'success', bool: true }, |
| | | 0: { textKey: 'common.status.frozen', fallback: 'Frozen', type: 'danger', bool: false } |
| | | } |
| | | |
| | | export const COMPANYS_REPORT_TITLE = '往来企业报表' |
| | | export function getCompanysReportTitle(t) { |
| | | return typeof t === 'function' ? t('pages.basicInfo.companys.reportTitle') : 'Company Report' |
| | | } |
| | | export const COMPANYS_REPORT_STYLE = { |
| | | titleAlign: 'center', |
| | | titleLevel: 'strong', |
| | |
| | | } |
| | | } |
| | | |
| | | export function getCompanysStatusOptions() { |
| | | export function getCompanysStatusOptions(t) { |
| | | return [ |
| | | { label: '正常', value: 1 }, |
| | | { label: '冻结', value: 0 } |
| | | { label: typeof t === 'function' ? t('common.status.normal') : 'Normal', value: 1 }, |
| | | { label: typeof t === 'function' ? t('common.status.frozen') : 'Frozen', value: 0 } |
| | | ] |
| | | } |
| | | |
| | |
| | | if (status === false || Number(status) === 0) { |
| | | return STATUS_META[0] |
| | | } |
| | | return { text: '未知', type: 'info', bool: false } |
| | | return { textKey: 'common.status.unknown', fallback: 'Unknown', type: 'info', bool: false } |
| | | } |
| | | |
| | | export function buildCompanysTypeOptions(records = []) { |
| | |
| | | city: normalizeText(record.city || ''), |
| | | address: normalizeText(record.address || ''), |
| | | memo: normalizeText(record.memo || ''), |
| | | statusText: statusMeta.text, |
| | | statusTextKey: statusMeta.textKey, |
| | | statusText: statusMeta.fallback, |
| | | statusType: statusMeta.type, |
| | | statusBool: record.statusBool !== void 0 ? Boolean(record.statusBool) : statusMeta.bool, |
| | | createByText: normalizeText(record.createBy$ || record.createByText || ''), |
| | |
| | | orientation = COMPANYS_REPORT_STYLE.orientation |
| | | } = {}) { |
| | | return { |
| | | reportTitle: COMPANYS_REPORT_TITLE, |
| | | reportTitle: previewMeta.reportTitle, |
| | | reportDate: previewMeta.reportDate, |
| | | printedAt: previewMeta.printedAt, |
| | | operator: previewMeta.operator, |