121 lines
4.4 KiB
Dart
121 lines
4.4 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|||
|
|
import 'package:wms_app/page/stockIn/stock_in_normal.dart';
|
|||
|
|
import '../../common/user/login_user.dart';
|
|||
|
|
import '/common/colorCom.dart';
|
|||
|
|
import 'package:bruno/bruno.dart';
|
|||
|
|
import 'package:wms_app/page/stockIn/stock_in_empty.dart';
|
|||
|
|
import 'package:wms_app/page/pick/pick.dart';
|
|||
|
|
|
|||
|
|
class Home extends StatefulWidget {
|
|||
|
|
const Home({super.key});
|
|||
|
|
@override
|
|||
|
|
State<Home> createState() => _HomePageState();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
class _HomePageState extends State<Home> {
|
|||
|
|
List<BrnDoughnutDataItem> stockChartsData = []; // 库存占用情况
|
|||
|
|
|
|||
|
|
@override
|
|||
|
|
Widget build(BuildContext context) {
|
|||
|
|
return Scaffold(
|
|||
|
|
appBar: AppBar(
|
|||
|
|
iconTheme: const IconThemeData(color: Colors.white),
|
|||
|
|
centerTitle: true,
|
|||
|
|
backgroundColor: ColorCommon.colorScheme,
|
|||
|
|
title: const Text("WMS移动终端(徐工料箱库)",
|
|||
|
|
style: TextStyle(color: Colors.white)),
|
|||
|
|
actions: [
|
|||
|
|
IconButton(onPressed: refreshData, icon: const Icon(Icons.refresh))
|
|||
|
|
],
|
|||
|
|
),
|
|||
|
|
drawer: Drawer(
|
|||
|
|
backgroundColor: Colors.white,
|
|||
|
|
child: ListView(
|
|||
|
|
padding: const EdgeInsets.all(0),
|
|||
|
|
children: [
|
|||
|
|
UserAccountsDrawerHeader(
|
|||
|
|
accountName: Text(LoginUser.userName),
|
|||
|
|
accountEmail: const Text("欢迎使用WMS移动终端"),
|
|||
|
|
decoration: BoxDecoration(color: ColorCommon.colorScheme)),
|
|||
|
|
ListTile(
|
|||
|
|
title: const Text("空料箱入库"),
|
|||
|
|
trailing: const Icon(Icons.grain),
|
|||
|
|
onTap: () {
|
|||
|
|
Navigator.push(
|
|||
|
|
context,
|
|||
|
|
MaterialPageRoute(
|
|||
|
|
builder: (context) => const StockInEmpty()));
|
|||
|
|
}),
|
|||
|
|
ListTile(
|
|||
|
|
title: const Text("货位信息码盘"),
|
|||
|
|
trailing: const Icon(Icons.add_box),
|
|||
|
|
onTap: () {Navigator.push(context, MaterialPageRoute(builder: (context) => const StockInNormal()));}),
|
|||
|
|
ListTile(
|
|||
|
|
title: const Text("采购有货入库"),
|
|||
|
|
trailing: const Icon(Icons.add_box),
|
|||
|
|
onTap: () {}),
|
|||
|
|
ListTile(
|
|||
|
|
title: const Text("其他物料入库"),
|
|||
|
|
trailing: const Icon(Icons.add_box),
|
|||
|
|
onTap: () {Navigator.push(context, MaterialPageRoute(builder: (context) => const StockInNormal()));}),
|
|||
|
|
ListTile(
|
|||
|
|
title: const Text("生产配盘入库"),
|
|||
|
|
trailing: const Icon(Icons.add_box),
|
|||
|
|
onTap: () {}),
|
|||
|
|
ListTile(
|
|||
|
|
title: const Text("呼叫空托"),
|
|||
|
|
trailing: const Icon(Icons.ac_unit),
|
|||
|
|
onTap: () {}),
|
|||
|
|
ListTile(
|
|||
|
|
title: const Text("出库拣货"),
|
|||
|
|
trailing: const Icon(Icons.back_hand),
|
|||
|
|
onTap: () {
|
|||
|
|
Navigator.push(context,
|
|||
|
|
MaterialPageRoute(builder: (context) => const Pick()));
|
|||
|
|
}),
|
|||
|
|
ListTile(
|
|||
|
|
title: const Text("物料盘点"),
|
|||
|
|
trailing: const Icon(Icons.checklist),
|
|||
|
|
onTap: () {})
|
|||
|
|
],
|
|||
|
|
),
|
|||
|
|
),
|
|||
|
|
body: Padding(
|
|||
|
|
padding: const EdgeInsets.only(top: 10, left: 20, right: 20),
|
|||
|
|
child: ListView(children: [
|
|||
|
|
const Text("库存占用情况:"),
|
|||
|
|
Row(children: [
|
|||
|
|
Column(
|
|||
|
|
children: [
|
|||
|
|
BrnDoughnutChart(
|
|||
|
|
padding: const EdgeInsets.all(50),
|
|||
|
|
width: 150,
|
|||
|
|
height: 150,
|
|||
|
|
data: stockChartsData,
|
|||
|
|
showTitleWhenSelected: false),
|
|||
|
|
],
|
|||
|
|
),
|
|||
|
|
Column(children: [
|
|||
|
|
DoughnutChartLegend(
|
|||
|
|
data: stockChartsData,
|
|||
|
|
legendStyle: BrnDoughnutChartLegendStyle.list),
|
|||
|
|
])
|
|||
|
|
])
|
|||
|
|
])));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// 刷新界面数据
|
|||
|
|
refreshData() {}
|
|||
|
|
|
|||
|
|
@override
|
|||
|
|
void initState() {
|
|||
|
|
super.initState();
|
|||
|
|
setState(() {
|
|||
|
|
stockChartsData = [
|
|||
|
|
BrnDoughnutDataItem(value: 40, title: "空闲", color: Colors.green),
|
|||
|
|
BrnDoughnutDataItem(value: 60, title: "占用", color: Colors.orange)
|
|||
|
|
];
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|