|
|
@@ -12,6 +12,7 @@ import '../../shared/widgets/form_section.dart';
|
|
|
import '../../shared/widgets/form_field_row.dart';
|
|
|
import '../../shared/widgets/app_skeletons.dart';
|
|
|
import 'expense_apply_model.dart';
|
|
|
+import 'widgets/expense_apply_detail_view_dialog.dart';
|
|
|
import '../../core/i18n/app_localizations.dart';
|
|
|
import '../../shared/models/bill_attachment.dart';
|
|
|
import 'expense_apply_api.dart';
|
|
|
@@ -159,9 +160,9 @@ class _ExpenseApplyDetailPageState extends ConsumerState<ExpenseApplyDetailPage>
|
|
|
const SizedBox(height: 16),
|
|
|
FormFieldRow(label: l10n.get('date'), value: du.DateUtils.formatDate(app.createTime), readOnly: true, showArrow: false),
|
|
|
const SizedBox(height: 16),
|
|
|
- FormFieldRow(label: l10n.get('applicant'), value: app.applicantName, readOnly: true, showArrow: false),
|
|
|
+ FormFieldRow(label: l10n.get('applicant'), value: app.applicantId.isNotEmpty ? '${app.applicantId}/${app.applicantName}' : app.applicantName, readOnly: true, showArrow: false),
|
|
|
const SizedBox(height: 16),
|
|
|
- FormFieldRow(label: l10n.get('department'), value: app.deptName, readOnly: true, showArrow: false),
|
|
|
+ FormFieldRow(label: l10n.get('department'), value: app.deptId.isNotEmpty ? '${app.deptId}/${app.deptName}' : app.deptName, readOnly: true, showArrow: false),
|
|
|
const SizedBox(height: 16),
|
|
|
SizedBox(
|
|
|
height: 24,
|
|
|
@@ -171,7 +172,7 @@ class _ExpenseApplyDetailPageState extends ConsumerState<ExpenseApplyDetailPage>
|
|
|
]),
|
|
|
),
|
|
|
const SizedBox(height: 16),
|
|
|
- FormFieldRow(label: l10n.get('applyReason'), value: app.purpose, readOnly: true, showArrow: false),
|
|
|
+ FormFieldRow(label: l10n.get('applyReason'), value: app.purpose, readOnly: true, showArrow: false, bold: true),
|
|
|
const SizedBox(height: 16),
|
|
|
FormFieldRow(label: l10n.get('remark'), value: app.remark.isNotEmpty ? app.remark : '-', readOnly: true, showArrow: false),
|
|
|
],
|
|
|
@@ -199,11 +200,13 @@ class _ExpenseApplyDetailPageState extends ConsumerState<ExpenseApplyDetailPage>
|
|
|
final catLabel = d.categoryName.isNotEmpty
|
|
|
? '${d.expenseCategory}/${d.categoryName}'
|
|
|
: d.expenseCategory;
|
|
|
- return Container(
|
|
|
- margin: const EdgeInsets.symmetric(vertical: 8),
|
|
|
- padding: const EdgeInsets.all(12),
|
|
|
- decoration: BoxDecoration(color: colors.bgPage, borderRadius: BorderRadius.circular(8)),
|
|
|
- child: Row(
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: () => _showExpenseDetailDialog(context, d),
|
|
|
+ child: Container(
|
|
|
+ margin: const EdgeInsets.symmetric(vertical: 8),
|
|
|
+ padding: const EdgeInsets.all(12),
|
|
|
+ decoration: BoxDecoration(color: colors.bgPage, borderRadius: BorderRadius.circular(8)),
|
|
|
+ child: Row(
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
children: [
|
|
|
Expanded(
|
|
|
@@ -231,7 +234,7 @@ class _ExpenseApplyDetailPageState extends ConsumerState<ExpenseApplyDetailPage>
|
|
|
if (d.acctSubjectId.isNotEmpty) ...[
|
|
|
const SizedBox(height: 4),
|
|
|
Text(
|
|
|
- '${l10n.get('acctSubject')}: ${d.acctSubjectId}${d.acctSubjectName.isNotEmpty ? '/$d.acctSubjectName' : ''}',
|
|
|
+ '${l10n.get('acctSubject')}: ${d.acctSubjectId}${d.acctSubjectName.isNotEmpty ? '/${d.acctSubjectName}' : ''}',
|
|
|
maxLines: 1,
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
style: TextStyle(fontSize: AppFontSizes.caption, color: colors.textSecondary),
|
|
|
@@ -240,7 +243,7 @@ class _ExpenseApplyDetailPageState extends ConsumerState<ExpenseApplyDetailPage>
|
|
|
if (d.projectId.isNotEmpty && d.projectName.isNotEmpty) ...[
|
|
|
const SizedBox(height: 4),
|
|
|
Text(
|
|
|
- '${d.projectId}/${d.projectName}',
|
|
|
+ '${l10n.get('project')}: ${d.projectId}/${d.projectName}',
|
|
|
maxLines: 1,
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
style: TextStyle(fontSize: AppFontSizes.caption, color: colors.textSecondary),
|
|
|
@@ -287,7 +290,8 @@ class _ExpenseApplyDetailPageState extends ConsumerState<ExpenseApplyDetailPage>
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
- );
|
|
|
+ ),
|
|
|
+ );
|
|
|
}),
|
|
|
if (app.details.isNotEmpty) ...[
|
|
|
const SizedBox(height: 8),
|
|
|
@@ -429,6 +433,10 @@ class _ExpenseApplyDetailPageState extends ConsumerState<ExpenseApplyDetailPage>
|
|
|
child: Text(label, style: TextStyle(fontSize: 11, fontWeight: FontWeight.w500, color: color)),
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ void _showExpenseDetailDialog(BuildContext context, ExpenseApplyDetailModel d) {
|
|
|
+ ExpenseApplyDetailViewDialog.show(context, d);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// 附件缩略图 — 自动调用 DownloadAttachment 加载图片
|