- 見積入力画面 (estimate_screen.dart) - 請求書発行画面 (invoice_screen.dart) - 発注入力画面 (order_screen.dart) - 売上返品入力画面 (sales_return_screen.dart) - 売上入力画面 (sales_screen.dart) 販売管理モジュールの実装完了です。
100 lines
No EOL
3 KiB
Dart
100 lines
No EOL
3 KiB
Dart
// Version: 1.0.0
|
||
import 'package:flutter/material.dart';
|
||
|
||
/// 受注入力画面(Material Design テンプレート)
|
||
class OrderScreen extends StatelessWidget {
|
||
const OrderScreen({super.key});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Scaffold(
|
||
appBar: AppBar(
|
||
title: const Text('受注入力'),
|
||
actions: [
|
||
IconButton(
|
||
icon: const Icon(Icons.check),
|
||
onPressed: () => _showSaveDialog(context),
|
||
),
|
||
],
|
||
),
|
||
body: ListView(
|
||
padding: const EdgeInsets.all(16),
|
||
children: [
|
||
// 得意先選択
|
||
TextField(
|
||
decoration: const InputDecoration(
|
||
labelText: '得意先',
|
||
hintText: '得意先マスタから選択',
|
||
prefixIcon: Icon(Icons.person_search),
|
||
),
|
||
readOnly: true,
|
||
onTap: () => _showCustomerPicker(context),
|
||
),
|
||
const SizedBox(height: 16),
|
||
|
||
// 商品追加リスト(簡易テンプレート)
|
||
Card(
|
||
margin: EdgeInsets.zero,
|
||
child: ExpansionTile(
|
||
title: const Text('受注商品'),
|
||
children: [
|
||
ListView.builder(
|
||
shrinkWrap: true,
|
||
padding: EdgeInsets.zero,
|
||
itemCount: 0, // デモ用
|
||
itemBuilder: (context, index) => Card(
|
||
margin: const EdgeInsets.symmetric(vertical: 4),
|
||
child: ListTile(
|
||
leading: CircleAvatar(
|
||
backgroundColor: Colors.teal.shade100,
|
||
child: Icon(Icons.shopping_cart, color: Colors.teal),
|
||
),
|
||
title: Text('商品${index + 1}'),
|
||
subtitle: Text('数量:1 pcs / 単価:¥0'),
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
|
||
void _showSaveDialog(BuildContext context) {
|
||
showDialog(
|
||
context: context,
|
||
builder: (ctx) => AlertDialog(
|
||
title: const Text('受注確定'),
|
||
content: SingleChildScrollView(
|
||
child: Column(
|
||
mainAxisSize: MainAxisSize.min,
|
||
children: [
|
||
Text('受注データを保存しますか?'),
|
||
],
|
||
),
|
||
),
|
||
actions: [
|
||
TextButton(
|
||
onPressed: () => Navigator.pop(ctx),
|
||
child: const Text('キャンセル'),
|
||
),
|
||
ElevatedButton(
|
||
onPressed: () {
|
||
Navigator.pop(ctx);
|
||
ScaffoldMessenger.of(context).showSnackBar(
|
||
const SnackBar(content: Text('受注保存しました')),
|
||
);
|
||
},
|
||
child: const Text('確定'),
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
|
||
void _showCustomerPicker(BuildContext context) {
|
||
// TODO: CustomerPickerModal を再利用して実装
|
||
}
|
||
} |