| | |
| | | /** 表单类型 */ |
| | | export type FormType = 'create' | 'detail' | 'edit'; |
| | | |
| | | /** 发票类型选项(固定枚举,对应后台 finance_reimbursement_item.invoice_type) */ |
| | | export const INVOICE_TYPE_OPTIONS = [ |
| | | { label: '增值税专用发票', value: '增值税专用发票' }, |
| | | { label: '增值税普通发票', value: '增值税普通发票' }, |
| | | { label: '电子发票', value: '电子发票' }, |
| | | { label: '收据', value: '收据' }, |
| | | { label: '其他', value: '其他' }, |
| | | ]; |
| | | |
| | | /** 报销单状态(对应字典 finance_reimbursement_status) */ |
| | | export const ReimbursementStatus = { |
| | | DRAFT: 0, // 草稿 |
| | |
| | | placeholder: '留空则由系统自动生成', |
| | | maxlength: 36, |
| | | disabled: formType === 'detail', |
| | | }, |
| | | }, |
| | | { |
| | | // 本人发起:申请人只读,默认当前登录用户 |
| | | fieldName: 'applicantName', |
| | | label: '申请人', |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '默认为当前登录用户', |
| | | disabled: true, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['proxyFlag'], |
| | | show: (values) => !values.proxyFlag, |
| | | }, |
| | | }, |
| | | { |
| | | // 代他人发起:选择实际申请人,代录人由后端创建人字段记录 |
| | | fieldName: 'applicantId', |
| | | label: '实际申请人', |
| | | component: 'ApiSelect', |
| | | componentProps: { |
| | | placeholder: '请选择实际申请人', |
| | | allowClear: true, |
| | | showSearch: true, |
| | | api: getSimpleUserList, |
| | | labelField: 'nickname', |
| | | valueField: 'id', |
| | | disabled: formType === 'detail', |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['proxyFlag'], |
| | | show: (values) => !!values.proxyFlag, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'proxyFlag', |
| | | label: '代他人发起', |
| | | component: 'Switch', |
| | | componentProps: { |
| | | checkedChildren: '代发起', |
| | | unCheckedChildren: '本人', |
| | | }, |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => formType !== 'detail', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | slots: { default: 'expenseType' }, |
| | | }, |
| | | { |
| | | field: 'invoiceType', |
| | | title: '发票类型', |
| | | minWidth: 150, |
| | | slots: { default: 'invoiceType' }, |
| | | }, |
| | | { |
| | | field: 'invoiceNo', |
| | | title: '发票号码', |
| | | minWidth: 160, |
| | |
| | | ): FinanceReimbursementApi.ReimbursementItem[] { |
| | | return (items ?? []).map((item) => ({ |
| | | expenseType: item.expenseType, |
| | | invoiceType: item.invoiceType, |
| | | invoiceNo: item.invoiceNo, |
| | | invoiceAmount: item.invoiceAmount, |
| | | invoiceDate: item.invoiceDate, |