chengc 1 týždeň pred
rodič
commit
687d5511e7

+ 8 - 15
lib/features/expense/expense_edit_page.dart

@@ -1076,21 +1076,14 @@ class _ExpenseEditPageState extends ConsumerState<ExpenseEditPage> {
           LoadingDialog.hide(context);
 
           if (billNo != null) {
-            try {
-              final config = await api.getBillAuditConfig('BX');
-              if (!mounted) return;
-              final hasFlow = config['hasAuditFlow'] == true;
-              final autoSubmit = config['autoSubmit'] == true;
-              if (hasFlow && !autoSubmit) {
-                final dd = data['HeadData']['BX_DD']?.toString() ?? '';
-                await AuditFlowHelper.handle(
-                  context: context,
-                  l10n: l10n,
-                  getConfig: () async => config,
-                  onShSubmit: () => api.shSubmit(bilNo: billNo, bilDd: dd),
-                );
-              }
-            } catch (_) {}
+            final dd = data['HeadData']['BX_DD']?.toString() ?? '';
+            await AuditFlowHelper.handle(
+              context: context,
+              l10n: l10n,
+              getConfig: () => api.getBillAuditConfig('BX'),
+              onShSubmit: () => api.shSubmit(bilNo: billNo, bilDd: dd),
+              skipOnAutoSubmit: true,
+            );
           }
           if (mounted) {
             TDToast.showSuccess(l10n.get('billModified'), context: context);

+ 8 - 15
lib/features/expense_apply/expense_apply_edit_page.dart

@@ -771,21 +771,14 @@ class _ExpenseApplyEditPageState extends ConsumerState<ExpenseApplyEditPage> {
           LoadingDialog.hide(context);
 
           if (billNo != null) {
-            try {
-              final config = await api.getBillAuditConfig('AE');
-              if (!mounted) return;
-              final hasFlow = config['hasAuditFlow'] == true;
-              final autoSubmit = config['autoSubmit'] == true;
-              if (hasFlow && !autoSubmit) {
-                final dd = data['HeadData']['AE_DD']?.toString() ?? '';
-                await AuditFlowHelper.handle(
-                  context: context,
-                  l10n: l10n,
-                  getConfig: () async => config,
-                  onShSubmit: () => api.shSubmit(bilNo: billNo, bilDd: dd),
-                );
-              }
-            } catch (_) {}
+            final dd = data['HeadData']['AE_DD']?.toString() ?? '';
+            await AuditFlowHelper.handle(
+              context: context,
+              l10n: l10n,
+              getConfig: () => api.getBillAuditConfig('AE'),
+              onShSubmit: () => api.shSubmit(bilNo: billNo, bilDd: dd),
+              skipOnAutoSubmit: true,
+            );
           }
           if (mounted) {
             TDToast.showSuccess(l10n.get('billModified'), context: context);

+ 1 - 2
lib/features/vehicle/vehicle_apply_api.dart

@@ -141,7 +141,6 @@ class VehicleApplyApi {
 
   /// 提交审核流
   Future<bool> shSubmit({
-    required String bilId,
     required String bilNo,
     required String bilDd,
     String dep = '',
@@ -154,7 +153,7 @@ class VehicleApplyApi {
         '/OA/SHSubmit',
         data: {
           'erpCategory': 'MasterService',
-          'bilId': bilId,
+          'bilId': 'YC',
           'bilNo': bilNo,
           'bilDd': bilDd,
           'dep': dep,

+ 1 - 1
lib/features/vehicle/vehicle_apply_create_page.dart

@@ -752,7 +752,7 @@ class _VehicleApplyCreatePageState
               l10n: l10n,
               getConfig: () => api.getBillAuditConfig('YC'),
               onShSubmit: () =>
-                  api.shSubmit(bilId: 'YC', bilNo: billNo, bilDd: dd),
+                  api.shSubmit(bilNo: billNo, bilDd: dd),
             );
           }
           if (mounted) {

+ 0 - 2
lib/features/vehicle/vehicle_apply_detail_page.dart

@@ -111,7 +111,6 @@ class _VehicleApplyDetailPageState
                       LoadingDialog.show(context, text: l10n.get('submitting'));
                       try {
                         await api.shSubmit(
-                          bilId: 'YC',
                           bilNo: widget.billNo,
                           bilDd: dd,
                         );
@@ -128,7 +127,6 @@ class _VehicleApplyDetailPageState
                       LoadingDialog.show(context, text: l10n.get('submitting'));
                       try {
                         await api.shSubmit(
-                          bilId: 'YC',
                           bilNo: widget.billNo,
                           bilDd: dd,
                           isCancel: true,

+ 1 - 1
lib/features/vehicle/vehicle_apply_edit_page.dart

@@ -807,7 +807,7 @@ class _VehicleApplyEditPageState extends ConsumerState<VehicleApplyEditPage> {
               l10n: l10n,
               getConfig: () => api.getBillAuditConfig('YC'),
               onShSubmit: () =>
-                  api.shSubmit(bilId: 'YC', bilNo: billNo, bilDd: dd),
+                  api.shSubmit(bilNo: billNo, bilDd: dd),
             );
           }
           if (mounted) {