chengc 2 周之前
父節點
當前提交
f83b74ff5d

+ 6 - 0
lib/features/expense/expense_create_page.dart

@@ -1254,6 +1254,12 @@ class _ExpenseCreatePageState extends ConsumerState<ExpenseCreatePage> {
           aeNo: result.aeNo,
           aeDd: result.aeDd,
           remark: result.remark,
+          sortOrder: editIndex != null
+              ? state.expense.details[editIndex].sortOrder
+              : 1,
+          preItm: editIndex != null
+              ? state.expense.details[editIndex].preItm
+              : null,
           attachments: result.attachmentPaths,
           createTime: now,
           updateTime: now,

+ 5 - 14
lib/features/expense/expense_detail_page.dart

@@ -272,20 +272,11 @@ class _ExpenseDetailPageState extends ConsumerState<ExpenseDetailPage>
             readOnly: true,
             showArrow: false),
         const SizedBox(height: 16),
-        SizedBox(
-          height: 24,
-          child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [
-            Text(l10n.get('remark'),
-                style: TextStyle(fontSize: AppFontSizes.subtitle, color: colors.textSecondary)),
-            const SizedBox(width: 8),
-            Expanded(
-              child: Text(expense.remark.isNotEmpty ? expense.remark : '-',
-                  textAlign: TextAlign.end,
-                  maxLines: 2,
-                  overflow: TextOverflow.ellipsis,
-                  style: TextStyle(fontSize: AppFontSizes.subtitle, fontWeight: FontWeight.w500, color: colors.textPrimary)),
-            ),
-          ]),
+        FormFieldRow(
+            label: l10n.get('remark'),
+            value: expense.remark.isNotEmpty ? expense.remark : '-',
+            readOnly: true,
+            showArrow: false,
         ),
       ],
     );

+ 5 - 3
lib/features/expense/expense_edit_page.dart

@@ -935,6 +935,7 @@ class _ExpenseEditPageState extends ConsumerState<ExpenseEditPage> {
         initialData: initialData,
         checkAttachHealth: () =>
             ref.read(expenseApiProvider).checkAttachHealth(),
+        showAttachments: false,
       );
       if (result != null && mounted) {
         final now = DateTime.now();
@@ -971,9 +972,10 @@ class _ExpenseEditPageState extends ConsumerState<ExpenseEditPage> {
           aeNo: result.aeNo,
           aeDd: result.aeDd,
           remark: result.remark,
-          preItm: editIndex != null
-              ? expense.details[editIndex].preItm
-              : null,
+          sortOrder: editIndex != null
+              ? expense.details[editIndex].sortOrder
+              : 1,
+          preItm: editIndex != null ? expense.details[editIndex].preItm : null,
           attachments: result.attachmentPaths,
           createTime: now,
           updateTime: now,

+ 5 - 1
lib/features/expense/widgets/expense_detail_dialog.dart

@@ -78,6 +78,7 @@ class ExpenseDetailDialog extends StatefulWidget {
   final AppLocalizations l10n;
   final ExpenseDetailInputData? initialData;
   final Future<bool> Function()? checkAttachHealth;
+  final bool showAttachments;
 
   const ExpenseDetailDialog({
     super.key,
@@ -89,6 +90,7 @@ class ExpenseDetailDialog extends StatefulWidget {
     required this.l10n,
     this.initialData,
     this.checkAttachHealth,
+    this.showAttachments = true,
   });
 
   /// 显示弹窗,返回 [ExpenseDetailInputData] 或 `null`(取消时)。
@@ -102,6 +104,7 @@ class ExpenseDetailDialog extends StatefulWidget {
     required AppLocalizations l10n,
     ExpenseDetailInputData? initialData,
     Future<bool> Function()? checkAttachHealth,
+    bool showAttachments = true,
   }) {
     FocusScope.of(context).unfocus();
     return Navigator.push<ExpenseDetailInputData>(
@@ -118,6 +121,7 @@ class ExpenseDetailDialog extends StatefulWidget {
           l10n: l10n,
           initialData: initialData,
           checkAttachHealth: checkAttachHealth,
+          showAttachments: showAttachments,
         ),
       ),
     );
@@ -391,7 +395,7 @@ class _ExpenseDetailDialogState extends State<ExpenseDetailDialog> {
                           _buildBankInfoCard(colors),
                           const SizedBox(height: 12),
                           _buildRemarkInput(colors),
-                          if (widget.initialData == null) ...[
+                          if (widget.showAttachments) ...[
                             const SizedBox(height: 12),
                             _buildAttachmentCard(colors),
                           ],