승인 단계 삭제 복구 흐름 구현하고 API 정렬 문서 추가
This commit is contained in:
@@ -173,7 +173,7 @@ class _ApprovalEnabledPageState extends State<_ApprovalEnabledPage> {
|
||||
actions: [
|
||||
ShadButton(
|
||||
leading: const Icon(lucide.LucideIcons.plus, size: 16),
|
||||
onPressed: () {},
|
||||
onPressed: _openCreateApprovalDialog,
|
||||
child: const Text('신규 결재'),
|
||||
),
|
||||
],
|
||||
@@ -357,6 +357,116 @@ class _ApprovalEnabledPageState extends State<_ApprovalEnabledPage> {
|
||||
);
|
||||
}
|
||||
|
||||
/// 신규 결재 등록 다이얼로그를 열어 UI 단계에서 필요한 필드와 안내를 제공한다.
|
||||
Future<void> _openCreateApprovalDialog() async {
|
||||
final transactionController = TextEditingController();
|
||||
final noteController = TextEditingController();
|
||||
var submitted = false;
|
||||
|
||||
final shouldShowToast = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (dialogContext) {
|
||||
return StatefulBuilder(
|
||||
builder: (context, setState) {
|
||||
final shadTheme = ShadTheme.of(context);
|
||||
final errorVisible =
|
||||
submitted && transactionController.text.trim().isEmpty;
|
||||
|
||||
return SuperportDialog(
|
||||
title: '신규 결재 등록',
|
||||
description: '트랜잭션 정보를 입력하면 API 연동 시 자동 제출이 지원됩니다.',
|
||||
constraints: const BoxConstraints(maxWidth: 480),
|
||||
actions: [
|
||||
ShadButton.ghost(
|
||||
onPressed: () => Navigator.of(dialogContext).pop(false),
|
||||
child: const Text('닫기'),
|
||||
),
|
||||
ShadButton(
|
||||
key: const ValueKey('approval_create_submit'),
|
||||
onPressed: () {
|
||||
final trimmed = transactionController.text.trim();
|
||||
setState(() => submitted = true);
|
||||
if (trimmed.isEmpty) {
|
||||
return;
|
||||
}
|
||||
Navigator.of(dialogContext).pop(true);
|
||||
},
|
||||
child: const Text('임시 저장'),
|
||||
),
|
||||
],
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('트랜잭션 ID', style: shadTheme.textTheme.small),
|
||||
const SizedBox(height: 8),
|
||||
ShadInput(
|
||||
key: const ValueKey('approval_create_transaction'),
|
||||
controller: transactionController,
|
||||
placeholder: const Text('예: 2404-TRX-001'),
|
||||
onChanged: (_) => setState(() {}),
|
||||
),
|
||||
if (errorVisible)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 6),
|
||||
child: Text(
|
||||
'트랜잭션 ID를 입력해야 결재 생성이 가능합니다.',
|
||||
style: shadTheme.textTheme.small.copyWith(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text('비고 (선택)', style: shadTheme.textTheme.small),
|
||||
const SizedBox(height: 8),
|
||||
ShadTextarea(
|
||||
key: const ValueKey('approval_create_note'),
|
||||
controller: noteController,
|
||||
minHeight: 120,
|
||||
maxHeight: 220,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: shadTheme.colorScheme.mutedForeground.withValues(
|
||||
alpha: 0.08,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: const [
|
||||
Text(
|
||||
'API 연동 준비 중',
|
||||
style: TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(height: 6),
|
||||
Text(
|
||||
'현재는 결재 생성 UI만 제공됩니다. 실제 저장은 백엔드 연동 이후 지원될 예정입니다.',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
transactionController.dispose();
|
||||
noteController.dispose();
|
||||
|
||||
if (shouldShowToast == true && mounted) {
|
||||
SuperportToast.info(
|
||||
context,
|
||||
'결재 생성은 API 연동 이후 지원될 예정입니다. 입력한 값은 실제로 저장되지 않았습니다.',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void _applyFilters() {
|
||||
_controller.updateQuery(_searchController.text.trim());
|
||||
if (_dateRange != null) {
|
||||
|
||||
Reference in New Issue
Block a user